summary refs log tree commit diff
path: root/pkgs/stdenv/adapters.nix
diff options
context:
space:
mode:
authorLluís Batlle i Rossell <viric@vicerveza.homeunix.net>2009-11-19 23:05:11 +0000
committerLluís Batlle i Rossell <viric@vicerveza.homeunix.net>2009-11-19 23:05:11 +0000
commit6f3630e1289923de7d7b3e720fac56013fe7aea6 (patch)
treec62613c86c80eac522ad1e1b267272be3bee5997 /pkgs/stdenv/adapters.nix
parent40e564c87c69ff193d64ed3ac8de5deb47c7b664 (diff)
downloadnixpkgs-6f3630e1289923de7d7b3e720fac56013fe7aea6.tar
nixpkgs-6f3630e1289923de7d7b3e720fac56013fe7aea6.tar.gz
nixpkgs-6f3630e1289923de7d7b3e720fac56013fe7aea6.tar.bz2
nixpkgs-6f3630e1289923de7d7b3e720fac56013fe7aea6.tar.lz
nixpkgs-6f3630e1289923de7d7b3e720fac56013fe7aea6.tar.xz
nixpkgs-6f3630e1289923de7d7b3e720fac56013fe7aea6.tar.zst
nixpkgs-6f3630e1289923de7d7b3e720fac56013fe7aea6.zip
Attention, people who care on the builders for native builds. In the stdenv
derivation, the "buildInputs" in every stdenv mkDerivation don't map now
directly to the environment
variable "buildInputs" in the builder, but "buildNativeInputs". So, the inputs
build by the native compiler.
When cross compiling, they will map to the environment variable "buildInputs"
(yes, now the same name), which means does to be built with the cross compiler.

I think I improved the naming of variables a bit. There was a big mess,
specially in the stdenv adapter for cross building, and also in the default
builder script.

I also tried to add proper manager of propagatedInputBuilds, these being
propagated considering the host or build origin of that input build (so, at the
end, being those propagatedInputBuilds being propagated properly to the native
or the cross compiler.


svn path=/nixpkgs/branches/stdenv-updates/; revision=18477
Diffstat (limited to 'pkgs/stdenv/adapters.nix')
-rw-r--r--pkgs/stdenv/adapters.nix30
1 files changed, 22 insertions, 8 deletions
diff --git a/pkgs/stdenv/adapters.nix b/pkgs/stdenv/adapters.nix
index 1b739f85168..f6939f57e62 100644
--- a/pkgs/stdenv/adapters.nix
+++ b/pkgs/stdenv/adapters.nix
@@ -111,20 +111,34 @@ rec {
   # builds.
   makeStdenvCross = stdenv: cross: binutilsCross: gccCross: stdenv //
     { mkDerivation = {name, buildInputs ? [], buildNativeInputs ? [],
-            propagatedBuildInputs ? [], ...}@args: let
-            # propagatedBuildInputs exists temporarily as another name for
-            # propagatedHostInputs.
+            propagatedBuildInputs ? [], propagatedBuildNativeInputs ? [], ...}@args: let
+
+            # *BuildInputs exists temporarily as another name for
+            # *HostInputs.
+
             getBuildDrv = drv : if (drv ? buildDrv) then drv.buildDrv else drv;
-            buildInputsDrvs = map (getBuildDrv) buildNativeInputs;
-            hostInputsDrvs = map (drv: drv.hostDrv) buildInputs;
-            hostInputsDrvsAsBuildInputs = map (getBuildDrv) buildInputs;
-            propagatedHostInputsDrvs = map (drv: drv.buildDrv) (propagatedBuildInputs);
+            buildNativeInputsDrvs = map (getBuildDrv) buildNativeInputs;
+            buildInputsDrvs = map (drv: drv.hostDrv) buildInputs;
+            buildInputsDrvsAsBuildInputs = map (getBuildDrv) buildInputs;
+            propagatedBuildInputsDrvs = map (drv: drv.hostDrv) (propagatedBuildInputs);
+            propagatedBuildNativeInputsDrvs = map (drv: drv.buildDrv)
+                (propagatedBuildNativeInputs);
+
+            # The base stdenv already knows that buildNativeInputs and
+            # buildInputs should be built with the usual gcc-wrapper
+            # And the same for propagatedBuildInputs.
             buildDrv = stdenv.mkDerivation args;
+
+            # We should overwrite the input attributes in hostDrv, to overwrite
+            # the defaults for only-native builds in the base stdenv
             hostDrv = if (cross == null) then buildDrv else
                 stdenv.mkDerivation (args // {
                     name = name + "-" + cross.config;
-                    buildInputs = buildInputsDrvs
+                    buildNativeInputs = buildNativeInputsDrvs
                       ++ [ gccCross binutilsCross ];
+                    buildInputs = buildInputsDrvs;
+                    propagatedBuildInputs = propagatedBuildInputsDrvs;
+                    propagatedBuildNativeInputs = propagatedBuildNativeInputsDrvs;
 
                     crossConfig = cross.config;
                 });