From 93f91ed3c04bdc19af4cf141f9f974b1a071eab7 Mon Sep 17 00:00:00 2001 From: Oliver Smith Date: Sun, 21 Dec 2025 17:08:04 +0100 Subject: [PATCH] cross/systemd-boot-x86: fix build without libintl Fix that the build aborts with: Checking for function "dgettext" : NO meson.build:1029:21: ERROR: C shared or static library 'intl' not found Part-of: --- ...ble-libintl-check-if-pam-is-disabled.patch | 33 +++++++++++++++++++ cross/systemd-boot-x86/APKBUILD | 3 +- 2 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 cross/systemd-boot-x86/0001-meson-disable-libintl-check-if-pam-is-disabled.patch diff --git a/cross/systemd-boot-x86/0001-meson-disable-libintl-check-if-pam-is-disabled.patch b/cross/systemd-boot-x86/0001-meson-disable-libintl-check-if-pam-is-disabled.patch new file mode 100644 index 000000000..ac27945a3 --- /dev/null +++ b/cross/systemd-boot-x86/0001-meson-disable-libintl-check-if-pam-is-disabled.patch @@ -0,0 +1,33 @@ +From abcc28985f5ab3b50c3ed85abee5e7f8bbd0889e Mon Sep 17 00:00:00 2001 +From: Oliver Smith +Date: Sun, 21 Dec 2025 17:04:26 +0100 +Subject: [PATCH] meson: disable libintl check if pam is disabled + +Disable the libintl check when building without the pam feature, so e.g. +systemd-boot can be (cross) compiled without having the foreign arch +libintl installed on a musl platform. +--- + meson.build | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +diff --git a/meson.build b/meson.build +index bcf1ff2df5..c7088f3d9c 100644 +--- a/meson.build ++++ b/meson.build +@@ -1021,11 +1021,10 @@ libdl = cc.find_library('dl') + + # On some distributions that use musl (e.g. Alpine), libintl.h may be provided by gettext rather than musl. + # In that case, we need to explicitly link with libintl.so. +-if cc.has_function('dgettext', ++libintl = [] ++if get_option('pam').enabled() and not cc.has_function('dgettext', + prefix : '''#include ''', + args : '-D_GNU_SOURCE') +- libintl = [] +-else + libintl = cc.find_library('intl') + if not cc.has_function('dgettext', + prefix : '''#include ''', +-- +2.52.0 + diff --git a/cross/systemd-boot-x86/APKBUILD b/cross/systemd-boot-x86/APKBUILD index cc1383792..085cbf550 100644 --- a/cross/systemd-boot-x86/APKBUILD +++ b/cross/systemd-boot-x86/APKBUILD @@ -16,13 +16,13 @@ makedepends=" libcap-dev meson musl-dev-x86 - musl-libintl py3-elftools py3-jinja2 util-linux-dev " source=" systemd-$pkgver.tar.gz::https://github.com/systemd/systemd/archive/refs/tags/v$pkgver.tar.gz + 0001-meson-disable-libintl-check-if-pam-is-disabled.patch cross-x86.meson " # check: no tests @@ -119,5 +119,6 @@ efistub() { sha512sums=" ef46b13661df43e3cfbeee1bc22f0b1eb902e8ebe39c19868c465efd08b35a199c2a2cd9d8021a6bc4d692fa0c6e0eab3f13eecd6ce24dde81d3945464a25b50 systemd-259.tar.gz +8ecb5e25c0d8b01c406fa3084b0910d517cabbf12894958b4d3d77462cb0924f0a52fe2bf1aa39af29b16fd78fe080a6a99daa18015c6059fb2e52c971d83ba9 0001-meson-disable-libintl-check-if-pam-is-disabled.patch ad54e2c7e7a21bfa9b5f9e8db1b6af6a6d78a3e5dfe2dafcec77488f6224865ab4d4c8a8c8ee1c54c99d1741361e9fb3a51e5d36bcbc7a1c3fdcc4d0c1672132 cross-x86.meson "