From 0ff6b6fc0fe0d4f75c97bc1d63770346fe5a4a4c Mon Sep 17 00:00:00 2001 From: Shea Levy Date: Sun, 22 Jan 2017 17:05:19 -0500 Subject: [PATCH] (haskellPackages.callPackage foo).env: Set the right env vars when cross-compiling --- pkgs/development/haskell-modules/generic-builder.nix | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkgs/development/haskell-modules/generic-builder.nix b/pkgs/development/haskell-modules/generic-builder.nix index a7696dfc2e3..43676f1e72e 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