* Use bzip instead of gzip for downloaded archives.

* Combine most of the archives together into one file (static.bz2).
* Don't depend on Subversion directories, but single files only.
  Otherwise any Subversion operation may cause a rebuild because
  something in .svn changes.  It would be nice if .svn directories
  were filtered out when copying things to the store.
* Glibc tarball: removed all .so files, /bin and /sbin, etc., and put
  linux-headers in the Glibc tarball.

svn path=/nixpkgs/trunk/; revision=2265
This commit is contained in:
Eelco Dolstra 2005-02-22 07:59:15 +00:00
parent 63bd7cdb79
commit 31ff064352
11 changed files with 32 additions and 105 deletions

View File

@ -17,11 +17,11 @@ rec {
# binary which is unpacked here.
curl = derivation {
name = "curl";
builder = ./bash-static/bash;
tar = ./gnutar-static/bin/tar;
gunzip = ./gzip-static/bin/gunzip;
curl = ./curl-static/curl-7.12.2-static.tar.gz;
builder = ./tools/bash;
tar = ./tools/tar;
bunzip2 = ./tools/bunzip2;
cp = ./tools/cp;
curl = ./curl-static/curl-7.12.2-static.tar.bz2;
system = "i686-linux";
args = [ ./scripts/curl-unpack ];
};
@ -33,11 +33,11 @@ rec {
, extra3 ? null, extra4? null, patchelf ? null}:
derivation {
name = pkgname;
builder = ./bash-static/bash;
tar = ./gnutar-static/bin/tar;
gunzip = ./gzip-static/bin/gunzip;
inherit curl url;
builder = ./tools/bash;
tar = ./tools/tar;
bunzip2 = ./tools/bunzip2;
cp = ./tools/cp;
inherit curl url;
system = "i686-linux";
args = [ ./scripts/download-script ];
inherit postProcess addToPath extra extra2 extra3 extra4 patchelf;
@ -45,97 +45,48 @@ rec {
# The various statically linked components that make up the standard
# environment.
coreutils = download {
url = http://losser.st-lab.cs.uu.nl/~armijn/.nix/coreutils-5.0-static.tar.gz;
pkgname = "coreutils";
};
patchelf = ./patchelf-static/bin/patchelf;
bzip2 = download {
url = http://losser.st-lab.cs.uu.nl/~armijn/.nix/bzip2-1.0.2-static.tar.gz;
pkgname = "bzip2";
};
gnumake = download {
url = http://losser.st-lab.cs.uu.nl/~armijn/.nix/make-3.80-static.tar.gz;
pkgname = "gnumake";
staticTools = download {
url = http://catamaran.labs.cs.uu.nl/dist/tarballs/stdenv-linux/////static.tar.bz2;
pkgname = "static-tools";
};
binutils = download {
url = http://losser.st-lab.cs.uu.nl/~armijn/.nix/binutils-2.15-static.tar.gz;
url = http://catamaran.labs.cs.uu.nl/dist/tarballs/stdenv-linux/binutils-2.15-static.tar.bz2;
pkgname = "binutils";
};
diffutils = download {
url = http://losser.st-lab.cs.uu.nl/~armijn/.nix/diffutils-2.8.1-static.tar.gz;
pkgname = "diffutils";
};
gnused = download {
url = http://losser.st-lab.cs.uu.nl/~armijn/.nix/sed-4.0.7-static.tar.gz;
pkgname = "gnused";
};
gnugrep = download {
url = http://losser.st-lab.cs.uu.nl/~armijn/.nix/grep-2.5.1-static.tar.gz;
pkgname = "gnugrep";
};
gcc = (download {url = http://losser.st-lab.cs.uu.nl/~armijn/.nix/gcc-3.4.2-static.tar.gz;
gcc = (download {url = http://catamaran.labs.cs.uu.nl/dist/tarballs/stdenv-linux/gcc-3.4.2-static.tar.bz2;
pkgname = "gcc";
postProcess = [./scripts/fix-outpath.sh];
addToPath = [coreutils findutils gnused];
addToPath = [staticTools];
}) // { langC = true; langCC = false; langF77 = false; };
gawk = download {
url = http://losser.st-lab.cs.uu.nl/~armijn/.nix/gawk-3.1.3-static.tar.gz;
pkgname = "gawk";
};
patch = download {
url = http://losser.st-lab.cs.uu.nl/~armijn/.nix/patch-2.5.4-static.tar.gz;
pkgname = "patch";
};
findutils = download {
url = http://losser.st-lab.cs.uu.nl/~armijn/.nix/findutils-4.1.20-static.tar.gz;
pkgname = "findutils";
};
linuxHeaders = download {
url = http://losser.st-lab.cs.uu.nl/~armijn/.nix/linux-headers-2.4.25-i386.tar.gz;
pkgname = "linux-headers";
};
glibc = download {
url = http://losser.st-lab.cs.uu.nl/~armijn/.nix/glibc-2.3.3-static-2.tar.gz;
url = http://catamaran.labs.cs.uu.nl/dist/tarballs/stdenv-linux/glibc-2.3.3-static.tar.bz2;
pkgname = "glibc";
patchelf = ./patchelf-static/bin/patchelf;
postProcess = [./scripts/add-symlink.sh ./scripts/fix-outpath.sh];
addToPath = [coreutils findutils gnused];
extra = linuxHeaders;
postProcess = [./scripts/fix-outpath.sh];
addToPath = [staticTools];
};
# The "fake" standard environment used to build "real" standard
# environments. It consists of just bash, coreutils, and sed, which
# is all that is needed by ../generic/builder.sh.
# environments. It consists of just the basic statically linked
# tools.
stdenvInitial = let {
body = derivation {
name = "stdenv-linux-static-initial";
name = "stdenv-linux-initial";
system = "i686-linux";
builder = ./bash-static/bash;
builder = ./tools/bash;
args = ./scripts/builder-stdenv-initial.sh;
inherit coreutils gnused;
inherit staticTools;
} // {
mkDerivation = attrs: derivation (attrs // {
builder = ./bash-static/bash;
builder = ./tools/bash;
args = ["-e" attrs.builder];
stdenv = body;
system = body.system;
});
shell = ./bash-static/bash;
shell = ./tools/bash;
};
};
@ -143,11 +94,11 @@ rec {
# This function builds the various standard environments used during
# the bootstrap.
stdenvBootFun = {glibc, gcc, binutils, staticGlibc}: (import ../generic) {
name = "stdenv-linux-static-boot";
name = "stdenv-linux-boot";
param1 = if staticGlibc then "static" else "dynamic";
preHook = ./prehook.sh;
stdenv = stdenvInitial;
shell = ./bash-static/bash;
shell = ./tools/bash;
gcc = (import ../../build-support/gcc-wrapper) {
stdenv = stdenvInitial;
nativeTools = false;
@ -155,18 +106,7 @@ rec {
inherit gcc glibc binutils;
};
initialPath = [
coreutils
./gnutar-static
./gzip-static
bzip2
gnused
gnugrep
gawk
gnumake
findutils
diffutils
patch
./patchelf-static
staticTools
];
};
@ -225,7 +165,7 @@ rec {
# Binutils built above, and adds in dynamically linked versions
# of all other tools.
stdenvLinux = (import ../generic) {
name = "stdenv-nix-linux";
name = "stdenv-linux";
preHook = ./prehook.sh;
initialPath = [
((import ../nix/path.nix) {pkgs = stdenvLinuxBoot3Pkgs;})

View File

@ -1,13 +0,0 @@
chmod u+w $out/include
(cd $out/include && ln -s $extra/include/* .) || exit 1
cd $out
find . -not -type l -exec $extra2/bin/chmod u+w {} \;
find . -exec $patchelf --interpreter $out/lib/ld-linux.so.2 --shrink-rpath {} \; || true
$extra2/bin/rm -rf bin
$extra2/bin/cat ./lib/libc.so | $extra4/bin/sed "s|/nix/store/[a-z0-9]*-glibc|$out|g" > ./lib/libc.so
$extra2/bin/cat ./lib/libpthread.so | $extra4/bin/sed "s|/nix/store/[a-z0-9]*-glibc|$out|g" > ./lib/libpthread.so
rm $out/lib/*.so*

View File

@ -6,5 +6,5 @@ PATH=$coreutils/bin
mkdir $out
cat > $out/setup <<EOF
PATH=$coreutils/bin:$gnused/bin
EOF
PATH=$staticTools/bin
EOF

View File

@ -3,6 +3,6 @@ set -e
echo $curl
$gunzip -d < $curl | $tar xvf -
$bunzip2 -d < $curl | $tar xvf -
$cp -prvd * $out

View File

@ -4,7 +4,7 @@ echo "using curl executable $curl"
$curl/bin/curl "$url" > .tmp
$gunzip -d < .tmp | $tar xvf -
$bunzip2 -d < .tmp | $tar xvf -
$cp -prd * $out

BIN
pkgs/stdenv/linux/tools/bunzip2 Executable file

Binary file not shown.