Skip to content

Commit

Permalink
stdenv/adapters.nix: fixup makeStaticBinaries
Browse files Browse the repository at this point in the history
- makeStaticBinaries don’t work on Darwin (no stable ABI!)
- Need to make sure NIX_CFLAGS_LINK appends
- isStatic is not used anymore
  • Loading branch information
matthewbauer committed Dec 5, 2018
1 parent b966d3c commit 8726f6a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions pkgs/stdenv/adapters.nix
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,15 @@ rec {
# Return a modified stdenv that tries to build statically linked
# binaries.
makeStaticBinaries = stdenv: stdenv //
{ mkDerivation = args: stdenv.mkDerivation (args // {
NIX_CFLAGS_LINK = "-static";
{ mkDerivation = args:
if stdenv.hostPlatform.isDarwin
then throw "Cannot build fully static binaries on Darwin/macOS"
else stdenv.mkDerivation (args // {
NIX_CFLAGS_LINK = toString (args.NIX_CFLAGS_LINK or "") + "-static";
configureFlags = (args.configureFlags or []) ++ [
"--disable-shared" # brrr...
];
});
isStatic = true;
};


Expand Down

0 comments on commit 8726f6a

Please sign in to comment.