diff options
author | Lluís Batlle i Rossell <viric@vicerveza.homeunix.net> | 2009-11-19 19:03:34 +0000 |
---|---|---|
committer | Lluís Batlle i Rossell <viric@vicerveza.homeunix.net> | 2009-11-19 19:03:34 +0000 |
commit | 7ade207f6b75da0fde94cec621ac6d8fa6c3e586 (patch) | |
tree | b5994c723b674476a839f5ccbadb7431bce3f9b3 /pkgs/stdenv/adapters.nix | |
parent | 56ed820f84101fc7b7cc47cbb1f57e616f35ac73 (diff) | |
download | nixlib-7ade207f6b75da0fde94cec621ac6d8fa6c3e586.tar nixlib-7ade207f6b75da0fde94cec621ac6d8fa6c3e586.tar.gz nixlib-7ade207f6b75da0fde94cec621ac6d8fa6c3e586.tar.bz2 nixlib-7ade207f6b75da0fde94cec621ac6d8fa6c3e586.tar.lz nixlib-7ade207f6b75da0fde94cec621ac6d8fa6c3e586.tar.xz nixlib-7ade207f6b75da0fde94cec621ac6d8fa6c3e586.tar.zst nixlib-7ade207f6b75da0fde94cec621ac6d8fa6c3e586.zip |
- Removed all *NoCross expressions I dupilcated in nixpkgs, while maintaining
the cross compilation functionality. - I renamed some expected stdenv.mkDerivation parameter attributes so we can keep this branch properly updated from trunk. We agreed with Nicolas Pierron doing a massive renaming, so all current buildInputs become hostInputs (input as build for the host machine, in autotools terminology) , and then buildInputs would mean "input as for the build machine". By now, the specific "input as for the build machine" is specified through buildNativeInputs. We should fix this in the merge to trunk. - I made the generic stdenv understand the buildNativeInputs, otherwise if we start changing nixpkgs expressions so they distinguish the current buildInputs into buildInputs and buildNativeInputs, we could break even more nixpkgs for other platforms. - I changed the default result of mkDerivation so it becomes the derivation for to be run in the build machine. This allows, without any special rewriting, "fetchurl" derivations to be always results for the build machine to use them. - The change above implies that, for anyone wanting to cross-compile, has to build the hostDrv of the wanted derivation. For example, after this commit, the usual test of "nix-build -A bison.hostDrv arm.nix" works. I described the contents of this arm.nix in r18398. svn path=/nixpkgs/branches/stdenv-updates/; revision=18471
Diffstat (limited to 'pkgs/stdenv/adapters.nix')
-rw-r--r-- | pkgs/stdenv/adapters.nix | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/pkgs/stdenv/adapters.nix b/pkgs/stdenv/adapters.nix index ecbe2dbcf71d..85ff46a339df 100644 --- a/pkgs/stdenv/adapters.nix +++ b/pkgs/stdenv/adapters.nix @@ -110,29 +110,25 @@ rec { # Return a modified stdenv that adds a cross compiler to the # builds. makeStdenvCross = stdenv: cross: binutilsCross: gccCross: stdenv // - { mkDerivation = {name, buildInputs ? [], hostInputs ? [], - propagatedBuildInputs ? [], propagatedHostInputs ? [], ...}@args: let + { mkDerivation = {name, buildInputs ? [], buildNativeInputs ? [], + propagatedBuildInputs ? [], ...}@args: let # propagatedBuildInputs exists temporarily as another name for # propagatedHostInputs. - buildInputsDrvs = map (drv: drv.buildDrv) buildInputs; - hostInputsDrvs = map (drv: drv.hostDrv) hostInputs; - propagatedHostInputsDrvs = map (drv: drv.buildDrv) (propagatedBuildInputs - ++ propagatedHostInputs); - buildDrv = stdenv.mkDerivation (args // { - # buildInputs in the base stdenv will be named hostInputs - buildInputs = buildInputsDrvs ++ hostInputsDrvs; - # Should be propagatedHostInputs one day: - propagatedBuildInputs = propagatedHostInputsDrvs; - }); + 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); + buildDrv = stdenv.mkDerivation args; hostDrv = if (cross == null) then buildDrv else - stdenv.mkDerivation (args // { + stdenv.mkDerivation (args // { name = name + "-" + cross.config; buildInputs = buildInputsDrvs ++ [ gccCross binutilsCross ]; crossConfig = cross.config; }); - in hostDrv // { + in buildDrv // { inherit hostDrv buildDrv; }; } // { inherit cross; }; |