]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
tools/util-linux: build with meson 19598/head
authorRosen Penev <rosenp@gmail.com>
Tue, 29 Jul 2025 20:46:18 +0000 (13:46 -0700)
committerNick Hainke <vincent@systemli.org>
Thu, 31 Jul 2025 06:43:44 +0000 (08:43 +0200)
Simplifies Makefile by quite a bit.

Added an upstream backport fixing compilation with older OS.

Added a curses patch so -Dauto_features=disabled can work properly.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/19598
Signed-off-by: Nick Hainke <vincent@systemli.org>
tools/util-linux/Makefile
tools/util-linux/patches/010-meson-curses.patch [new file with mode: 0644]
tools/util-linux/patches/110-meson-fix-a-bug-in-posixipc_libs-configuration.patch [new file with mode: 0644]
tools/util-linux/patches/110-move-libpthread-to-libs.patch [deleted file]

index fd90f31b5f312f5b76e5798545a04c943d24eb33..23c39103b1bede77655876db157eded921a4a4df 100644 (file)
@@ -14,42 +14,14 @@ PKG_SOURCE_URL:=@KERNEL/linux/utils/$(PKG_NAME)/v2.41
 PKG_HASH:=be9ad9a276f4305ab7dd2f5225c8be1ff54352f565ff4dede9628c1aaa7dec57
 PKG_CPE_ID:=cpe:/a:kernel:util-linux
 
-PKG_FIXUP:=autoreconf
-
-HOST_BUILD_PARALLEL:=1
-
 include $(INCLUDE_DIR)/host-build.mk
-
-HOST_CONFIGURE_ARGS += \
-       --with-pic \
-       --disable-shared \
-       --disable-nls \
-       --disable-all-programs \
-       --enable-hexdump \
-       --enable-libuuid \
-       --without-util \
-       --without-selinux \
-       --without-audit \
-       --without-udev \
-       --without-ncursesw \
-       --without-ncurses \
-       --without-slang \
-       --without-tinfo \
-       --without-readline \
-       --without-utempter \
-       --without-cap-ng \
-       --without-libz \
-       --without-libmagic \
-       --without-user \
-       --without-btrfs \
-       --without-systemd \
-       --without-smack \
-       --without-econf \
-       --without-python \
-       --without-cryptsetup
-
-define Host/Uninstall
-       -$(call Host/Compile/Default,uninstall)
-endef
+include $(INCLUDE_DIR)/meson.mk
+
+MESON_HOST_ARGS += \
+       -Dauto_features=disabled \
+       -Dbuild-hexdump=enabled \
+       -Dbuild-libuuid=enabled \
+       -Dncurses=enabled \
+       -Dprogram-tests=false
 
 $(eval $(call HostBuild))
diff --git a/tools/util-linux/patches/010-meson-curses.patch b/tools/util-linux/patches/010-meson-curses.patch
new file mode 100644 (file)
index 0000000..80c28ee
--- /dev/null
@@ -0,0 +1,24 @@
+From c1ca5ec4a5c6a0e4acbdcc6ff4e4fa2109c1ec24 Mon Sep 17 00:00:00 2001
+From: Rosen Penev <rosenp@gmail.com>
+Date: Wed, 30 Jul 2025 14:13:07 -0700
+Subject: [PATCH] meson: use curses for the non wide version
+
+The curses dependency in meson in special in that it uses a combination
+of pkg-config, config-tool, and various system lookups to find it.
+
+Signed-off-by: Rosen Penev <rosenp@gmail.com>
+---
+ meson.build | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/meson.build
++++ b/meson.build
+@@ -289,7 +289,7 @@ if lib_ncursesw.found()
+   lib_ncurses = disabler()
+ else
+   lib_ncurses = dependency(
+-    'ncurses',
++    'curses',
+     disabler : true,
+     required : get_option('ncurses'))
+   headers += ['ncurses.h',
diff --git a/tools/util-linux/patches/110-meson-fix-a-bug-in-posixipc_libs-configuration.patch b/tools/util-linux/patches/110-meson-fix-a-bug-in-posixipc_libs-configuration.patch
new file mode 100644 (file)
index 0000000..a6ec1b8
--- /dev/null
@@ -0,0 +1,23 @@
+From 946c0b9c6f6481ed9370b8bd0f54a622a0c4a574 Mon Sep 17 00:00:00 2001
+From: Martin Valgur <martin.valgur@gmail.com>
+Date: Tue, 15 Apr 2025 16:19:21 +0300
+Subject: [PATCH] meson: fix a bug in posixipc_libs configuration
+
+Should append instead of assigning. Otherwise fails with
+
+meson.build:1482:22: ERROR: Object <[ExternalLibraryHolder] holds [ExternalLibrary]: <ExternalLibrary rt: True>> of type ExternalLibrary does not support the `+` operator.
+---
+ meson.build | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/meson.build
++++ b/meson.build
+@@ -1473,7 +1473,7 @@ has_seminfo_type = cc.has_type('struct s
+ posixipc_libs = []
+ if not cc.has_function('shm_open') and conf.get('HAVE_SYS_MMAN_H').to_string() == '1'
+-  posixipc_libs = cc.find_library('rt', required : true)
++  posixipc_libs += cc.find_library('rt', required : true)
+ endif
+ if not cc.has_function('sem_close') and conf.get('HAVE_SEMAPHORE_H').to_string() == '1'
diff --git a/tools/util-linux/patches/110-move-libpthread-to-libs.patch b/tools/util-linux/patches/110-move-libpthread-to-libs.patch
deleted file mode 100644 (file)
index 996402d..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-From 15bc69131a1e08019096251ea848104e57d99a12 Mon Sep 17 00:00:00 2001
-From: Rosen Penev <rosenp@gmail.com>
-Date: Sun, 27 Jul 2025 11:55:56 -0700
-Subject: [PATCH] move libpthread to Libs
-
-OpewWrt uses static host libraries and as such dependant libraries must
-be moved to public Libs. meson handles this automatically but Autotools
-does not.
-
-Signed-off-by: Rosen Penev <rosenp@gmail.com>
----
- libuuid/uuid.pc.in | 3 +--
- 1 file changed, 1 insertion(+), 2 deletions(-)
-
---- a/libuuid/uuid.pc.in
-+++ b/libuuid/uuid.pc.in
-@@ -7,5 +7,4 @@ Name: uuid
- Description: Universally unique id library
- Version: @LIBUUID_VERSION@
- Cflags: -I${includedir}/uuid
--Libs.private: @SOCKET_LIBS@ -lpthread
--Libs: -L${libdir} -luuid
-+Libs: -L${libdir} -luuid @SOCKET_LIBS@ -lpthread