summary refs log tree commit diff
path: root/pkgs/development/haskell-modules
diff options
context:
space:
mode:
authorShea Levy <shea@shealevy.com>2017-01-22 17:05:19 -0500
committerShea Levy <shea@shealevy.com>2017-01-22 17:05:19 -0500
commit0ff6b6fc0fe0d4f75c97bc1d63770346fe5a4a4c (patch)
tree9348dc723960138a12acbb3fc76eb5a20746cbbd /pkgs/development/haskell-modules
parent121b8d23af62cc0decf89eed52a467b8373f6c7b (diff)
downloadnixlib-0ff6b6fc0fe0d4f75c97bc1d63770346fe5a4a4c.tar
nixlib-0ff6b6fc0fe0d4f75c97bc1d63770346fe5a4a4c.tar.gz
nixlib-0ff6b6fc0fe0d4f75c97bc1d63770346fe5a4a4c.tar.bz2
nixlib-0ff6b6fc0fe0d4f75c97bc1d63770346fe5a4a4c.tar.lz
nixlib-0ff6b6fc0fe0d4f75c97bc1d63770346fe5a4a4c.tar.xz
nixlib-0ff6b6fc0fe0d4f75c97bc1d63770346fe5a4a4c.tar.zst
nixlib-0ff6b6fc0fe0d4f75c97bc1d63770346fe5a4a4c.zip
(haskellPackages.callPackage foo).env: Set the right env vars when cross-compiling
Diffstat (limited to 'pkgs/development/haskell-modules')
-rw-r--r--pkgs/development/haskell-modules/generic-builder.nix6
1 files changed, 4 insertions, 2 deletions
diff --git a/pkgs/development/haskell-modules/generic-builder.nix b/pkgs/development/haskell-modules/generic-builder.nix
index a7696dfc2e31..43676f1e72e2 100644
--- a/pkgs/development/haskell-modules/generic-builder.nix
+++ b/pkgs/development/haskell-modules/generic-builder.nix
@@ -148,8 +148,10 @@ let
 
   setupBuilder = if isCross || isGhcjs then "${nativeGhc}/bin/ghc" else ghcCommand;
   setupCommand = "./Setup";
-  ghcCommand = if isGhcjs then "ghcjs" else if isCross then "${ghc.cross.config}-ghc" else "ghc";
-  ghcCommandCaps = toUpper ghcCommand;
+  ghcCommand' = if isGhcjs then "ghcjs" else "ghc";
+  crossPrefix = if (ghc.cross or null) != null then "${ghc.cross.config}-" else "";
+  ghcCommand = "${crossPrefix}${ghcCommand'}";
+  ghcCommandCaps= lib.toUpper ghcCommand';
 
 in