top-level/static.nix: put makeStaticDarwin first in staticAdapters

This needs to go first since the .override will reset the mkDerivation
function, removing any other customisations done afterwards. Kind of
hacky, but seems to work correctly right now.
This commit is contained in:
Matthew Bauer 2020-12-06 17:09:07 -06:00
parent 399ac47521
commit 805c9d4847

View file

@ -34,14 +34,18 @@ self: super: let
});
};
staticAdapters = [ makeStaticLibraries propagateBuildInputs ]
staticAdapters =
# makeStaticDarwin must go first so that the extraBuildInputs
# override does not recreate mkDerivation, removing subsequent
# adapters.
optional super.stdenv.hostPlatform.isDarwin makeStaticDarwin
++ [ makeStaticLibraries propagateBuildInputs ]
# Apple does not provide a static version of libSystem or crt0.o
# So we cant build static binaries without extensive hacks.
++ optional (!super.stdenv.hostPlatform.isDarwin) makeStaticBinaries
++ optional super.stdenv.hostPlatform.isDarwin makeStaticDarwin
# Glibc doesnt come with static runtimes by default.
# ++ optional (super.stdenv.hostPlatform.libc == "glibc") ((flip overrideInStdenv) [ self.stdenv.glibc.static ])
;