* [PATCH v2] python3: make readline, gdbm, and db support conditional.
@ 2017-06-07 13:49 Ismo Puustinen
2017-06-07 14:10 ` Burton, Ross
2017-06-08 10:51 ` Alexander Kanavin
0 siblings, 2 replies; 7+ messages in thread
From: Ismo Puustinen @ 2017-06-07 13:49 UTC (permalink / raw)
To: openembedded-core
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
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH v2] python3: make readline, gdbm, and db support conditional.
2017-06-07 13:49 [PATCH v2] python3: make readline, gdbm, and db support conditional Ismo Puustinen
@ 2017-06-07 14:10 ` Burton, Ross
2017-06-08 10:20 ` Puustinen, Ismo
2017-06-09 7:43 ` Puustinen, Ismo
2017-06-08 10:51 ` Alexander Kanavin
1 sibling, 2 replies; 7+ messages in thread
From: Burton, Ross @ 2017-06-07 14:10 UTC (permalink / raw)
To: Ismo Puustinen; +Cc: OE-core
[-- Attachment #1: Type: text/plain, Size: 545 bytes --]
On 7 June 2017 at 14:49, Ismo Puustinen <ismo.puustinen@intel.com> wrote:
> +RRECOMMENDS_${PN}-core = "${@bb.utils.contains('PACKAGECONFIG',
> 'readline', '${PN}-readline', '', d)}"
>
Recommends can not exists, so I wouldn't bother with this complication.
+RDEPENDS_${PN}-modules_remove += "${@bb.utils.contains('PACKAGECONFIG',
> 'readline', '', '${PN}-readline', d)}"
(etc)
Don't use _remove and += as it's confusing.
But if for example readline is disabled, why would the package be created
in the first place?
Ross
[-- Attachment #2: Type: text/html, Size: 1503 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2] python3: make readline, gdbm, and db support conditional.
2017-06-07 14:10 ` Burton, Ross
@ 2017-06-08 10:20 ` Puustinen, Ismo
2017-06-09 7:43 ` Puustinen, Ismo
1 sibling, 0 replies; 7+ messages in thread
From: Puustinen, Ismo @ 2017-06-08 10:20 UTC (permalink / raw)
To: Burton, Ross; +Cc: openembedded-core@lists.openembedded.org
On Wed, 2017-06-07 at 15:10 +0100, Burton, Ross wrote:
>
> On 7 June 2017 at 14:49, Ismo Puustinen <ismo.puustinen@intel.com>
> wrote:
> > +RRECOMMENDS_${PN}-core = "${@bb.utils.contains('PACKAGECONFIG',
> > 'readline', '${PN}-readline', '', d)}"
> >
>
> Recommends can not exists, so I wouldn't bother with this
> complication.
Ok, I'll remove it.
> > +RDEPENDS_${PN}-modules_remove += "${@bb.utils.contains('PACKAGECON
> > FIG', 'readline', '', '${PN}-readline', d)}"
>
> (etc)
>
> Don't use _remove and += as it's confusing.
I'll change that.
> But if for example readline is disabled, why would the package be
> created in the first place?
The package indeed isn't created. However, it's added to
RDEPENDS_python3-modules in python3 manifest file here:
https://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/meta/recipes-devto
ols/python/python-3.5-manifest.inc#n280
The other variable changes are done also in the manifest. However, the
manifest file warns about modifying it, so the patch "reverses" the
changes based on PACKAGECONFIG from the recipe.
Ismo
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2] python3: make readline, gdbm, and db support conditional.
2017-06-07 13:49 [PATCH v2] python3: make readline, gdbm, and db support conditional Ismo Puustinen
2017-06-07 14:10 ` Burton, Ross
@ 2017-06-08 10:51 ` Alexander Kanavin
2017-06-08 12:35 ` Puustinen, Ismo
1 sibling, 1 reply; 7+ messages in thread
From: Alexander Kanavin @ 2017-06-08 10:51 UTC (permalink / raw)
To: Ismo Puustinen, openembedded-core
On 06/07/2017 04:49 PM, Ismo Puustinen wrote:
> 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.
db should be taken out from this patch, it's no longer a gplv3 concern
now that we're providing db 5.x only :)
Alex
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2] python3: make readline, gdbm, and db support conditional.
2017-06-08 10:51 ` Alexander Kanavin
@ 2017-06-08 12:35 ` Puustinen, Ismo
2017-06-08 12:37 ` Alexander Kanavin
0 siblings, 1 reply; 7+ messages in thread
From: Puustinen, Ismo @ 2017-06-08 12:35 UTC (permalink / raw)
To: openembedded-core@lists.openembedded.org,
alexander.kanavin@linux.intel.com
On Thu, 2017-06-08 at 13:51 +0300, Alexander Kanavin wrote:
> On 06/07/2017 04:49 PM, Ismo Puustinen wrote:
> > 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.
>
> db should be taken out from this patch, it's no longer a gplv3
> concern
> now that we're providing db 5.x only :)
I can leave db out of the patch then. Is db 5.x a long-term solution or
do we have to change to 6.x at some point? Is anyone maintaining db 5
(security fixes especially) anymore?
Ismo
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2] python3: make readline, gdbm, and db support conditional.
2017-06-08 12:35 ` Puustinen, Ismo
@ 2017-06-08 12:37 ` Alexander Kanavin
0 siblings, 0 replies; 7+ messages in thread
From: Alexander Kanavin @ 2017-06-08 12:37 UTC (permalink / raw)
To: Puustinen, Ismo, openembedded-core@lists.openembedded.org
On 06/08/2017 03:35 PM, Puustinen, Ismo wrote:
>> db should be taken out from this patch, it's no longer a gplv3
>> concern
>> now that we're providing db 5.x only :)
>
> I can leave db out of the patch then. Is db 5.x a long-term solution or
> do we have to change to 6.x at some point? Is anyone maintaining db 5
> (security fixes especially) anymore?
We have no plans to change to 6.x.
5.x is what all major Linux distros are using, so we can take security
fixes from them as needed. 6.x has been more or less rejected by open
source community.
Alex
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2] python3: make readline, gdbm, and db support conditional.
2017-06-07 14:10 ` Burton, Ross
2017-06-08 10:20 ` Puustinen, Ismo
@ 2017-06-09 7:43 ` Puustinen, Ismo
1 sibling, 0 replies; 7+ messages in thread
From: Puustinen, Ismo @ 2017-06-09 7:43 UTC (permalink / raw)
To: Burton, Ross; +Cc: openembedded-core@lists.openembedded.org
On Wed, 2017-06-07 at 15:10 +0100, Burton, Ross wrote:
> On 7 June 2017 at 14:49, Ismo Puustinen <ismo.puustinen@intel.com>
> wrote:
> > +RRECOMMENDS_${PN}-core = "${@bb.utils.contains('PACKAGECONFIG',
> > 'readline', '${PN}-readline', '', d)}"
> >
>
> Recommends can not exists, so I wouldn't bother with this
> complication.
Hmm, leaving out that change leads to a BB error:
ERROR: Nothing RPROVIDES 'python3-readline' (but /u/ipuustin/intel-iot-refkit/openembedded-core/meta/recipes-devtools/python/python3_3.5.3.bb RDEPENDS on or otherwise requires it)
I'm posting the next version of the patch in a minute.
Ismo
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2017-06-09 7:43 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-07 13:49 [PATCH v2] python3: make readline, gdbm, and db support conditional Ismo Puustinen
2017-06-07 14:10 ` 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
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox