From 028779fb401cce8f087a41a929b97441b96ac356 Mon Sep 17 00:00:00 2001 From: Peter Simons Date: Sun, 29 Mar 2015 11:02:31 +0200 Subject: [PATCH] ghcWithPackages: fix isGhcjs evaluation even some more This is harder than I would have thought. --- pkgs/development/haskell-modules/with-packages-wrapper.nix | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pkgs/development/haskell-modules/with-packages-wrapper.nix b/pkgs/development/haskell-modules/with-packages-wrapper.nix index be708e7da577..be3e2e22a131 100644 --- a/pkgs/development/haskell-modules/with-packages-wrapper.nix +++ b/pkgs/development/haskell-modules/with-packages-wrapper.nix @@ -29,9 +29,10 @@ assert versionOlder "6.12" ghc.version; # fi let - ghc761OrLater = ghc.isGhcjs || versionOlder "7.6.1" ghc.version; + isGhcjs = ghc.isGhcjs or false; + ghc761OrLater = isGhcjs || versionOlder "7.6.1" ghc.version; packageDBFlag = if ghc761OrLater then "--global-package-db" else "--global-conf"; - ghcCommand = if ghc.isGhcjs then "ghcjs" else "ghc"; + ghcCommand = if isGhcjs then "ghcjs" else "ghc"; libDir = "$out/lib/${ghcCommand}-${ghc.version}"; docDir = "$out/share/doc/ghc/html"; packageCfgDir = "${libDir}/package.conf.d"; @@ -51,7 +52,7 @@ buildEnv { postBuild = '' . ${makeWrapper}/nix-support/setup-hook - ${optionalString (ghc.isGhcjs or false) '' + ${optionalString isGhcjs '' cp -r "${ghc}/${ghc.libDir}/"* ${libDir}/ ''}