Skip to content

Commit

Permalink
Make a sepseparate directory for darwin's stdenv
Browse files Browse the repository at this point in the history
svn path=/nixpkgs/branches/darwin-without-xcode/; revision=31575
  • Loading branch information
shlevy committed Jan 15, 2012
1 parent b7c53fc commit b28b8c7
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 17 deletions.
23 changes: 23 additions & 0 deletions pkgs/stdenv/darwin/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{stdenv, pkgs}:

import ../generic {
name = "stdenv-darwin";
preHook = ./prehook.sh;
initialPath = (import ../common-path.nix) {pkgs = pkgs;};

system = stdenv.system;

gcc = import ../../build-support/gcc-wrapper {
nativeTools = false;
nativeLibc = true;
inherit stdenv;
binutils = import ../../build-support/native-darwin-cctools-wrapper {inherit stdenv;};
gcc = pkgs.gccApple.gcc;
coreutils = pkgs.coreutils;
shell = pkgs.bash + "/bin/sh";
};

shell = pkgs.bash + "/bin/sh";

fetchurlBoot = stdenv.fetchurlBoot;
}
9 changes: 9 additions & 0 deletions pkgs/stdenv/darwin/prehook.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export NIX_ENFORCE_PURITY=1
export NIX_IGNORE_LD_THROUGH_GCC=1

export NIX_DONT_SET_RPATH=1
export NIX_NO_SELF_RPATH=1
dontFixLibtool=1
NIX_STRIP_DEBUG=0 # !!! do we still need this?
stripAllFlags=" " # the Darwin "strip" command doesn't know "-s"
xargsFlags=" "
9 changes: 7 additions & 2 deletions pkgs/stdenv/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ rec {
pkgs = stdenvNativePkgs;
};

# Darwin standard environment.
stdenvDarwin = import ./darwin {
stdenv = stdenvNative;
pkgs = stdenvNativePkgs;
};

# Linux standard environment.
stdenvLinux = (import ./linux {inherit system allPackages platform;}).stdenvLinux;
Expand All @@ -58,7 +63,7 @@ rec {
if stdenvType == "mips64-linux" then stdenvLinux else
if stdenvType == "powerpc-linux" then /* stdenvLinux */ stdenvNative else
if stdenvType == "i686-mingw" then stdenvMinGW else
if stdenvType == "i686-darwin" then stdenvNix else
if stdenvType == "x86_64-darwin" then stdenvNix else
if stdenvType == "i686-darwin" then stdenvDarwin else
if stdenvType == "x86_64-darwin" then stdenvDarwin else
stdenvNative;
}
8 changes: 2 additions & 6 deletions pkgs/stdenv/nix/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,8 @@ import ../generic {
nativeTools = false;
nativeLibc = true;
inherit stdenv;
binutils =
if stdenv.isDarwin then
import ../../build-support/native-darwin-cctools-wrapper {inherit stdenv;}
else
pkgs.binutils;
gcc = if stdenv.isDarwin then pkgs.gccApple.gcc else pkgs.gcc.gcc;
binutils = pkgs.binutils;
gcc = pkgs.gcc.gcc;
coreutils = pkgs.coreutils;
shell = pkgs.bash + "/bin/sh";
};
Expand Down
9 changes: 0 additions & 9 deletions pkgs/stdenv/nix/prehook.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,2 @@
export NIX_ENFORCE_PURITY=1
export NIX_IGNORE_LD_THROUGH_GCC=1

if test "$system" = "i686-darwin" -o "$system" = "powerpc-darwin" -o "$system" = "x86_64-darwin"; then
export NIX_DONT_SET_RPATH=1
export NIX_NO_SELF_RPATH=1
dontFixLibtool=1
NIX_STRIP_DEBUG=0 # !!! do we still need this?
stripAllFlags=" " # the Darwin "strip" command doesn't know "-s"
xargsFlags=" "
fi

0 comments on commit b28b8c7

Please sign in to comment.