diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2005-02-21 16:03:34 +0000 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2005-02-21 16:03:34 +0000 |
commit | e6744d0f893e0641b22996382cc6dcb81f8acc3d (patch) | |
tree | ba656c68d6348d24c4814a6da79bb204e06ff2d7 /pkgs/stdenv/nix-linux-static/default.nix | |
parent | cdaecff49f9b06d74de87e217659c13b2b2bba98 (diff) | |
parent | 8125cd8915a1601280327503ce3ac14e0a356771 (diff) |
* Merge diff between trunk/pkgs@1646 and branches/nixos-pkgs@2256;
this contains mostly Armijn's pure stdenv-linux. * After unpacking the statically linked GCC, patch all store paths to /nix/store/ffffffffffffffffffffffffffffffff. Ugly hack to prevent undeclared references but it works. * We don't need Glib's dynamic libraries in the first bootstrap stage; delete them. Actually the downloaded Glibc binary is only needed for building Glibc, since GCC needs a C compiler to build some programs in `configure'. So static linking is fine for that. Maybe it would be better to patch `configure' so that we don't need a pre-built Glibc at all. * Set the svn:executable property on `cp' and `patchelf'. * In Glibc, revert to LinuxThreads. Maybe NPTL will work, but TLS support is a problem. * Delete most Glibc patches; they're no longer needed since the branch updated it to 20050110. * Some cleanups. svn path=/nixpkgs/trunk/; revision=2258
Diffstat (limited to 'pkgs/stdenv/nix-linux-static/default.nix')
-rw-r--r-- | pkgs/stdenv/nix-linux-static/default.nix | 159 |
1 files changed, 144 insertions, 15 deletions
diff --git a/pkgs/stdenv/nix-linux-static/default.nix b/pkgs/stdenv/nix-linux-static/default.nix index d4afccabe6ba3..f8121fb540231 100644 --- a/pkgs/stdenv/nix-linux-static/default.nix +++ b/pkgs/stdenv/nix-linux-static/default.nix @@ -1,22 +1,151 @@ -{stdenv, glibc, pkgs, genericStdenv, gccWrapper}: +rec { -genericStdenv { - name = "stdenv-nix-linux-static"; - preHook = ./prehook.sh; - initialPath = (import ./path.nix) {pkgs = (import ./pkgs.nix) {stdenv = stdenv;};}; + 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; + cp = ./tools/cp; + system = "i686-linux"; + args = [ ./scripts/curl-unpack ]; + }; + + download = + { url, pkgname, postProcess ? [], addToPath ? [] + , extra ? null, extra2 ? null + , 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; + cp = ./tools/cp; + system = "i686-linux"; + args = [ ./scripts/download-script ]; + inherit postProcess addToPath extra extra2 extra3 extra4 patchelf; + }; + + 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"; + }; - inherit stdenv; + gnumake = download { + url = http://losser.st-lab.cs.uu.nl/~armijn/.nix/make-3.80-static.tar.gz; + pkgname = "gnumake"; + }; + + binutils = download { + url = http://losser.st-lab.cs.uu.nl/~armijn/.nix/binutils-2.15-static.tar.gz; + 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"; + }; - gcc = gccWrapper { - #name = pkgs.gcc.name; - nativeTools = false; - nativeGlibc = false; - inherit (pkgs) binutils; - gcc = (import ./gcc-static) {stdenv = stdenv;}; - inherit stdenv glibc; - shell = pkgs.bash ~ /bin/sh; + gnugrep = download { + url = http://losser.st-lab.cs.uu.nl/~armijn/.nix/grep-2.5.1-static.tar.gz; + pkgname = "gnugrep"; }; - shell = pkgs.bash ~ /bin/sh; + gcc = (download {url = http://losser.st-lab.cs.uu.nl/~armijn/.nix/gcc-3.4.2-static.tar.gz; + pkgname = "gcc"; + postProcess = [./scripts/fix-outpath.sh]; + addToPath = [coreutils findutils gnused]; + }) // { 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; + pkgname = "glibc"; + patchelf = ./patchelf-static/bin/patchelf; + postProcess = [./scripts/add-symlink.sh /* ./scripts/fix-outpath.sh */]; + addToPath = [coreutils findutils gnused]; + extra = linuxHeaders; + }; + + + stdenvInitial = let { + + body = derivation { + name = "stdenv-linux-static-initial"; + system = "i686-linux"; + builder = ./bash-static/bash; + args = ./scripts/builder-stdenv-initial.sh; + inherit coreutils gnused; + } // { + mkDerivation = attrs: derivation (attrs // { + builder = ./bash-static/bash; + args = ["-e" attrs.builder]; + stdenv = body; + system = body.system; + }); + + shell = ./bash-static/bash; + }; + }; + + + stdenvBootFun = {glibc, gcc, binutils, staticGlibc}: (import ../generic) { + name = "stdenv-linux-static-boot"; + param1 = if staticGlibc then "static" else "dynamic"; + preHook = ./prehook.sh; + stdenv = stdenvInitial; + shell = ./bash-static/bash; + gcc = (import ../../build-support/gcc-wrapper) { + stdenv = stdenvInitial; + nativeTools = false; + nativeGlibc = false; + inherit gcc glibc binutils; + }; + initialPath = [ + coreutils + ./gnutar-static + ./gzip-static + bzip2 + gnused + gnugrep + gawk + gnumake + findutils + diffutils + patch + ./patchelf-static + ]; + }; } |