summary refs log tree commit diff
path: root/pkgs/development/haskell-modules/generic-builder.nix
diff options
context:
space:
mode:
authorJohn Ericson <git@JohnEricson.me>2019-12-25 14:34:40 -0500
committerJohn Ericson <git@JohnEricson.me>2019-12-25 14:34:40 -0500
commitd8dd3014120af31d4567de8247900a1088ec6e7b (patch)
tree2d190592f476e4379a9bc1714081d50b85b2d9a5 /pkgs/development/haskell-modules/generic-builder.nix
parent6a23c9ddbef2bf80f28d9d2cda778f429a50b3f1 (diff)
downloadnixpkgs-d8dd3014120af31d4567de8247900a1088ec6e7b.tar
nixpkgs-d8dd3014120af31d4567de8247900a1088ec6e7b.tar.gz
nixpkgs-d8dd3014120af31d4567de8247900a1088ec6e7b.tar.bz2
nixpkgs-d8dd3014120af31d4567de8247900a1088ec6e7b.tar.lz
nixpkgs-d8dd3014120af31d4567de8247900a1088ec6e7b.tar.xz
nixpkgs-d8dd3014120af31d4567de8247900a1088ec6e7b.tar.zst
nixpkgs-d8dd3014120af31d4567de8247900a1088ec6e7b.zip
haskell generic-builder: Hack so CPP without a CC works
Diffstat (limited to 'pkgs/development/haskell-modules/generic-builder.nix')
-rw-r--r--pkgs/development/haskell-modules/generic-builder.nix5
1 files changed, 4 insertions, 1 deletions
diff --git a/pkgs/development/haskell-modules/generic-builder.nix b/pkgs/development/haskell-modules/generic-builder.nix
index e27769d9c76..018979cf7ae 100644
--- a/pkgs/development/haskell-modules/generic-builder.nix
+++ b/pkgs/development/haskell-modules/generic-builder.nix
@@ -133,8 +133,11 @@ let
   crossCabalFlags = [
     "--with-ghc=${ghcCommand}"
     "--with-ghc-pkg=${ghc.targetPrefix}ghc-pkg"
+    # Pass the "wrong" C compiler rather than none at all so packages that just
+    # use the C preproccessor still work, see
+    # https://github.com/haskell/cabal/issues/6466 for details.
+    "--with-gcc=${(if stdenv.hasCC then stdenv else buildPackages.stdenv).cc.targetPrefix}cc"
   ] ++ optionals stdenv.hasCC [
-    "--with-gcc=${stdenv.cc.targetPrefix}cc"
     "--with-ld=${stdenv.cc.bintools.targetPrefix}ld"
     "--with-ar=${stdenv.cc.bintools.targetPrefix}ar"
     # use the one that comes with the cross compiler.