Merge pull request #7064 from cstrahan/ghc7101-cabal-use-patch

ghc-7.10.1: cherry-pick Cabal bugfix for GHCJS.
This commit is contained in:
Peter Simons 2015-03-30 03:03:32 +02:00
commit cfa06c1a8d

View File

@ -1,4 +1,4 @@
{ stdenv, fetchurl, ghc, perl, gmp, ncurses, libiconv }:
{ stdenv, fetchurl, fetchpatch, ghc, perl, gmp, ncurses, libiconv }:
let
@ -13,6 +13,13 @@ let
''}
'';
# We patch Cabal for GHCJS. See: https://github.com/haskell/cabal/issues/2454
# This should be removed when GHC includes Cabal > 1.22.2.0
cabalPatch = fetchpatch {
url = https://github.com/haskell/cabal/commit/f11b7c858bb25be78b81413c69648c87c446859e.patch;
sha256 = "1z56yyc7lgc78g847qf19f5n1yk054pzlnc2i178dpsj0mgjppyb";
};
in
stdenv.mkDerivation rec {
@ -28,9 +35,13 @@ stdenv.mkDerivation rec {
enableParallelBuilding = true;
# We patch Cabal for GHCJS. See: https://github.com/haskell/cabal/issues/2454
postPatch = ''
pushd libraries/Cabal
patch -p1 < ${cabalPatch}
popd
'';
preConfigure = ''
sed -i 's/HcPkg.useSingleFileDb = .*/HcPkg.useSingleFileDb = False/' libraries/Cabal/Cabal/Distribution/Simple/GHCJS.hs
echo >mk/build.mk "${buildMK}"
sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure
'' + stdenv.lib.optionalString (!stdenv.isDarwin) ''