The python bindings are built unconditionally, so using libpwquality
drags libpython3 and python3-core onto the image even when only the C
library or pam_pwquality is needed.

Add a "python3" PACKAGECONFIG for the bindings, enabled by default to
keep the current behaviour. The setuptools3-base inherit is deferred
and conditional on it. With python3 disabled, the package depends only
on cracklib and libc.

Signed-off-by: Markus Klotzbuecher <[email protected]>
---
 .../libpwquality/libpwquality_1.4.5.bb              | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/meta-oe/recipes-extended/libpwquality/libpwquality_1.4.5.bb 
b/meta-oe/recipes-extended/libpwquality/libpwquality_1.4.5.bb
index 7ec01ecd3f..b7c673be52 100644
--- a/meta-oe/recipes-extended/libpwquality/libpwquality_1.4.5.bb
+++ b/meta-oe/recipes-extended/libpwquality/libpwquality_1.4.5.bb
@@ -5,7 +5,7 @@ SECTION = "devel/lib"
 LICENSE = "GPL-2.0-or-later"
 LIC_FILES_CHKSUM = "file://COPYING;md5=6bd2f1386df813a459a0c34fde676fc2"
 
-DEPENDS = "cracklib python3-setuptools-native"
+DEPENDS = "cracklib"
 
 SRC_URI = 
"git://github.com/libpwquality/libpwquality;branch=master;protocol=https \
     file://0001-Use-setuptools-instead-of-distutils.patch \
@@ -14,7 +14,8 @@ SRC_URI = 
"git://github.com/libpwquality/libpwquality;branch=master;protocol=htt
 SRCREV = "5490e96a3dd6ed7371435ca5b3ccef98bdb48b5a"
 
 
-inherit autotools-brokensep gettext setuptools3-base
+inherit autotools-brokensep gettext
+inherit_defer ${@bb.utils.contains('PACKAGECONFIG', 'python3', 
'setuptools3-base', '', d)}
 
 do_configure:prepend() {
     cp ${STAGING_DATADIR_NATIVE}/gettext/ABOUT-NLS ${AUTOTOOLS_AUXDIR}/
@@ -24,15 +25,13 @@ export PYTHON_DIR
 export BUILD_SYS
 export HOST_SYS
 
-EXTRA_OECONF += "--with-python-rev=${PYTHON_BASEVERSION} \
-                 
--with-python-binary=${STAGING_BINDIR_NATIVE}/python3-native/python3 \
-                 --with-pythonsitedir=${PYTHON_SITEPACKAGES_DIR} \
-                 --libdir=${libdir} \
+EXTRA_OECONF += "--libdir=${libdir} \
                  --with-securedir=${base_libdir}/security \
 "
 
-PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam', '', 
d)}"
+PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam', '', 
d)} python3"
 PACKAGECONFIG[pam] = "--enable-pam,--disable-pam,libpam"
+PACKAGECONFIG[python3] = "--enable-python-bindings 
--with-python-rev=${PYTHON_BASEVERSION} 
--with-python-binary=${STAGING_BINDIR_NATIVE}/python3-native/python3 
--with-pythonsitedir=${PYTHON_SITEPACKAGES_DIR},--disable-python-bindings,python3-setuptools-native"
 
 FILES:${PN} += "${base_libdir}/security/pam_pwquality.so"
 FILES:${PN}-dbg += "${base_libdir}/security/.debug"
-- 
2.53.0


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#127407): 
https://lists.openembedded.org/g/openembedded-devel/message/127407
Mute This Topic: https://lists.openembedded.org/mt/119675951/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to