summary refs log tree commit diff
path: root/pkgs/development/haskell-modules
diff options
context:
space:
mode:
authorPeter Simons <simons@cryp.to>2017-01-15 21:07:35 +0100
committerGitHub <noreply@github.com>2017-01-15 21:07:35 +0100
commitc85a8f0d2ab56b2a13eb700404851a3d404d267d (patch)
treec6e83f3434ec48aeb109a10a77cab6463e1c1bcf /pkgs/development/haskell-modules
parent5b052661805913894d5568fb6251acb77840b55d (diff)
parenta798850675321c5104c78accfdeaaddfa76bfa27 (diff)
downloadnixlib-c85a8f0d2ab56b2a13eb700404851a3d404d267d.tar
nixlib-c85a8f0d2ab56b2a13eb700404851a3d404d267d.tar.gz
nixlib-c85a8f0d2ab56b2a13eb700404851a3d404d267d.tar.bz2
nixlib-c85a8f0d2ab56b2a13eb700404851a3d404d267d.tar.lz
nixlib-c85a8f0d2ab56b2a13eb700404851a3d404d267d.tar.xz
nixlib-c85a8f0d2ab56b2a13eb700404851a3d404d267d.tar.zst
nixlib-c85a8f0d2ab56b2a13eb700404851a3d404d267d.zip
Merge pull request #21876 from shlevy/ghcWithPackages-cross
ghc with-packages-wrapper: Add support for cross-compiling
Diffstat (limited to 'pkgs/development/haskell-modules')
-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";