1
0
mirror of https://git.yoctoproject.org/poky synced 2026-05-08 05:09:24 +00:00

xcb-proto: don't compile for Python 2

Remove the do_install_append to create the Python 2 pyc files, as nothing in the
build is using Python 2 anymore (libxcb is the only user, and that uses Python
3).

Also use variables instead of a patch to control what Python binary and path the
modules are installed to.

(From OE-Core rev: c27c60fe012bf42ea3b22fc1b4496450dc68b50b)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Ross Burton
2018-02-20 22:43:53 +00:00
committed by Richard Purdie
parent a63aa5c0e4
commit 3abf75f923
2 changed files with 5 additions and 36 deletions
@@ -1,27 +0,0 @@
Upstream uses AM_PATH_PYTHON to find a python binary and ask it where to install
libraries. This means we either need to depend on python-native (large build
dependency, early in the build) or use the host python (pythondir reflects the
host and not the target, breaks builds).
The third option is to just hardcode the path where the module goes, as most
callers of the code use pkg-config to find where it was installed anyway.
Upstream-Status: Inappropriate
Signed-off-by: Ross Burton <ross.burton@intel.com>
diff --git a/configure.ac b/configure.ac
index d140bfe..c7b68da 100644
--- a/configure.ac
+++ b/configure.ac
@@ -14,7 +14,10 @@ if test "$XMLLINT" = "no"; then
AC_MSG_WARN([xmllint not found; unable to validate against schema.])
fi
-AM_PATH_PYTHON([2.5])
+pythondir="${libdir}/xcb-proto"
+AC_SUBST(pythondir)
+PYTHON="python3"
+AC_SUBST(PYTHON)
xcbincludedir='${datadir}/xcb'
AC_SUBST(xcbincludedir)
@@ -11,8 +11,7 @@ LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://COPYING;md5=d763b081cb10c223435b01e00dc0aba7 \
file://src/dri2.xml;beginline=2;endline=28;md5=f8763b13ff432e8597e0d610cf598e65"
SRC_URI = "http://xcb.freedesktop.org/dist/xcb-proto-${PV}.tar.bz2 \
file://no-python-native.patch \
SRC_URI = "http://xcb.freedesktop.org/dist/${BP}.tar.bz2 \
file://0001-Make-whitespace-use-consistent.patch \
file://0002-print-is-a-function-and-needs-parentheses.patch \
"
@@ -21,6 +20,10 @@ SRC_URI[sha256sum] = "5922aba4c664ab7899a29d92ea91a87aa4c1fc7eb5ee550325c3216c48
inherit autotools pkgconfig
# Force the use of Python 3 and a specific library path so we don't need to
# depend on python3-native
CACHED_CONFIGUREVARS += "PYTHON=python3 am_cv_python_pythondir=${libdir}/xcb-proto"
PACKAGES += "python-xcbgen"
FILES_${PN} = ""
@@ -31,10 +34,3 @@ RDEPENDS_${PN}-dev = ""
RRECOMMENDS_${PN}-dbg = "${PN}-dev (= ${EXTENDPKGV})"
BBCLASSEXTEND = "native nativesdk"
do_install_append() {
# Makefile's do_install creates .pyc files for python3, now also create
# them for python2 so that they will be recorded by manifest, and can be
# cleaned correctly.
(cd ${D}; python -m py_compile ./${libdir}/xcb-proto/xcbgen/*.py)
}