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