about summary refs log tree commit diff
path: root/pkgs/development
diff options
context:
space:
mode:
authorJohn Ericson <Ericson2314@yahoo.com>2017-05-17 19:09:00 -0400
committerGitHub <noreply@github.com>2017-05-17 19:09:00 -0400
commitafec912d81e08339868e0e1e84234e6ed7f6b3fd (patch)
treeff7616435b45620a8b1d4a94f27fbfc45c99ff3c /pkgs/development
parent64acaa1e2dcb73d19c91c97499a23c0c2f6f19a9 (diff)
parent2601a80639ecee27fdb83ce099c037a348ba7125 (diff)
downloadnixlib-afec912d81e08339868e0e1e84234e6ed7f6b3fd.tar
nixlib-afec912d81e08339868e0e1e84234e6ed7f6b3fd.tar.gz
nixlib-afec912d81e08339868e0e1e84234e6ed7f6b3fd.tar.bz2
nixlib-afec912d81e08339868e0e1e84234e6ed7f6b3fd.tar.lz
nixlib-afec912d81e08339868e0e1e84234e6ed7f6b3fd.tar.xz
nixlib-afec912d81e08339868e0e1e84234e6ed7f6b3fd.tar.zst
nixlib-afec912d81e08339868e0e1e84234e6ed7f6b3fd.zip
Merge pull request #25867 from obsidiansystems/ghc-deps-cross
Fix cross compilation of some GHC deps
Diffstat (limited to 'pkgs/development')
-rw-r--r--pkgs/development/libraries/gmp/6.x.nix10
-rw-r--r--pkgs/development/libraries/ncurses/default.nix12
2 files changed, 17 insertions, 5 deletions
diff --git a/pkgs/development/libraries/gmp/6.x.nix b/pkgs/development/libraries/gmp/6.x.nix
index e30c15e629ef..92dd602fc4d8 100644
--- a/pkgs/development/libraries/gmp/6.x.nix
+++ b/pkgs/development/libraries/gmp/6.x.nix
@@ -1,4 +1,7 @@
-{ stdenv, fetchurl, m4, cxx ? true, withStatic ? false }:
+{ stdenv, fetchurl, m4, cxx ? true
+, buildPackages
+, buildPlatform, hostPlatform
+, withStatic ? false }:
 
 let inherit (stdenv.lib) optional optionalString; in
 
@@ -16,7 +19,8 @@ let self = stdenv.mkDerivation rec {
   outputs = [ "out" "dev" "info" ];
   passthru.static = self.out;
 
-  nativeBuildInputs = [ m4 ];
+  nativeBuildInputs = [ m4 ]
+    ++ stdenv.lib.optional (buildPlatform != hostPlatform) buildPackages.stdenv.cc;
 
   configureFlags =
     # Build a "fat binary", with routines for several sub-architectures
@@ -39,7 +43,7 @@ let self = stdenv.mkDerivation rec {
       configureFlagsArray+=("--build=$(./configfsf.guess)")
     '';
 
-  doCheck = true;
+  doCheck = buildPlatform == hostPlatform;
 
   dontDisableStatic = withStatic;
 
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;