diff mbox series

python3-ctypes: depend on ldconfig only if distro-feature set

Message ID 11ada3e2ff22324b5da965bb2ca1fcae017a8463.1732286366.git.joerg.sommer@navimatix.de
State New
Headers show
Series python3-ctypes: depend on ldconfig only if distro-feature set | expand

Commit Message

Jörg Sommer Nov. 22, 2024, 2:39 p.m. UTC
From: Jörg Sommer <joerg.sommer@navimatix.de>

In the source code is only usage of ldconfig (for Linux) in
Lib/ctypes/util.py:301. This is wrapped in try-execpt which causes
_findSoname_ldconfig return Nothing. This is handled properly in
find_library and other methods to find the library a tried.

So, the code can handle the case of a missing /sbin/ldconfig (BTW:
hard-coded path). When DISTRO_FEATURES does not contain ldconfig some other
services (Systemd) to setup and maintain the ldconfig.cache are not
installed. Hence, this ldconfig pulled in by the ctype dependency is of no
use.

Therefore, do not set the dependency on ldconfig, if the distro-feature is
not set.

Signed-off-by: Jörg Sommer <joerg.sommer@navimatix.de>
---
 meta/recipes-devtools/python/python3_3.13.0.bb | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/meta/recipes-devtools/python/python3_3.13.0.bb b/meta/recipes-devtools/python/python3_3.13.0.bb
index 54742f5257..8db5b81373 100644
--- a/meta/recipes-devtools/python/python3_3.13.0.bb
+++ b/meta/recipes-devtools/python/python3_3.13.0.bb
@@ -461,7 +461,9 @@  FILES:${PN}-man = "${datadir}/man"
 
 # See https://bugs.python.org/issue18748 and https://bugs.python.org/issue37395
 RDEPENDS:libpython3:append:libc-glibc = " libgcc"
-RDEPENDS:${PN}-ctypes:append:libc-glibc = " ${MLPREFIX}ldconfig"
+RDEPENDS:${PN}-ctypes:append:libc-glibc = "\
+    ${@bb.utils.contains('DISTRO_FEATURES', 'ldconfig', '${MLPREFIX}ldconfig', '', d)} \
+"
 RDEPENDS:${PN}-ptest = "${PN}-modules ${PN}-tests ${PN}-dev ${PN}-zipapp unzip bzip2 libgcc tzdata coreutils sed gcc g++ binutils \
                         locale-base-fr-fr locale-base-en-us locale-base-de-de"
 RDEPENDS:${PN}-ptest:append:libc-glibc = " locale-base-tr-tr"