ncurses: Fix for cross

This commit is contained in:
John Ericson 2017-04-25 23:52:29 -04:00
parent 76667036ec
commit 8ad2c6a830

View File

@ -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;