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: <https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/7604>
This commit is contained in:
Oliver Smith 2025-12-21 17:08:04 +01:00 committed by The Friendly Merge Bot
parent 30546c9795
commit 93f91ed3c0
No known key found for this signature in database
2 changed files with 35 additions and 1 deletions

View file

@ -0,0 +1,33 @@
From abcc28985f5ab3b50c3ed85abee5e7f8bbd0889e Mon Sep 17 00:00:00 2001
From: Oliver Smith <ollieparanoid@postmarketos.org>
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 <libintl.h>''',
args : '-D_GNU_SOURCE')
- libintl = []
-else
libintl = cc.find_library('intl')
if not cc.has_function('dgettext',
prefix : '''#include <libintl.h>''',
--
2.52.0

View file

@ -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
"