about summary refs log tree commit diff
path: root/pkgs/development/libraries/ncurses/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/libraries/ncurses/default.nix')
-rw-r--r--pkgs/development/libraries/ncurses/default.nix12
1 files changed, 10 insertions, 2 deletions
diff --git a/pkgs/development/libraries/ncurses/default.nix b/pkgs/development/libraries/ncurses/default.nix
index 4ffaee9be5ab..9e7f2eef46bf 100644
--- a/pkgs/development/libraries/ncurses/default.nix
+++ b/pkgs/development/libraries/ncurses/default.nix
@@ -5,6 +5,9 @@
 , unicode ? true
 
 , gpm
+
+, buildPlatform, hostPlatform
+, buildPackages
 }:
 let
   version = if abiVersion == "5" then "5.9" else "6.0";
@@ -35,7 +38,11 @@ stdenv.mkDerivation rec {
   # Only the C compiler, and explicitly not C++ compiler needs this flag on solaris:
   CFLAGS = lib.optionalString stdenv.isSunOS "-D_XOPEN_SOURCE_EXTENDED";
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [
+    pkgconfig
+  ] ++ lib.optionals (buildPlatform != hostPlatform) [
+    buildPackages.ncurses buildPackages.stdenv.cc
+  ];
   buildInputs = lib.optional (mouseSupport && stdenv.isLinux) gpm;
 
   preConfigure = ''
@@ -58,7 +65,8 @@ stdenv.mkDerivation rec {
     sed -i -e 's,LIB_SUFFIX="t,LIB_SUFFIX=",' configure
   '';
 
-  selfNativeBuildInput = true;
+  # Here only for native hash, remove on next mass rebuild
+  selfNativeBuildInput = buildPlatform == hostPlatform;
 
   enableParallelBuilding = true;