nixpkgs/pkgs/stdenv/nix/default.nix
Eelco Dolstra fd1a5d8531 Set MACOSX_DEPLOYMENT_TARGET
This variable sets the minimal Mac OS X version required for
running binaries produced by the Darwin toolchain. Since it
defaults to the version of the user's SDK, setting it explicitly
should make our builds more deterministic. It's now set to 10.6
because that's what hydra.nixos.org runs.
2014-07-02 19:52:25 +02:00

55 lines
1.5 KiB
Nix

{ stdenv, pkgs, config }:
import ../generic rec {
inherit config;
preHook =
''
export NIX_ENFORCE_PURITY=1
export NIX_IGNORE_LD_THROUGH_GCC=1
'' + (if stdenv.isDarwin then ''
export NIX_ENFORCE_PURITY=
export NIX_DONT_SET_RPATH=1
export NIX_NO_SELF_RPATH=1
dontFixLibtool=1
stripAllFlags=" " # the Darwin "strip" command doesn't know "-s"
xargsFlags=" "
export MACOSX_DEPLOYMENT_TARGET=10.6
export NIX_CFLAGS_COMPILE+=" --sysroot=/var/empty"
xcodePath=$(/usr/bin/xcrun --show-sdk-path 2> /dev/null || true)
export NIX_CFLAGS_COMPILE+=" -idirafter $xcodePath/usr/include -F$xcodePath/System/Library/Frameworks"
export NIX_LDFLAGS_AFTER+=" -L$xcodePath/usr/lib"
'' else "");
initialPath = (import ../common-path.nix) {pkgs = pkgs;};
system = stdenv.system;
gcc = import ../../build-support/gcc-wrapper {
nativeTools = false;
nativePrefix = stdenv.lib.optionalString stdenv.isSunOS "/usr";
nativeLibc = true;
inherit stdenv;
binutils =
if stdenv.isDarwin then
import ../../build-support/native-darwin-cctools-wrapper {inherit stdenv;}
else
pkgs.binutils;
gcc = pkgs.gcc.gcc;
coreutils = pkgs.coreutils;
shell = pkgs.bash + "/bin/sh";
};
shell = pkgs.bash + "/bin/sh";
fetchurlBoot = stdenv.fetchurlBoot;
overrides = pkgs_: {
inherit gcc;
inherit (gcc) binutils;
inherit (pkgs)
gzip bzip2 xz bash coreutils diffutils findutils gawk
gnumake gnused gnutar gnugrep gnupatch perl;
};
}