stdenv/adapters.nix: fixup makeStaticBinaries
- makeStaticBinaries don’t work on Darwin (no stable ABI!) - Need to make sure NIX_CFLAGS_LINK appends - isStatic is not used anymore
This commit is contained in:
parent
b966d3c583
commit
8726f6a558
|
@ -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;
|
||||
};
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue