Skip to contentSkip to conversation

libgpiod: improve package dependencies

PATCH New Bartosz Golaszewski 1 participant 4 messages Dec 6, 2024

lore
Share & tools
lore
#0 lore raw

cover libgpiod: improve package dependencies

From: Bartosz Golaszewski <[email protected]>

I noticed that if I select python3-gpiod-ptest, the gpio-manager daemon is pulled in too which doesn't make sense. This is caused by the fact that we pull in libgpiod-ptest which in turn rdepends on gpio-manager. This series reworks the dependencies, makes them a bit more fine-grained and results in limited impact of selecting ptest packages for libgpiod and the python bindings.

Bartosz Golaszewski (3):
libgpiod: minimize intra-recipe dependencies for ptest
python3-gpiod: pull in just libgpiosim, not the entire libgpiod-ptest
python3-gpiod: don't recommend kernel-module-configfs for ptest

 .../recipes-support/libgpiod/libgpiod_2.2.bb  | 19 +++++++++++--------
 .../python/python3-gpiod_2.2.2.bb             |  3 +--
 2 files changed, 12 insertions(+), 10 deletions(-)
Signature · 1 line
2.45.2
#1 lore raw

PATCH 1/3 libgpiod: minimize intra-recipe dependencies for ptest

From: Bartosz Golaszewski <[email protected]>

Make the packaging a bit more fine-grained. Create separate packages for the libgpiosim library and gpio-manager configuration files. Make the ptest package run-time depend on only the gpio-manager config. This way, we don't pull the entire daemon infrastructure if all we want is to run its test suite.

While at it: add GPIO udev rules to the gpio-manager config package. Currently they are in the main libgpiod package where they don't really belong.

---
 .../recipes-support/libgpiod/libgpiod_2.2.bb  | 19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)
meta-oe/recipes-support/libgpiod/libgpiod_2.2.bb +11 -8
index 224918a55..259ee04d2 100644
@@ -20,27 +20,30 @@ PACKAGECONFIG[tests] = " \
     --enable-tests --enable-tools --enable-bindings-cxx --enable-bindings-glib --enable-gpioset-interactive --enable-dbus, \
     --disable-tests, \
     kmod util-linux glib-2.0 catch2 libedit glib-2.0-native libgudev, \
-    bash dbus glib-2.0-utils libgpiod-manager shunit2 \
+    bash dbus glib-2.0-utils libgpiod-manager-cfg shunit2 \
 "
 PACKAGECONFIG[gpioset-interactive] = "--enable-gpioset-interactive,--disable-gpioset-interactive,libedit"
 PACKAGECONFIG[glib] = "--enable-bindings-glib,--disable-bindings-glib,glib-2.0 glib-2.0-native"
 PACKAGECONFIG[dbus] = "--enable-dbus,--disable-dbus,glib-2.0 glib-2.0-native libgudev,dbus"
 
-PACKAGES =+ "${PN}-ptest-dev ${PN}-glib ${PN}-manager ${PN}-cli"
+PACKAGES =+ "${PN}-gpiosim ${PN}-glib ${PN}-manager ${PN}-manager-cfg ${PN}-cli"
 FILES:${PN}-tools += "${bindir}/gpionotify"
-FILES:${PN}-ptest += "${libdir}/libgpiosim.so.*"
-FILES:${PN}-ptest-dev += "${includedir}/gpiosim.h"
+FILES:${PN}-gpiosim += "${libdir}/libgpiosim.so.*"
+FILES:${PN}-gpiosim-dev += "${includedir}/gpiosim.h"
 FILES:${PN}-glib += "${libdir}/libgpiod-glib.so.*"
 FILES:${PN}-manager += " \
     ${bindir}/gpio-manager \
-    ${sysconfdir}/dbus-1/system.d/io.gpiod1.conf \
-    ${datadir}/dbus-1/interfaces/io.gpiod1.xml \
     ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '${systemd_system_unitdir}/gpio-manager.service', '', d)} \
     ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', '${sysconfdir}/init.d/gpio-manager', '', d)} \
 "
+FILES:${PN}-manager-cfg += " \
+    ${sysconfdir}/dbus-1/system.d/io.gpiod1.conf \
+    ${datadir}/dbus-1/interfaces/io.gpiod1.xml \
+    ${nonarch_base_libdir}/udev/rules.d/90-gpio.rules \
+"
 FILES:${PN}-cli += "${bindir}/gpiocli"
 
-RDEPENDS:${PN}-manager += "dbus"
+RDEPENDS:${PN}-manager += "dbus ${PN}-manager-cfg"
 RDEPENDS:${PN}-cli += "${PN}-manager"
 
 SYSTEMD_PACKAGES = "${PN}-manager"
@@ -74,7 +77,7 @@ USERADD_PARAM:${PN}-manager = "--system -M -s /bin/nologin -g gpio gpio-manager"
 RDEPENDS:${PN}-ptest += " \
     ${@bb.utils.contains('PTEST_ENABLED', '1', 'shunit2 bash', '', d)} \
 "
-RRECOMMENDS:${PN}-ptest += "kernel-module-gpio-sim kernel-module-configfs"
+RRECOMMENDS:${PN}-gpiosim += "kernel-module-gpio-sim kernel-module-configfs"
 INSANE_SKIP:${PN}-ptest += "buildpaths"
 
 do_compile:prepend() {
Signature · 1 line
2.45.2
#2 lore raw

PATCH 2/3 python3-gpiod: pull in just libgpiosim, not the entire libgpiod-ptest

In reply to Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

We now have a separate package containing the libgpiosim shared object which is all from libgpiod-ptest that we need for this package's tests. Let's relax the run-time dependency.

---
 meta-python/recipes-devtools/python/python3-gpiod_2.2.2.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta-python/recipes-devtools/python/python3-gpiod_2.2.2.bb +1 -1
index 0c7e8ef93..c4be99468 100644
@@ -21,7 +21,7 @@ RDEPENDS:${PN} += " \
     python3-profile \
 "
 RDEPENDS:${PN}-ptest += " \
-    libgpiod-ptest \
+    libgpiod-gpiosim \
     python3-setuptools \
 "
 RRECOMMENDS:${PN}-ptest += "kernel-module-configfs"
Signature · 1 line
2.45.2
#3 lore raw

PATCH 3/3 python3-gpiod: don't recommend kernel-module-configfs for ptest

In reply to Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

This is already done by the libgpiod recipe for libgpiod-gpiosim which is a dependency for python3-gpiod's ptest package.

---
 meta-python/recipes-devtools/python/python3-gpiod_2.2.2.bb | 1 -
 1 file changed, 1 deletion(-)
meta-python/recipes-devtools/python/python3-gpiod_2.2.2.bb +0 -1
index c4be99468..a7c4ee52c 100644
@@ -24,7 +24,6 @@ RDEPENDS:${PN}-ptest += " \
     libgpiod-gpiosim \
     python3-setuptools \
 "
-RRECOMMENDS:${PN}-ptest += "kernel-module-configfs"
 
 export LINK_SYSTEM_LIBGPIOD = "1"
 
Signature · 1 line
2.45.2