Skip to content

Commit cd21eaf

Browse files
committed
Refactor and add comment about enableStatic
1 parent 8ba9d87 commit cd21eaf

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

overlays/musl.nix

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +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 { enableStatic = true; };
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+
});
1321
gmp = prev.gmp.override { withStatic = true; };
1422
ncurses = prev.ncurses.override { enableStatic = true; };
1523
libsodium = prev.libsodium.overrideAttrs (_: { dontDisableStatic = true; });
@@ -40,8 +48,4 @@ final: prev: prev.lib.optionalAttrs prev.stdenv.hostPlatform.isMusl ({
4048
} // prev.lib.optionalAttrs (prev.lib.versionAtLeast prev.lib.trivial.release "20.03") {
4149
# Fix infinite recursion between openssh and fetchcvs
4250
openssh = prev.openssh.override { withFIDO = false; };
43-
} // prev.lib.optionalAttrs (prev.lib.versionOlder prev.lib.trivial.release "23.11") {
44-
# This option was renamed to enableStatic, to be more consistent with packages with a similar
45-
# static toggles. However, it now correctly defaults to true when `hostPlatform.isStatic` is true.
46-
bzip2 = prev.bzip2.override { linkStatic = true; };
4751
})

0 commit comments

Comments
 (0)