Skip to content

Commit

Permalink
ENH Fix musl64 bzip2 (#2176)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
  • Loading branch information
luispedro and hamishmack authored Jul 13, 2024
1 parent 071f213 commit 2e2b43f
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions overlays/musl.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +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 (
# 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; });
Expand Down Expand Up @@ -39,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.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; };
})

0 comments on commit 2e2b43f

Please sign in to comment.