Skip to contentSkip to conversation

eudev: Convert dependencies to PACKAGECONFIG

PATCH Superseded Alex Kiernan 2 participants 5 messages May 16, 2022 – May 20, 2022

v1 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 eudev: Convert dependencies to PACKAGECONFIG

GObject support was dropped in 252150e181c5 ("src/gudev: remove Gobject libudev support."), but some gir support appears to still exist.

Fill out PACKAGECONFIG options.

---
 meta/recipes-core/udev/eudev_3.2.11.bb | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
meta/recipes-core/udev/eudev_3.2.11.bb +6 -3
index 841039f6d745..0fd1b6ab2283 100644
@@ -5,7 +5,7 @@ LICENSE = "GPL-2.0-or-later & LGPL-2.1-or-later"
 LICENSE:libudev = "LGPL-2.1-or-later"
 LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
 
-DEPENDS = "glib-2.0 glib-2.0-native gperf-native kmod util-linux"
+DEPENDS = "gperf-native"
 
 PROVIDES = "udev"
 
@@ -19,7 +19,7 @@ SRC_URI[sha256sum] = "19847cafec67897da855fde56f9dc7d92e21c50e450aa79068a7e704ed
 UPSTREAM_CHECK_URI = "https://github.com/eudev-project/eudev/releases"
 UPSTREAM_CHECK_REGEX = "eudev-(?P<pver>\d+(\.\d+)+)\.tar"
 
-inherit autotools update-rc.d qemu pkgconfig features_check manpages
+inherit autotools update-rc.d qemu pkgconfig features_check manpages gobject-introspection
 
 CONFLICT_DISTRO_FEATURES = "systemd"
 
@@ -30,11 +30,14 @@ EXTRA_OECONF = " \
     --with-rootprefix= \
 "
 
-PACKAGECONFIG ?= "hwdb \
+PACKAGECONFIG ?= "blkid hwdb kmod \
                   ${@bb.utils.filter('DISTRO_FEATURES', 'selinux', d)} \
 "
+PACKAGECONFIG[blkid] = "--enable-blkid,--disable-blkid,util-linux"
 PACKAGECONFIG[hwdb] = "--enable-hwdb,--disable-hwdb"
+PACKAGECONFIG[kmod] = "--enable-kmod,--disable-kmod,kmod"
 PACKAGECONFIG[manpages] = "--enable-manpages,--disable-manpages"
+PACKAGECONFIG[rule-generator] = "--enable-rule-generator,--disable-rule-generator"
 PACKAGECONFIG[selinux] = "--enable-selinux,--disable-selinux,libselinux"
 
 do_install:append() {
Signature · 1 line
2.35.1
#1 lore raw

PATCH 2/3 eudev: Cleanup redundant configuration

hid2hci moved to bluez4 in 2011. The FILES changes for ${PN} and ${PN}-dev only added existing defaults into the set.

---
 meta/recipes-core/udev/eudev_3.2.11.bb | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)
meta/recipes-core/udev/eudev_3.2.11.bb +1 -8
index 0fd1b6ab2283..fc17e119bc68 100644
@@ -50,9 +50,6 @@ do_install:append() {
 
 	# Use classic network interface naming scheme
 	touch ${D}${sysconfdir}/udev/rules.d/80-net-name-slot.rules
-
-	# hid2hci has moved to bluez4. removed in udev as of version 169
-	rm -f ${D}${base_libdir}/udev/hid2hci
 }
 
 do_install:prepend:class-target () {
@@ -67,11 +64,7 @@ INITSCRIPT_PARAMS = "start 04 S ."
 PACKAGES =+ "libudev"
 PACKAGES =+ "eudev-hwdb"
 
-FILES:${PN} += "${libexecdir} ${nonarch_base_libdir}/udev ${bindir}/udevadm"
-FILES:${PN}-dev = "${datadir}/pkgconfig/udev.pc \
-                   ${includedir}/libudev.h ${libdir}/libudev.so \
-                   ${includedir}/udev.h ${libdir}/libudev.la \
-                   ${libdir}/libudev.a ${libdir}/pkgconfig/libudev.pc"
+FILES:${PN} += "${nonarch_base_libdir}/udev"
 FILES:libudev = "${base_libdir}/libudev.so.*"
 FILES:eudev-hwdb = "${sysconfdir}/udev/hwdb.d"
 
Signature · 1 line
2.35.1
#2 lore raw

PATCH 3/3 eudev: Use PACKAGE_BEFORE_PN/${PN}

In reply to Alex Kiernan

Use PACKAGE_BEFORE_PN for packages which need to capture files early, switch to idiomatic ${PN} for additional packages.

---
 meta/recipes-core/udev/eudev_3.2.11.bb | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)
