2015-02-13 21:13:25 +00:00
|
|
|
{ stdenv, fetchgit, ghc, perl, gmp, ncurses, libiconv, autoconf, automake, happy, alex }:
|
2010-09-28 13:48:22 +00: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-22 20:55:27 +00:00
|
|
|
DYNAMIC_BY_DEFAULT = NO
|
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 13:48:22 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2015-06-08 07:48:13 +00:00
|
|
|
version = "7.11.20150607";
|
2010-09-28 13:48:22 +00:00
|
|
|
name = "ghc-${version}";
|
2015-06-08 07:48:13 +00:00
|
|
|
rev = "89223ce1340654455a9f3aa9cbf25f30884227fd";
|
2011-08-08 19:47:31 +00:00
|
|
|
|
2015-02-12 20:18:06 +00:00
|
|
|
src = fetchgit {
|
|
|
|
url = "git://git.haskell.org/ghc.git";
|
|
|
|
inherit rev;
|
2015-06-08 07:48:13 +00:00
|
|
|
sha256 = "1qsv2n5js21kqphq92xlyc91f11fnr9sh1glqzsirc8xr60dg5cs";
|
2010-09-28 13:48:22 +00: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 13:48:22 +00: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 16:33:09 +00:00
|
|
|
export NIX_LDFLAGS="$NIX_LDFLAGS -rpath $out/lib/ghc-${version}"
|
2010-09-28 13:48:22 +00: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 13:48:22 +00: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 13:48:22 +00:00
|
|
|
|
|
|
|
meta = {
|
2011-12-16 18:11:23 +00:00
|
|
|
homepage = "http://haskell.org/ghc";
|
2010-09-28 13:48:22 +00: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 13:48:22 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|