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
+9 -1
View File
@@ -1,4 +1,5 @@
{ mkDerivation
, lib
, broken ? false
, test-framework
, test-framework-hunit
@@ -94,6 +95,11 @@
]
, stage2 ? import ./stage2.nix
, patches ? [ ./ghcjs.patch ]
# used for resolving compiler plugins
, ghcLibdir ? null
}:
let
inherit (bootPkgs) ghc;
@@ -122,7 +128,7 @@ in mkDerivation (rec {
testDepends = [
HUnit test-framework test-framework-hunit
];
patches = [ ./ghcjs.patch ];
inherit patches;
postPatch = ''
substituteInPlace Setup.hs \
--replace "/usr/bin/env" "${coreutils}/bin/env"
@@ -165,6 +171,8 @@ in mkDerivation (rec {
--with-cabal ${cabal-install}/bin/cabal \
--with-gmp-includes ${gmp.dev}/include \
--with-gmp-libraries ${gmp.out}/lib
'' + lib.optionalString (ghcLibdir != null) ''
printf '%s' '${ghcLibdir}' > "$out/lib/ghcjs-${version}/ghc_libdir"
'';
passthru = {
inherit bootPkgs;