diff --git a/pkgs/stdenv/darwin/make-bootstrap-tools.nix b/pkgs/stdenv/darwin/make-bootstrap-tools.nix index bd581f71a436..c862eb141a8c 100644 --- a/pkgs/stdenv/darwin/make-bootstrap-tools.nix +++ b/pkgs/stdenv/darwin/make-bootstrap-tools.nix @@ -334,7 +334,7 @@ in rec { # The ultimate test: bootstrap a whole stdenv from the tools specified above and get a package set out of it test-pkgs = import test-pkgspath { inherit system; - stdenv = args: let + stdenvFunc = args: let args' = args // { inherit bootstrapFiles; }; in (import (test-pkgspath + "/pkgs/stdenv/darwin") args').stdenvDarwin; }; diff --git a/pkgs/stdenv/linux/bootstrap/armv5tel.nix b/pkgs/stdenv/linux/bootstrap-files/armv5tel.nix similarity index 100% rename from pkgs/stdenv/linux/bootstrap/armv5tel.nix rename to pkgs/stdenv/linux/bootstrap-files/armv5tel.nix diff --git a/pkgs/stdenv/linux/bootstrap/armv6l.nix b/pkgs/stdenv/linux/bootstrap-files/armv6l.nix similarity index 100% rename from pkgs/stdenv/linux/bootstrap/armv6l.nix rename to pkgs/stdenv/linux/bootstrap-files/armv6l.nix diff --git a/pkgs/stdenv/linux/bootstrap/armv7l.nix b/pkgs/stdenv/linux/bootstrap-files/armv7l.nix similarity index 100% rename from pkgs/stdenv/linux/bootstrap/armv7l.nix rename to pkgs/stdenv/linux/bootstrap-files/armv7l.nix diff --git a/pkgs/stdenv/linux/bootstrap/i686.nix b/pkgs/stdenv/linux/bootstrap-files/i686.nix similarity index 100% rename from pkgs/stdenv/linux/bootstrap/i686.nix rename to pkgs/stdenv/linux/bootstrap-files/i686.nix diff --git a/pkgs/stdenv/linux/bootstrap/loongson2f.nix b/pkgs/stdenv/linux/bootstrap-files/loongson2f.nix similarity index 100% rename from pkgs/stdenv/linux/bootstrap/loongson2f.nix rename to pkgs/stdenv/linux/bootstrap-files/loongson2f.nix diff --git a/pkgs/stdenv/linux/bootstrap/x86_64.nix b/pkgs/stdenv/linux/bootstrap-files/x86_64.nix similarity index 100% rename from pkgs/stdenv/linux/bootstrap/x86_64.nix rename to pkgs/stdenv/linux/bootstrap-files/x86_64.nix diff --git a/pkgs/stdenv/linux/bootstrap-tools/default.nix b/pkgs/stdenv/linux/bootstrap-tools/default.nix new file mode 100644 index 000000000000..6118585d545f --- /dev/null +++ b/pkgs/stdenv/linux/bootstrap-tools/default.nix @@ -0,0 +1,18 @@ +{ system, bootstrapFiles }: + +derivation { + name = "bootstrap-tools"; + + builder = bootstrapFiles.busybox; + + args = [ "ash" "-e" ./scripts/unpack-bootstrap-tools.sh ]; + + tarball = bootstrapFiles.bootstrapTools; + + inherit system; + + # Needed by the GCC wrapper. + langC = true; + langCC = true; + isGNU = true; +} diff --git a/pkgs/stdenv/linux/scripts/unpack-bootstrap-tools.sh b/pkgs/stdenv/linux/bootstrap-tools/scripts/unpack-bootstrap-tools.sh similarity index 100% rename from pkgs/stdenv/linux/scripts/unpack-bootstrap-tools.sh rename to pkgs/stdenv/linux/bootstrap-tools/scripts/unpack-bootstrap-tools.sh diff --git a/pkgs/stdenv/linux/default.nix b/pkgs/stdenv/linux/default.nix index 34196359f525..9900fc6dd3d5 100644 --- a/pkgs/stdenv/linux/default.nix +++ b/pkgs/stdenv/linux/default.nix @@ -7,12 +7,12 @@ , system, platform, crossSystem, config , bootstrapFiles ? - if system == "i686-linux" then import ./bootstrap/i686.nix - else if system == "x86_64-linux" then import ./bootstrap/x86_64.nix - else if system == "armv5tel-linux" then import ./bootstrap/armv5tel.nix - else if system == "armv6l-linux" then import ./bootstrap/armv6l.nix - else if system == "armv7l-linux" then import ./bootstrap/armv7l.nix - else if system == "mips64el-linux" then import ./bootstrap/loongson2f.nix + if system == "i686-linux" then import ./bootstrap-files/i686.nix + else if system == "x86_64-linux" then import ./bootstrap-files/x86_64.nix + else if system == "armv5tel-linux" then import ./bootstrap-files/armv5tel.nix + else if system == "armv6l-linux" then import ./bootstrap-files/armv6l.nix + else if system == "armv7l-linux" then import ./bootstrap-files/armv7l.nix + else if system == "mips64el-linux" then import ./bootstrap-files/loongson2f.nix else abort "unsupported platform for the pure Linux stdenv" }: @@ -37,22 +37,7 @@ rec { # Download and unpack the bootstrap tools (coreutils, GCC, Glibc, ...). - bootstrapTools = derivation { - name = "bootstrap-tools"; - - builder = bootstrapFiles.busybox; - - args = [ "ash" "-e" ./scripts/unpack-bootstrap-tools.sh ]; - - tarball = bootstrapFiles.bootstrapTools; - - inherit system; - - # Needed by the GCC wrapper. - langC = true; - langCC = true; - isGNU = true; - }; + bootstrapTools = import ./bootstrap-tools { inherit system bootstrapFiles; }; # This function builds the various standard environments used during diff --git a/pkgs/stdenv/linux/make-bootstrap-tools.nix b/pkgs/stdenv/linux/make-bootstrap-tools.nix index 7063d7bfcb6a..e13fb88eff0b 100644 --- a/pkgs/stdenv/linux/make-bootstrap-tools.nix +++ b/pkgs/stdenv/linux/make-bootstrap-tools.nix @@ -173,16 +173,7 @@ rec { bootstrapTools = "${build}/on-server/bootstrap-tools.tar.xz"; }; - bootstrapTools = (import ./default.nix { - inherit system bootstrapFiles; - - lib = assert false; null; - allPackages = assert false; null; - - platform = assert false; null; - crossSystem = assert false; null; - config = assert false; null; - }).bootstrapTools; + bootstrapTools = import ./bootstrap-tools { inherit system bootstrapFiles; }; test = derivation { name = "test-bootstrap-tools"; diff --git a/pkgs/top-level/default.nix b/pkgs/top-level/default.nix index 31c51215676b..658f149908c7 100644 --- a/pkgs/top-level/default.nix +++ b/pkgs/top-level/default.nix @@ -25,7 +25,7 @@ , # The standard environment for building packages, or rather a function # providing it. See below for the arguments given to that function. - stdenv ? assert false; null + stdenvFunc ? import ../stdenv , crossSystem ? null , platform ? assert false; null @@ -76,7 +76,7 @@ in let inherit lib nixpkgsFun; } // newArgs); - stdenv = (args.stdenv or (import ../stdenv)) { + stdenv = stdenvFunc { inherit lib allPackages system platform crossSystem config; };