diff --git a/pkgs/by-name/li/libcgroup/package.nix b/pkgs/by-name/li/libcgroup/package.nix index 69f2238df1b8..c2032d1511db 100644 --- a/pkgs/by-name/li/libcgroup/package.nix +++ b/pkgs/by-name/li/libcgroup/package.nix @@ -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 \