about summary refs log tree commit diff
path: root/pkgs/development/compilers/ghc/6.6.1.nix
blob: 841306578eb6994222c093dfe29eefb263abfc7f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
{stdenv, fetchurl, readline, ghc, perl58, m4, gmp, ncurses}:

stdenv.mkDerivation (rec {
  name = "ghc-6.6.1";

  src = map fetchurl [
    { url = http://www.haskell.org/ghc/dist/6.6.1/ghc-6.6.1-src.tar.bz2;
      md5 = "ba9f4aec2fde5ff1e1548ae69b78aeb0";
    }
    { url = http://www.haskell.org/ghc/dist/6.6.1/ghc-6.6.1-src-extralibs.tar.bz2;
      md5 = "43a26b81608b206c056adc3032f7da2a";
    }
  ];

  buildInputs = [ghc readline perl58 m4 gmp];

  setupHook = ./setup-hook.sh;

  meta = {
    description = "The Glasgow Haskell Compiler";
  };

  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
  '';

  configureFlags=[
    "--with-gmp-libraries=${gmp}/lib"
    "--with-readline-libraries=${readline}/lib"
    "--with-gmp-includes=${gmp}/include"
    "--with-gcc=${gcc}/bin/gcc"
  ];

  preConfigure = ''
    # still requires a hack for ncurses
    sed -i "s|^\(library-dirs.*$\)|\1 \"${ncurses}/lib\"|" libraries/readline/package.conf.in
    # fix for gcc 4.2
    echo "SplitObjs=NO" >> mk/build.mk
  '';

  inherit (stdenv) gcc;
  inherit readline gmp ncurses;
})