summary refs log tree commit diff
path: root/pkgs/stdenv
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2014-10-29 17:26:29 +0100
committerEelco Dolstra <eelco.dolstra@logicblox.com>2014-10-29 17:26:29 +0100
commit119ce1ab03d0b3250e9e350f0686e095060014b0 (patch)
tree5bcd405b2a5d6bbe8527929dd3787bb5ef9ce89b /pkgs/stdenv
parentac8e5cd145fa5f22bab1b01d8b4db4d26d22e65c (diff)
downloadnixlib-119ce1ab03d0b3250e9e350f0686e095060014b0.tar
nixlib-119ce1ab03d0b3250e9e350f0686e095060014b0.tar.gz
nixlib-119ce1ab03d0b3250e9e350f0686e095060014b0.tar.bz2
nixlib-119ce1ab03d0b3250e9e350f0686e095060014b0.tar.lz
nixlib-119ce1ab03d0b3250e9e350f0686e095060014b0.tar.xz
nixlib-119ce1ab03d0b3250e9e350f0686e095060014b0.tar.zst
nixlib-119ce1ab03d0b3250e9e350f0686e095060014b0.zip
Update the stdenv-linux bootstrap tools
Diffstat (limited to 'pkgs/stdenv')
-rw-r--r--pkgs/stdenv/linux/bootstrap/i686.nix41
-rw-r--r--pkgs/stdenv/linux/bootstrap/x86_64.nix9
-rw-r--r--pkgs/stdenv/linux/default.nix11
-rw-r--r--pkgs/stdenv/linux/scripts/unpack-bootstrap-tools.sh50
4 files changed, 32 insertions, 79 deletions
diff --git a/pkgs/stdenv/linux/bootstrap/i686.nix b/pkgs/stdenv/linux/bootstrap/i686.nix
index 7b6b3ee80344..04712360d152 100644
--- a/pkgs/stdenv/linux/bootstrap/i686.nix
+++ b/pkgs/stdenv/linux/bootstrap/i686.nix
@@ -1,39 +1,12 @@
-let
-
-  fetch = { file, sha256 }: import <nix/fetchurl.nix> {
-    url = "http://tarballs.nixos.org/stdenv-linux/i686/r24519/${file}";
-    inherit sha256;
+{
+  busybox = import <nix/fetchurl.nix> {
+    url = http://tarballs.nixos.org/stdenv-linux/i686/ac8e5cd145fa5f22bab1b01d8b4db4d26d22e65c/busybox;
+    sha256 = "0314dskcp6gp0jpy87phpjz1r13zh0grb40yvdl9s4l2rxzgzr2v";
     executable = true;
   };
 
-in {
-  sh = fetch {
-    file = "sh";
-    sha256 = "1l6sdhyqjlh4m5gj3pfpi8aisp1m012lpwxfcc4v1x8g429mflmy";
-  };
-
-  bzip2 = fetch {
-    file = "bzip2";
-    sha256 = "1p5nkrdn52jm6rsx8x3wwjpsh83f2qsjl1qckkgnkplwhj23zjp7";
-  };
-
-  mkdir = fetch {
-    file = "mkdir";
-    sha256 = "02ff7i9ph9ahiapsg2v9c3pwr7sl73sk4n7ic112ljkrgwkail33";
-  };
-
-  cpio = fetch {
-    file = "cpio";
-    sha256 = "046if3aqqramyhrn2yxrjf4bfkl8x1bcqxhvi7ml9nrv9smx8irg";
-  };
-
-  curl = fetch {
-    file = "curl.bz2";
-    sha256 = "1v0yfb4gcdyqpl2fxlxjh337r28c23iqm7vwck4p4643xd55di7q";
-  };
-
-  bootstrapTools = {
-    url = http://tarballs.nixos.org/stdenv-linux/i686/r24519/bootstrap-tools.cpio.bz2;
-    sha256 = "0imypaxy6piwbk8ff2y1nr7yk49pqmdgdbv6g8miq1zs5yfip6ij";
+  bootstrapTools = import <nix/fetchurl.nix> {
+    url = http://tarballs.nixos.org/stdenv-linux/i686/ac8e5cd145fa5f22bab1b01d8b4db4d26d22e65c/bootstrap-tools.tar.xz;
+    sha256 = "025r3vifkqlw0i5nvlkmfrvbn0v73r1pr6jkqckgs585y7nmsjhz";
   };
 }
diff --git a/pkgs/stdenv/linux/bootstrap/x86_64.nix b/pkgs/stdenv/linux/bootstrap/x86_64.nix
index 71961e6961e6..2950e42ae0a5 100644
--- a/pkgs/stdenv/linux/bootstrap/x86_64.nix
+++ b/pkgs/stdenv/linux/bootstrap/x86_64.nix
@@ -1,10 +1,9 @@
-# Use the static tools for i686-linux.  They work on x86_64-linux
-# machines as well.
+# Use busybox for i686-linux since it works on x86_64-linux as well.
 (import ./i686.nix) //
 
 {
-  bootstrapTools = {
-    url = http://tarballs.nixos.org/stdenv-linux/x86_64/r23302/bootstrap-tools.cpio.bz2;
-    sha256 = "0w89kqhx47yl0jifp2vffp073pyrqha5f312kp971smi4h41drna";
+  bootstrapTools = import <nix/fetchurl.nix> {
+    url = http://tarballs.nixos.org/stdenv-linux/x86_64/ac8e5cd145fa5f22bab1b01d8b4db4d26d22e65c/bootstrap-tools.tar.xz;
+    sha256 = "01485vvwxb7fsx8c8il5hip0bhh4xy2gg76sj4zc98gl4v1jbfq9";
   };
 }
diff --git a/pkgs/stdenv/linux/default.nix b/pkgs/stdenv/linux/default.nix
index 0467b60ca476..a5d8f5ba7265 100644
--- a/pkgs/stdenv/linux/default.nix
+++ b/pkgs/stdenv/linux/default.nix
@@ -40,20 +40,15 @@ rec {
   bootstrapTools = derivation {
     name = "bootstrap-tools";
 
-    builder = bootstrapFiles.sh;
+    builder = bootstrapFiles.busybox;
 
     args =
       if system == "armv5tel-linux" || system == "armv6l-linux"
         || system == "armv7l-linux"
       then [ ./scripts/unpack-bootstrap-tools-arm.sh ]
-      else [ ./scripts/unpack-bootstrap-tools.sh ];
+      else [ "ash" "-e" ./scripts/unpack-bootstrap-tools.sh ];
 
-    # FIXME: get rid of curl.
-    inherit (bootstrapFiles) bzip2 mkdir curl cpio;
-
-    tarball = import <nix/fetchurl.nix> {
-      inherit (bootstrapFiles.bootstrapTools) url sha256;
-    };
+    tarball = bootstrapFiles.bootstrapTools;
 
     inherit system;
 
diff --git a/pkgs/stdenv/linux/scripts/unpack-bootstrap-tools.sh b/pkgs/stdenv/linux/scripts/unpack-bootstrap-tools.sh
index 422dc6dd5fef..9db5d2c88e5d 100644
--- a/pkgs/stdenv/linux/scripts/unpack-bootstrap-tools.sh
+++ b/pkgs/stdenv/linux/scripts/unpack-bootstrap-tools.sh
@@ -1,9 +1,7 @@
-set -e
-
 # Unpack the bootstrap tools tarball.
 echo Unpacking the bootstrap tools...
-$mkdir $out
-$bzip2 -d < $tarball | (cd $out && $cpio -i)
+$builder mkdir $out
+< $tarball $builder unxz | $builder tar x -C $out
 
 # Set the ELF interpreter / RPATH in the bootstrap binaries.
 echo Patching the bootstrap tools...
@@ -21,32 +19,17 @@ fi
 LD_LIBRARY_PATH=$out/lib $LD_BINARY $out/bin/cp $out/bin/patchelf .
 
 for i in $out/bin/* $out/libexec/gcc/*/*/*; do
-    echo patching $i
-    if ! test -L $i; then
-         LD_LIBRARY_PATH=$out/lib $LD_BINARY \
-             $out/bin/patchelf --set-interpreter $LD_BINARY --set-rpath $out/lib --force-rpath $i
-         LD_LIBRARY_PATH=$out/lib $LD_BINARY \
-             $out/bin/patchelf --set-interpreter $LD_BINARY --set-rpath $out/lib --force-rpath $i
-    fi
-done
-for i in $out/lib/librt* ; do
-    echo patching $i
-    if ! test -L $i; then
-         LD_LIBRARY_PATH=$out/lib $LD_BINARY \
-             $out/bin/patchelf --set-interpreter $LD_BINARY --set-rpath $out/lib --force-rpath $i
-         LD_LIBRARY_PATH=$out/lib $LD_BINARY \
-             $out/bin/patchelf --set-interpreter $LD_BINARY --set-rpath $out/lib --force-rpath $i
-    fi
+    if [ -L "$i" ]; then continue; fi
+    if [ -z "${i##*/liblto*}" ]; then continue; fi
+    echo patching "$i"
+    LD_LIBRARY_PATH=$out/lib $out/lib/ld-linux*.so.2 \
+        $out/bin/patchelf --set-interpreter $LD_BINARY --set-rpath $out/lib --force-rpath "$i"
 done
 
-for i in $out/lib/libgmp* $out/lib/libppl* $out/lib/libcloog* $out/lib/libmpc* $out/lib/libpcre* $out/lib/libstdc++*.so.*[0-9]; do
-    echo trying to patch $i
-    if test -f $i -a ! -L $i; then
-         LD_LIBRARY_PATH=$out/lib $LD_BINARY \
-             $out/bin/patchelf --set-rpath $out/lib --force-rpath $i
-         LD_LIBRARY_PATH=$out/lib $LD_BINARY \
-             $out/bin/patchelf --set-rpath $out/lib --force-rpath $i
-    fi
+for i in $out/lib/libpcre*; do
+    if [ -L "$i" ]; then continue; fi
+    echo patching "$i"
+    $out/bin/patchelf --set-rpath $out/lib --force-rpath "$i"
 done
 
 # Fix the libc linker script.
@@ -60,13 +43,16 @@ mv $out/lib/libpthread.so.tmp $out/lib/libpthread.so
 ln -s bash $out/bin/sh
 ln -s bzip2 $out/bin/bunzip2
 
-# Mimic the gunzip script as in gzip installations
+# Provide a gunzip script.
 cat > $out/bin/gunzip <<EOF
 #!$out/bin/sh
 exec $out/bin/gzip -d "\$@"
 EOF
 chmod +x $out/bin/gunzip
 
-# fetchurl needs curl.
-bzip2 -d < $curl > $out/bin/curl
-chmod +x $out/bin/curl
+# Provide fgrep/egrep.
+echo "#! $out/bin/sh" > $out/bin/egrep
+echo "exec $out/bin/grep -E \"\$@\"" >> $out/bin/egrep
+echo "#! $out/bin/sh" > $out/bin/fgrep
+echo "exec $out/bin/grep -F \"\$@\"" >> $out/bin/fgrep
+chmod +x $out/bin/egrep $out/bin/fgrep