forked from mirrors/nixpkgs
* 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:
parent
2881391565
commit
dd325103df
pkgs
build-support/native-darwin-cctools-wrapper
stdenv
|
@ -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
|
|
@ -0,0 +1,6 @@
|
|||
{stdenv}:
|
||||
|
||||
stdenv.mkDerivation {
|
||||
name = "native-darwin-cctools-wrapper";
|
||||
builder = ./builder.sh;
|
||||
}
|
|
@ -37,14 +37,13 @@ rec {
|
|||
|
||||
|
||||
# The Nix build environment.
|
||||
stdenvNix = (import ./nix) {
|
||||
stdenv = stdenvNative;
|
||||
stdenvNix = (import ./nix) (rec {
|
||||
stdenv = if system == "i686-darwin" then stdenvDarwin else stdenvNative; # !!! hack
|
||||
pkgs = allPackages {
|
||||
bootStdenv = removeAttrs stdenvNative ["gcc"]; # Hack
|
||||
bootStdenv = removeAttrs stdenv ["gcc"]; # Hack
|
||||
noSysDirs = false;
|
||||
};
|
||||
inherit genericStdenv;
|
||||
};
|
||||
});
|
||||
|
||||
|
||||
# Linux standard environment.
|
||||
|
@ -81,6 +80,6 @@ rec {
|
|||
else if system == "i686-freebsd" then stdenvFreeBSD
|
||||
else if system == "i686-cygwin" then stdenvCygwin
|
||||
else if system == "powerpc-darwin" then stdenvDarwin
|
||||
else if system == "i686-darwin" then stdenvDarwin
|
||||
else if system == "i686-darwin" then stdenvNix
|
||||
else stdenvNative;
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{stdenv, pkgs, genericStdenv}:
|
||||
{stdenv, pkgs}:
|
||||
|
||||
genericStdenv {
|
||||
import ../generic {
|
||||
name = "stdenv-nix";
|
||||
preHook = ./prehook.sh;
|
||||
initialPath = (import ../common-path.nix) {pkgs = pkgs;};
|
||||
|
@ -11,7 +11,11 @@ genericStdenv {
|
|||
nativeTools = false;
|
||||
nativeGlibc = true;
|
||||
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;
|
||||
shell = pkgs.bash ~ /bin/sh;
|
||||
};
|
||||
|
|
|
@ -1,2 +1,9 @@
|
|||
export NIX_ENFORCE_PURITY=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
|
||||
|
|
Loading…
Reference in a new issue