commit some stuff
svn path=/nixpkgs/branches/nixos-pkgs/; revision=1678
This commit is contained in:
parent
bb421a4972
commit
a8fa64c3da
|
@ -1,22 +1,135 @@
|
||||||
{stdenv, glibc, pkgs, genericStdenv, gccWrapper}:
|
rec {
|
||||||
|
|
||||||
genericStdenv {
|
curl = derivation {
|
||||||
name = "stdenv-nix-linux-static";
|
name = "curl";
|
||||||
preHook = ./prehook.sh;
|
builder = ./bash-static/bash;
|
||||||
initialPath = (import ./path.nix) {pkgs = (import ./pkgs.nix) {stdenv = stdenv;};};
|
tar = ./gnutar-static/bin/tar;
|
||||||
|
gunzip = ./gzip-static/bin/gunzip;
|
||||||
inherit stdenv;
|
curl = ./curl-static/curl-7.12.0-static.tar.gz;
|
||||||
|
cp = ./tools/cp;
|
||||||
gcc = gccWrapper {
|
system = "i686-linux";
|
||||||
#name = pkgs.gcc.name;
|
args = [ ./scripts/curl-unpack ];
|
||||||
nativeTools = false;
|
|
||||||
nativeGlibc = false;
|
|
||||||
inherit (pkgs) binutils;
|
|
||||||
gcc = (import ./gcc-static) {stdenv = stdenv;};
|
|
||||||
inherit stdenv glibc;
|
|
||||||
shell = pkgs.bash ~ /bin/sh;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
shell = pkgs.bash ~ /bin/sh;
|
download = {url, pkgname, postprocess ? null, extra ? null, extra2 ? 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 extra;
|
||||||
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
|
glibc = derivation {
|
||||||
|
name = "glibc";
|
||||||
|
builder = ./bash;
|
||||||
|
tar = ../gnutar-static/bin/tar;
|
||||||
|
glibc_src = ./glibc-2.3.3.tar.bz2;
|
||||||
|
glibc_threads_src = ./glibc-linuxthreads-2.3.3.tar.bz2;
|
||||||
|
patch1 = ./no-unit-at-a-time.patch;
|
||||||
|
patch2 = ./fixup.patch;
|
||||||
|
inherit bzip2 gnumake binutils gcc coreutils gnused diffutils gnugrep gawk linuxHeaders patch;
|
||||||
|
gzip_path = ../gzip-static/bin;
|
||||||
|
system = "i686-linux";
|
||||||
|
args = [ ./script3 ];
|
||||||
|
};
|
||||||
|
*/
|
||||||
|
|
||||||
|
coreutils = download {url = http://losser.st-lab.cs.uu.nl/~armijn/.nix/coreutils-5.0-static.tar.gz; pkgname = "coreutils";};
|
||||||
|
|
||||||
|
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";};
|
||||||
|
|
||||||
|
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";};
|
||||||
|
|
||||||
|
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; pkgname = "gcc";}) //
|
||||||
|
{ 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";
|
||||||
|
postprocess = ./scripts/add-symlink.sh;
|
||||||
|
extra = linuxHeaders;
|
||||||
|
extra2 = coreutils;
|
||||||
|
};
|
||||||
|
|
||||||
|
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}: (import ../generic) {
|
||||||
|
name = "stdenv-linux-static-boot";
|
||||||
|
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
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
stdenvBoot = stdenvBootFun {inherit glibc;};
|
||||||
|
|
||||||
|
fetchurl = (import ../../build-support/fetchurl) {
|
||||||
|
stdenv = stdenvBoot;
|
||||||
|
inherit curl;
|
||||||
|
};
|
||||||
|
|
||||||
|
aterm = (import ../../development/libraries/aterm) {
|
||||||
|
stdenv = stdenvBoot;
|
||||||
|
inherit fetchurl;
|
||||||
|
};
|
||||||
|
|
||||||
|
body = [coreutils bzip2 gnumake binutils diffutils gcc glibc gnused gnugrep diffutils gawk];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,41 +28,42 @@
|
||||||
inherit genericStdenv gccWrapper;
|
inherit genericStdenv gccWrapper;
|
||||||
};
|
};
|
||||||
|
|
||||||
stdenvNativePkgsFun = bootstrap: allPackages {
|
stdenvNativePkgs = allPackages {
|
||||||
stdenv = stdenvNative;
|
stdenv = stdenvNative;
|
||||||
bootCurl = null;
|
bootCurl = null;
|
||||||
noSysDirs = false;
|
noSysDirs = false;
|
||||||
gccWithCC = !bootstrap;
|
|
||||||
gccWithProfiling = !bootstrap;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
stdenvNativePkgs = stdenvNativePkgsFun false;
|
|
||||||
|
|
||||||
|
|
||||||
# The Nix build environment.
|
# The Nix build environment.
|
||||||
stdenvNixFun = bootstrap: (import ../stdenv/nix) {
|
stdenvNix = (import ../stdenv/nix) {
|
||||||
stdenv = stdenvNative;
|
stdenv = stdenvNative;
|
||||||
pkgs = stdenvNativePkgsFun bootstrap;
|
pkgs = stdenvNativePkgs;
|
||||||
inherit genericStdenv gccWrapper;
|
inherit genericStdenv gccWrapper;
|
||||||
};
|
};
|
||||||
|
|
||||||
stdenvNix = stdenvNixFun false;
|
stdenvNixPkgs = allPackages {
|
||||||
|
stdenv = stdenvNix;
|
||||||
stdenvNixPkgsFun = bootstrap: allPackages {
|
bootCurl = stdenvNativePkgs.curl;
|
||||||
stdenv = stdenvNixFun bootstrap;
|
|
||||||
bootCurl = (stdenvNativePkgsFun bootstrap).curl;
|
|
||||||
noSysDirs = false;
|
noSysDirs = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
stdenvNixPkgs = stdenvNixPkgs false;
|
|
||||||
|
|
||||||
|
|
||||||
# The Linux build environment is a fully bootstrapped Nix
|
# The Linux build environment is a fully bootstrapped Nix
|
||||||
# environment, that is, it should contain no external references.
|
# environment, that is, it should contain no external references.
|
||||||
|
|
||||||
|
# 0) ...
|
||||||
|
stdenvLinuxBoot0 = (import ../stdenv/nix-linux-static).stdenvBoot;
|
||||||
|
|
||||||
|
stdenvLinuxBoot0Pkgs = allPackages {
|
||||||
|
stdenv = stdenvLinuxBoot0;
|
||||||
|
bootCurl = (import ../stdenv/nix-linux-static).curl;
|
||||||
|
noSysDirs = true;
|
||||||
|
};
|
||||||
|
|
||||||
# 1) Build glibc in the Nix build environment. The result is
|
# 1) Build glibc in the Nix build environment. The result is
|
||||||
# pure.
|
# pure.
|
||||||
stdenvLinuxGlibc = (stdenvNixPkgsFun true).glibc;
|
stdenvLinuxGlibc = stdenvLinuxBoot0Pkgs.glibc;
|
||||||
|
|
||||||
# 2) Construct a stdenv consisting of the Nix build environment, but
|
# 2) Construct a stdenv consisting of the Nix build environment, but
|
||||||
# with a gcc-wrapper that causes linking against the glibc from
|
# with a gcc-wrapper that causes linking against the glibc from
|
||||||
|
@ -70,11 +71,8 @@
|
||||||
# native system directories (e.g., `/usr/lib'), it doesn't
|
# native system directories (e.g., `/usr/lib'), it doesn't
|
||||||
# prevent impurity in the things it builds (e.g., through
|
# prevent impurity in the things it builds (e.g., through
|
||||||
# `-lncurses').
|
# `-lncurses').
|
||||||
stdenvLinuxBoot1 = (import ../stdenv/nix-linux) {
|
stdenvLinuxBoot1 = (import ../stdenv/nix-linux-static).stdenvBootFun {
|
||||||
stdenv = stdenvNative;
|
|
||||||
pkgs = stdenvNativePkgsFun true;
|
|
||||||
glibc = stdenvLinuxGlibc;
|
glibc = stdenvLinuxGlibc;
|
||||||
inherit genericStdenv gccWrapper;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
# 3) Now we can build packages that will link against the Nix
|
# 3) Now we can build packages that will link against the Nix
|
||||||
|
@ -84,10 +82,8 @@
|
||||||
# *doesn't* search in `/lib' etc. So these programs won't work.
|
# *doesn't* search in `/lib' etc. So these programs won't work.
|
||||||
stdenvLinuxBoot1Pkgs = allPackages {
|
stdenvLinuxBoot1Pkgs = allPackages {
|
||||||
stdenv = stdenvLinuxBoot1;
|
stdenv = stdenvLinuxBoot1;
|
||||||
bootCurl = (stdenvNativePkgsFun true).curl;
|
bootCurl = (import ../stdenv/nix-linux-static).curl;
|
||||||
noSysDirs = true;
|
noSysDirs = true;
|
||||||
gccWithCC = false;
|
|
||||||
gccWithProfiling = false;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
# 4) Therefore we build a new standard environment which is the same
|
# 4) Therefore we build a new standard environment which is the same
|
||||||
|
@ -96,7 +92,7 @@
|
||||||
# system directories), things built by this stdenv should be pure.
|
# system directories), things built by this stdenv should be pure.
|
||||||
stdenvLinuxBoot2 = (import ../stdenv/nix-linux) {
|
stdenvLinuxBoot2 = (import ../stdenv/nix-linux) {
|
||||||
stdenv = stdenvLinuxBoot1;
|
stdenv = stdenvLinuxBoot1;
|
||||||
pkgs = (stdenvNativePkgsFun true) // {
|
pkgs = stdenvLinuxBoot0Pkgs // {
|
||||||
inherit (stdenvLinuxBoot1Pkgs) gcc binutils;
|
inherit (stdenvLinuxBoot1Pkgs) gcc binutils;
|
||||||
};
|
};
|
||||||
glibc = stdenvLinuxGlibc;
|
glibc = stdenvLinuxGlibc;
|
||||||
|
@ -106,7 +102,7 @@
|
||||||
# 5) So these packages should be pure.
|
# 5) So these packages should be pure.
|
||||||
stdenvLinuxBoot2Pkgs = allPackages {
|
stdenvLinuxBoot2Pkgs = allPackages {
|
||||||
stdenv = stdenvLinuxBoot2;
|
stdenv = stdenvLinuxBoot2;
|
||||||
bootCurl = (stdenvNativePkgsFun true).curl;
|
bootCurl = stdenvLinuxBoot0Pkgs.curl;
|
||||||
};
|
};
|
||||||
|
|
||||||
# 6) Finally we can construct the Nix build environment from the
|
# 6) Finally we can construct the Nix build environment from the
|
||||||
|
@ -148,7 +144,7 @@
|
||||||
# (essentially it's just the native environment).
|
# (essentially it's just the native environment).
|
||||||
stdenvDarwin = (import ../stdenv/darwin) {
|
stdenvDarwin = (import ../stdenv/darwin) {
|
||||||
stdenv = stdenvInitial;
|
stdenv = stdenvInitial;
|
||||||
genericStdenv = import ../stdenv/generic;
|
genericStdenv = import ../stdenv/generic-branch;
|
||||||
inherit gccWrapper;
|
inherit gccWrapper;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -157,5 +153,21 @@
|
||||||
bootCurl = null;
|
bootCurl = null;
|
||||||
noSysDirs = false;
|
noSysDirs = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
# Testing the new stdenv-linux (TODO: remove this eventually).
|
||||||
|
stdenvLinuxTest = (import ../stdenv/nix-linux) {
|
||||||
|
stdenv = stdenvLinuxBoot2;
|
||||||
|
pkgs = stdenvLinuxBoot2Pkgs;
|
||||||
|
glibc = stdenvLinuxGlibc;
|
||||||
|
genericStdenv = import ../stdenv/generic-branch;
|
||||||
|
inherit gccWrapper;
|
||||||
|
};
|
||||||
|
|
||||||
|
stdenvDarwinTest = (import ../stdenv/darwin) {
|
||||||
|
stdenv = stdenvInitial;
|
||||||
|
genericStdenv = import ../stdenv/generic-branch;
|
||||||
|
inherit gccWrapper;
|
||||||
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue