nekobee: Hack build with python3

Signed-off-by: Andreas Müller <schnitzeltony@gmail.com>
This commit is contained in:
Andreas Müller
2020-01-23 23:18:59 +01:00
parent a74c668d51
commit 6b81d16eb3

View File

@@ -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 \
"