* Function `makeStaticBinaries' that augments stdenv to produce

statically linked binaries.

svn path=/nixpkgs/trunk/; revision=6787
This commit is contained in:
Eelco Dolstra 2006-10-20 11:49:47 +00:00
parent 0bacb7b00d
commit 54c158cb84

View File

@ -104,6 +104,18 @@ rec {
isDietLibC = true; isDietLibC = true;
}; };
# Return a modified stdenv that tries to build statically linked
# binaries.
makeStaticBinaries = stdenv: stdenv //
{ mkDerivation = args: stdenv.mkDerivation (args // {
NIX_CFLAGS_LINK = "-static";
configureFlags =
(if args ? configureFlags then args.configureFlags else "")
+ " --disable-shared"; # brrr...
});
};
# Applying this to an attribute set will cause nix-env to look # Applying this to an attribute set will cause nix-env to look
# inside the set for derivations. # inside the set for derivations.
recurseIntoAttrs = attrs: attrs // {recurseForDerivations = true;}; recurseIntoAttrs = attrs: attrs // {recurseForDerivations = true;};