mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-16 09:53:17 +00:00
bf687907d7
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.
43 lines
1.1 KiB
Nix
43 lines
1.1 KiB
Nix
{stdenv, fetchurl, libedit, ghc, perl, gmp, ncurses}:
|
|
|
|
# TODO(@Ericson2314): Cross compilation support
|
|
assert stdenv.targetPlatform == stdenv.hostPlatform;
|
|
|
|
stdenv.mkDerivation rec {
|
|
version = "6.10.4";
|
|
|
|
name = "ghc-${version}";
|
|
|
|
src = fetchurl {
|
|
url = "https://downloads.haskell.org/~ghc/${version}/ghc-${version}-src.tar.bz2";
|
|
sha256 = "d66a8e52572f4ff819fe5c4e34c6dd1e84a7763e25c3fadcc222453c0bd8534d";
|
|
};
|
|
|
|
buildInputs = [ghc libedit perl gmp];
|
|
|
|
hardeningDisable = [ "format" ];
|
|
|
|
configureFlags = [
|
|
"--with-gmp-libraries=${gmp.out}/lib"
|
|
"--with-gmp-includes=${gmp.dev}/include"
|
|
"--with-gcc=${stdenv.cc}/bin/gcc"
|
|
];
|
|
|
|
NIX_CFLAGS_COMPILE = "-fomit-frame-pointer";
|
|
|
|
passthru = {
|
|
targetPrefix = "";
|
|
|
|
# Our Cabal compiler name
|
|
haskellCompilerName = "ghc";
|
|
};
|
|
|
|
meta = {
|
|
homepage = http://haskell.org/ghc;
|
|
description = "The Glasgow Haskell Compiler";
|
|
platforms = ["x86_64-linux" "i686-linux"]; # Darwin is unsupported.
|
|
inherit (ghc.meta) license;
|
|
broken = true; # https://nix-cache.s3.amazonaws.com/log/6ys7lzckf2c0532kzhmss73mmz504can-ghc-6.10.4.drv
|
|
};
|
|
}
|