-
-
Save colemickens/d473846709dab727b6e48b2c3dd3c5dc to your computer and use it in GitHub Desktop.
This file has been truncated, but you can view the full file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nix-archive-1 ( type regular contents Derive([("out","/nix/store/lan2w3ab1mvpxj3ppiw2sizh8i7rpz7s-busybox","r:sha256","ef4c1be6c7ae57e4f654efd90ae2d2e204d6769364c46469fa9ff3761195cba1")],[],[],"builtin","builtin:fetchurl",[],[("builder","builtin:fetchurl"),("executable","1"),("impureEnvVars","http_proxy https_proxy ftp_proxy all_proxy no_proxy"),("name","busybox"),("out","/nix/store/lan2w3ab1mvpxj3ppiw2sizh8i7rpz7s-busybox"),("outputHash","ef4c1be6c7ae57e4f654efd90ae2d2e204d6769364c46469fa9ff3761195cba1"),("outputHashAlgo","sha256"),("outputHashMode","recursive"),("preferLocalBuild","1"),("system","builtin"),("unpack",""),("url","http://tarballs.nixos.org/stdenv-linux/i686/4907fc9e8d0d82b28b3c56e3a478a2882f1d700f/busybox"),("urls","http://tarballs.nixos.org/stdenv-linux/i686/4907fc9e8d0d82b28b3c56e3a478a2882f1d700f/busybox")]) ) NIXE 7 /nix/store/b7irlwi2wjlx5aj1dghx4c8k3ax6m56q-busybox.drv nix-archive-1 ( type regular contentsg Derive([("out","/nix/store/cijs9ypwccmdfjhkq9a35nin7qizg6jm-bootstrap-tools.tar.xz","sha256","a5ce9c155ed09397614646c9717fc7cd94b1023d7b76b618d409e4fefd6e9d39")],[],[],"builtin","builtin:fetchurl",[],[("builder","builtin:fetchurl"),("executable",""),("impureEnvVars","http_proxy https_proxy ftp_proxy all_proxy no_proxy"),("name","bootstrap-tools.tar.xz"),("out","/nix/store/cijs9ypwccmdfjhkq9a35nin7qizg6jm-bootstrap-tools.tar.xz"),("outputHash","a5ce9c155ed09397614646c9717fc7cd94b1023d7b76b618d409e4fefd6e9d39"),("outputHashAlgo","sha256"),("outputHashMode","flat"),("preferLocalBuild","1"),("system","builtin"),("unpack",""),("url","http://tarballs.nixos.org/stdenv-linux/x86_64/c5aabb0d603e2c1ea05f5a93b3be82437f5ebf31/bootstrap-tools.tar.xz"),("urls","http://tarballs.nixos.org/stdenv-linux/x86_64/c5aabb0d603e2c1ea05f5a93b3be82437f5ebf31/bootstrap-tools.tar.xz")]) ) NIXE F /nix/store/bzq60ip2z5xgi7jk6jgdw8cngfiwjrcm-bootstrap-tools.tar.xz.drv nix-archive-1 ( type regular contents� # 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.? | |
elif test -f $out/lib/ld64.so.?; then | |
# ppc64(le) | |
LD_BINARY=$out/lib/ld64.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 \ | |
./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 | |
export PATH=$out/bin | |
# 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 | |