gdb-cross: do not hardcode the use of Python 2
PATCH 1/2 gdb-cross: do not hardcode the use of Python 2
This was overlooked in the move to Python 3
--- meta/recipes-devtools/gdb/gdb-cross.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-devtools/gdb/gdb-cross.inc +1 -1
@@ -6,7 +6,7 @@ inherit python3native # Overrides PACKAGECONFIG variables in gdb-common.inc PACKAGECONFIG ??= "python readline" -PACKAGECONFIG[python] = "--with-python=${STAGING_BINDIR_NATIVE}/python-native/python,--without-python,python3-native" +PACKAGECONFIG[python] = "--with-python=${PYTHON},--without-python,python3-native" PACKAGECONFIG[readline] = "--with-system-readline,--without-system-readline,readline-native" do_compile_prepend() {
Signature · 1 line
2.8.1
PATCH 2/2 pythonnative.bbclass, python3native.bbclass: export STAGING_INCDIR, STAGING_LIBDIR, PYTHON variables
We patch Python's distutils modules to access STAGING_INCDIR/LIBDIR, so when they are not set, scripts that utilize distutils (e.g. python-config) fail. Several recipes need to export those manually to prevent such failures, so let's do that in the class instead.
PYTHON variable is exported because otherwise autotools' python.m4 macro will pick up its own internal default, which may not be the version that we want.
glib recipe in particular was previously using Python 2.x during build due to python.m4 defaulting to it - now it's using Python 3.x, and so needs a small fix in deletion of *.pyc files.
--- meta/classes/gobject-introspection.bbclass | 5 ----- meta/classes/python3native.bbclass | 8 ++++++++ meta/classes/pythonnative.bbclass | 8 ++++++++ meta/recipes-core/glib-2.0/glib.inc | 1 + meta/recipes-core/libxml/libxml2_2.9.4.bb | 4 ---- meta/recipes-devtools/python/python3-dbus_1.2.4.bb | 4 ---- meta/recipes-extended/libuser/libuser_0.62.bb | 2 -- meta/recipes-extended/newt/libnewt_0.52.19.bb | 2 -- .../gobject-introspection/gobject-introspection_1.48.0.bb | 7 ------- meta/recipes-kernel/perf/perf.bb | 2 -- meta/recipes-support/libcap-ng/libcap-ng_0.7.7.bb | 3 --- 11 files changed, 17 insertions(+), 29 deletions(-)
meta/classes/gobject-introspection.bbclass +0 -5
@@ -24,11 +24,6 @@ DEPENDS_append_class-target = " gobject-introspection gobject-introspection-nati DEPENDS_append_class-native = " gobject-introspection-native" DEPENDS_append_class-nativesdk = " gobject-introspection-native" -# This is necessary for python scripts to succeed - distutils fails if these -# are not set -export STAGING_INCDIR -export STAGING_LIBDIR - # This is used by introspection tools to find .gir includes export XDG_DATA_DIRS = "${STAGING_DATADIR}"
meta/classes/python3native.bbclass +8 -0
@@ -3,3 +3,11 @@ inherit python3-dir PYTHON="${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN}" EXTRANATIVEPATH += "${PYTHON_PN}-native" DEPENDS += " ${PYTHON_PN}-native " + +# python-config and other scripts are using distutils modules +# which we patch to access these variables +export STAGING_INCDIR +export STAGING_LIBDIR + +# autoconf macros will use their internal default preference otherwise +export PYTHON
meta/classes/pythonnative.bbclass +8 -0
@@ -6,3 +6,11 @@ PYTHON="${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN}" PYTHON_EXECUTABLE="${PYTHON}" EXTRANATIVEPATH += "${PYTHON_PN}-native" DEPENDS += " ${PYTHON_PN}-native " + +# python-config and other scripts are using distutils modules +# which we patch to access these variables +export STAGING_INCDIR +export STAGING_LIBDIR + +# autoconf macros will use their internal default preference otherwise +export PYTHON
meta/recipes-core/glib-2.0/glib.inc +1 -0
@@ -77,6 +77,7 @@ do_install_append () { fi # Remove some unpackaged files + rm -rf ${D}${datadir}/glib-2.0/codegen/__pycache__ rm -f ${D}${datadir}/glib-2.0/codegen/*.pyc rm -f ${D}${datadir}/glib-2.0/codegen/*.pyo
meta/recipes-core/libxml/libxml2_2.9.4.bb +0 -4
@@ -47,10 +47,6 @@ EXTRA_OECONF_class-native = "--without-legacy --without-docbook --with-c14n --wi EXTRA_OECONF_class-nativesdk = "--without-legacy --without-docbook --with-c14n --without-lzma --with-zlib" EXTRA_OECONF_linuxstdbase = "--with-debug --with-legacy --with-docbook --with-c14n --without-lzma --with-zlib" -# required for python binding -export STAGING_LIBDIR -export STAGING_INCDIR - python populate_packages_prepend () { # autonamer would call this libxml2-2, but we don't want that if d.getVar('DEBIAN_NAMES', True):
meta/recipes-devtools/python/python3-dbus_1.2.4.bb +0 -4
@@ -18,10 +18,6 @@ PACKAGECONFIG ?= "" PACKAGECONFIG[docs] = "--enable-html-docs,--disable-html-docs,python3-docutils-native" PACKAGECONFIG[api-docs] = "--enable-api-docs,--disable-api-docs,python3-docutils-native python3-epydoc-native" -do_configure_prepend() { - export PYTHON=${PYTHON} -} - RDEPENDS_${PN} = "python3-io python3-logging python3-stringold python3-threading python3-xml" FILES_${PN}-dev += "${libdir}/pkgconfig"
meta/recipes-extended/libuser/libuser_0.62.bb +0 -2
@@ -24,8 +24,6 @@ DEPENDS = "popt libpam glib-2.0 docbook-utils-native linuxdoc-tools-native pytho inherit autotools gettext python3native python3-dir pkgconfig -export PYTHON - EXTRA_OEMAKE = "PYTHON_CPPFLAGS=-I${STAGING_INCDIR}/${PYTHON_DIR}${PYTHON_ABI}" PACKAGES += "${PN}-python "
meta/recipes-extended/newt/libnewt_0.52.19.bb +0 -2
@@ -35,8 +35,6 @@ inherit autotools-brokensep CLEANBROKEN = "1" -export STAGING_INCDIR -export STAGING_LIBDIR export CPPFLAGS PACKAGES_prepend = "whiptail "
meta/recipes-gnome/gobject-introspection/gobject-introspection_1.48.0.bb +0 -7
@@ -21,13 +21,6 @@ SRC_URI[sha256sum] = "fa275aaccdbfc91ec0bc9a6fd0562051acdba731e7d584b64a277fec60 inherit autotools pkgconfig gtk-doc python3native qemu gobject-introspection-data BBCLASSEXTEND = "native" -# necessary to let the call for python-config from configure.ac succeed -export STAGING_INCDIR -export STAGING_LIBDIR - -# autoconf macros otherwise will default to Python 2 -export PYTHON - # needed for writing out the qemu wrapper script export STAGING_DIR_HOST export B
meta/recipes-kernel/perf/perf.bb +0 -2
@@ -40,8 +40,6 @@ inherit linux-kernel-base kernel-arch pythonnative # needed for building the tools/perf Python bindings inherit python-dir -export STAGING_INCDIR -export STAGING_LIBDIR export PYTHON_SITEPACKAGES_DIR #kernel 3.1+ supports WERROR to disable warnings as errors
meta/recipes-support/libcap-ng/libcap-ng_0.7.7.bb +0 -3
@@ -17,9 +17,6 @@ SRC_URI[sha256sum] = "615549ce39b333f6b78baee0c0b4ef18bc726c6bf1cca123dfd89dd963 DEPENDS += "swig-native python3" -export PYTHON -export STAGING_INCDIR -export STAGING_LIBDIR EXTRA_OECONF += "--with-python --with-python3" EXTRA_OEMAKE += "PYLIBVER='python${PYTHON_BASEVERSION}${PYTHON_ABI}' PYINC='${STAGING_INCDIR}/${PYLIBVER}'"
Signature · 1 line
2.8.1