diff --git a/pkgs/development/libraries/ncurses/default.nix b/pkgs/development/libraries/ncurses/default.nix index d82c9de81f2..e9d286a3641 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 011bede0d54..e21a9e02d29 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;