From 6b81d16eb33c283c8fbad0c1bea86c94d02f53ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=BCller?= Date: Thu, 23 Jan 2020 23:18:59 +0100 Subject: [PATCH] nekobee: Hack build with python3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Andreas Müller --- recipes-musicians/nekobee/nekobee.bb | 45 +++++++++++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-) diff --git a/recipes-musicians/nekobee/nekobee.bb b/recipes-musicians/nekobee/nekobee.bb index c9a9eca..20eda4a 100644 --- a/recipes-musicians/nekobee/nekobee.bb +++ b/recipes-musicians/nekobee/nekobee.bb @@ -3,7 +3,7 @@ HOMEPAGE = "https://github.com/gordonjcp/nekobee" LICENSE = "GPLv2" LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f" -inherit wafold pkgconfig +inherit wafold pkgconfig python3native DEPENDS += " \ gtk+ \ @@ -17,6 +17,49 @@ SRCREV = "593d4be0ff6b4279e1b2b1bacbd5b6b02221358a" S = "${WORKDIR}/git" PV = "0.2+git${SRCPV}" +waf_preconfigure() { +} + +do_configure_prepend() { + cd ${S} + + # link python -> python3 + ln -sf `which python3` ${B}/python + export PATH="${PATH}:${B}" + + # dummy call -> unpacks waf + ./waf configure -o ${B} --prefix=${prefix} ${EXTRA_OECONF} || true + + # add unpacked modules to pypath + echo `find ${S} -type d -name wafadmin` > ${B}/PYTHONPATH + export PYTHONPATH=`cat ${B}/PYTHONPATH` + + # -> python3 + 2to3 -w -x import `find .waf3-* -name '*.py'` + + # hmmm + #sed -i 's:from . import:import:g' `find .waf3-* -name '*.py'` + #sed -i 's:from .:from :g' `find .waf3-* -name '*.py'` + + ./waf configure --prefix=${prefix} ${WAF_EXTRA_CONF} ${EXTRA_OECONF} +} + +do_compile() { + export PATH="${PATH}:${B}" + export PYTHONPATH=`cat ${B}/PYTHONPATH` + + # waf breaks but gets far enough to build what's necessary + ${S}/waf build ${@oe.utils.parallel_make_argument(d, '-j%d', limit=64)} || true +} + +do_install() { + install -d ${D}${libdir}/dssi/nekobee + install -m 0644 ${B}/build/default/nekobee.so ${D}${libdir}/dssi/ + install -m 0755 ${B}/build/default/nekobee_gtk ${D}${libdir}/dssi/nekobee/ + install -m 0644 ${B}/extra/knob.png ${D}${libdir}/dssi/nekobee/ + install -m 0644 ${B}/extra/switch.png ${D}${libdir}/dssi/nekobee/ +} + FILES_${PN} += " \ ${libdir}/dssi \ "