diff options
author | Domen Kožar <domen@dev.si> | 2016-03-27 13:19:04 +0100 |
---|---|---|
committer | Domen Kožar <domen@dev.si> | 2016-03-27 13:19:04 +0100 |
commit | b07e7bfc7bc8f0b5428acaab026738866af32a28 (patch) | |
tree | 88dfca9473373d72d3d0e60a84ced34f33d69bf4 /pkgs/stdenv | |
parent | d88ae1045d37f8cd1b3428617670f7358eb45a29 (diff) | |
parent | dae3a7b721aeaaffabf336563182852c800a5ae0 (diff) | |
download | nixlib-b07e7bfc7bc8f0b5428acaab026738866af32a28.tar nixlib-b07e7bfc7bc8f0b5428acaab026738866af32a28.tar.gz nixlib-b07e7bfc7bc8f0b5428acaab026738866af32a28.tar.bz2 nixlib-b07e7bfc7bc8f0b5428acaab026738866af32a28.tar.lz nixlib-b07e7bfc7bc8f0b5428acaab026738866af32a28.tar.xz nixlib-b07e7bfc7bc8f0b5428acaab026738866af32a28.tar.zst nixlib-b07e7bfc7bc8f0b5428acaab026738866af32a28.zip |
Merge remote-tracking branch 'origin/staging'
Diffstat (limited to 'pkgs/stdenv')
-rw-r--r-- | pkgs/stdenv/darwin/default.nix | 15 | ||||
-rw-r--r-- | pkgs/stdenv/generic/setup.sh | 16 | ||||
-rw-r--r-- | pkgs/stdenv/linux/default.nix | 78 | ||||
-rw-r--r-- | pkgs/stdenv/linux/make-bootstrap-tools.nix | 57 | ||||
-rw-r--r-- | pkgs/stdenv/linux/scripts/unpack-bootstrap-tools.sh | 2 | ||||
-rw-r--r-- | pkgs/stdenv/native/default.nix | 1 | ||||
-rw-r--r-- | pkgs/stdenv/nix/default.nix | 3 |
7 files changed, 80 insertions, 92 deletions
diff --git a/pkgs/stdenv/darwin/default.nix b/pkgs/stdenv/darwin/default.nix index 85c406d3703d..52f8f007b001 100644 --- a/pkgs/stdenv/darwin/default.nix +++ b/pkgs/stdenv/darwin/default.nix @@ -25,7 +25,8 @@ in rec { allPackages = import ../../..; commonPreHook = '' - export NIX_ENFORCE_PURITY=1 + export NIX_ENFORCE_PURITY="''${NIX_ENFORCE_PURITY-1}" + export NIX_ENFORCE_NO_NATIVE="''${NIX_ENFORCE_NO_NATIVE-1}" export NIX_IGNORE_LD_THROUGH_GCC=1 stripAllFlags=" " # the Darwin "strip" command doesn't know "-s" export MACOSX_DEPLOYMENT_TARGET=10.7 @@ -55,8 +56,7 @@ in rec { stageFun = step: last: {shell ? "${bootstrapTools}/bin/sh", overrides ? (pkgs: {}), extraPreHook ? "", - extraBuildInputs ? with last.pkgs; [ xz darwin.CF libcxx ], - extraInitialPath ? [], + extraBuildInputs, allowedRequisites ? null}: let thisStdenv = import ../generic { @@ -85,7 +85,7 @@ in rec { ${commonPreHook} ${extraPreHook} ''; - initialPath = extraInitialPath ++ [ bootstrapTools ]; + initialPath = [ bootstrapTools ]; fetchurlBoot = import ../../build-support/fetchurl { stdenv = stage0.stdenv; curl = bootstrapTools; @@ -174,6 +174,8 @@ in rec { export PATH_LOCALE=${pkgs.darwin.locale}/share/locale ''; + extraBuildInputs = with pkgs; [ xz darwin.CF libcxx ]; + allowedRequisites = [ bootstrapTools ] ++ (with pkgs; [ xz libcxx libcxxabi icu ]) ++ @@ -203,9 +205,10 @@ in rec { # enables patchShebangs above. Unfortunately, patchShebangs ignores our $SHELL setting # and instead goes by $PATH, which happens to contain bootstrapTools. So it goes and # patches our shebangs back to point at bootstrapTools. This makes sure bash comes first. - extraInitialPath = [ pkgs.bash ]; + extraBuildInputs = with pkgs; [ xz darwin.CF libcxx pkgs.bash ]; extraPreHook = '' + export PATH=${pkgs.bash}/bin:$PATH export PATH_LOCALE=${pkgs.darwin.locale}/share/locale ''; @@ -236,7 +239,7 @@ in rec { stage4 = with stage3; stageFun 4 stage3 { shell = "${pkgs.bash}/bin/bash"; - extraInitialPath = [ pkgs.bash ]; + extraBuildInputs = with pkgs; [ xz darwin.CF libcxx pkgs.bash ]; extraPreHook = '' export PATH_LOCALE=${pkgs.darwin.locale}/share/locale ''; diff --git a/pkgs/stdenv/generic/setup.sh b/pkgs/stdenv/generic/setup.sh index b49846fa050c..97eb855d3594 100644 --- a/pkgs/stdenv/generic/setup.sh +++ b/pkgs/stdenv/generic/setup.sh @@ -214,7 +214,6 @@ PATH= for i in $initialPath; do if [ "$i" = / ]; then i=; fi addToSearchPath PATH $i/bin - addToSearchPath PATH $i/sbin done if [ "$NIX_DEBUG" = 1 ]; then @@ -262,6 +261,10 @@ findInputs() { source "$pkg" fi + if [ -d $1/bin ]; then + addToSearchPath _PATH $1/bin + fi + if [ -f "$pkg/nix-support/setup-hook" ]; then source "$pkg/nix-support/setup-hook" fi @@ -289,10 +292,6 @@ done _addToNativeEnv() { local pkg=$1 - if [ -d $1/bin ]; then - addToSearchPath _PATH $1/bin - fi - # Run the package-specific hooks set by the setup-hook scripts. runHook envHook "$pkg" } @@ -304,13 +303,6 @@ done _addToCrossEnv() { local pkg=$1 - # Some programs put important build scripts (freetype-config and similar) - # into their crossDrv bin path. Intentionally these should go after - # the nativePkgs in PATH. - if [ -d $1/bin ]; then - addToSearchPath _PATH $1/bin - fi - # Run the package-specific hooks set by the setup-hook scripts. runHook crossEnvHook "$pkg" } diff --git a/pkgs/stdenv/linux/default.nix b/pkgs/stdenv/linux/default.nix index 1135ad78acdc..f0b6ce7c9f3d 100644 --- a/pkgs/stdenv/linux/default.nix +++ b/pkgs/stdenv/linux/default.nix @@ -8,24 +8,22 @@ { system ? builtins.currentSystem , allPackages ? import ../../.. , platform ? null, config ? {}, lib ? (import ../../../lib) -, customBootstrapFiles ? null }: - -rec { - - bootstrapFiles = - if customBootstrapFiles != null then customBootstrapFiles - else if system == "i686-linux" then import ./bootstrap/i686.nix +, bootstrapFiles ? + if system == "i686-linux" then import ./bootstrap/i686.nix else if system == "x86_64-linux" then import ./bootstrap/x86_64.nix else if system == "armv5tel-linux" then import ./bootstrap/armv5tel.nix else if system == "armv6l-linux" then import ./bootstrap/armv6l.nix else if system == "armv7l-linux" then import ./bootstrap/armv7l.nix else if system == "mips64el-linux" then import ./bootstrap/loongson2f.nix - else abort "unsupported platform for the pure Linux stdenv"; + else abort "unsupported platform for the pure Linux stdenv" +}: +rec { commonPreHook = '' - export NIX_ENFORCE_PURITY=1 + export NIX_ENFORCE_PURITY="''${NIX_ENFORCE_PURITY-1}" + export NIX_ENFORCE_NO_NATIVE="''${NIX_ENFORCE_NO_NATIVE-1}" ${if system == "x86_64-linux" then "NIX_LIB64_IN_SELF_RPATH=1" else ""} ${if system == "mips64el-linux" then "NIX_LIB32_IN_SELF_RPATH=1" else ""} ''; @@ -190,7 +188,7 @@ rec { name = "bootstrap-gcc-wrapper"; overrides = pkgs: { - inherit (stage1.pkgs) perl binutils paxctl; + inherit (stage1.pkgs) perl binutils paxctl gnum4 bison; # This also contains the full, dynamically linked, final Glibc. }; }; @@ -207,21 +205,16 @@ rec { name = "bootstrap-gcc-wrapper"; overrides = pkgs: rec { - inherit (stage2.pkgs) binutils glibc perl patchelf linuxHeaders; + inherit (stage2.pkgs) binutils glibc perl patchelf linuxHeaders gnum4 bison; # Link GCC statically against GMP etc. This makes sense because # these builds of the libraries are only used by GCC, so it # reduces the size of the stdenv closure. gmp = pkgs.gmp.override { stdenv = pkgs.makeStaticLibraries pkgs.stdenv; }; mpfr = pkgs.mpfr.override { stdenv = pkgs.makeStaticLibraries pkgs.stdenv; }; libmpc = pkgs.libmpc.override { stdenv = pkgs.makeStaticLibraries pkgs.stdenv; }; - isl_0_11 = pkgs.isl_0_11.override { stdenv = pkgs.makeStaticLibraries pkgs.stdenv; }; - cloog_0_18_0 = pkgs.cloog_0_18_0.override { - stdenv = pkgs.makeStaticLibraries pkgs.stdenv; - isl = isl_0_11; - }; + isl_0_14 = pkgs.isl_0_14.override { stdenv = pkgs.makeStaticLibraries pkgs.stdenv; }; gccPlain = pkgs.gcc.cc.override { - isl = isl_0_11; - cloog = cloog_0_18_0; + isl = isl_0_14; }; }; extraBuildInputs = [ stage2.pkgs.patchelf stage2.pkgs.paxctl ]; @@ -241,7 +234,7 @@ rec { # because gcc (since JAR support) already depends on zlib, and # then if we already have a zlib we want to use that for the # other purposes (binutils and top-level pkgs) too. - inherit (stage3.pkgs) gettext gnum4 gmp perl glibc zlib linuxHeaders; + inherit (stage3.pkgs) gettext gnum4 bison gmp perl glibc zlib linuxHeaders; gcc = lib.makeOverridable (import ../../build-support/cc-wrapper) { nativeTools = false; @@ -310,51 +303,4 @@ rec { }; }; - - testBootstrapTools = let - defaultPkgs = allPackages { inherit system platform; }; - in derivation { - name = "test-bootstrap-tools"; - inherit system; - builder = bootstrapFiles.busybox; - args = [ "ash" "-e" "-c" "eval \"$buildCommand\"" ]; - - buildCommand = '' - export PATH=${bootstrapTools}/bin - - ls -l - mkdir $out - mkdir $out/bin - sed --version - find --version - diff --version - patch --version - make --version - awk --version - grep --version - gcc --version - - ldlinux=$(echo ${bootstrapTools}/lib/ld-linux*.so.?) - export CPP="cpp -idirafter ${bootstrapTools}/include-glibc -B${bootstrapTools}" - export CC="gcc -idirafter ${bootstrapTools}/include-glibc -B${bootstrapTools} -Wl,-dynamic-linker,$ldlinux -Wl,-rpath,${bootstrapTools}/lib" - export CXX="g++ -idirafter ${bootstrapTools}/include-glibc -B${bootstrapTools} -Wl,-dynamic-linker,$ldlinux -Wl,-rpath,${bootstrapTools}/lib" - - echo '#include <stdio.h>' >> foo.c - echo '#include <limits.h>' >> foo.c - echo 'int main() { printf("Hello World\\n"); return 0; }' >> foo.c - $CC -o $out/bin/foo foo.c - $out/bin/foo - - echo '#include <iostream>' >> bar.cc - echo 'int main() { std::cout << "Hello World\\n"; }' >> bar.cc - $CXX -v -o $out/bin/bar bar.cc - $out/bin/bar - - tar xvf ${defaultPkgs.hello.src} - cd hello-* - ./configure --prefix=$out - make - make install - ''; - }; } diff --git a/pkgs/stdenv/linux/make-bootstrap-tools.nix b/pkgs/stdenv/linux/make-bootstrap-tools.nix index 75dc009f5e67..68456942d40f 100644 --- a/pkgs/stdenv/linux/make-bootstrap-tools.nix +++ b/pkgs/stdenv/linux/make-bootstrap-tools.nix @@ -164,12 +164,57 @@ rec { ''; }; - test = ((import ./default.nix) { + bootstrapFiles = { + busybox = "${build}/on-server/busybox"; + bootstrapTools = "${build}/on-server/bootstrap-tools.tar.xz"; + }; + + bootstrapTools = (import ./default.nix { + inherit system bootstrapFiles; + }).bootstrapTools; + + test = derivation { + name = "test-bootstrap-tools"; inherit system; + builder = bootstrapFiles.busybox; + args = [ "ash" "-e" "-c" "eval \"$buildCommand\"" ]; - customBootstrapFiles = { - busybox = "${build}/on-server/busybox"; - bootstrapTools = "${build}/on-server/bootstrap-tools.tar.xz"; - }; - }).testBootstrapTools; + buildCommand = '' + export PATH=${bootstrapTools}/bin + + ls -l + mkdir $out + mkdir $out/bin + sed --version + find --version + diff --version + patch --version + make --version + awk --version + grep --version + gcc --version + + ldlinux=$(echo ${bootstrapTools}/lib/ld-linux*.so.?) + export CPP="cpp -idirafter ${bootstrapTools}/include-glibc -B${bootstrapTools}" + export CC="gcc -idirafter ${bootstrapTools}/include-glibc -B${bootstrapTools} -Wl,-dynamic-linker,$ldlinux -Wl,-rpath,${bootstrapTools}/lib" + export CXX="g++ -idirafter ${bootstrapTools}/include-glibc -B${bootstrapTools} -Wl,-dynamic-linker,$ldlinux -Wl,-rpath,${bootstrapTools}/lib" + + echo '#include <stdio.h>' >> foo.c + echo '#include <limits.h>' >> foo.c + echo 'int main() { printf("Hello World\\n"); return 0; }' >> foo.c + $CC -o $out/bin/foo foo.c + $out/bin/foo + + echo '#include <iostream>' >> bar.cc + echo 'int main() { std::cout << "Hello World\\n"; }' >> bar.cc + $CXX -v -o $out/bin/bar bar.cc + $out/bin/bar + + tar xvf ${hello.src} + cd hello-* + ./configure --prefix=$out + make + make install + ''; + }; } diff --git a/pkgs/stdenv/linux/scripts/unpack-bootstrap-tools.sh b/pkgs/stdenv/linux/scripts/unpack-bootstrap-tools.sh index efec363c5c79..85e74aea89ef 100644 --- a/pkgs/stdenv/linux/scripts/unpack-bootstrap-tools.sh +++ b/pkgs/stdenv/linux/scripts/unpack-bootstrap-tools.sh @@ -23,7 +23,7 @@ for i in $out/bin/* $out/libexec/gcc/*/*/*; do if [ -z "${i##*/liblto*}" ]; then continue; fi echo patching "$i" LD_LIBRARY_PATH=$out/lib $LD_BINARY \ - $out/bin/patchelf --set-interpreter $LD_BINARY --set-rpath $out/lib --force-rpath "$i" + ./patchelf --set-interpreter $LD_BINARY --set-rpath $out/lib --force-rpath "$i" done for i in $out/lib/librt-*.so $out/lib/libpcre*; do diff --git a/pkgs/stdenv/native/default.nix b/pkgs/stdenv/native/default.nix index bd90d580d3f5..291ef5a5079f 100644 --- a/pkgs/stdenv/native/default.nix +++ b/pkgs/stdenv/native/default.nix @@ -16,6 +16,7 @@ rec { # Disable purity tests; it's allowed (even needed) to link to # libraries outside the Nix store (like the C library). export NIX_ENFORCE_PURITY= + export NIX_ENFORCE_NO_NATIVE="''${NIX_ENFORCE_NO_NATIVE-1}" ''; prehookFreeBSD = '' diff --git a/pkgs/stdenv/nix/default.nix b/pkgs/stdenv/nix/default.nix index 30ac92837cba..e58972e5c8a6 100644 --- a/pkgs/stdenv/nix/default.nix +++ b/pkgs/stdenv/nix/default.nix @@ -5,7 +5,8 @@ import ../generic rec { preHook = '' - export NIX_ENFORCE_PURITY=1 + export NIX_ENFORCE_PURITY="''${NIX_ENFORCE_PURITY-1}" + export NIX_ENFORCE_NO_NATIVE="''${NIX_ENFORCE_NO_NATIVE-1}" export NIX_IGNORE_LD_THROUGH_GCC=1 ''; |