about summary refs log tree commit diff
path: root/pkgs/stdenv
diff options
context:
space:
mode:
authorVladimír Čunát <vcunat@gmail.com>2015-11-20 14:32:58 +0100
committerVladimír Čunát <vcunat@gmail.com>2015-11-20 14:32:58 +0100
commit333d69a5f0e7ccfe7b8c0bdb14ebd3934b3f77fb (patch)
tree0f4757ddd2bb3d73b438eea85828d8e01c049583 /pkgs/stdenv
parentbdbbfa0d4247e203ffe3171621b614374da05f70 (diff)
parentb809f886c0bdbd4665fc65a4c308d38a30c368d8 (diff)
downloadnixlib-333d69a5f0e7ccfe7b8c0bdb14ebd3934b3f77fb.tar
nixlib-333d69a5f0e7ccfe7b8c0bdb14ebd3934b3f77fb.tar.gz
nixlib-333d69a5f0e7ccfe7b8c0bdb14ebd3934b3f77fb.tar.bz2
nixlib-333d69a5f0e7ccfe7b8c0bdb14ebd3934b3f77fb.tar.lz
nixlib-333d69a5f0e7ccfe7b8c0bdb14ebd3934b3f77fb.tar.xz
nixlib-333d69a5f0e7ccfe7b8c0bdb14ebd3934b3f77fb.tar.zst
nixlib-333d69a5f0e7ccfe7b8c0bdb14ebd3934b3f77fb.zip
Merge staging into closure-size
The most complex problems were from dealing with switches reverted in
the meantime (gcc5, gmp6, ncurses6).
It's likely that darwin is (still) broken nontrivially.
Diffstat (limited to 'pkgs/stdenv')
-rw-r--r--pkgs/stdenv/default.nix2
-rw-r--r--pkgs/stdenv/generic/setup.sh2
-rw-r--r--pkgs/stdenv/linux/default.nix8
-rw-r--r--pkgs/stdenv/linux/make-bootstrap-tools.nix14
-rw-r--r--pkgs/stdenv/pure-darwin/default.nix32
-rw-r--r--pkgs/stdenv/pure-darwin/make-bootstrap-tools.nix60
6 files changed, 65 insertions, 53 deletions
diff --git a/pkgs/stdenv/default.nix b/pkgs/stdenv/default.nix
index 71bdc3e8f829..da93229ce94c 100644
--- a/pkgs/stdenv/default.nix
+++ b/pkgs/stdenv/default.nix
@@ -54,7 +54,7 @@ rec {
     if system == "armv7l-linux" then stdenvLinux else
     if system == "mips64el-linux" then stdenvLinux else
     if system == "powerpc-linux" then /* stdenvLinux */ stdenvNative else
-    if system == "x86_64-darwin" then stdenvDarwin else
+    if system == "x86_64-darwin" then stdenvDarwinPure else
     if system == "x86_64-solaris" then stdenvNix else
     if system == "i686-cygwin" then stdenvNative else
     if system == "x86_64-cygwin" then stdenvNative else
diff --git a/pkgs/stdenv/generic/setup.sh b/pkgs/stdenv/generic/setup.sh
index 87e18db90a4b..788973b0cb5c 100644
--- a/pkgs/stdenv/generic/setup.sh
+++ b/pkgs/stdenv/generic/setup.sh
@@ -450,7 +450,7 @@ substituteAllInPlace() {
 # the environment used for building.
 dumpVars() {
     if [ "$noDumpEnvVars" != 1 ]; then
-        export > "$NIX_BUILD_TOP/env-vars"
+        export > "$NIX_BUILD_TOP/env-vars" || true
     fi
 }
 
diff --git a/pkgs/stdenv/linux/default.nix b/pkgs/stdenv/linux/default.nix
index 5696797a9567..b796faa9a3f4 100644
--- a/pkgs/stdenv/linux/default.nix
+++ b/pkgs/stdenv/linux/default.nix
@@ -210,9 +210,13 @@ rec {
       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_14 = pkgs.isl_0_14.override { stdenv = pkgs.makeStaticLibraries pkgs.stdenv; };
+      isl = pkgs.isl.override { stdenv = pkgs.makeStaticLibraries pkgs.stdenv; };
+      cloog = pkgs.cloog.override {
+        stdenv = pkgs.makeStaticLibraries pkgs.stdenv;
+        inherit isl;
+      };
       gccPlain = pkgs.gcc.cc.override {
-        isl = isl_0_14;
+        inherit isl cloog;
       };
     };
     extraBuildInputs = [ stage2.pkgs.patchelf stage2.pkgs.paxctl ];
diff --git a/pkgs/stdenv/linux/make-bootstrap-tools.nix b/pkgs/stdenv/linux/make-bootstrap-tools.nix
index 0b84f92d2b50..b1a824983a3e 100644
--- a/pkgs/stdenv/linux/make-bootstrap-tools.nix
+++ b/pkgs/stdenv/linux/make-bootstrap-tools.nix
@@ -34,7 +34,7 @@ rec {
   build =
 
     stdenv.mkDerivation {
-      name = "build";
+      name = "stdenv-bootstrap-tools";
 
       buildInputs = [nukeReferences cpio];
 
@@ -154,9 +154,19 @@ rec {
       allowedReferences = [];
     };
 
+  dist = stdenv.mkDerivation {
+    name = "stdenv-bootstrap-tools";
+
+    buildCommand = ''
+      mkdir -p $out/nix-support
+      echo "file tarball ${build}/on-server/bootstrap-tools.tar.xz" >> $out/nix-support/hydra-build-products
+      echo "file busybox ${build}/on-server/busybox" >> $out/nix-support/hydra-build-products
+    '';
+  };
+
   test = ((import ./default.nix) {
     inherit system;
-    
+
     customBootstrapFiles = {
       busybox = "${build}/on-server/busybox";
       bootstrapTools = "${build}/on-server/bootstrap-tools.tar.xz";
diff --git a/pkgs/stdenv/pure-darwin/default.nix b/pkgs/stdenv/pure-darwin/default.nix
index 51780b6f774b..d13dc98cd742 100644
--- a/pkgs/stdenv/pure-darwin/default.nix
+++ b/pkgs/stdenv/pure-darwin/default.nix
@@ -18,21 +18,19 @@ let
     "/usr/lib/system"
   ];
 
-  fetch = { file, sha256 }: derivation ((import <nix/fetchurl.nix> {
-    url = "https://dl.dropboxusercontent.com/u/2857322/${file}";
-    inherit sha256;
-    executable = true;
-  }).drvAttrs // {
-    __impureHostDeps = libSystemClosure;
-  });
+  fetch = { file, sha256, executable ? true }: import <nix/fetchurl.nix> {
+    url = "http://tarballs.nixos.org/stdenv-darwin/x86_64/4f07c88d467216d9692fefc951deb5cd3c4cc722/${file}";
+    inherit sha256 system executable;
+  };
 
   bootstrapFiles = {
-    sh    = fetch { file = "sh";    sha256 = "1qakpg37vl61jnkplz13m3g1csqr85cg8ybp6jwiv6apmg26isnm"; };
-    bzip2 = fetch { file = "bzip2"; sha256 = "1gxa67255q9v00j1vn1mzyrnbwys2g1102cx02vpcyvvrl4vqxr0"; };
-    mkdir = fetch { file = "mkdir"; sha256 = "1yfl8w65ksji7fggrbvqxw8lp0gm02qilk11n9axj2jxay53ngvg"; };
-    cpio  = fetch { file = "cpio";  sha256 = "0nssyg19smgcblwq1mfcw4djbd85md84d2f093qcqkbigdjg484b"; };
+    sh    = fetch { file = "sh";    sha256 = "1siix3wakzil31r2cydmh3v8a1nyq4605dwiabqc5lx73j4xzrzi"; };
+    bzip2 = fetch { file = "bzip2"; sha256 = "0zvqm977k11b5cl4ixxb5h0ds24g6z0f8m28z4pqxzpa353lqbla"; };
+    mkdir = fetch { file = "mkdir"; sha256 = "13frk8lsfgzlb65p9l26cvxf06aag43yjk7vg9msn7ix3v8cmrg1"; };
+    cpio  = fetch { file = "cpio";  sha256 = "0ms5i9m1vdksj575sf1djwgm7zhnvfrrb44dxnfh9avr793rc2w4"; };
   };
-  tarball = fetch { file = "bootstrap-tools.9.cpio.bz2"; sha256 = "1xim0wm4ld45ysdmgpsa6b1f6srdnfj054ilv86k0pa5plvcmsf4"; };
+
+  tarball = fetch { file = "bootstrap-tools.cpio.bz2"; sha256 = "1lz1b0grl4642h6n635xvi6imf0yyy1zyzdr9ing5aphzz0z5iic"; executable = false; };
 in rec {
   allPackages = import ../../top-level/all-packages.nix;
 
@@ -43,6 +41,8 @@ in rec {
     export MACOSX_DEPLOYMENT_TARGET=10.7
     export SDKROOT=
     export CMAKE_OSX_ARCHITECTURES=x86_64
+    # Workaround for https://openradar.appspot.com/22671534 on 10.11.
+    export gl_cv_func_getcwd_abort_bug=no
   '';
 
   # The one dependency of /bin/sh :(
@@ -220,11 +220,13 @@ in rec {
   persistent3 = orig: with stage3.pkgs; {
     inherit
       gnumake gzip gnused bzip2 gawk ed xz patch bash
-      libcxxabi libcxx ncurses libffi zlib llvm gmp pcre gnugrep
+      libcxxabi libcxx ncurses libffi zlib gmp pcre gnugrep
       coreutils findutils diffutils patchutils;
 
-    llvmPackages = orig.llvmPackages // {
-      inherit (llvmPackages) llvm clang-unwrapped;
+    llvmPackages = let llvmOverride = llvmPackages.llvm.override { inherit libcxxabi; };
+    in orig.llvmPackages // {
+      llvm = llvmOverride;
+      clang-unwrapped = llvmPackages.clang-unwrapped.override { llvm = llvmOverride; };
     };
 
     darwin = orig.darwin // {
diff --git a/pkgs/stdenv/pure-darwin/make-bootstrap-tools.nix b/pkgs/stdenv/pure-darwin/make-bootstrap-tools.nix
index 428d2847a7cd..816899482873 100644
--- a/pkgs/stdenv/pure-darwin/make-bootstrap-tools.nix
+++ b/pkgs/stdenv/pure-darwin/make-bootstrap-tools.nix
@@ -1,6 +1,4 @@
-{system ? builtins.currentSystem}:
-
-with import ../../top-level/all-packages.nix {inherit system;};
+with import ../../top-level/all-packages.nix { system = "x86_64-darwin"; };
 
 rec {
   # We want coreutils without ACL support.
@@ -9,7 +7,7 @@ rec {
   });
 
   build = stdenv.mkDerivation {
-    name = "build";
+    name = "stdenv-bootstrap-tools";
 
     buildInputs = [nukeReferences cpio];
 
@@ -62,9 +60,10 @@ rec {
       cp -d ${openssl.out}/lib/*.dylib $out/lib
 
       cp -d ${gnugrep.pcre.out}/lib/libpcre*.dylib $out/lib
-      cp -d ${libiconv.lib}/lib/libiconv*.dylib $out/lib
+      cp -d ${libiconv}/lib/lib*.dylib $out/lib
       cp -d ${gettext}/lib/libintl*.dylib $out/lib
       chmod +x $out/lib/libintl*.dylib
+      cp -d ${ncurses}/lib/libncurses*.dylib $out/lib
 
       # Copy what we need of clang
       cp -d ${llvmPackages.clang-unwrapped}/bin/clang $out/bin
@@ -117,7 +116,7 @@ rec {
         fi
       done
 
-      for i in $out/bin/* $out/lib/*.dylib $out/lib/clang/3.5.0/lib/darwin/*.dylib $out/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation; do
+      for i in $out/bin/* $out/lib/*.dylib $out/lib/clang/*/lib/darwin/*.dylib $out/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation; do
         if test -x $i -a ! -L $i; then
           echo "Adding rpath to $i"
           rpathify $i
@@ -125,48 +124,45 @@ rec {
       done
 
       nuke-refs $out/lib/*
-      nuke-refs $out/lib/clang/3.5.0/lib/darwin/*
+      nuke-refs $out/lib/clang/*/lib/darwin/*
       nuke-refs $out/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
 
+      set -x
       mkdir $out/.pack
       mv $out/* $out/.pack
       mv $out/.pack $out/pack
 
       mkdir $out/on-server
-      (cd $out/pack && (find | cpio -o -H newc)) | bzip2 > $out/on-server/bootstrap-tools.cpio.bz2
-
-      mkdir $out/in-nixpkgs
-      cp ${stdenv.shell} $out/in-nixpkgs/sh
-      cp ${cpio}/bin/cpio $out/in-nixpkgs
-      cp ${coreutils_}/bin/mkdir $out/in-nixpkgs
-      cp ${bzip2}/bin/bzip2 $out/in-nixpkgs
+      cp ${stdenv.shell} $out/on-server/sh
+      cp ${cpio}/bin/cpio $out/on-server
+      cp ${coreutils_}/bin/mkdir $out/on-server
+      cp ${bzip2}/bin/bzip2 $out/on-server
 
-      chmod u+w $out/in-nixpkgs/*
-      strip $out/in-nixpkgs/*
-      nuke-refs $out/in-nixpkgs/*
+      chmod u+w $out/on-server/*
+      strip $out/on-server/*
+      nuke-refs $out/on-server/*
 
-      for i in $out/in-nixpkgs/*; do
+      for i in $out/on-server/*; do
         fix_dyld $i
       done
+
+      (cd $out/pack && (find | cpio -o -H newc)) | bzip2 > $out/on-server/bootstrap-tools.cpio.bz2
     '';
 
     allowedReferences = [];
   };
 
-  host = stdenv.mkDerivation {
-    name = "host";
+  dist = stdenv.mkDerivation {
+    name = "stdenv-bootstrap-tools";
 
     buildCommand = ''
       mkdir -p $out/nix-support
-
-      for i in "${build}/on-server/"*; do
-        echo "file binary-dist $i" >> $out/nix-support/hydra-build-products
-      done
-
-      echo "darwin-bootstrap-tools-$(date +%Y.%m.%d)" >> $out/nix-support/hydra-release-name
+      echo "file tarball ${build}/on-server/bootstrap-tools.cpio.bz2" >> $out/nix-support/hydra-build-products
+      echo "file sh ${build}/on-server/sh" >> $out/nix-support/hydra-build-products
+      echo "file cpio ${build}/on-server/cpio" >> $out/nix-support/hydra-build-products
+      echo "file mkdir ${build}/on-server/mkdir" >> $out/nix-support/hydra-build-products
+      echo "file bzip2 ${build}/on-server/bzip2" >> $out/nix-support/hydra-build-products
     '';
-
-    allowedReferences = [ build ];
   };
 
   unpack = stdenv.mkDerivation {
@@ -218,9 +214,9 @@ rec {
 
     tarball = "${build}/on-server/bootstrap-tools.cpio.bz2";
 
-    mkdir = "${build}/in-nixpkgs/mkdir";
-    bzip2 = "${build}/in-nixpkgs/bzip2";
-    cpio  = "${build}/in-nixpkgs/cpio";
+    mkdir = "${build}/on-server/mkdir";
+    bzip2 = "${build}/on-server/bzip2";
+    cpio  = "${build}/on-server/cpio";
 
     allowedReferences = [ "out" ];
   };
@@ -249,7 +245,7 @@ rec {
       # an SSL-capable curl
       curl --version | grep SSL
 
-      ${build}/in-nixpkgs/sh -c 'echo Hello World'
+      ${build}/on-server/sh -c 'echo Hello World'
 
       export flags="-idirafter ${unpack}/include-Libsystem --sysroot=${unpack} -L${unpack}/lib"