summary refs log tree commit diff
path: root/pkgs/stdenv
diff options
context:
space:
mode:
authorAmbroz Bizjak <ambrop7@gmail.com>2015-02-03 20:01:28 +0100
committerAmbroz Bizjak <ambrop7@gmail.com>2015-02-05 21:27:12 +0100
commit810b416d895477de01c2a984da827a9c98590b35 (patch)
tree29e5981a2fe2ecf0d50323a22c5635138bfd28a5 /pkgs/stdenv
parent8fb7d8bedec39eb14a19683656ed7622f2aa9fed (diff)
downloadnixlib-810b416d895477de01c2a984da827a9c98590b35.tar
nixlib-810b416d895477de01c2a984da827a9c98590b35.tar.gz
nixlib-810b416d895477de01c2a984da827a9c98590b35.tar.bz2
nixlib-810b416d895477de01c2a984da827a9c98590b35.tar.lz
nixlib-810b416d895477de01c2a984da827a9c98590b35.tar.xz
nixlib-810b416d895477de01c2a984da827a9c98590b35.tar.zst
nixlib-810b416d895477de01c2a984da827a9c98590b35.zip
Consolidate the unpack scripts for the bootstrap tools.
Diffstat (limited to 'pkgs/stdenv')
-rw-r--r--pkgs/stdenv/linux/default.nix5
-rw-r--r--pkgs/stdenv/linux/scripts/unpack-bootstrap-tools-arm.sh66
-rw-r--r--pkgs/stdenv/linux/scripts/unpack-bootstrap-tools.sh4
3 files changed, 3 insertions, 72 deletions
diff --git a/pkgs/stdenv/linux/default.nix b/pkgs/stdenv/linux/default.nix
index f2d7747b03d2..6cf716586f0e 100644
--- a/pkgs/stdenv/linux/default.nix
+++ b/pkgs/stdenv/linux/default.nix
@@ -42,10 +42,7 @@ rec {
 
     builder = bootstrapFiles.busybox;
 
-    args = if system == "armv5tel-linux" || system == "armv6l-linux"
-        || system == "armv7l-linux"
-      then [ "ash" "-e" ./scripts/unpack-bootstrap-tools-arm.sh ]
-      else [ "ash" "-e" ./scripts/unpack-bootstrap-tools.sh ];
+    args = [ "ash" "-e" ./scripts/unpack-bootstrap-tools.sh ];
 
     tarball = bootstrapFiles.bootstrapTools;
 
diff --git a/pkgs/stdenv/linux/scripts/unpack-bootstrap-tools-arm.sh b/pkgs/stdenv/linux/scripts/unpack-bootstrap-tools-arm.sh
deleted file mode 100644
index a44ed7522814..000000000000
--- a/pkgs/stdenv/linux/scripts/unpack-bootstrap-tools-arm.sh
+++ /dev/null
@@ -1,66 +0,0 @@
-# TBD: It should be OK to mv this file to unpack-bootstrap-tools.sh,
-# except for a mass rebuild.
-
-# Unpack the bootstrap tools tarball.
-echo Unpacking the bootstrap tools...
-$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...
-
-if test -f $out/lib/ld.so.?; then
-   # MIPS case
-   LD_BINARY=$out/lib/ld.so.?
-else
-   # i686, x86_64 and armv5tel
-   LD_BINARY=$out/lib/ld-*so.?
-fi
-
-# On x86_64, ld-linux-x86-64.so.2 barfs on patchelf'ed programs.  So
-# use a copy of patchelf.
-LD_LIBRARY_PATH=$out/lib $LD_BINARY $out/bin/cp $out/bin/patchelf .
-
-for i in $out/bin/* $out/libexec/gcc/*/*/*; do
-    if [ -L "$i" ]; then continue; fi
-    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"
-done
-
-for i in $out/lib/librt-*.so $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.
-export PATH=$out/bin
-cat $out/lib/libc.so | sed "s|/nix/store/e*-[^/]*/|$out/|g" > $out/lib/libc.so.tmp
-mv $out/lib/libc.so.tmp $out/lib/libc.so
-cat $out/lib/libpthread.so | sed "s|/nix/store/e*-[^/]*/|$out/|g" > $out/lib/libpthread.so.tmp
-mv $out/lib/libpthread.so.tmp $out/lib/libpthread.so
-
-# Provide some additional symlinks.
-ln -s bash $out/bin/sh
-ln -s bzip2 $out/bin/bunzip2
-
-# Provide a gunzip script.
-cat > $out/bin/gunzip <<EOF
-#!$out/bin/sh
-exec $out/bin/gzip -d "\$@"
-EOF
-chmod +x $out/bin/gunzip
-
-# 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
-
-# Provide xz (actually only xz -d will work).
-echo "#! $out/bin/sh" > $out/bin/xz
-echo "exec $builder unxz \"\$@\"" >> $out/bin/xz
-
-chmod +x $out/bin/egrep $out/bin/fgrep $out/bin/xz
diff --git a/pkgs/stdenv/linux/scripts/unpack-bootstrap-tools.sh b/pkgs/stdenv/linux/scripts/unpack-bootstrap-tools.sh
index 52953c9b88da..efec363c5c79 100644
--- a/pkgs/stdenv/linux/scripts/unpack-bootstrap-tools.sh
+++ b/pkgs/stdenv/linux/scripts/unpack-bootstrap-tools.sh
@@ -22,11 +22,11 @@ for i in $out/bin/* $out/libexec/gcc/*/*/*; do
     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 \
+    LD_LIBRARY_PATH=$out/lib $LD_BINARY \
         $out/bin/patchelf --set-interpreter $LD_BINARY --set-rpath $out/lib --force-rpath "$i"
 done
 
-for i in $out/lib/libpcre*; do
+for i in $out/lib/librt-*.so $out/lib/libpcre*; do
     if [ -L "$i" ]; then continue; fi
     echo patching "$i"
     $out/bin/patchelf --set-rpath $out/lib --force-rpath "$i"