[v6,04/13] util-linux: fix packaging nativesdk-util-linux-lib*

Submitted by André Draszik on Feb. 5, 2019, 2:32 a.m. | Patch ID: 158513

Details

Message ID 20190205023241.29707-5-git@andred.net
State Accepted
Commit e2a6b316651412054af1dbddfb25ab980249f85d
Headers show

Commit Message

André Draszik Feb. 5, 2019, 2:32 a.m.
From: André Draszik <andre.draszik@jci.com>

util-linux is configured with --libdir=${base_libdir} for -target builds,
but with the default --libdir=${libdir} for all other builds. Furthermore,
dynamic util-linux-lib* packages are unconditionally being generated from
${base_libdir}, which is the right location for -target builds, only.

IOW, in the nativesdk case, util-linux-lib* packages are empty, and all
the shared libraries implicitly become part of the main package again.

While this surely wasn't intended, this also is going to cause problems as
upcoming changes are explicitly making util-linux an empty meta-package,
which then is going to cause packaging failures.

While fixing this, clean up the existing use of EXTRA_OECONF as it is a
bit confusing, hard to follow, and needlessly duplicates information:
    target: ${SHARED_EXTRA_OECONF} --libdir=${base_libdir}
    native/nativesdk: ${SHARED_EXTRA_OECONF} --disable-use-tty-group
where ${SHARED_EXTRA_OECONF} already contains --disable-use-tty-group.

This can be simplified by completely dropping the duplicated EXTRA_OECONF
assignments and simply using a new variable UTIL_LINUX_LIBDIR with a
_class-target override.

Additionally, this allows to easily fix packaging of the util-linux-lib*
packages, as we can now simply inspect UTIL_LINUX_LIBDIR where and as
needed to get to the right directories.

Lastly, all this can be moved from the .bb file into the .inc file as none
of that appears to actually be version specific, and we can sort the
configure options alphabetically for clarity.

[YOCTO #13058]

Signed-off-by: André Draszik <andre.draszik@jci.com>
---
 meta/recipes-core/util-linux/util-linux.inc   | 31 ++++++++++++-------
 .../util-linux/util-linux_2.32.1.bb           |  9 ------
 2 files changed, 19 insertions(+), 21 deletions(-)

Patch hide | download patch | download mbox

diff --git a/meta/recipes-core/util-linux/util-linux.inc b/meta/recipes-core/util-linux/util-linux.inc
index 4a72e3d40e..a35174f009 100644
--- a/meta/recipes-core/util-linux/util-linux.inc
+++ b/meta/recipes-core/util-linux/util-linux.inc
@@ -42,19 +42,26 @@  PACKAGES =+ "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'util-linux-runuser
 
 PACKAGES_DYNAMIC = "^util-linux-lib.*"
 
-SHARED_EXTRA_OECONF = "--disable-use-tty-group \
-                       --disable-makeinstall-chown \
-                       --enable-kill --enable-last --enable-mesg --enable-partx \
-                       --enable-raw --enable-rfkill --disable-login \
-                       --disable-vipw --disable-newgrp --disable-chfn-chsh \
-                       --enable-write --enable-mount --enable-unshare \
-                       --enable-libuuid --enable-libblkid --enable-fsck \
-                       --disable-minix --disable-bfs --without-udev \
-                       usrsbin_execdir='${sbindir}' \
+CACHED_CONFIGUREVARS += "scanf_cv_alloc_modifier=ms"
+UTIL_LINUX_LIBDIR = "${libdir}"
+UTIL_LINUX_LIBDIR_class-target = "${base_libdir}"
+EXTRA_OECONF = "\
+    --enable-libuuid --enable-libblkid \
+    \
+    --enable-fsck --enable-kill --enable-last --enable-mesg \
+    --enable-mount --enable-partx --enable-raw --enable-rfkill \
+    --enable-unshare --enable-write \
+    \
+    --disable-bfs --disable-chfn-chsh --disable-login \
+    --disable-makeinstall-chown --disable-minix --disable-newgrp \
+    --disable-use-tty-group --disable-vipw \
+    \
+    --without-udev \
+    \
+    usrsbin_execdir='${sbindir}' \
+    --libdir='${UTIL_LINUX_LIBDIR}' \
 "
 
-EXTRA_OECONF = "${SHARED_EXTRA_OECONF} --libdir=${base_libdir}"
-
 PACKAGECONFIG_class-target ?= "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}"
 PACKAGECONFIG[pam] = "--enable-su --enable-runuser,--disable-su --disable-runuser, libpam,"
 
@@ -309,7 +316,7 @@  ALTERNATIVE_LINK_NAME[switch_root] = "${base_sbindir}/switch_root"
 BBCLASSEXTEND = "native nativesdk"
 
 python populate_packages_prepend() {
-    do_split_packages(d, '${base_libdir}', r'^lib(.*)\.so\..*$',
+    do_split_packages(d, d.getVar('UTIL_LINUX_LIBDIR'), r'^lib(.*)\.so\..*$',
                       output_pattern='util-linux-lib%s',
                       description='util-linux lib%s',
                       extra_depends='', prepend=True, allow_links=True)
diff --git a/meta/recipes-core/util-linux/util-linux_2.32.1.bb b/meta/recipes-core/util-linux/util-linux_2.32.1.bb
index 0f860c221b..e0bd383631 100644
--- a/meta/recipes-core/util-linux/util-linux_2.32.1.bb
+++ b/meta/recipes-core/util-linux/util-linux_2.32.1.bb
@@ -11,12 +11,3 @@  SRC_URI += "file://configure-sbindir.patch \
 "
 SRC_URI[md5sum] = "9e5b1b8c1dc99455bdb6b462cf9436d9"
 SRC_URI[sha256sum] = "86e6707a379c7ff5489c218cfaf1e3464b0b95acf7817db0bc5f179e356a67b2"
-
-CACHED_CONFIGUREVARS += "scanf_cv_alloc_modifier=ms"
-
-EXTRA_OECONF_class-native = "${SHARED_EXTRA_OECONF} \
-			     --disable-use-tty-group \
-"
-EXTRA_OECONF_class-nativesdk = "${SHARED_EXTRA_OECONF} \
-				--disable-use-tty-group \
-"