public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
From: Ismo Puustinen <ismo.puustinen@intel.com>
To: openembedded-core@lists.openembedded.org
Subject: [PATCH v2] python3: make readline, gdbm, and db support conditional.
Date: Wed,  7 Jun 2017 16:49:42 +0300	[thread overview]
Message-ID: <20170607134942.13281-1-ismo.puustinen@intel.com> (raw)

The three libraries' (readline, gdbm, and db) licenses belong to the
GPLv3 family. Add them to to PACKAGECONFIG so they can be switched off
if the licensing doesn't allow using them. Python build system
autodetects the dependencies but doesn't allow them to be explicitly
disabled, so just deal with the dependencies.

The defaults in PACKAGECONFIG are the same as before, so there should be
no change to current users.

Signed-off-by: Ismo Puustinen <ismo.puustinen@intel.com>
---
 meta/recipes-devtools/python/python3_3.5.3.bb | 23 +++++++++++++++++++++--
 1 file changed, 21 insertions(+), 2 deletions(-)

diff --git a/meta/recipes-devtools/python/python3_3.5.3.bb b/meta/recipes-devtools/python/python3_3.5.3.bb
index d7c29f2..e9a1e6b 100644
--- a/meta/recipes-devtools/python/python3_3.5.3.bb
+++ b/meta/recipes-devtools/python/python3_3.5.3.bb
@@ -1,6 +1,6 @@
 require recipes-devtools/python/python.inc
 
-DEPENDS = "python3-native libffi bzip2 db gdbm openssl readline sqlite3 zlib virtual/libintl xz"
+DEPENDS = "python3-native libffi bzip2 openssl sqlite3 zlib virtual/libintl xz"
 PR = "${INC_PR}.0"
 PYTHON_MAJMIN = "3.5"
 PYTHON_BINABI= "${PYTHON_MAJMIN}m"
@@ -76,6 +76,11 @@ export CROSSPYTHONPATH = "${STAGING_LIBDIR_NATIVE}/python${PYTHON_MAJMIN}/lib-dy
 # No ctypes option for python 3
 PYTHONLSBOPTS = ""
 
+PACKAGECONFIG ??= "readline gdbm db"
+PACKAGECONFIG[readline] = ",,readline"
+PACKAGECONFIG[gdbm] = ",,gdbm"
+PACKAGECONFIG[db] = ",,db"
+
 do_configure_append() {
 	rm -f ${S}/Makefile.orig
 	autoreconf -Wcross --verbose --install --force --exclude=autopoint ../Python-${PV}/Modules/_ctypes/libffi
@@ -194,7 +199,7 @@ require python-${PYTHON_MAJMIN}-manifest.inc
 
 # manual dependency additions
 RPROVIDES_${PN}-modules = "${PN}"
-RRECOMMENDS_${PN}-core = "${PN}-readline"
+RRECOMMENDS_${PN}-core = "${@bb.utils.contains('PACKAGECONFIG', 'readline', '${PN}-readline', '', d)}"
 RRECOMMENDS_${PN}-crypt = "openssl"
 RRECOMMENDS_${PN}-crypt_class-nativesdk = "nativesdk-openssl"
 
@@ -222,3 +227,17 @@ PACKAGES += "${PN}-man"
 FILES_${PN}-man = "${datadir}/man"
 
 BBCLASSEXTEND = "nativesdk"
+
+# If readline is not there, don't create python3-readline package. Same
+# for gdbm and db.
+PACKAGES_remove += "${@bb.utils.contains('PACKAGECONFIG', 'readline', '', '${PN}-readline', d)}"
+PROVIDES_remove += "${@bb.utils.contains('PACKAGECONFIG', 'readline', '', '${PN}-readline', d)}"
+RDEPENDS_${PN}-modules_remove += "${@bb.utils.contains('PACKAGECONFIG', 'readline', '', '${PN}-readline', d)}"
+
+PACKAGES_remove += "${@bb.utils.contains('PACKAGECONFIG', 'gdbm', '', '${PN}-gdbm', d)}"
+PROVIDES_remove += "${@bb.utils.contains('PACKAGECONFIG', 'gdbm', '', '${PN}-gdbm', d)}"
+RDEPENDS_${PN}-modules_remove += "${@bb.utils.contains('PACKAGECONFIG', 'gdbm', '', '${PN}-gdbm', d)}"
+
+PACKAGES_remove += "${@bb.utils.contains('PACKAGECONFIG', 'db', '', '${PN}-db', d)}"
+PROVIDES_remove += "${@bb.utils.contains('PACKAGECONFIG', 'db', '', '${PN}-db', d)}"
+RDEPENDS_${PN}-modules_remove += "${@bb.utils.contains('PACKAGECONFIG', 'db', '', '${PN}-db', d)}"
-- 
2.9.4



             reply	other threads:[~2017-06-07 13:49 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-07 13:49 Ismo Puustinen [this message]
2017-06-07 14:10 ` [PATCH v2] python3: make readline, gdbm, and db support conditional Burton, Ross
2017-06-08 10:20   ` Puustinen, Ismo
2017-06-09  7:43   ` Puustinen, Ismo
2017-06-08 10:51 ` Alexander Kanavin
2017-06-08 12:35   ` Puustinen, Ismo
2017-06-08 12:37     ` Alexander Kanavin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170607134942.13281-1-ismo.puustinen@intel.com \
    --to=ismo.puustinen@intel.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox