Skip to content

Commit 2e2b43f

Browse files
ENH Fix musl64 bzip2 (#2176)
* ENH Fix musl64 bzip2 * Fix for nixpkgs 23.05 and set enableStatic for 23.11 * Refactor and add comment about enableStatic --------- Co-authored-by: Hamish Mackenzie <Hamish.K.Mackenzie@gmail.com>
1 parent 071f213 commit 2e2b43f

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

overlays/musl.nix

+9-4
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,15 @@ final: prev: prev.lib.optionalAttrs prev.stdenv.hostPlatform.isMusl ({
99
zlib = prev.zlib.override { splitStaticOutput = false; };
1010

1111
# and a few more packages that need their static libs explicitly enabled
12+
bzip2 = prev.bzip2.override (
13+
# This option was renamed to `enableStatic`, to be more consistent with packages with a similar
14+
# static toggles. However, it now correctly defaults to true when `hostPlatform.isStatic` is true.
15+
if builtins.compareVersions prev.lib.trivial.release "23.11" < 0
16+
then { linkStatic = true; }
17+
else {
18+
# `isMusl` does not always mean `isStatic`, so setting `enableStatic` to true here.
19+
enableStatic = true;
20+
});
1221
gmp = prev.gmp.override { withStatic = true; };
1322
ncurses = prev.ncurses.override { enableStatic = true; };
1423
libsodium = prev.libsodium.overrideAttrs (_: { dontDisableStatic = true; });
@@ -39,8 +48,4 @@ final: prev: prev.lib.optionalAttrs prev.stdenv.hostPlatform.isMusl ({
3948
} // prev.lib.optionalAttrs (prev.lib.versionAtLeast prev.lib.trivial.release "20.03") {
4049
# Fix infinite recursion between openssh and fetchcvs
4150
openssh = prev.openssh.override { withFIDO = false; };
42-
} // prev.lib.optionalAttrs (prev.lib.versionOlder prev.lib.trivial.release "23.05") {
43-
# This option was renamed to enableStatic, to be more consistent with packages with a similar
44-
# static toggles. However, it now correctly defaults to true when `hostPlatform.isStatic` is true.
45-
bzip2 = prev.bzip2.override { linkStatic = true; };
4651
})

0 commit comments

Comments
 (0)