Skip to content

Instantly share code, notes, and snippets.

@Fuuzetsu
Created May 11, 2014 07:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Fuuzetsu/209ae10378ca3aaf7eec to your computer and use it in GitHub Desktop.
Save Fuuzetsu/209ae10378ca3aaf7eec to your computer and use it in GitHub Desktop.
GHC default
let
pkgs = import <nixpkgs> {};
inherit (pkgs) stdenv fetchurl ghc perl gmp ncurses haskellPackages
automake autoconf git dblatex docbook2x
docbook_xml_xslt docbook_xml_dtd_45;
in
stdenv.mkDerivation rec {
name = "ghcDev-${version}";
version = "7.9.20140511";
src = /home/shana/programming/ghc;
buildInputs = [ ghc.ghc763 perl gmp ncurses automake autoconf git
haskellPackages.happy_1_19_3 haskellPackages.alex_3_1_3 ];
enableParallelBuilding = true;
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"
DYNAMIC_BY_DEFAULT = NO
'';
preConfigure = ''
echo "${buildMK}" > mk/build.mk
perl boot
sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure
'' + stdenv.lib.optionalString (!stdenv.isDarwin) ''
export NIX_LDFLAGS="$NIX_LDFLAGS -rpath $out/lib/ghc-${version}"
'';
configureFlags = "--with-gcc=${stdenv.gcc}/bin/gcc";
# required, because otherwise all symbols from HSffi.o are stripped, and
# that in turn causes GHCi to abort
stripDebugFlags = [ "-S" "--keep-file-symbols" ];
meta = {
homepage = "http://haskell.org/ghc";
description = "The Glasgow Haskell Compiler";
maintainers = [
stdenv.lib.maintainers.marcweber
stdenv.lib.maintainers.andres
stdenv.lib.maintainers.simons
];
inherit (ghc.ghc742.meta) license platforms;
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment