* Use the sh from klibc in the bootstrap. It's a lot smaller than
bash. Also, use the cpio from klibc instead of tar. svn path=/nixpkgs/branches/stdenv-updates/; revision=13905
This commit is contained in:
parent
c584bb878a
commit
1c623126c7
|
@ -4,7 +4,7 @@ ensureDir $out/bin
|
||||||
cat > $out/bin/nuke-refs <<EOF
|
cat > $out/bin/nuke-refs <<EOF
|
||||||
#! $SHELL -e
|
#! $SHELL -e
|
||||||
for i in \$*; do
|
for i in \$*; do
|
||||||
if ! test -L \$i; then
|
if test ! -L \$i -a -f \$i; then
|
||||||
cat \$i | sed "s|/nix/store/[a-z0-9]*-|/nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-|g" > \$i.tmp
|
cat \$i | sed "s|/nix/store/[a-z0-9]*-|/nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-|g" > \$i.tmp
|
||||||
if test -x \$i; then chmod +x \$i.tmp; fi
|
if test -x \$i; then chmod +x \$i.tmp; fi
|
||||||
mv \$i.tmp \$i
|
mv \$i.tmp \$i
|
||||||
|
|
|
@ -14,15 +14,18 @@ rec {
|
||||||
gcc = gcc43;
|
gcc = gcc43;
|
||||||
|
|
||||||
|
|
||||||
curl = import ../../tools/networking/curl {
|
curlDiet = import ../../tools/networking/curl {
|
||||||
inherit fetchurl;
|
inherit fetchurl;
|
||||||
stdenv = makeStaticBinaries stdenv;
|
stdenv = useDietLibC stdenv;
|
||||||
zlibSupport = false;
|
zlibSupport = false;
|
||||||
sslSupport = false;
|
sslSupport = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
foo = kernelPackages.klibc;
|
bzip2Diet = import ../../tools/compression/bzip2 {
|
||||||
|
inherit fetchurl;
|
||||||
|
stdenv = useDietLibC stdenv;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
build =
|
build =
|
||||||
|
@ -30,7 +33,7 @@ rec {
|
||||||
stdenv.mkDerivation {
|
stdenv.mkDerivation {
|
||||||
name = "build";
|
name = "build";
|
||||||
|
|
||||||
buildInputs = [nukeReferences];
|
buildInputs = [nukeReferences cpio];
|
||||||
|
|
||||||
buildCommand = ''
|
buildCommand = ''
|
||||||
ensureDir $out/bin $out/lib $out/libexec
|
ensureDir $out/bin $out/lib $out/libexec
|
||||||
|
@ -91,6 +94,9 @@ rec {
|
||||||
cp -rd ${gcc.gcc}/libexec/* $out/libexec
|
cp -rd ${gcc.gcc}/libexec/* $out/libexec
|
||||||
mkdir $out/include
|
mkdir $out/include
|
||||||
cp -rd ${gcc.gcc}/include/c++ $out/include
|
cp -rd ${gcc.gcc}/include/c++ $out/include
|
||||||
|
chmod -R u+w $out/include
|
||||||
|
rm -rf $out/include/c++/*/ext/pb_ds
|
||||||
|
rm -rf $out/include/c++/*/ext/parallel
|
||||||
|
|
||||||
cp -d ${gmp}/lib/libgmp*.so* $out/lib
|
cp -d ${gmp}/lib/libgmp*.so* $out/lib
|
||||||
cp -d ${mpfr}/lib/libmpfr*.so* $out/lib
|
cp -d ${mpfr}/lib/libmpfr*.so* $out/lib
|
||||||
|
@ -109,12 +115,28 @@ rec {
|
||||||
strip -s $i || true
|
strip -s $i || true
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
nuke-refs $out/bin/*
|
nuke-refs $out/bin/*
|
||||||
nuke-refs $out/lib/*
|
nuke-refs $out/lib/*
|
||||||
nuke-refs $out/libexec/gcc/*/*/*
|
nuke-refs $out/libexec/gcc/*/*/*
|
||||||
|
|
||||||
(cd $out && tar cvfj $out/bootstrap-tools.tar.bz2 bin lib libexec include include-glibc)
|
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 ${klibc}/lib/klibc/bin.static/sh $out/in-nixpkgs
|
||||||
|
cp ${klibc}/lib/klibc/bin.static/cpio $out/in-nixpkgs
|
||||||
|
cp ${klibc}/lib/klibc/bin.static/mkdir $out/in-nixpkgs
|
||||||
|
cp ${curlDiet}/bin/curl $out/in-nixpkgs
|
||||||
|
cp ${bzip2Diet}/bin/bzip2 $out/in-nixpkgs
|
||||||
|
chmod u+w $out/in-nixpkgs/*
|
||||||
|
strip $out/in-nixpkgs/*
|
||||||
|
nuke-refs $out/in-nixpkgs/*
|
||||||
|
bzip2 $out/in-nixpkgs/curl
|
||||||
''; # */
|
''; # */
|
||||||
|
|
||||||
# The result should not contain any references (store paths) so
|
# The result should not contain any references (store paths) so
|
||||||
|
@ -130,9 +152,8 @@ rec {
|
||||||
name = "unpack";
|
name = "unpack";
|
||||||
|
|
||||||
buildCommand = ''
|
buildCommand = ''
|
||||||
tar xvfj ${build}/bootstrap-tools.tar.bz2
|
${build}/in-nixpkgs/mkdir $out
|
||||||
cp -prd . $out
|
${build}/in-nixpkgs/bzip2 -d < ${build}/on-server/bootstrap-tools.cpio.bz2 | (cd $out && ${build}/in-nixpkgs/cpio -V -i)
|
||||||
rm $out/env-vars
|
|
||||||
|
|
||||||
for i in $out/bin/* $out/libexec/gcc/*/*/*; do
|
for i in $out/bin/* $out/libexec/gcc/*/*/*; do
|
||||||
echo patching $i
|
echo patching $i
|
||||||
|
@ -147,7 +168,7 @@ rec {
|
||||||
cat $i | sed "s|/nix/store/e*-[^/]*/|$out/|g" > $i.tmp
|
cat $i | sed "s|/nix/store/e*-[^/]*/|$out/|g" > $i.tmp
|
||||||
mv $i.tmp $i
|
mv $i.tmp $i
|
||||||
done
|
done
|
||||||
''; # */
|
''; # " */
|
||||||
|
|
||||||
allowedReferences = ["out"];
|
allowedReferences = ["out"];
|
||||||
};
|
};
|
||||||
|
@ -176,6 +197,8 @@ rec {
|
||||||
grep --version
|
grep --version
|
||||||
gcc --version
|
gcc --version
|
||||||
|
|
||||||
|
${build}/in-nixpkgs/sh -c 'echo Hello World'
|
||||||
|
|
||||||
ldlinux=$(echo ${unpack}/lib/ld-linux*.so.2)
|
ldlinux=$(echo ${unpack}/lib/ld-linux*.so.2)
|
||||||
|
|
||||||
export CPP="cpp -idirafter ${unpack}/include-glibc -B${unpack}"
|
export CPP="cpp -idirafter ${unpack}/include-glibc -B${unpack}"
|
||||||
|
|
|
@ -11,7 +11,7 @@ stdenv.mkDerivation {
|
||||||
};
|
};
|
||||||
|
|
||||||
sharedLibrary =
|
sharedLibrary =
|
||||||
!stdenv.isDarwin && !(stdenv ? isDietLibC) && stdenv.system != "i686-cygwin";
|
!stdenv.isDarwin && !(stdenv ? isDietLibC) && !(stdenv ? isStatic) && stdenv.system != "i686-cygwin";
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
homepage = http://www.bzip.org;
|
homepage = http://www.bzip.org;
|
||||||
|
|
Loading…
Reference in New Issue