From 1c623126c7f7a3277918a6dbad91138380e5c4b8 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 29 Jan 2009 17:48:45 +0000 Subject: * 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 --- pkgs/build-support/nuke-references/builder.sh | 2 +- pkgs/stdenv/linux/test.nix | 43 ++++++++++++++++++++------- pkgs/tools/compression/bzip2/default.nix | 2 +- 3 files changed, 35 insertions(+), 12 deletions(-) diff --git a/pkgs/build-support/nuke-references/builder.sh b/pkgs/build-support/nuke-references/builder.sh index a08dfa2bd9449..429a5a8dee4ed 100644 --- a/pkgs/build-support/nuke-references/builder.sh +++ b/pkgs/build-support/nuke-references/builder.sh @@ -4,7 +4,7 @@ ensureDir $out/bin cat > $out/bin/nuke-refs < \$i.tmp if test -x \$i; then chmod +x \$i.tmp; fi mv \$i.tmp \$i diff --git a/pkgs/stdenv/linux/test.nix b/pkgs/stdenv/linux/test.nix index c0beb34625d13..8f9f8cb5f40e1 100644 --- a/pkgs/stdenv/linux/test.nix +++ b/pkgs/stdenv/linux/test.nix @@ -14,15 +14,18 @@ rec { gcc = gcc43; - curl = import ../../tools/networking/curl { + curlDiet = import ../../tools/networking/curl { inherit fetchurl; - stdenv = makeStaticBinaries stdenv; + stdenv = useDietLibC stdenv; zlibSupport = false; sslSupport = false; }; - foo = kernelPackages.klibc; + bzip2Diet = import ../../tools/compression/bzip2 { + inherit fetchurl; + stdenv = useDietLibC stdenv; + }; build = @@ -30,7 +33,7 @@ rec { stdenv.mkDerivation { name = "build"; - buildInputs = [nukeReferences]; + buildInputs = [nukeReferences cpio]; buildCommand = '' ensureDir $out/bin $out/lib $out/libexec @@ -91,6 +94,9 @@ rec { cp -rd ${gcc.gcc}/libexec/* $out/libexec mkdir $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 ${mpfr}/lib/libmpfr*.so* $out/lib @@ -109,12 +115,28 @@ rec { strip -s $i || true fi done - + nuke-refs $out/bin/* nuke-refs $out/lib/* 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 @@ -130,9 +152,8 @@ rec { name = "unpack"; buildCommand = '' - tar xvfj ${build}/bootstrap-tools.tar.bz2 - cp -prd . $out - rm $out/env-vars + ${build}/in-nixpkgs/mkdir $out + ${build}/in-nixpkgs/bzip2 -d < ${build}/on-server/bootstrap-tools.cpio.bz2 | (cd $out && ${build}/in-nixpkgs/cpio -V -i) for i in $out/bin/* $out/libexec/gcc/*/*/*; do echo patching $i @@ -147,7 +168,7 @@ rec { cat $i | sed "s|/nix/store/e*-[^/]*/|$out/|g" > $i.tmp mv $i.tmp $i done - ''; # */ + ''; # " */ allowedReferences = ["out"]; }; @@ -176,6 +197,8 @@ rec { grep --version gcc --version + ${build}/in-nixpkgs/sh -c 'echo Hello World' + ldlinux=$(echo ${unpack}/lib/ld-linux*.so.2) export CPP="cpp -idirafter ${unpack}/include-glibc -B${unpack}" diff --git a/pkgs/tools/compression/bzip2/default.nix b/pkgs/tools/compression/bzip2/default.nix index eedcf242bcabd..ddc31de6196b7 100644 --- a/pkgs/tools/compression/bzip2/default.nix +++ b/pkgs/tools/compression/bzip2/default.nix @@ -11,7 +11,7 @@ stdenv.mkDerivation { }; sharedLibrary = - !stdenv.isDarwin && !(stdenv ? isDietLibC) && stdenv.system != "i686-cygwin"; + !stdenv.isDarwin && !(stdenv ? isDietLibC) && !(stdenv ? isStatic) && stdenv.system != "i686-cygwin"; meta = { homepage = http://www.bzip.org; -- cgit 1.4.1