* Better stdenv for Darwin: uses gcc, coreutils etc. built in Nix, but

external binutils (i.e., Apple's cctools in /usr/bin).

svn path=/nixpkgs/trunk/; revision=5706
This commit is contained in:
Eelco Dolstra 2006-07-14 11:59:38 +00:00
parent 2881391565
commit dd325103df
5 changed files with 29 additions and 9 deletions

View File

@ -0,0 +1,4 @@
source $stdenv/setup
ensureDir $out/bin
ln -s /usr/bin/ld /usr/bin/as /usr/bin/ar /usr/bin/ranlib /usr/bin/strip $out/bin

View File

@ -0,0 +1,6 @@
{stdenv}:
stdenv.mkDerivation {
name = "native-darwin-cctools-wrapper";
builder = ./builder.sh;
}

View File

@ -37,14 +37,13 @@ rec {
# The Nix build environment. # The Nix build environment.
stdenvNix = (import ./nix) { stdenvNix = (import ./nix) (rec {
stdenv = stdenvNative; stdenv = if system == "i686-darwin" then stdenvDarwin else stdenvNative; # !!! hack
pkgs = allPackages { pkgs = allPackages {
bootStdenv = removeAttrs stdenvNative ["gcc"]; # Hack bootStdenv = removeAttrs stdenv ["gcc"]; # Hack
noSysDirs = false; noSysDirs = false;
}; };
inherit genericStdenv; });
};
# Linux standard environment. # Linux standard environment.
@ -81,6 +80,6 @@ rec {
else if system == "i686-freebsd" then stdenvFreeBSD else if system == "i686-freebsd" then stdenvFreeBSD
else if system == "i686-cygwin" then stdenvCygwin else if system == "i686-cygwin" then stdenvCygwin
else if system == "powerpc-darwin" then stdenvDarwin else if system == "powerpc-darwin" then stdenvDarwin
else if system == "i686-darwin" then stdenvDarwin else if system == "i686-darwin" then stdenvNix
else stdenvNative; else stdenvNative;
} }

View File

@ -1,6 +1,6 @@
{stdenv, pkgs, genericStdenv}: {stdenv, pkgs}:
genericStdenv { import ../generic {
name = "stdenv-nix"; name = "stdenv-nix";
preHook = ./prehook.sh; preHook = ./prehook.sh;
initialPath = (import ../common-path.nix) {pkgs = pkgs;}; initialPath = (import ../common-path.nix) {pkgs = pkgs;};
@ -11,7 +11,11 @@ genericStdenv {
nativeTools = false; nativeTools = false;
nativeGlibc = true; nativeGlibc = true;
inherit stdenv; inherit stdenv;
inherit (pkgs) binutils; binutils =
if stdenv.system == "i686-darwin" || stdenv.system == "powerpc-darwin" then
import ../../build-support/native-darwin-cctools-wrapper {inherit stdenv;};
else
pkgs.binutils;
gcc = pkgs.gcc.gcc; gcc = pkgs.gcc.gcc;
shell = pkgs.bash ~ /bin/sh; shell = pkgs.bash ~ /bin/sh;
}; };

View File

@ -1,2 +1,9 @@
export NIX_ENFORCE_PURITY=1 export NIX_ENFORCE_PURITY=1
export NIX_IGNORE_LD_THROUGH_GCC=1 export NIX_IGNORE_LD_THROUGH_GCC=1
if test "$system" = "i686-darwin" -o "$system" = "powerpc-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?
fi