summary refs log tree commit diff
diff options
context:
space:
mode:
authorShea Levy <shea@shealevy.com>2017-01-13 21:21:21 -0500
committerShea Levy <shea@shealevy.com>2017-01-13 21:21:21 -0500
commita798850675321c5104c78accfdeaaddfa76bfa27 (patch)
treeeb56a60715fdc2d9ba48c84d8a1f624c2ed1fe67
parent40083709922eca7fd9da0ebffe79654fe6fb5f24 (diff)
downloadnixlib-a798850675321c5104c78accfdeaaddfa76bfa27.tar
nixlib-a798850675321c5104c78accfdeaaddfa76bfa27.tar.gz
nixlib-a798850675321c5104c78accfdeaaddfa76bfa27.tar.bz2
nixlib-a798850675321c5104c78accfdeaaddfa76bfa27.tar.lz
nixlib-a798850675321c5104c78accfdeaaddfa76bfa27.tar.xz
nixlib-a798850675321c5104c78accfdeaaddfa76bfa27.tar.zst
nixlib-a798850675321c5104c78accfdeaaddfa76bfa27.zip
ghc with-packages-wrapper: Add support for cross-compiling
-rw-r--r--pkgs/development/haskell-modules/with-packages-wrapper.nix6
1 files changed, 4 insertions, 2 deletions
diff --git a/pkgs/development/haskell-modules/with-packages-wrapper.nix b/pkgs/development/haskell-modules/with-packages-wrapper.nix
index 7929d99de153..2dcf206cec94 100644
--- a/pkgs/development/haskell-modules/with-packages-wrapper.nix
+++ b/pkgs/development/haskell-modules/with-packages-wrapper.nix
@@ -32,8 +32,10 @@ let
   isGhcjs       = ghc.isGhcjs or false;
   ghc761OrLater = isGhcjs || lib.versionOlder "7.6.1" ghc.version;
   packageDBFlag = if ghc761OrLater then "--global-package-db" else "--global-conf";
-  ghcCommand    = if isGhcjs then "ghcjs" else "ghc";
-  ghcCommandCaps= lib.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';
   libDir        = "$out/lib/${ghcCommand}-${ghc.version}";
   docDir        = "$out/share/doc/ghc/html";
   packageCfgDir = "${libDir}/package.conf.d";