libcgroup: fix static build (#404243)

This commit is contained in:
Aleksana
2025-05-26 13:03:10 +08:00
committed by GitHub
+21 -4
View File
@@ -5,7 +5,9 @@
pam,
bison,
flex,
enableSystemd ? lib.meta.availableOn stdenv.hostPlatform systemdLibs,
systemdLibs,
musl-fts,
autoreconfHook,
}:
@@ -21,15 +23,30 @@ stdenv.mkDerivation rec {
hash = "sha256-kWW9ID/eYZH0O/Ge8pf3Cso4yu644R5EiQFYfZMcizs=";
};
configureFlags =
[
(lib.enableFeature enableSystemd "systemd")
]
# implicit declaration of function 'rpl_malloc', ; did you mean 'realloc'
#
# It looks like in case of cross-compilation, autoconf assumes that malloc of the
# target platform is broken.
++ lib.optionals (!lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform) [
"ac_cv_func_malloc_0_nonnull=yes"
"ac_cv_func_realloc_0_nonnull=yes"
];
nativeBuildInputs = [
autoreconfHook
bison
flex
];
buildInputs = [
pam
systemdLibs
];
buildInputs =
[
pam
]
++ lib.optional enableSystemd systemdLibs
++ lib.optional stdenv.hostPlatform.isMusl musl-fts;
postPatch = ''
substituteInPlace src/tools/Makefile.am \