* [PATCH v3] python3: make readline and gdbm support conditional.
@ 2017-06-09 7:43 Ismo Puustinen
2017-06-13 19:36 ` Burton, Ross
0 siblings, 1 reply; 3+ messages in thread
From: Ismo Puustinen @ 2017-06-09 7:43 UTC (permalink / raw)
To: openembedded-core
The two libraries' (readline and gdbm) 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..a85c3d6 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 db openssl sqlite3 zlib virtual/libintl xz"
PR = "${INC_PR}.0"
PYTHON_MAJMIN = "3.5"
PYTHON_BINABI= "${PYTHON_MAJMIN}m"
@@ -76,6 +76,10 @@ export CROSSPYTHONPATH = "${STAGING_LIBDIR_NATIVE}/python${PYTHON_MAJMIN}/lib-dy
# No ctypes option for python 3
PYTHONLSBOPTS = ""
+PACKAGECONFIG ??= "readline gdbm"
+PACKAGECONFIG[readline] = ",,readline"
+PACKAGECONFIG[gdbm] = ",,gdbm"
+
do_configure_append() {
rm -f ${S}/Makefile.orig
autoreconf -Wcross --verbose --install --force --exclude=autopoint ../Python-${PV}/Modules/_ctypes/libffi
@@ -194,7 +198,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 +226,18 @@ PACKAGES += "${PN}-man"
FILES_${PN}-man = "${datadir}/man"
BBCLASSEXTEND = "nativesdk"
+
+# If readline is not there, don't create python3-readline package and
+# also do not depend on it. Same goes for gdbm.
+PACKAGES_remove = " \
+ ${@bb.utils.contains('PACKAGECONFIG', 'readline', '', '${PN}-readline', d)} \
+ ${@bb.utils.contains('PACKAGECONFIG', 'gdbm', '', '${PN}-gdbm', d)} \
+"
+PROVIDES_remove = " \
+ ${@bb.utils.contains('PACKAGECONFIG', 'readline', '', '${PN}-readline', d)} \
+ ${@bb.utils.contains('PACKAGECONFIG', 'gdbm', '', '${PN}-gdbm', d)} \
+"
+RDEPENDS_${PN}-modules_remove = " \
+ ${@bb.utils.contains('PACKAGECONFIG', 'readline', '', '${PN}-readline', d)} \
+ ${@bb.utils.contains('PACKAGECONFIG', 'gdbm', '', '${PN}-gdbm', d)} \
+"
--
2.9.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v3] python3: make readline and gdbm support conditional.
2017-06-09 7:43 [PATCH v3] python3: make readline and gdbm support conditional Ismo Puustinen
@ 2017-06-13 19:36 ` Burton, Ross
2017-06-14 9:59 ` Puustinen, Ismo
0 siblings, 1 reply; 3+ messages in thread
From: Burton, Ross @ 2017-06-13 19:36 UTC (permalink / raw)
To: Ismo Puustinen; +Cc: OE-core
[-- Attachment #1: Type: text/plain, Size: 1317 bytes --]
On 9 June 2017 at 08:43, Ismo Puustinen <ismo.puustinen@intel.com> wrote:
> +# If readline is not there, don't create python3-readline package and
> +# also do not depend on it. Same goes for gdbm.
> +PACKAGES_remove = " \
> + ${@bb.utils.contains('PACKAGECONFIG', 'readline', '',
> '${PN}-readline', d)} \
> + ${@bb.utils.contains('PACKAGECONFIG', 'gdbm', '', '${PN}-gdbm', d)} \
> +"
> +PROVIDES_remove = " \
> + ${@bb.utils.contains('PACKAGECONFIG', 'readline', '',
> '${PN}-readline', d)} \
> + ${@bb.utils.contains('PACKAGECONFIG', 'gdbm', '', '${PN}-gdbm', d)} \
> +"
> +RDEPENDS_${PN}-modules_remove = " \
> + ${@bb.utils.contains('PACKAGECONFIG', 'readline', '',
> '${PN}-readline', d)} \
> + ${@bb.utils.contains('PACKAGECONFIG', 'gdbm', '', '${PN}-gdbm', d)} \
> +"
>
Just looked at what happens to the packaging without these lines.
If gdbm isn't present then the gdbm package isn't generated at all, which
is as expected. python3-readline just contains the rlcompleter package
which is basically an implementation detail and could arguably be deleted
in a do_install_append that checks the PACKAGECONFIG.
The provides/depends will be needed still though, unless we teach the
manifest generator that some packages depend on PACKAGECONFIG flags.
Ross
[-- Attachment #2: Type: text/html, Size: 2162 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v3] python3: make readline and gdbm support conditional.
2017-06-13 19:36 ` Burton, Ross
@ 2017-06-14 9:59 ` Puustinen, Ismo
0 siblings, 0 replies; 3+ messages in thread
From: Puustinen, Ismo @ 2017-06-14 9:59 UTC (permalink / raw)
To: Burton, Ross; +Cc: openembedded-core@lists.openembedded.org
On Tue, 2017-06-13 at 20:36 +0100, Burton, Ross wrote:
> If gdbm isn't present then the gdbm package isn't generated at all,
> which is as expected. python3-readline just contains the rlcompleter
> package which is basically an implementation detail and could
> arguably be deleted in a do_install_append that checks the
> PACKAGECONFIG.
So, if I understand this correctly, you want to have this
do_install_append?
> The provides/depends will be needed still though, unless we teach the
> manifest generator that some packages depend on PACKAGECONFIG flags.
I was thinking the same. Changing the manifest generator might be
cleaner than "patching" the manifest file like this. However, it would
split the changes into three places: the recipe itself, the manifest
generator, and the generated manifest file. This would make it more
difficult for someone reading the recipe to understand how the
mechanism works. Anyway, please tell how you would like me to proceed
here: do you want to have the patch as it is done now or do you want to
see the generator changed?
Ismo
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-06-14 9:59 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-09 7:43 [PATCH v3] python3: make readline and gdbm support conditional Ismo Puustinen
2017-06-13 19:36 ` Burton, Ross
2017-06-14 9:59 ` Puustinen, Ismo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox