diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2010-08-06 10:34:34 +0000 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2010-08-06 10:34:34 +0000 |
commit | a1e834e85ade13317ed51853b600d5df5a870d50 (patch) | |
tree | bff6ce9d58075b6281c53487cd40644854c61233 /pkgs/stdenv | |
parent | d8ba69a16eebb64328287ac997e7f6d3019476a5 (diff) |
* Get rid of the ugly `useFromStdenv' hack in all-packages.nix.
Instead, use the generic package override mechanism to use packages from earlier bootstrap phases. * Don't rely on the existence of attributes such as `stdenv.coreutils'. svn path=/nixpkgs/trunk/; revision=22991
Diffstat (limited to 'pkgs/stdenv')
-rw-r--r-- | pkgs/stdenv/generic/default.nix | 3 | ||||
-rw-r--r-- | pkgs/stdenv/linux/default.nix | 23 | ||||
-rw-r--r-- | pkgs/stdenv/mingw/default.nix | 2 |
3 files changed, 18 insertions, 10 deletions
diff --git a/pkgs/stdenv/generic/default.nix b/pkgs/stdenv/generic/default.nix index 4b988ef524a86..585bb2f7fe17e 100644 --- a/pkgs/stdenv/generic/default.nix +++ b/pkgs/stdenv/generic/default.nix @@ -1,6 +1,6 @@ { system, name, preHook ? null, postHook ? null, initialPath, gcc, shell , param1 ? "", param2 ? "", param3 ? "", param4 ? "", param5 ? "" -, extraAttrs ? {} +, extraAttrs ? {}, overrides ? {} , # The `fetchurl' to use for downloading curl and its dependencies # (see all-packages.nix). @@ -118,6 +118,7 @@ let inherit fetchurlBoot; + inherit overrides; } # Propagate any extra attributes. For instance, we use this to diff --git a/pkgs/stdenv/linux/default.nix b/pkgs/stdenv/linux/default.nix index dd5647bec4560..71aee5912e7fd 100644 --- a/pkgs/stdenv/linux/default.nix +++ b/pkgs/stdenv/linux/default.nix @@ -73,7 +73,7 @@ rec { # This function builds the various standard environments used during # the bootstrap. stdenvBootFun = - {gcc, extraAttrs ? {}, extraPath ? [], fetchurl}: + {gcc, extraAttrs ? {}, overrides ? {}, extraPath ? [], fetchurl}: import ../generic { inherit system; @@ -89,8 +89,10 @@ rec { shell = "${bootstrapTools}/bin/sh"; initialPath = [bootstrapTools] ++ extraPath; fetchurlBoot = fetchurl; - inherit gcc; - extraAttrs = extraAttrs // {inherit fetchurl;}; + inherit gcc extraAttrs; + overrides = overrides // { + inherit fetchurl; + }; }; # Build a dummy stdenv with no GCC or working fetchurl. This is @@ -168,7 +170,7 @@ rec { coreutils = bootstrapTools; libc = stdenvLinuxGlibc; }; - extraAttrs = { + overrides = { glibc = stdenvLinuxGlibc; inherit (stdenvLinuxBoot1Pkgs) perl; }; @@ -195,7 +197,7 @@ rec { gcc = stdenvLinuxBoot2Pkgs.gcc.gcc; name = ""; }; - extraAttrs = { + overrides = { inherit (stdenvLinuxBoot1Pkgs) perl; }; inherit fetchurl; @@ -215,7 +217,7 @@ rec { # # When updating stdenvLinux, make sure that the result has no # dependency (`nix-store -qR') on bootstrapTools. - stdenvLinux = import ../generic { + stdenvLinux = import ../generic rec { name = "stdenv-linux"; inherit system; @@ -240,10 +242,15 @@ rec { fetchurlBoot = fetchurl; extraAttrs = { - inherit (stdenvLinuxBoot2Pkgs) binutils /* gcc */ glibc; + inherit (stdenvLinuxBoot2Pkgs) glibc; + }; + + overrides = { + inherit gcc; + inherit (stdenvLinuxBoot2Pkgs) binutils glibc; inherit (stdenvLinuxBoot3Pkgs) gzip bzip2 bash coreutils diffutils findutils gawk - gnumake gnused gnutar gnugrep patch patchelf + gnumake gnused gnutar gnugrep gnupatch patchelf attr acl; }; }; diff --git a/pkgs/stdenv/mingw/default.nix b/pkgs/stdenv/mingw/default.nix index bedf3986d1701..71c974cfad856 100644 --- a/pkgs/stdenv/mingw/default.nix +++ b/pkgs/stdenv/mingw/default.nix @@ -62,7 +62,7 @@ let { body = stdenv // mkDerivationFun // { inherit fetchurl; - pkgconfig = pkgconfigBin; + overrides.pkgconfig = pkgconfigBin; }; shell = |