2007-10-19 15:24:29 +02:00
|
|
|
{stdenv, fetchurl, readline, ghc, perl, m4, gmp, ncurses}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation (rec {
|
2007-12-10 11:50:59 +01:00
|
|
|
name = "ghc-6.8.1";
|
2007-10-19 15:24:29 +02:00
|
|
|
homepage = "http://www.haskell.org/ghc";
|
|
|
|
|
|
|
|
src = map fetchurl [
|
|
|
|
{ url = "${homepage}/dist/stable/dist/${name}-src.tar.bz2";
|
2007-12-10 11:50:59 +01:00
|
|
|
md5 = "8d47d4dcde96c31fe8bedcee7f99eaf1";
|
2007-10-19 15:24:29 +02:00
|
|
|
}
|
|
|
|
{ url = "${homepage}/dist/stable/dist/${name}-src-extralibs.tar.bz2";
|
2007-12-10 11:50:59 +01:00
|
|
|
md5 = "f91de87e7c0a3fe2f27c5a83212d9743";
|
2007-10-19 15:24:29 +02:00
|
|
|
}
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [ghc readline perl m4];
|
|
|
|
|
|
|
|
setupHook = ./setup-hook.sh;
|
|
|
|
|
|
|
|
meta = {
|
2007-12-10 11:50:59 +01:00
|
|
|
description = "The Glasgow Haskell Compiler v6.8.1";
|
2007-10-19 15:24:29 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
postInstall = "
|
|
|
|
ensureDir \"$out/nix-support\"
|
|
|
|
echo \"# Path to the GHC compiler directory in the store\" > $out/nix-support/setup-hook
|
|
|
|
echo \"ghc=$out\" >> $out/nix-support/setup-hook
|
|
|
|
echo \"\" >> $out/nix-support/setup-hook
|
|
|
|
cat $setupHook >> $out/nix-support/setup-hook
|
|
|
|
";
|
|
|
|
|
2007-12-06 00:31:38 +01:00
|
|
|
patch64 = ./x86_64-linux_patch;
|
|
|
|
|
|
|
|
# Thanks to Ian Lynagh ghc now works on x86_64-linux as well
|
2007-12-10 11:50:59 +01:00
|
|
|
patchPhase = if (stdenv.system == "x86_64-linux") then "patch -p2 < $patch64" else "";
|
2007-12-06 00:31:38 +01:00
|
|
|
|
2007-12-11 20:00:56 +01:00
|
|
|
configureFlags="--with-gmp-libraries=${gmp}/lib --with-readline-libraries=${readline}/lib";
|
2007-10-19 15:24:29 +02:00
|
|
|
|
|
|
|
preConfigure = "
|
2007-12-11 20:00:56 +01:00
|
|
|
# the presence of this file makes Cabal cry for happy while generating makefiles ...
|
2007-10-19 15:24:29 +02:00
|
|
|
rm libraries/haskell-src/Language/Haskell/Parser.ly
|
2007-12-11 20:00:56 +01:00
|
|
|
# still requires a hack for ncurses
|
|
|
|
sed -i \"s|^\\\(ld-options.*$\\\)|\\\1 -L${ncurses}/lib|\" libraries/readline/readline.buildinfo.in
|
2007-10-19 15:24:29 +02:00
|
|
|
";
|
|
|
|
|
|
|
|
inherit readline gmp ncurses;
|
|
|
|
})
|