From 13a1c932a797224af23abac5994582955109a80b Mon Sep 17 00:00:00 2001 From: Colin Date: Wed, 28 Jan 2026 19:16:54 +0000 Subject: [PATCH] dpkg: fix musl build fixes `nix-build -A pkgsMusl.dpkg` from x86_64-linux builder. `pkgsCross.x86_64-darwin.stdenv.hostPlatform.libc` et al show "libSystem" so this new condition should not change darwin behavior. the condition is derived from upstream, e.g. - - or (currently offline) `glibc ? !stdenv.hostPlatform.isDarwin` call arg was nonsense so delete it: `pkgs.glibc` always exists and it would have been an eval error to actually override it with a bool value. --- pkgs/by-name/dp/dpkg/package.nix | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/pkgs/by-name/dp/dpkg/package.nix b/pkgs/by-name/dp/dpkg/package.nix index c2e6b0ed08ed..618649f16e56 100644 --- a/pkgs/by-name/dp/dpkg/package.nix +++ b/pkgs/by-name/dp/dpkg/package.nix @@ -15,7 +15,7 @@ pkg-config, diffutils, versionCheckHook, - glibc ? !stdenv.hostPlatform.isDarwin, + glibc, }: stdenv.mkDerivation (finalAttrs: { @@ -91,10 +91,20 @@ stdenv.mkDerivation (finalAttrs: { # which makes some tests fail. sed -i '/opts normalize/a AT_SKIP_IF([true])' src/at/chdir.at '' - + lib.optionalString (!stdenv.hostPlatform.isDarwin) '' - substituteInPlace src/main/help.c \ - --replace-fail '"ldconfig"' \"${glibc.bin}/bin/ldconfig\" - ''; + + + lib.optionalString + ( + stdenv.hostPlatform.libc == "glibc" + || stdenv.hostPlatform.libc == "uclibc" + || stdenv.hostPlatform.isFreeBSD + || stdenv.hostPlatform.isOpenBSD + || stdenv.hostPlatform.isNetBSD + ) + '' + # See + substituteInPlace src/main/help.c \ + --replace-fail '"ldconfig"' \"${glibc.bin}/bin/ldconfig\" + ''; buildInputs = [ perl