From a798850675321c5104c78accfdeaaddfa76bfa27 Mon Sep 17 00:00:00 2001 From: Shea Levy Date: Fri, 13 Jan 2017 21:21:21 -0500 Subject: [PATCH] ghc with-packages-wrapper: Add support for cross-compiling --- pkgs/development/haskell-modules/with-packages-wrapper.nix | 6 ++++-- 1 file 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";