Message ID | 20180223153535.11063-1-ross.burton@intel.com |
---|---|
State | Accepted |
Commit | c27c60fe012bf42ea3b22fc1b4496450dc68b50b |
Headers | show |
Series | xcb-proto: don't compile for Python 2 | expand |
Nice. This should fix Yocto #12543 as well. ________________________________________ From: openembedded-core-bounces@lists.openembedded.org [openembedded-core-bounces@lists.openembedded.org] on behalf of Ross Burton [ross.burton@intel.com] Sent: Friday, February 23, 2018 7:35 AM To: openembedded-core@lists.openembedded.org Subject: [OE-core] [PATCH] 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. Signed-off-by: Ross Burton <ross.burton@intel.com> --- .../xorg-proto/xcb-proto/no-python-native.patch | 27 ---------------------- meta/recipes-graphics/xorg-proto/xcb-proto_1.12.bb | 14 ++++------- 2 files changed, 5 insertions(+), 36 deletions(-) delete mode 100644 meta/recipes-graphics/xorg-proto/xcb-proto/no-python-native.patch diff --git a/meta/recipes-graphics/xorg-proto/xcb-proto/no-python-native.patch b/meta/recipes-graphics/xorg-proto/xcb-proto/no-python-native.patch deleted file mode 100644 index 09b6088db0a..00000000000 --- a/meta/recipes-graphics/xorg-proto/xcb-proto/no-python-native.patch +++ /dev/null @@ -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) diff --git a/meta/recipes-graphics/xorg-proto/xcb-proto_1.12.bb b/meta/recipes-graphics/xorg-proto/xcb-proto_1.12.bb index be6b1a0200e..712ab6c59ab 100644 --- a/meta/recipes-graphics/xorg-proto/xcb-proto_1.12.bb +++ b/meta/recipes-graphics/xorg-proto/xcb-proto_1.12.bb @@ -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) -} -- 2.11.0 -- _______________________________________________ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core -- _______________________________________________ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core
Indeed, meant to put that number in the message. On 23 February 2018 at 17:21, Bystricky, Juro <juro.bystricky@intel.com> wrote: > Nice. This should fix Yocto #12543 as well. > ________________________________________ > From: openembedded-core-bounces@lists.openembedded.org [ > openembedded-core-bounces@lists.openembedded.org] on behalf of Ross > Burton [ross.burton@intel.com] > Sent: Friday, February 23, 2018 7:35 AM > To: openembedded-core@lists.openembedded.org > Subject: [OE-core] [PATCH] 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. > > Signed-off-by: Ross Burton <ross.burton@intel.com> > --- > .../xorg-proto/xcb-proto/no-python-native.patch | 27 > ---------------------- > meta/recipes-graphics/xorg-proto/xcb-proto_1.12.bb | 14 ++++------- > 2 files changed, 5 insertions(+), 36 deletions(-) > delete mode 100644 meta/recipes-graphics/xorg-proto/xcb-proto/no-python- > native.patch > > diff --git a/meta/recipes-graphics/xorg-proto/xcb-proto/no-python-native.patch > b/meta/recipes-graphics/xorg-proto/xcb-proto/no-python-native.patch > deleted file mode 100644 > index 09b6088db0a..00000000000 > --- a/meta/recipes-graphics/xorg-proto/xcb-proto/no-python-native.patch > +++ /dev/null > @@ -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) > diff --git a/meta/recipes-graphics/xorg-proto/xcb-proto_1.12.bb > b/meta/recipes-graphics/xorg-proto/xcb-proto_1.12.bb > index be6b1a0200e..712ab6c59ab 100644 > --- a/meta/recipes-graphics/xorg-proto/xcb-proto_1.12.bb > +++ b/meta/recipes-graphics/xorg-proto/xcb-proto_1.12.bb > @@ -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] = "5922aba4c664ab7899a29d92ea91a8 > 7aa4c1fc7eb5ee550325c3216c48 > > 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) > -} > -- > 2.11.0 > > -- > _______________________________________________ > Openembedded-core mailing list > Openembedded-core@lists.openembedded.org > http://lists.openembedded.org/mailman/listinfo/openembedded-core > <div dir="ltr">Indeed, meant to put that number in the message.</div><div class="gmail_extra"><br><div class="gmail_quote">On 23 February 2018 at 17:21, Bystricky, Juro <span dir="ltr"><<a href="mailto:juro.bystricky@intel.com" target="_blank">juro.bystricky@intel.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Nice. This should fix Yocto #12543 as well.<br> ______________________________<wbr>__________<br> From: <a href="mailto:openembedded-core-bounces@lists.openembedded.org">openembedded-core-bounces@<wbr>lists.openembedded.org</a> [<a href="mailto:openembedded-core-bounces@lists.openembedded.org">openembedded-core-bounces@<wbr>lists.openembedded.org</a>] on behalf of Ross Burton [<a href="mailto:ross.burton@intel.com">ross.burton@intel.com</a>]<br> Sent: Friday, February 23, 2018 7:35 AM<br> To: <a href="mailto:openembedded-core@lists.openembedded.org">openembedded-core@lists.<wbr>openembedded.org</a><br> Subject: [OE-core] [PATCH] xcb-proto: don't compile for Python 2<br> <div><div class="h5"><br> Remove the do_install_append to create the Python 2 pyc files, as nothing in the<br> build is using Python 2 anymore (libxcb is the only user, and that uses Python<br> 3).<br> <br> Also use variables instead of a patch to control what Python binary and path the<br> modules are installed to.<br> <br> Signed-off-by: Ross Burton <<a href="mailto:ross.burton@intel.com">ross.burton@intel.com</a>><br> ---<br> .../xorg-proto/xcb-proto/no-<wbr>python-native.patch | 27 ----------------------<br> meta/recipes-graphics/xorg-<wbr>proto/<a href="http://xcb-proto_1.12.bb" rel="noreferrer" target="_blank">xcb-proto_1.12.bb</a> | 14 ++++-------<br> 2 files changed, 5 insertions(+), 36 deletions(-)<br> delete mode 100644 meta/recipes-graphics/xorg-<wbr>proto/xcb-proto/no-python-<wbr>native.patch<br> <br> diff --git a/meta/recipes-graphics/xorg-<wbr>proto/xcb-proto/no-python-<wbr>native.patch b/meta/recipes-graphics/xorg-<wbr>proto/xcb-proto/no-python-<wbr>native.patch<br> deleted file mode 100644<br> index 09b6088db0a..00000000000<br> --- a/meta/recipes-graphics/xorg-<wbr>proto/xcb-proto/no-python-<wbr>native.patch<br> +++ /dev/null<br> @@ -1,27 +0,0 @@<br> -Upstream uses AM_PATH_PYTHON to find a python binary and ask it where to install<br> -libraries. This means we either need to depend on python-native (large build<br> -dependency, early in the build) or use the host python (pythondir reflects the<br> -host and not the target, breaks builds).<br> -<br> -The third option is to just hardcode the path where the module goes, as most<br> -callers of the code use pkg-config to find where it was installed anyway.<br> -<br> -Upstream-Status: Inappropriate<br> -Signed-off-by: Ross Burton <<a href="mailto:ross.burton@intel.com">ross.burton@intel.com</a>><br> -<br> -diff --git a/<a href="http://configure.ac" rel="noreferrer" target="_blank">configure.ac</a> b/<a href="http://configure.ac" rel="noreferrer" target="_blank">configure.ac</a><br> -index d140bfe..c7b68da 100644<br> ---- a/<a href="http://configure.ac" rel="noreferrer" target="_blank">configure.ac</a><br> -+++ b/<a href="http://configure.ac" rel="noreferrer" target="_blank">configure.ac</a><br> -@@ -14,7 +14,10 @@ if test "$XMLLINT" = "no"; then<br> - AC_MSG_WARN([xmllint not found; unable to validate against schema.])<br> - fi<br> -<br> --AM_PATH_PYTHON([2.5])<br> -+pythondir="${libdir}/xcb-<wbr>proto"<br> -+AC_SUBST(pythondir)<br> -+PYTHON="python3"<br> -+AC_SUBST(PYTHON)<br> -<br> - xcbincludedir='${datadir}/xcb'<br> - AC_SUBST(xcbincludedir)<br> diff --git a/meta/recipes-graphics/xorg-<wbr>proto/<a href="http://xcb-proto_1.12.bb" rel="noreferrer" target="_blank">xcb-proto_1.12.bb</a> b/meta/recipes-graphics/xorg-<wbr>proto/<a href="http://xcb-proto_1.12.bb" rel="noreferrer" target="_blank">xcb-proto_1.12.bb</a><br> index be6b1a0200e..712ab6c59ab 100644<br> --- a/meta/recipes-graphics/xorg-<wbr>proto/<a href="http://xcb-proto_1.12.bb" rel="noreferrer" target="_blank">xcb-proto_1.12.bb</a><br> +++ b/meta/recipes-graphics/xorg-<wbr>proto/<a href="http://xcb-proto_1.12.bb" rel="noreferrer" target="_blank">xcb-proto_1.12.bb</a><br> @@ -11,8 +11,7 @@ LICENSE = "MIT"<br> LIC_FILES_CHKSUM = "file://COPYING;md5=<wbr>d763b081cb10c223435b01e00dc0ab<wbr>a7 \<br> file://src/dri2.xml;beginline=<wbr>2;endline=28;md5=<wbr>f8763b13ff432e8597e0d610cf598e<wbr>65"<br> <br> -SRC_URI = "<a href="http://xcb.freedesktop.org/dist/xcb-proto-${PV}.tar.bz2" rel="noreferrer" target="_blank">http://xcb.freedesktop.org/<wbr>dist/xcb-proto-${PV}.tar.bz2</a> \<br> - file://no-python-native.patch \<br> +SRC_URI = "<a href="http://xcb.freedesktop.org/dist/${BP}.tar.bz2" rel="noreferrer" target="_blank">http://xcb.freedesktop.org/<wbr>dist/${BP}.tar.bz2</a> \<br> file://0001-Make-whitespace-<wbr>use-consistent.patch \<br> file://0002-print-is-a-<wbr>function-and-needs-<wbr>parentheses.patch \<br> "<br> @@ -21,6 +20,10 @@ SRC_URI[sha256sum] = "<wbr>5922aba4c664ab7899a29d92ea91a8<wbr>7aa4c1fc7eb5ee550325c3216c48<br> <br> inherit autotools pkgconfig<br> <br> +# Force the use of Python 3 and a specific library path so we don't need to<br> +# depend on python3-native<br> +CACHED_CONFIGUREVARS += "PYTHON=python3 am_cv_python_pythondir=${<wbr>libdir}/xcb-proto"<br> +<br> PACKAGES += "python-xcbgen"<br> <br> FILES_${PN} = ""<br> @@ -31,10 +34,3 @@ RDEPENDS_${PN}-dev = ""<br> RRECOMMENDS_${PN}-dbg = "${PN}-dev (= ${EXTENDPKGV})"<br> <br> BBCLASSEXTEND = "native nativesdk"<br> -<br> -do_install_append() {<br> - # Makefile's do_install creates .pyc files for python3, now also create<br> - # them for python2 so that they will be recorded by manifest, and can be<br> - # cleaned correctly.<br> - (cd ${D}; python -m py_compile ./${libdir}/xcb-proto/xcbgen/*<wbr>.py)<br> -}<br> --<br> 2.11.0<br> <br> </div></div>--<br> ______________________________<wbr>_________________<br> Openembedded-core mailing list<br> <a href="mailto:Openembedded-core@lists.openembedded.org">Openembedded-core@lists.<wbr>openembedded.org</a><br> <a href="http://lists.openembedded.org/mailman/listinfo/openembedded-core" rel="noreferrer" target="_blank">http://lists.openembedded.org/<wbr>mailman/listinfo/openembedded-<wbr>core</a><br> </blockquote></div><br></div> -- _______________________________________________ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core
diff --git a/meta/recipes-graphics/xorg-proto/xcb-proto/no-python-native.patch b/meta/recipes-graphics/xorg-proto/xcb-proto/no-python-native.patch deleted file mode 100644 index 09b6088db0a..00000000000 --- a/meta/recipes-graphics/xorg-proto/xcb-proto/no-python-native.patch +++ /dev/null @@ -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) diff --git a/meta/recipes-graphics/xorg-proto/xcb-proto_1.12.bb b/meta/recipes-graphics/xorg-proto/xcb-proto_1.12.bb index be6b1a0200e..712ab6c59ab 100644 --- a/meta/recipes-graphics/xorg-proto/xcb-proto_1.12.bb +++ b/meta/recipes-graphics/xorg-proto/xcb-proto_1.12.bb @@ -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) -}
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. Signed-off-by: Ross Burton <ross.burton@intel.com> --- .../xorg-proto/xcb-proto/no-python-native.patch | 27 ---------------------- meta/recipes-graphics/xorg-proto/xcb-proto_1.12.bb | 14 ++++------- 2 files changed, 5 insertions(+), 36 deletions(-) delete mode 100644 meta/recipes-graphics/xorg-proto/xcb-proto/no-python-native.patch -- 2.11.0 -- _______________________________________________ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core