[oe-commits] Paul Eggleton : libxml2: fix python packaging for nativesdk

git at git.openembedded.org git at git.openembedded.org
Fri Oct 10 09:39:41 UTC 2014


Module: openembedded-core.git
Branch: daisy
Commit: 360fc811ff843c63f796e958517a5152f07e851d
URL:    http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=360fc811ff843c63f796e958517a5152f07e851d

Author: Paul Eggleton <paul.eggleton at linux.intel.com>
Date:   Thu Jun  5 10:46:17 2014 +0100

libxml2: fix python packaging for nativesdk

We enable the python module in nativesdk-libxml2, but the python binary
used is in the native sysroot and thus you get the module installed in
the wrong path. Even with that fixed the python files are still
unpackaged, so create an ${PN}-python package and add them to it. (This
does not affect the libxml target build at all since python is disabled
for that.)

Signed-off-by: Paul Eggleton <paul.eggleton at linux.intel.com>
Signed-off-by: Saul Wold <sgw at linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>

---

 meta/recipes-core/libxml/libxml2.inc                | 11 ++++++++++-
 .../libxml/libxml2/python-sitepackages-dir.patch    | 21 +++++++++++++++++++++
 2 files changed, 31 insertions(+), 1 deletion(-)

diff --git a/meta/recipes-core/libxml/libxml2.inc b/meta/recipes-core/libxml/libxml2.inc
index 60bb6b8..1401c73 100644
--- a/meta/recipes-core/libxml/libxml2.inc
+++ b/meta/recipes-core/libxml/libxml2.inc
@@ -19,6 +19,7 @@ SRC_URI = "ftp://xmlsoft.org/libxml2/libxml2-${PV}.tar.gz;name=libtar \
            file://runtest.patch \
            file://run-ptest \
            file://libxml2-CVE-2014-0191-fix.patch \
+           file://python-sitepackages-dir.patch \
           "
 
 inherit autotools pkgconfig binconfig pythonnative ptest
@@ -30,6 +31,11 @@ do_configure_prepend () {
 	sed -i -e '/.*ansidecl.h.*/d' ${S}/configure.in
 }
 
+do_configure_prepend_class-nativesdk () {
+	# Ensure we get the correct site-packages path
+	export PYTHON_SITE_PACKAGES="${PYTHON_SITEPACKAGES_DIR}"
+}
+
 EXTRA_OECONF = "--without-python --without-debug --without-legacy --without-catalog --without-docbook --with-c14n --without-lzma --with-fexceptions"
 EXTRA_OECONF_class-native = "--with-python=${STAGING_BINDIR}/python --without-legacy --with-catalog --without-docbook --with-c14n --without-lzma"
 EXTRA_OECONF_class-nativesdk = "--with-python=${STAGING_BINDIR}/python --without-legacy --with-catalog --without-docbook --with-c14n --without-lzma"
@@ -49,10 +55,13 @@ python populate_packages_prepend () {
         d.setVar('PKG_libxml2', '${MLPREFIX}libxml2')
 }
 
-PACKAGES += "${PN}-utils"
+PACKAGES += "${PN}-utils ${PN}-python"
 
+FILES_${PN}-dbg += "${PYTHON_SITEPACKAGES_DIR}/.debug"
+FILES_${PN}-staticdev += "${PYTHON_SITEPACKAGES_DIR}/*.a"
 FILES_${PN}-dev += "${libdir}/xml2Conf.sh"
 FILES_${PN}-utils += "${bindir}/*"
+FILES_${PN}-python += "${PYTHON_SITEPACKAGES_DIR}"
 
 do_install_ptest () {
   cp -r ${WORKDIR}/xmlconf ${D}${PTEST_PATH}
diff --git a/meta/recipes-core/libxml/libxml2/python-sitepackages-dir.patch b/meta/recipes-core/libxml/libxml2/python-sitepackages-dir.patch
new file mode 100644
index 0000000..a697ddf
--- /dev/null
+++ b/meta/recipes-core/libxml/libxml2/python-sitepackages-dir.patch
@@ -0,0 +1,21 @@
+Allow us to pass in PYTHON_SITE_PACKAGES
+
+The python binary used when building for nativesdk doesn't give us the
+correct path here so we need to be able to specify it ourselves.
+
+Upstream-Status: Inappropriate [config]
+
+Signed-off-by: Paul Eggleton <paul.eggleton at linux.intel.com>
+
+--- a/configure.in
++++ b/configure.in
+@@ -743,7 +743,8 @@ dnl
+ 
+ PYTHON_VERSION=
+ PYTHON_INCLUDES=
+-PYTHON_SITE_PACKAGES=
++# Allow this to be set externally
++#PYTHON_SITE_PACKAGES=
+ PYTHON_TESTS=
+ pythondir=
+ if test "$with_python" != "no" ; then



More information about the Openembedded-commits mailing list