[OE-core] [PATCH] libxml2: make dependencies on python conditional

Dmitry Rozhkov dmitry.rozhkov at linux.intel.com
Mon Apr 3 13:12:25 UTC 2017


The library libxml2 can provide its own bindings for python2 in addition
to the third party python-lxml and python3-lxml packages if this
functionality is enabled in PACKAGECONFIG.

But in case the functionality is disabled there's no need to depend
on python2.

Make the dependency on python2 enabled only if the python feature
is added to PACKAGECONFIG. Also don't produce the binary
package libxml2-python if it's not needed.

Signed-off-by: Dmitry Rozhkov <dmitry.rozhkov at linux.intel.com>
---
 meta/recipes-core/libxml/libxml2_2.9.4.bb | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/meta/recipes-core/libxml/libxml2_2.9.4.bb b/meta/recipes-core/libxml/libxml2_2.9.4.bb
index 023fe99..1c629d1 100644
--- a/meta/recipes-core/libxml/libxml2_2.9.4.bb
+++ b/meta/recipes-core/libxml/libxml2_2.9.4.bb
@@ -32,9 +32,11 @@ SRC_URI[testtar.sha256sum] = "96151685cec997e1f9f3387e3626d61e6284d4d6e66e0e440c
 
 BINCONFIG = "${bindir}/xml2-config"
 
-inherit autotools pkgconfig binconfig-disabled pythonnative ptest
+inherit autotools pkgconfig binconfig-disabled ptest
 
-RDEPENDS_${PN}-ptest += "python-core"
+inherit ${@bb.utils.contains('PACKAGECONFIG', 'python', 'pythonnative', '', d)}
+
+RDEPENDS_${PN}-ptest += "make ${@bb.utils.contains('PACKAGECONFIG', 'python', 'python-core', '', d)}"
 
 RDEPENDS_${PN}-python += "python-core"
 
@@ -60,7 +62,8 @@ python populate_packages_prepend () {
         d.setVar('PKG_libxml2', '${MLPREFIX}libxml2')
 }
 
-PACKAGES += "${PN}-utils ${PN}-python"
+PACKAGES += "${PN}-utils \
+             ${@bb.utils.contains('PACKAGECONFIG', 'python', '${PN}-python', '', d)}"
 
 FILES_${PN}-staticdev += "${PYTHON_SITEPACKAGES_DIR}/*.a"
 FILES_${PN}-dev += "${libdir}/xml2Conf.sh ${libdir}/cmake/*"
-- 
2.9.3




More information about the Openembedded-core mailing list