From 6e6d22afc251b9734d3fe7b0c9eb6e51641798fd Mon Sep 17 00:00:00 2001 From: Luis Pedro Coelho Date: Mon, 26 Feb 2024 11:59:40 +1000 Subject: [PATCH 1/3] ENH Fix musl64 bzip2 --- overlays/musl.nix | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/overlays/musl.nix b/overlays/musl.nix index 67377f516a..e9ea523b00 100644 --- a/overlays/musl.nix +++ b/overlays/musl.nix @@ -9,6 +9,7 @@ final: prev: prev.lib.optionalAttrs prev.stdenv.hostPlatform.isMusl ({ zlib = prev.zlib.override { splitStaticOutput = false; }; # and a few more packages that need their static libs explicitly enabled + bzip2 = prev.bzip2.override { linkStatic = true; }; gmp = prev.gmp.override { withStatic = true; }; ncurses = prev.ncurses.override { enableStatic = true; }; libsodium = prev.libsodium.overrideAttrs (_: { dontDisableStatic = true; }); @@ -39,8 +40,4 @@ final: prev: prev.lib.optionalAttrs prev.stdenv.hostPlatform.isMusl ({ } // prev.lib.optionalAttrs (prev.lib.versionAtLeast prev.lib.trivial.release "20.03") { # Fix infinite recursion between openssh and fetchcvs openssh = prev.openssh.override { withFIDO = false; }; -} // prev.lib.optionalAttrs (prev.lib.versionOlder prev.lib.trivial.release "23.05") { - # This option was renamed to enableStatic, to be more consistent with packages with a similar - # static toggles. However, it now correctly defaults to true when `hostPlatform.isStatic` is true. - bzip2 = prev.bzip2.override { linkStatic = true; }; }) From 8ba9d87acc4bd84301c31f57cd62c72047d612ff Mon Sep 17 00:00:00 2001 From: Hamish Mackenzie Date: Fri, 5 Apr 2024 14:01:35 +1300 Subject: [PATCH 2/3] Fix for nixpkgs 23.05 and set enableStatic for 23.11 --- overlays/musl.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/overlays/musl.nix b/overlays/musl.nix index e9ea523b00..dd35e9f42d 100644 --- a/overlays/musl.nix +++ b/overlays/musl.nix @@ -9,7 +9,7 @@ final: prev: prev.lib.optionalAttrs prev.stdenv.hostPlatform.isMusl ({ zlib = prev.zlib.override { splitStaticOutput = false; }; # and a few more packages that need their static libs explicitly enabled - bzip2 = prev.bzip2.override { linkStatic = true; }; + bzip2 = prev.bzip2.override { enableStatic = true; }; gmp = prev.gmp.override { withStatic = true; }; ncurses = prev.ncurses.override { enableStatic = true; }; libsodium = prev.libsodium.overrideAttrs (_: { dontDisableStatic = true; }); @@ -40,4 +40,8 @@ final: prev: prev.lib.optionalAttrs prev.stdenv.hostPlatform.isMusl ({ } // prev.lib.optionalAttrs (prev.lib.versionAtLeast prev.lib.trivial.release "20.03") { # Fix infinite recursion between openssh and fetchcvs openssh = prev.openssh.override { withFIDO = false; }; +} // prev.lib.optionalAttrs (prev.lib.versionOlder prev.lib.trivial.release "23.11") { + # This option was renamed to enableStatic, to be more consistent with packages with a similar + # static toggles. However, it now correctly defaults to true when `hostPlatform.isStatic` is true. + bzip2 = prev.bzip2.override { linkStatic = true; }; }) From cd21eaf6548180a7b3674bb0a0a1106e78d3f663 Mon Sep 17 00:00:00 2001 From: Hamish Mackenzie Date: Fri, 5 Apr 2024 15:09:32 +1300 Subject: [PATCH 3/3] Refactor and add comment about enableStatic --- overlays/musl.nix | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/overlays/musl.nix b/overlays/musl.nix index dd35e9f42d..f86e270118 100644 --- a/overlays/musl.nix +++ b/overlays/musl.nix @@ -9,7 +9,15 @@ final: prev: prev.lib.optionalAttrs prev.stdenv.hostPlatform.isMusl ({ zlib = prev.zlib.override { splitStaticOutput = false; }; # and a few more packages that need their static libs explicitly enabled - bzip2 = prev.bzip2.override { enableStatic = true; }; + bzip2 = prev.bzip2.override ( + # This option was renamed to `enableStatic`, to be more consistent with packages with a similar + # static toggles. However, it now correctly defaults to true when `hostPlatform.isStatic` is true. + if builtins.compareVersions prev.lib.trivial.release "23.11" < 0 + then { linkStatic = true; } + else { + # `isMusl` does not always mean `isStatic`, so setting `enableStatic` to true here. + enableStatic = true; + }); gmp = prev.gmp.override { withStatic = true; }; ncurses = prev.ncurses.override { enableStatic = true; }; libsodium = prev.libsodium.overrideAttrs (_: { dontDisableStatic = true; }); @@ -40,8 +48,4 @@ final: prev: prev.lib.optionalAttrs prev.stdenv.hostPlatform.isMusl ({ } // prev.lib.optionalAttrs (prev.lib.versionAtLeast prev.lib.trivial.release "20.03") { # Fix infinite recursion between openssh and fetchcvs openssh = prev.openssh.override { withFIDO = false; }; -} // prev.lib.optionalAttrs (prev.lib.versionOlder prev.lib.trivial.release "23.11") { - # This option was renamed to enableStatic, to be more consistent with packages with a similar - # static toggles. However, it now correctly defaults to true when `hostPlatform.isStatic` is true. - bzip2 = prev.bzip2.override { linkStatic = true; }; })