meta/recipes-core/udev/eudev_3.2.11.bb +6 -7
index fc17e119bc68..f12cc250fbdf 100644
@@ -61,20 +61,19 @@ do_install:prepend:class-target () {
 INITSCRIPT_NAME = "udev"
 INITSCRIPT_PARAMS = "start 04 S ."
 
-PACKAGES =+ "libudev"
-PACKAGES =+ "eudev-hwdb"
+PACKAGE_BEFORE_PN = "libudev ${PN}-hwdb"
 
 FILES:${PN} += "${nonarch_base_libdir}/udev"
 FILES:libudev = "${base_libdir}/libudev.so.*"
-FILES:eudev-hwdb = "${sysconfdir}/udev/hwdb.d"
+FILES:${PN}-hwdb = "${sysconfdir}/udev/hwdb.d"
 
-RDEPENDS:eudev-hwdb += "eudev"
+RDEPENDS:${PN}-hwdb += "${PN}"
 
 RPROVIDES:${PN} = "hotplug udev"
-RPROVIDES:eudev-hwdb += "udev-hwdb"
+RPROVIDES:${PN}-hwdb += "udev-hwdb"
 
 PACKAGE_WRITE_DEPS += "qemu-native"
-pkg_postinst:eudev-hwdb () {
+pkg_postinst:${PN}-hwdb () {
     if test -n "$D"; then
         $INTERCEPT_DIR/postinst_intercept update_udev_hwdb ${PKG} mlprefix=${MLPREFIX} binprefix=${MLPREFIX}
     else
@@ -82,6 +81,6 @@ pkg_postinst:eudev-hwdb () {
     fi
 }
 
-pkg_prerm:eudev-hwdb () {
+pkg_prerm:${PN}-hwdb () {
         rm -f $D${sysconfdir}/udev/hwdb.bin
 }
Signature · 1 line
2.35.1
#3 lore raw
In reply to Alex Kiernan
Quoted 25 lines · Alex Kiernan

GObject support was dropped in 252150e181c5 ("src/gudev: remove Gobject libudev support."), but some gir support appears to still exist.

Fill out PACKAGECONFIG options.

---
 meta/recipes-core/udev/eudev_3.2.11.bb | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
meta/recipes-core/udev/eudev_3.2.11.bb +1 -1
index 841039f6d745..0fd1b6ab2283 100644
@@ -5,7 +5,7 @@ LICENSE = "GPL-2.0-or-later & LGPL-2.1-or-later"
 LICENSE:libudev = "LGPL-2.1-or-later"
 LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
 
-DEPENDS = "glib-2.0 glib-2.0-native gperf-native kmod util-linux"
+DEPENDS = "gperf-native"
 
 PROVIDES = "udev"
 

meta/recipes-core/udev/eudev_3.2.11.bb SRC_URI[sha256sum] = "19847cafec67897da855fde56f9dc7d92e21c50e450aa79068a7e704ed · line 22

Quoted 5 lines
meta/recipes-core/udev/eudev_3.2.11.bb +1 -1
@@ -19,7 +19,7 @@ SRC_URI[sha256sum] = "19847cafec67897da855fde56f9dc7d92e21c50e450aa79068a7e704ed
 UPSTREAM_CHECK_URI = "https://github.com/eudev-project/eudev/releases"
 UPSTREAM_CHECK_REGEX = "eudev-(?P<pver>\d+(\.\d+)+)\.tar"
 
-inherit autotools update-rc.d qemu pkgconfig features_check manpages
+inherit autotools update-rc.d qemu pkgconfig features_check manpages gobject-introspection

I like most of what this patch does, cleaning up this kind of thing is great. I am a bit worried about the gobject-introspection inherit though as this wasn't there before and brings with it a huge dependency tree. For something as "core" as udev that is rather sad. Do we really need it? Should we find a way to disable it by default?

Cheers,

Richard

#4 lore raw
Quoted 30 lines · On Fri, May 20, 2022 at 9:24 AM <[email protected]> wrote:
Quoted 28 lines · Alex Kiernan

GObject support was dropped in 252150e181c5 ("src/gudev: remove Gobject libudev support."), but some gir support appears to still exist.

Fill out PACKAGECONFIG options.

---
 meta/recipes-core/udev/eudev_3.2.11.bb | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
meta/recipes-core/udev/eudev_3.2.11.bb +1 -1
index 841039f6d745..0fd1b6ab2283 100644
@@ -5,7 +5,7 @@ LICENSE = "GPL-2.0-or-later & LGPL-2.1-or-later"
 LICENSE:libudev = "LGPL-2.1-or-later"
 LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
 
-DEPENDS = "glib-2.0 glib-2.0-native gperf-native kmod util-linux"
+DEPENDS = "gperf-native"
 
 PROVIDES = "udev"
 
@@ -19,7 +19,7 @@ SRC_URI[sha256sum] = "19847cafec67897da855fde56f9dc7d92e21c50e450aa79068a7e704ed
 UPSTREAM_CHECK_URI = "https://github.com/eudev-project/eudev/releases"
 UPSTREAM_CHECK_REGEX = "eudev-(?P<pver>\d+(\.\d+)+)\.tar"
 
Quoted 9 lines

meta/recipes-core/udev/eudev_3.2.11.bb SRC_URI[sha256sum] = "19847cafec67897da855fde56f9dc7d92e21c50e450aa79068a7e704ed · line 22

Quoted 2 lines
meta/recipes-core/udev/eudev_3.2.11.bb +1 -1
-inherit autotools update-rc.d qemu pkgconfig features_check manpages
+inherit autotools update-rc.d qemu pkgconfig features_check manpages gobject-introspection

I like most of what this patch does, cleaning up this kind of thing is great. I am a bit worried about the gobject-introspection inherit though as this wasn't there before and brings with it a huge dependency tree. For something as "core" as udev that is rather sad. Do we really need it? Should we find a way to disable it by default?

Let me dig some more... basically swapping in g-i-r made the intent of the previous glib inherits more obvious but I have a strong suspicion there's no actual code left in eudev which will drive it and it just wasn't removed from configure.ac as part of removing GObject.

I'll try an upstream patch to completely expunge it and see where we end up.

Signature · 1 line
Alex Kiernan