]> code.ossystems Code Review - openembedded-core.git/commitdiff
pythonnative.bbclass, python3native.bbclass: export STAGING_INCDIR, STAGING_LIBDIR...
authorAlexander Kanavin <alexander.kanavin@linux.intel.com>
Wed, 22 Jun 2016 12:06:35 +0000 (15:06 +0300)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 1 Jul 2016 15:08:44 +0000 (16:08 +0100)
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.

Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
meta/classes/gobject-introspection.bbclass
meta/classes/python3native.bbclass
meta/classes/pythonnative.bbclass
meta/recipes-core/glib-2.0/glib.inc
meta/recipes-core/libxml/libxml2_2.9.4.bb
meta/recipes-devtools/python/python3-dbus_1.2.4.bb
meta/recipes-extended/libuser/libuser_0.62.bb
meta/recipes-extended/newt/libnewt_0.52.19.bb
meta/recipes-gnome/gobject-introspection/gobject-introspection_1.48.0.bb
meta/recipes-kernel/perf/perf.bb
meta/recipes-support/libcap-ng/libcap-ng_0.7.7.bb

index 8cd7b7ed50f6ada5ddd254b5d0d7dcae881213c0..37389cbc8b3860101a29c71883435b8871b923be 100644 (file)
@@ -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}"
 
index 18998636b424fd3093fa0a09b4a5b17cd0b3048d..d7b2d357e91bb4fe3e3dc108d24c6bf34546efad 100644 (file)
@@ -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
index 97029dc525c56e1dfa633978bb145fe337a466bf..bd239fa792f15f7f6d1f4c8a4ecf815fea44fc6e 100644 (file)
@@ -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
index c6b8e57e7d7a3f69f1d93a23422754cf756ad6e6..c2ccedaeff4025ef4c944c9287d96da2cf505b24 100644 (file)
@@ -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
 
index 5ff508a5ceda5310f1fa74f7246fb44cd7583dfa..e2febf0c60b792e207e546bc947bb4f5ed62062d 100644 (file)
@@ -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):
index 759512c396ee16eda772ab8dd73665a1cbbf4798..de5a01c7f2ad2e8f402ddd5a59d1c022ff19cd4c 100644 (file)
@@ -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"
index 85905630a2334e383fcb8ce58aae4b5b1e83611f..960f789e27edda699a2040cd01db989052f3cf54 100644 (file)
@@ -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 "
index b45461cde31cf014bce4b8810d195f1d208e5960..22bdaf5ab1eb3e63f6e03257cf633fbf7f1e0c33 100644 (file)
@@ -35,8 +35,6 @@ inherit autotools-brokensep
 
 CLEANBROKEN = "1"
 
-export STAGING_INCDIR
-export STAGING_LIBDIR
 export CPPFLAGS
 
 PACKAGES_prepend = "whiptail "
index 8adede66a5c671f9f3f85f1f5cc88266745a6961..6948aff2faea62ac78c1716574635d753913d206 100644 (file)
@@ -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
index d6683006fc83ede1e5d93e45de2e691c907caa24..171d23f454f3a5d8788ca3cffecd2f471a9077d4 100644 (file)
@@ -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
index 5608f495e6876b3644ed46875b0bfc53efb5d6bb..a38a818c037aef9d38b098214e10ec28dab1b7a3 100644 (file)
@@ -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}'"