summary refs log tree commit diff
path: root/pkgs/development/haskell-modules/generic-builder.nix
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2019-11-24 23:07:20 +0000
committerJohn Ericson <John.Ericson@Obsidian.Systems>2019-11-25 00:12:39 +0000
commitea9a2c5ec21bf088bbdef036238fa67cdc85b073 (patch)
tree53105bd314468e565d42fcb3932f99d84d3fc0df /pkgs/development/haskell-modules/generic-builder.nix
parentc739c420db5b9d56c335414be1696c57f2dbbb6a (diff)
downloadnixpkgs-ea9a2c5ec21bf088bbdef036238fa67cdc85b073.tar
nixpkgs-ea9a2c5ec21bf088bbdef036238fa67cdc85b073.tar.gz
nixpkgs-ea9a2c5ec21bf088bbdef036238fa67cdc85b073.tar.bz2
nixpkgs-ea9a2c5ec21bf088bbdef036238fa67cdc85b073.tar.lz
nixpkgs-ea9a2c5ec21bf088bbdef036238fa67cdc85b073.tar.xz
nixpkgs-ea9a2c5ec21bf088bbdef036238fa67cdc85b073.tar.zst
nixpkgs-ea9a2c5ec21bf088bbdef036238fa67cdc85b073.zip
haskell genenric-builder: Make the C compiler optional
This is GHCJS, and perhaps other obscure targets.
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 87d3b5ae496..d6966d69136 100644
--- a/pkgs/development/haskell-modules/generic-builder.nix
+++ b/pkgs/development/haskell-modules/generic-builder.nix
@@ -40,7 +40,7 @@ in
 # They must be propagated to the environment of any executable linking with the library
 , libraryFrameworkDepends ? [], executableFrameworkDepends ? []
 , homepage ? "https://hackage.haskell.org/package/${pname}"
-, platforms ? with stdenv.lib.platforms; unix ++ windows # GHC can cross-compile
+, platforms ? with stdenv.lib.platforms; all # GHC can cross-compile
 , hydraPlatforms ? null
 , hyperlinkSource ? true
 , isExecutable ? false, isLibrary ? !isExecutable
@@ -133,6 +133,7 @@ let
   crossCabalFlags = [
     "--with-ghc=${ghc.targetPrefix}ghc"
     "--with-ghc-pkg=${ghc.targetPrefix}ghc-pkg"
+  ] ++ optionals stdenv.hasCC [
     "--with-gcc=${stdenv.cc.targetPrefix}cc"
     "--with-ld=${stdenv.cc.bintools.targetPrefix}ld"
     "--with-ar=${stdenv.cc.bintools.targetPrefix}ar"
@@ -156,7 +157,9 @@ let
     "--libsubdir=\\$abi/\\$libname"
     (optionalString enableSeparateDataOutput "--datadir=$data/share/${ghc.name}")
     (optionalString enableSeparateDocOutput "--docdir=${docdir "$doc"}")
+  ] ++ optionals stdenv.hasCC [
     "--with-gcc=$CC" # Clang won't work without that extra information.
+  ] ++ [
     "--package-db=$packageConfDir"
     (optionalString (enableSharedExecutables && stdenv.isLinux) "--ghc-option=-optl=-Wl,-rpath=$out/lib/${ghc.name}/${pname}-${version}")
     (optionalString (enableSharedExecutables && stdenv.isDarwin) "--ghc-option=-optl=-Wl,-headerpad_max_install_names")