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.
(From OE-Core rev:
c1e0eb62f2d89b10b187016200018830b1c77945)
Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
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}"
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
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
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
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):
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"
inherit autotools gettext python3native python3-dir pkgconfig
-export PYTHON
-
EXTRA_OEMAKE = "PYTHON_CPPFLAGS=-I${STAGING_INCDIR}/${PYTHON_DIR}${PYTHON_ABI}"
PACKAGES += "${PN}-python "
CLEANBROKEN = "1"
-export STAGING_INCDIR
-export STAGING_LIBDIR
export CPPFLAGS
PACKAGES_prepend = "whiptail "
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
# 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
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}'"