All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] libxml2: make dependencies on python conditional
@ 2017-04-03 13:12 Dmitry Rozhkov
  2017-04-03 13:42 ` Burton, Ross
  0 siblings, 1 reply; 2+ messages in thread
From: Dmitry Rozhkov @ 2017-04-03 13:12 UTC (permalink / raw)
  To: openembedded-core

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@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



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] libxml2: make dependencies on python conditional
  2017-04-03 13:12 [PATCH] libxml2: make dependencies on python conditional Dmitry Rozhkov
@ 2017-04-03 13:42 ` Burton, Ross
  0 siblings, 0 replies; 2+ messages in thread
From: Burton, Ross @ 2017-04-03 13:42 UTC (permalink / raw)
  To: Dmitry Rozhkov; +Cc: OE-core

[-- Attachment #1: Type: text/plain, Size: 2649 bytes --]

On 3 April 2017 at 14:12, Dmitry Rozhkov <dmitry.rozhkov@linux.intel.com>
wrote:

> 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.
>

| ERROR: oe_runmake failed
| cc1: warning: include location "/usr/include/python3.4m" is unsafe for
cross-compilation [-Wpoison-system-directories]
| cc1: warning: include location "/usr/include/python3.4m" is unsafe for
cross-compilation [-Wpoison-system-directories]
| cc1: warning: include location "/usr/include/python3.4m" is unsafe for
cross-compilation [-Wpoison-system-directories]
| In file included from /usr/include/python3.4m/Python.h:8:0,
|                  from ../../libxml2-2.9.4/python/libxml2-py.c:3:
| /usr/include/python3.4m/pyconfig.h:3:52: fatal error:
x86_64-linux-gnu/python3.4m/pyconfig.h: No such file or directory
|  #  include <x86_64-linux-gnu/python3.4m/pyconfig.h>
|                                                     ^
| In file included from /usr/include/python3.4m/Python.h:8:0,
|                  from ../../libxml2-2.9.4/python/libxml_wrap.h:1,
|                  from ../../libxml2-2.9.4/python/types.c:9:
| /usr/include/python3.4m/pyconfig.h:3:52: fatal error:
x86_64-linux-gnu/python3.4m/pyconfig.h: No such file or directory
|  #  include <x86_64-linux-gnu/python3.4m/pyconfig.h>
|                                                     ^
| compilation terminated.
| compilation terminated.
| Makefile:625: recipe for target 'types.lo' failed
| make[4]: *** [types.lo] Error 1
| make[4]: *** Waiting for unfinished jobs....
| Makefile:625: recipe for target 'libxml2-py.lo' failed
| make[4]: *** [libxml2-py.lo] Error 1
| In file included from /usr/include/python3.4m/Python.h:8:0,
|                  from ../../libxml2-2.9.4/python/libxml.c:14:
| /usr/include/python3.4m/pyconfig.h:3:52: fatal error:
x86_64-linux-gnu/python3.4m/pyconfig.h: No such file or directory
|  #  include <x86_64-linux-gnu/python3.4m/pyconfig.h>
|                                                     ^
| compilation terminated.
| Makefile:625: recipe for target 'libxml.lo' failed

Something went wrong...  Promise it built before I applied the patch.  Also
the PACKAGES change shouldn't be required as an empty package won't be
generated.

Ross

[-- Attachment #2: Type: text/html, Size: 4277 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-04-03 13:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-03 13:12 [PATCH] libxml2: make dependencies on python conditional Dmitry Rozhkov
2017-04-03 13:42 ` Burton, Ross

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.