* Push packages from the final stdenv bootstrapping phase to

all-packages.  That is, an attribute like "bash" in all-packages.nix
  should evaluate to the "bash" used to build stdenv, it shouldn't
  build a new one.

  Hm, this would be a lot cleaner if we had lazy_rec ;-)

svn path=/nixpkgs/branches/usability/; revision=4775
This commit is contained in:
Eelco Dolstra
2006-02-09 17:04:18 +00:00
parent 29c64c6c67
commit 07bc3fbf00
3 changed files with 83 additions and 67 deletions

View File

@@ -114,22 +114,26 @@ rec {
# This function builds the various standard environments used during
# the bootstrap.
stdenvBootFun = {glibc, gcc, binutils, staticGlibc}: (import ../generic) {
name = "stdenv-linux-boot";
param1 = if staticGlibc then "static" else "dynamic";
preHook = ./prehook.sh;
stdenv = stdenvInitial;
shell = ./tools/bash;
gcc = (import ../../build-support/gcc-wrapper) {
stdenvBootFun =
{glibc, gcc, binutils, staticGlibc, extraAttrs ? {}}:
import ../generic {
name = "stdenv-linux-boot";
param1 = if staticGlibc then "static" else "dynamic";
preHook = ./prehook.sh;
stdenv = stdenvInitial;
nativeTools = false;
nativeGlibc = false;
inherit gcc glibc binutils;
shell = ./tools/bash;
gcc = (import ../../build-support/gcc-wrapper) {
stdenv = stdenvInitial;
nativeTools = false;
nativeGlibc = false;
inherit gcc glibc binutils;
};
initialPath = [
staticTools
];
inherit extraAttrs;
};
initialPath = [
staticTools
];
};
# Create the first "real" standard environment. This one consists
@@ -139,13 +143,13 @@ rec {
# Use the statically linked, downloaded glibc/gcc/binutils.
inherit glibc gcc binutils;
staticGlibc = true;
extraAttrs = {inherit curl;};
};
# 2) These are the packages that we can build with the first
# stdenv. We only need Glibc (in step 3).
stdenvLinuxBoot1Pkgs = allPackages {
bootStdenv = stdenvLinuxBoot1;
# bootCurl = curl;
};
# 3) Build Glibc with the statically linked tools. The result is the
@@ -159,12 +163,12 @@ rec {
glibc = stdenvLinuxGlibc;
staticGlibc = false;
inherit gcc binutils;
extraAttrs = {inherit curl;};
};
# 5) The packages that can be built using the second stdenv.
stdenvLinuxBoot2Pkgs = allPackages {
bootStdenv = stdenvLinuxBoot2;
# bootCurl = curl;
};
# 6) Construct a third stdenv identical to the second, except that
@@ -174,12 +178,12 @@ rec {
glibc = stdenvLinuxGlibc;
staticGlibc = false;
inherit (stdenvLinuxBoot2Pkgs) gcc binutils;
extraAttrs = {inherit curl;};
};
# 7) The packages that can be built using the third stdenv.
stdenvLinuxBoot3Pkgs = allPackages {
bootStdenv = stdenvLinuxBoot3;
# bootCurl = curl;
};
# 8) Construct the final stdenv. It uses the Glibc, GCC and
@@ -205,20 +209,14 @@ rec {
};
shell = stdenvLinuxBoot3Pkgs.bash ~ /bin/sh;
extraAttrs = {
curl = stdenvLinuxBoot3Pkgs.realCurl;
inherit (stdenvLinuxBoot2Pkgs) binutils /* gcc */;
inherit (stdenvLinuxBoot3Pkgs)
gzip bzip2 bash coreutils diffutils findutils gawk
gnumake gnused gnutar gnugrep patch patchelf;
};
};
# 8) Finally, the set of components built using the Linux stdenv.
# Reuse the tools built in the previous steps.
stdenvLinuxPkgs =
allPackages {
bootStdenv = stdenvLinux;
# bootCurl = stdenvLinuxBoot3Pkgs.curl;
} //
{inherit (stdenvLinuxBoot2Pkgs) binutils gcc;} //
{inherit (stdenvLinuxBoot3Pkgs)
gzip bzip2 bash coreutils diffutils findutils gawk
gnumake gnused gnutar gnugrep curl patch patchelf;
} //
{glibc = stdenvLinuxGlibc;};
}