[staging-next] Get util-linux building on Darwin again (#380821)

This commit is contained in:
K900
2025-02-10 16:02:47 +03:00
committed by GitHub
3 changed files with 16 additions and 1 deletions
+2
View File
@@ -75,6 +75,8 @@ stdenv.mkDerivation rec {
"--with-systemdtmpfilesdir=${placeholder "out"}/lib/tmpfiles.d"
"--with-systemdsystemunitdir=${placeholder "out"}/lib/systemd/system"
"--with-pager=less"
]
++ lib.optionals util-linuxMinimal.hasCol [
"--with-col=${util-linuxMinimal}/bin/col"
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
+8
View File
@@ -101,6 +101,10 @@ stdenv.mkDerivation rec {
"--disable-nls"
"--disable-ipcrm"
"--disable-ipcs"
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
# Doesn't build on Darwin, also doesn't really make sense on Darwin
"--disable-liblastlog2"
];
makeFlags = [
@@ -164,6 +168,10 @@ stdenv.mkDerivation rec {
rev-prefix = "v";
ignoredVersions = "(-rc).*";
};
# encode upstream assumption to be used in man-db
# https://github.com/util-linux/util-linux/commit/8886d84e25a457702b45194d69a47313f76dc6bc
hasCol = stdenv.hostPlatform.libc == "glibc";
};
meta = with lib; {
@@ -23,7 +23,12 @@ preConfigure() {
local flagsArray=()
concatTo flagsArray makeMakerFlags
perl Makefile.PL AR=$AR FULL_AR=$AR CC=$CC LD=$CC CPPRUN="$CC -E" \
# Perl expect these to be exported
export CPPRUN="$CC -E"
export FULL_AR=$AR
# Requires to be $CC since it tries adding "-Wl"
export LD=$CC
perl Makefile.PL AR="$AR" FULL_AR="$AR" CC="$CC" LD="$CC" CPPRUN="$CPPRUN" \
PREFIX=$out INSTALLDIRS=site "${flagsArray[@]}" \
PERL=$(type -P perl) FULLPERL=\"$fullperl/bin/perl\"
}