diff options
author | Alexander Kanavin <alexander.kanavin@linux.intel.com> | 2016-06-22 15:06:35 +0300 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-07-01 16:22:42 +0100 |
commit | cf1af6b384ab102fc3d8d703546cafcc6ffc8a0a (patch) | |
tree | 6476c48f766a957618b38f494288b4ee6cf266ea | |
parent | 83b11dcd55f907d845c8efa45a2616b8890f3004 (diff) | |
download | poky-cf1af6b384ab102fc3d8d703546cafcc6ffc8a0a.tar.gz |
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.
(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>
-rw-r--r-- | meta/classes/gobject-introspection.bbclass | 5 | ||||
-rw-r--r-- | meta/classes/python3native.bbclass | 8 | ||||
-rw-r--r-- | meta/classes/pythonnative.bbclass | 8 | ||||
-rw-r--r-- | meta/recipes-core/glib-2.0/glib.inc | 1 | ||||
-rw-r--r-- | meta/recipes-core/libxml/libxml2_2.9.4.bb | 4 | ||||
-rw-r--r-- | meta/recipes-devtools/python/python3-dbus_1.2.4.bb | 4 | ||||
-rw-r--r-- | meta/recipes-extended/libuser/libuser_0.62.bb | 2 | ||||
-rw-r--r-- | meta/recipes-extended/newt/libnewt_0.52.19.bb | 2 | ||||
-rw-r--r-- | meta/recipes-gnome/gobject-introspection/gobject-introspection_1.48.0.bb | 7 | ||||
-rw-r--r-- | meta/recipes-kernel/perf/perf.bb | 2 | ||||
-rw-r--r-- | meta/recipes-support/libcap-ng/libcap-ng_0.7.7.bb | 3 |
11 files changed, 17 insertions, 29 deletions
diff --git a/meta/classes/gobject-introspection.bbclass b/meta/classes/gobject-introspection.bbclass index 8cd7b7ed50..37389cbc8b 100644 --- a/meta/classes/gobject-introspection.bbclass +++ b/meta/classes/gobject-introspection.bbclass | |||
@@ -24,11 +24,6 @@ DEPENDS_append_class-target = " gobject-introspection gobject-introspection-nati | |||
24 | DEPENDS_append_class-native = " gobject-introspection-native" | 24 | DEPENDS_append_class-native = " gobject-introspection-native" |
25 | DEPENDS_append_class-nativesdk = " gobject-introspection-native" | 25 | DEPENDS_append_class-nativesdk = " gobject-introspection-native" |
26 | 26 | ||
27 | # This is necessary for python scripts to succeed - distutils fails if these | ||
28 | # are not set | ||
29 | export STAGING_INCDIR | ||
30 | export STAGING_LIBDIR | ||
31 | |||
32 | # This is used by introspection tools to find .gir includes | 27 | # This is used by introspection tools to find .gir includes |
33 | export XDG_DATA_DIRS = "${STAGING_DATADIR}" | 28 | export XDG_DATA_DIRS = "${STAGING_DATADIR}" |
34 | 29 | ||
diff --git a/meta/classes/python3native.bbclass b/meta/classes/python3native.bbclass index 18998636b4..d7b2d357e9 100644 --- a/meta/classes/python3native.bbclass +++ b/meta/classes/python3native.bbclass | |||
@@ -3,3 +3,11 @@ inherit python3-dir | |||
3 | PYTHON="${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN}" | 3 | PYTHON="${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN}" |
4 | EXTRANATIVEPATH += "${PYTHON_PN}-native" | 4 | EXTRANATIVEPATH += "${PYTHON_PN}-native" |
5 | DEPENDS += " ${PYTHON_PN}-native " | 5 | DEPENDS += " ${PYTHON_PN}-native " |
6 | |||
7 | # python-config and other scripts are using distutils modules | ||
8 | # which we patch to access these variables | ||
9 | export STAGING_INCDIR | ||
10 | export STAGING_LIBDIR | ||
11 | |||
12 | # autoconf macros will use their internal default preference otherwise | ||
13 | export PYTHON | ||
diff --git a/meta/classes/pythonnative.bbclass b/meta/classes/pythonnative.bbclass index 97029dc525..bd239fa792 100644 --- a/meta/classes/pythonnative.bbclass +++ b/meta/classes/pythonnative.bbclass | |||
@@ -6,3 +6,11 @@ PYTHON="${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN}" | |||
6 | PYTHON_EXECUTABLE="${PYTHON}" | 6 | PYTHON_EXECUTABLE="${PYTHON}" |
7 | EXTRANATIVEPATH += "${PYTHON_PN}-native" | 7 | EXTRANATIVEPATH += "${PYTHON_PN}-native" |
8 | DEPENDS += " ${PYTHON_PN}-native " | 8 | DEPENDS += " ${PYTHON_PN}-native " |
9 | |||
10 | # python-config and other scripts are using distutils modules | ||
11 | # which we patch to access these variables | ||
12 | export STAGING_INCDIR | ||
13 | export STAGING_LIBDIR | ||
14 | |||
15 | # autoconf macros will use their internal default preference otherwise | ||
16 | export PYTHON | ||
diff --git a/meta/recipes-core/glib-2.0/glib.inc b/meta/recipes-core/glib-2.0/glib.inc index c6b8e57e7d..c2ccedaeff 100644 --- a/meta/recipes-core/glib-2.0/glib.inc +++ b/meta/recipes-core/glib-2.0/glib.inc | |||
@@ -77,6 +77,7 @@ do_install_append () { | |||
77 | fi | 77 | fi |
78 | 78 | ||
79 | # Remove some unpackaged files | 79 | # Remove some unpackaged files |
80 | rm -rf ${D}${datadir}/glib-2.0/codegen/__pycache__ | ||
80 | rm -f ${D}${datadir}/glib-2.0/codegen/*.pyc | 81 | rm -f ${D}${datadir}/glib-2.0/codegen/*.pyc |
81 | rm -f ${D}${datadir}/glib-2.0/codegen/*.pyo | 82 | rm -f ${D}${datadir}/glib-2.0/codegen/*.pyo |
82 | 83 | ||
diff --git a/meta/recipes-core/libxml/libxml2_2.9.4.bb b/meta/recipes-core/libxml/libxml2_2.9.4.bb index 5ff508a5ce..e2febf0c60 100644 --- a/meta/recipes-core/libxml/libxml2_2.9.4.bb +++ b/meta/recipes-core/libxml/libxml2_2.9.4.bb | |||
@@ -47,10 +47,6 @@ EXTRA_OECONF_class-native = "--without-legacy --without-docbook --with-c14n --wi | |||
47 | EXTRA_OECONF_class-nativesdk = "--without-legacy --without-docbook --with-c14n --without-lzma --with-zlib" | 47 | EXTRA_OECONF_class-nativesdk = "--without-legacy --without-docbook --with-c14n --without-lzma --with-zlib" |
48 | EXTRA_OECONF_linuxstdbase = "--with-debug --with-legacy --with-docbook --with-c14n --without-lzma --with-zlib" | 48 | EXTRA_OECONF_linuxstdbase = "--with-debug --with-legacy --with-docbook --with-c14n --without-lzma --with-zlib" |
49 | 49 | ||
50 | # required for python binding | ||
51 | export STAGING_LIBDIR | ||
52 | export STAGING_INCDIR | ||
53 | |||
54 | python populate_packages_prepend () { | 50 | python populate_packages_prepend () { |
55 | # autonamer would call this libxml2-2, but we don't want that | 51 | # autonamer would call this libxml2-2, but we don't want that |
56 | if d.getVar('DEBIAN_NAMES', True): | 52 | if d.getVar('DEBIAN_NAMES', True): |
diff --git a/meta/recipes-devtools/python/python3-dbus_1.2.4.bb b/meta/recipes-devtools/python/python3-dbus_1.2.4.bb index 759512c396..de5a01c7f2 100644 --- a/meta/recipes-devtools/python/python3-dbus_1.2.4.bb +++ b/meta/recipes-devtools/python/python3-dbus_1.2.4.bb | |||
@@ -18,10 +18,6 @@ PACKAGECONFIG ?= "" | |||
18 | PACKAGECONFIG[docs] = "--enable-html-docs,--disable-html-docs,python3-docutils-native" | 18 | PACKAGECONFIG[docs] = "--enable-html-docs,--disable-html-docs,python3-docutils-native" |
19 | PACKAGECONFIG[api-docs] = "--enable-api-docs,--disable-api-docs,python3-docutils-native python3-epydoc-native" | 19 | PACKAGECONFIG[api-docs] = "--enable-api-docs,--disable-api-docs,python3-docutils-native python3-epydoc-native" |
20 | 20 | ||
21 | do_configure_prepend() { | ||
22 | export PYTHON=${PYTHON} | ||
23 | } | ||
24 | |||
25 | RDEPENDS_${PN} = "python3-io python3-logging python3-stringold python3-threading python3-xml" | 21 | RDEPENDS_${PN} = "python3-io python3-logging python3-stringold python3-threading python3-xml" |
26 | 22 | ||
27 | FILES_${PN}-dev += "${libdir}/pkgconfig" | 23 | FILES_${PN}-dev += "${libdir}/pkgconfig" |
diff --git a/meta/recipes-extended/libuser/libuser_0.62.bb b/meta/recipes-extended/libuser/libuser_0.62.bb index 85905630a2..960f789e27 100644 --- a/meta/recipes-extended/libuser/libuser_0.62.bb +++ b/meta/recipes-extended/libuser/libuser_0.62.bb | |||
@@ -24,8 +24,6 @@ DEPENDS = "popt libpam glib-2.0 docbook-utils-native linuxdoc-tools-native pytho | |||
24 | 24 | ||
25 | inherit autotools gettext python3native python3-dir pkgconfig | 25 | inherit autotools gettext python3native python3-dir pkgconfig |
26 | 26 | ||
27 | export PYTHON | ||
28 | |||
29 | EXTRA_OEMAKE = "PYTHON_CPPFLAGS=-I${STAGING_INCDIR}/${PYTHON_DIR}${PYTHON_ABI}" | 27 | EXTRA_OEMAKE = "PYTHON_CPPFLAGS=-I${STAGING_INCDIR}/${PYTHON_DIR}${PYTHON_ABI}" |
30 | 28 | ||
31 | PACKAGES += "${PN}-python " | 29 | PACKAGES += "${PN}-python " |
diff --git a/meta/recipes-extended/newt/libnewt_0.52.19.bb b/meta/recipes-extended/newt/libnewt_0.52.19.bb index b45461cde3..22bdaf5ab1 100644 --- a/meta/recipes-extended/newt/libnewt_0.52.19.bb +++ b/meta/recipes-extended/newt/libnewt_0.52.19.bb | |||
@@ -35,8 +35,6 @@ inherit autotools-brokensep | |||
35 | 35 | ||
36 | CLEANBROKEN = "1" | 36 | CLEANBROKEN = "1" |
37 | 37 | ||
38 | export STAGING_INCDIR | ||
39 | export STAGING_LIBDIR | ||
40 | export CPPFLAGS | 38 | export CPPFLAGS |
41 | 39 | ||
42 | PACKAGES_prepend = "whiptail " | 40 | PACKAGES_prepend = "whiptail " |
diff --git a/meta/recipes-gnome/gobject-introspection/gobject-introspection_1.48.0.bb b/meta/recipes-gnome/gobject-introspection/gobject-introspection_1.48.0.bb index 8adede66a5..6948aff2fa 100644 --- a/meta/recipes-gnome/gobject-introspection/gobject-introspection_1.48.0.bb +++ b/meta/recipes-gnome/gobject-introspection/gobject-introspection_1.48.0.bb | |||
@@ -21,13 +21,6 @@ SRC_URI[sha256sum] = "fa275aaccdbfc91ec0bc9a6fd0562051acdba731e7d584b64a277fec60 | |||
21 | inherit autotools pkgconfig gtk-doc python3native qemu gobject-introspection-data | 21 | inherit autotools pkgconfig gtk-doc python3native qemu gobject-introspection-data |
22 | BBCLASSEXTEND = "native" | 22 | BBCLASSEXTEND = "native" |
23 | 23 | ||
24 | # necessary to let the call for python-config from configure.ac succeed | ||
25 | export STAGING_INCDIR | ||
26 | export STAGING_LIBDIR | ||
27 | |||
28 | # autoconf macros otherwise will default to Python 2 | ||
29 | export PYTHON | ||
30 | |||
31 | # needed for writing out the qemu wrapper script | 24 | # needed for writing out the qemu wrapper script |
32 | export STAGING_DIR_HOST | 25 | export STAGING_DIR_HOST |
33 | export B | 26 | export B |
diff --git a/meta/recipes-kernel/perf/perf.bb b/meta/recipes-kernel/perf/perf.bb index d6683006fc..171d23f454 100644 --- a/meta/recipes-kernel/perf/perf.bb +++ b/meta/recipes-kernel/perf/perf.bb | |||
@@ -40,8 +40,6 @@ inherit linux-kernel-base kernel-arch pythonnative | |||
40 | 40 | ||
41 | # needed for building the tools/perf Python bindings | 41 | # needed for building the tools/perf Python bindings |
42 | inherit python-dir | 42 | inherit python-dir |
43 | export STAGING_INCDIR | ||
44 | export STAGING_LIBDIR | ||
45 | export PYTHON_SITEPACKAGES_DIR | 43 | export PYTHON_SITEPACKAGES_DIR |
46 | 44 | ||
47 | #kernel 3.1+ supports WERROR to disable warnings as errors | 45 | #kernel 3.1+ supports WERROR to disable warnings as errors |
diff --git a/meta/recipes-support/libcap-ng/libcap-ng_0.7.7.bb b/meta/recipes-support/libcap-ng/libcap-ng_0.7.7.bb index 5608f495e6..a38a818c03 100644 --- a/meta/recipes-support/libcap-ng/libcap-ng_0.7.7.bb +++ b/meta/recipes-support/libcap-ng/libcap-ng_0.7.7.bb | |||
@@ -17,9 +17,6 @@ SRC_URI[sha256sum] = "615549ce39b333f6b78baee0c0b4ef18bc726c6bf1cca123dfd89dd963 | |||
17 | 17 | ||
18 | DEPENDS += "swig-native python3" | 18 | DEPENDS += "swig-native python3" |
19 | 19 | ||
20 | export PYTHON | ||
21 | export STAGING_INCDIR | ||
22 | export STAGING_LIBDIR | ||
23 | EXTRA_OECONF += "--with-python --with-python3" | 20 | EXTRA_OECONF += "--with-python --with-python3" |
24 | EXTRA_OEMAKE += "PYLIBVER='python${PYTHON_BASEVERSION}${PYTHON_ABI}' PYINC='${STAGING_INCDIR}/${PYLIBVER}'" | 21 | EXTRA_OEMAKE += "PYLIBVER='python${PYTHON_BASEVERSION}${PYTHON_ABI}' PYINC='${STAGING_INCDIR}/${PYLIBVER}'" |
25 | 22 | ||