1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-15 17:25:11 +00:00
nixpkgs/pkgs/development/compilers/ghc/6.12.3.nix
Ben Gamari bf687907d7 haskell lib: Make Cabal compiler names explicit
Cabal2nix expects a --compiler flag that contains a Cabal Compiler description.
We used to use the compiler's derivation name for this, but this breaks when
cross-compiling due to the target suffix. Instead we add an explicit
haskellCompilerName attribute to Haskell compiler derivations.
2018-01-21 23:31:05 -05:00

55 lines
1.7 KiB
Nix

{stdenv, fetchurl, ghc, perl, gmp, ncurses}:
# TODO(@Ericson2314): Cross compilation support
assert stdenv.targetPlatform == stdenv.hostPlatform;
stdenv.mkDerivation rec {
version = "6.12.3";
name = "ghc-${version}";
src = fetchurl {
url = "https://downloads.haskell.org/~ghc/${version}/ghc-${version}-src.tar.bz2";
sha256 = "0s2y1sv2nq1cgliv735q2w3gg4ykv1c0g1adbv8wgwhia10vxgbc";
};
buildInputs = [ghc perl gmp ncurses];
buildMK = ''
libraries/integer-gmp_CONFIGURE_OPTS += --configure-option=--with-gmp-libraries="${gmp.out}/lib"
libraries/integer-gmp_CONFIGURE_OPTS += --configure-option=--with-gmp-includes="${gmp.dev}/include"
libraries/terminfo_CONFIGURE_OPTS += --configure-option=--with-curses-includes="${ncurses.dev}/include"
libraries/terminfo_CONFIGURE_OPTS += --configure-option=--with-curses-libraries="${ncurses.out}/lib"
'';
preConfigure = ''
echo -n "${buildMK}" > mk/build.mk
'';
configureFlags = [
"--with-gcc=${stdenv.cc}/bin/gcc"
];
NIX_CFLAGS_COMPILE = "-fomit-frame-pointer";
# required, because otherwise all symbols from HSffi.o are stripped, and
# that in turn causes GHCi to abort
stripDebugFlags=["-S" "--keep-file-symbols"];
passthru = {
targetPrefix = "";
# Our Cabal compiler name
haskellCompilerName = "ghc";
};
meta = {
homepage = http://haskell.org/ghc;
description = "The Glasgow Haskell Compiler";
maintainers = with stdenv.lib.maintainers; [ marcweber andres peti ];
platforms = ["x86_64-linux" "i686-linux"]; # Darwin is unsupported.
inherit (ghc.meta) license;
broken = true; # broken by gcc 5.x: http://hydra.nixos.org/build/33627548
};
}