From 28d9e73d34a686409de74a8f16c3b40cec5a3fc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Batlle=20i=20Rossell?= Date: Fri, 20 Nov 2009 16:38:01 +0000 Subject: [PATCH] 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 --- pkgs/development/libraries/ncurses/default.nix | 2 ++ pkgs/stdenv/adapters.nix | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/pkgs/development/libraries/ncurses/default.nix b/pkgs/development/libraries/ncurses/default.nix index d82c9de81f23..e9d286a36417 100644 --- a/pkgs/development/libraries/ncurses/default.nix +++ b/pkgs/development/libraries/ncurses/default.nix @@ -12,6 +12,8 @@ stdenv.mkDerivation rec { --with-shared --includedir=''${out}/include --without-debug ${if unicode then "--enable-widec" else ""} ''; + + selfNativeBuildInput = true; preBuild = ''sed -e "s@\([[:space:]]\)sh @\1''${SHELL} @" -i */Makefile Makefile''; diff --git a/pkgs/stdenv/adapters.nix b/pkgs/stdenv/adapters.nix index 011bede0d545..e21a9e02d292 100644 --- a/pkgs/stdenv/adapters.nix +++ b/pkgs/stdenv/adapters.nix @@ -111,7 +111,8 @@ rec { # builds. makeStdenvCross = stdenv: cross: binutilsCross: gccCross: stdenv // { mkDerivation = {name ? "", buildInputs ? [], buildNativeInputs ? [], - propagatedBuildInputs ? [], propagatedBuildNativeInputs ? [], ...}@args: let + propagatedBuildInputs ? [], propagatedBuildNativeInputs ? [], + selfNativeBuildInput ? false, ...}@args: let # *BuildInputs exists temporarily as another name for # *HostInputs. @@ -135,7 +136,8 @@ rec { stdenv.mkDerivation (args // { name = name + "-" + cross.config; buildNativeInputs = buildNativeInputsDrvs - ++ [ gccCross binutilsCross ]; + ++ [ gccCross binutilsCross ] ++ + stdenv.lib.optional selfNativeBuildInput buildDrv; buildInputs = buildInputsDrvs; propagatedBuildInputs = propagatedBuildInputsDrvs; propagatedBuildNativeInputs = propagatedBuildNativeInputsDrvs;