2015-02-13 21:13:25 +00:00
|
|
|
{ stdenv, fetchgit, ghc, perl, gmp, ncurses, libiconv, autoconf, automake, happy, alex }:
|
2010-09-28 14:48:22 +01:00
|
|
|
|
2015-01-16 18:31:34 +00:00
|
|
|
let
|
|
|
|
|
|
|
|
buildMK = ''
|
|
|
|
libraries/integer-gmp_CONFIGURE_OPTS += --configure-option=--with-gmp-libraries="${gmp}/lib"
|
|
|
|
libraries/integer-gmp_CONFIGURE_OPTS += --configure-option=--with-gmp-includes="${gmp}/include"
|
|
|
|
libraries/terminfo_CONFIGURE_OPTS += --configure-option=--with-curses-includes="${ncurses}/include"
|
|
|
|
libraries/terminfo_CONFIGURE_OPTS += --configure-option=--with-curses-libraries="${ncurses}/lib"
|
2015-02-03 23:34:08 +00:00
|
|
|
${stdenv.lib.optionalString stdenv.isDarwin ''
|
|
|
|
libraries/base_CONFIGURE_OPTS += --configure-option=--with-iconv-includes="${libiconv}/include"
|
|
|
|
libraries/base_CONFIGURE_OPTS += --configure-option=--with-iconv-libraries="${libiconv}/lib"
|
|
|
|
''}
|
2015-01-16 18:31:34 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
in
|
|
|
|
|
2010-09-28 14:48:22 +01:00
|
|
|
stdenv.mkDerivation rec {
|
2015-01-19 11:12:28 +00:00
|
|
|
version = "7.11.20150118";
|
2010-09-28 14:48:22 +01:00
|
|
|
name = "ghc-${version}";
|
2015-02-12 20:18:06 +00:00
|
|
|
rev = "6ff3db92140e3ac8cbda50d1a4aab976350ac8c4";
|
2011-08-08 20:47:31 +01:00
|
|
|
|
2015-02-12 20:18:06 +00:00
|
|
|
src = fetchgit {
|
|
|
|
url = "git://git.haskell.org/ghc.git";
|
|
|
|
inherit rev;
|
|
|
|
sha256 = "1a1r3nw7x5rd8563770zcg1phm55vi3sxs2zwr91ik026n8jjba6";
|
2010-09-28 14:48:22 +01:00
|
|
|
};
|
|
|
|
|
2015-02-03 23:34:08 +00:00
|
|
|
postUnpack = ''
|
2015-02-12 20:18:06 +00:00
|
|
|
pushd ghc-${builtins.substring 0 7 rev}
|
2015-02-12 20:18:30 +00:00
|
|
|
patchShebangs .
|
2015-02-12 20:18:06 +00:00
|
|
|
./boot
|
|
|
|
popd
|
2015-02-03 23:34:08 +00:00
|
|
|
'';
|
|
|
|
|
2015-02-12 20:18:06 +00:00
|
|
|
buildInputs = [ ghc perl autoconf automake happy alex ];
|
2010-09-28 14:48:22 +01:00
|
|
|
|
|
|
|
preConfigure = ''
|
2015-01-16 18:31:34 +00:00
|
|
|
echo >mk/build.mk "${buildMK}"
|
2011-12-16 18:11:23 +00:00
|
|
|
sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure
|
2014-03-22 09:44:35 +00:00
|
|
|
'' + stdenv.lib.optionalString (!stdenv.isDarwin) ''
|
2013-10-26 17:33:09 +01:00
|
|
|
export NIX_LDFLAGS="$NIX_LDFLAGS -rpath $out/lib/ghc-${version}"
|
2010-09-28 14:48:22 +01:00
|
|
|
'';
|
|
|
|
|
2014-12-18 16:31:37 +00:00
|
|
|
configureFlags = [
|
2014-12-17 18:11:30 +00:00
|
|
|
"--with-gcc=${stdenv.cc}/bin/cc"
|
2014-12-18 16:31:37 +00:00
|
|
|
"--with-gmp-includes=${gmp}/include" "--with-gmp-libraries=${gmp}/lib"
|
|
|
|
];
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
2010-09-28 14:48:22 +01:00
|
|
|
|
|
|
|
# required, because otherwise all symbols from HSffi.o are stripped, and
|
|
|
|
# that in turn causes GHCi to abort
|
2015-02-03 23:34:08 +00:00
|
|
|
stripDebugFlags = [ "-S" ] ++ stdenv.lib.optional (!stdenv.isDarwin) "--keep-file-symbols";
|
2010-09-28 14:48:22 +01:00
|
|
|
|
|
|
|
meta = {
|
2011-12-16 18:11:23 +00:00
|
|
|
homepage = "http://haskell.org/ghc";
|
2010-09-28 14:48:22 +01:00
|
|
|
description = "The Glasgow Haskell Compiler";
|
2014-12-18 16:31:37 +00:00
|
|
|
maintainers = with stdenv.lib.maintainers; [ marcweber andres simons ];
|
2013-03-23 12:05:43 +00:00
|
|
|
inherit (ghc.meta) license platforms;
|
2010-09-28 14:48:22 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|