Adding a new mkDerivation flag for the cross stdenv, selfNativeBuildInput =

true/false, which tells whether the derivation needs itself as
buildNativeInput.
For example, in order to build cross ncurses, we need the a native build
ncurses.
(As libtool does not work in stdenv, I have not tested this change, to check
whether finally ncurses cross-build)


svn path=/nixpkgs/branches/stdenv-updates/; revision=18489
This commit is contained in:
Lluís Batlle i Rossell 2009-11-20 16:38:01 +00:00
parent 4497215410
commit 28d9e73d34
2 changed files with 6 additions and 2 deletions

View File

@ -12,6 +12,8 @@ stdenv.mkDerivation rec {
--with-shared --includedir=''${out}/include --without-debug --with-shared --includedir=''${out}/include --without-debug
${if unicode then "--enable-widec" else ""} ${if unicode then "--enable-widec" else ""}
''; '';
selfNativeBuildInput = true;
preBuild = ''sed -e "s@\([[:space:]]\)sh @\1''${SHELL} @" -i */Makefile Makefile''; preBuild = ''sed -e "s@\([[:space:]]\)sh @\1''${SHELL} @" -i */Makefile Makefile'';

View File

@ -111,7 +111,8 @@ rec {
# builds. # builds.
makeStdenvCross = stdenv: cross: binutilsCross: gccCross: stdenv // makeStdenvCross = stdenv: cross: binutilsCross: gccCross: stdenv //
{ mkDerivation = {name ? "", buildInputs ? [], buildNativeInputs ? [], { mkDerivation = {name ? "", buildInputs ? [], buildNativeInputs ? [],
propagatedBuildInputs ? [], propagatedBuildNativeInputs ? [], ...}@args: let propagatedBuildInputs ? [], propagatedBuildNativeInputs ? [],
selfNativeBuildInput ? false, ...}@args: let
# *BuildInputs exists temporarily as another name for # *BuildInputs exists temporarily as another name for
# *HostInputs. # *HostInputs.
@ -135,7 +136,8 @@ rec {
stdenv.mkDerivation (args // { stdenv.mkDerivation (args // {
name = name + "-" + cross.config; name = name + "-" + cross.config;
buildNativeInputs = buildNativeInputsDrvs buildNativeInputs = buildNativeInputsDrvs
++ [ gccCross binutilsCross ]; ++ [ gccCross binutilsCross ] ++
stdenv.lib.optional selfNativeBuildInput buildDrv;
buildInputs = buildInputsDrvs; buildInputs = buildInputsDrvs;
propagatedBuildInputs = propagatedBuildInputsDrvs; propagatedBuildInputs = propagatedBuildInputsDrvs;
propagatedBuildNativeInputs = propagatedBuildNativeInputsDrvs; propagatedBuildNativeInputs = propagatedBuildNativeInputsDrvs;