Fix GHCJS HEAD patch; support GHCJS libdir link; use full ghcEnv for GHCJS

Original:
https://github.com/NixOS/nixpkgs-channels/commit/f3110651c81cc3fd4f6d342f0c30d363ea8cd0b0

(With some tweaks from @cstrahan)

closes #23199
This commit is contained in:
3noch
2017-03-02 11:35:11 -05:00
committed by Charles Strahan
parent 7d356ff696
commit 4b77d425aa
5 changed files with 31 additions and 15 deletions
@@ -193,11 +193,13 @@ stdenv.mkDerivation ({
${jailbreak-cabal}/bin/jailbreak-cabal ${pname}.cabal
'' + postPatch;
# for ghcjs, we want to put ghcEnv on PATH so compiler plugins will be available.
# TODO(cstrahan): would the same be of benefit to native ghc?
setupCompilerEnvironmentPhase = ''
runHook preSetupCompilerEnvironment
echo "Build with ${ghc}."
export PATH="${ghc}/bin:$PATH"
export PATH="${if ghc.isGhcjs or false then ghcEnv else ghc}/bin:$PATH"
${optionalString (hasActiveLibrary && hyperlinkSource) "export PATH=${hscolour}/bin:$PATH"}
packageConfDir="$TMPDIR/package.conf.d"