From 88dd549f57bb0dc79c67ee11948904bfc48ca750 Mon Sep 17 00:00:00 2001 From: K900 Date: Mon, 10 Feb 2025 08:41:19 +0300 Subject: [PATCH 1/4] util-linux: don't build lastlog2 on Darwin It doesn't build, and it uses PAM, which doesn't work properly on Darwin to begin with. --- pkgs/by-name/ut/util-linux/package.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkgs/by-name/ut/util-linux/package.nix b/pkgs/by-name/ut/util-linux/package.nix index 47975dc5c38d..5917e2909be5 100644 --- a/pkgs/by-name/ut/util-linux/package.nix +++ b/pkgs/by-name/ut/util-linux/package.nix @@ -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 = [ From 3cb939f7350ffff9ef0e67eb99fde224a4d49912 Mon Sep 17 00:00:00 2001 From: K900 Date: Mon, 10 Feb 2025 08:42:15 +0300 Subject: [PATCH 2/4] util-linux: declare whether we have col See https://github.com/util-linux/util-linux/commit/8886d84e25a457702b45194d69a47313f76dc6bc --- pkgs/by-name/ut/util-linux/package.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkgs/by-name/ut/util-linux/package.nix b/pkgs/by-name/ut/util-linux/package.nix index 5917e2909be5..076c9316c158 100644 --- a/pkgs/by-name/ut/util-linux/package.nix +++ b/pkgs/by-name/ut/util-linux/package.nix @@ -168,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; { From e1e171fde85913f7b3850b0bb7327b24bf48574b Mon Sep 17 00:00:00 2001 From: K900 Date: Mon, 10 Feb 2025 08:43:02 +0300 Subject: [PATCH 3/4] man-db: only build --with-col if we have col --- pkgs/by-name/ma/man-db/package.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/by-name/ma/man-db/package.nix b/pkgs/by-name/ma/man-db/package.nix index 29be3e9e87bf..d8d645113287 100644 --- a/pkgs/by-name/ma/man-db/package.nix +++ b/pkgs/by-name/ma/man-db/package.nix @@ -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 [ From 9f2a89f948f19c473c23d8ec358087a9e51f67d8 Mon Sep 17 00:00:00 2001 From: K900 Date: Mon, 10 Feb 2025 08:57:27 +0300 Subject: [PATCH 4/4] buildPerlPackage: export some things harder Those may be used by the later stages of the build. Co-authored-by: Tristan Ross --- pkgs/development/perl-modules/generic/builder.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pkgs/development/perl-modules/generic/builder.sh b/pkgs/development/perl-modules/generic/builder.sh index c95b5cbb7d54..97d0bbcce7ac 100644 --- a/pkgs/development/perl-modules/generic/builder.sh +++ b/pkgs/development/perl-modules/generic/builder.sh @@ -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\" }