From c9cd0bc68cb5445f924e0d1620846ea71ace4345 Mon Sep 17 00:00:00 2001 From: Peter Simons Date: Thu, 18 Dec 2014 17:31:37 +0100 Subject: [PATCH] ghc-head: fix configure phase to make sure the compiler knows how to use gmp properly Start with version 7.9 of the compiler, the path to the gmp library must now be passed to the top-level configure script. --- pkgs/development/compilers/ghc/head.nix | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/pkgs/development/compilers/ghc/head.nix b/pkgs/development/compilers/ghc/head.nix index 63f43014dea..8a2b5bde979 100644 --- a/pkgs/development/compilers/ghc/head.nix +++ b/pkgs/development/compilers/ghc/head.nix @@ -9,24 +9,21 @@ stdenv.mkDerivation rec { sha256 = "0487x0rvpz6c47v9qvc7rgk3hnabmali6c66mzh2bizkgmy1qpk0"; }; - buildInputs = [ ghc perl gmp ncurses happy alex ]; - - 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 - ''; + buildInputs = [ ghc perl ncurses happy alex ]; preConfigure = '' - echo "${buildMK}" > mk/build.mk + echo >mk/build.mk "DYNAMIC_BY_DEFAULT = NO" 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"; + configureFlags = [ + "--with-gcc=${stdenv.gcc}/bin/gcc" + "--with-gmp-includes=${gmp}/include" "--with-gmp-libraries=${gmp}/lib" + ]; + + enableParallelBuilding = true; # required, because otherwise all symbols from HSffi.o are stripped, and # that in turn causes GHCi to abort @@ -35,11 +32,7 @@ stdenv.mkDerivation rec { meta = { homepage = "http://haskell.org/ghc"; description = "The Glasgow Haskell Compiler"; - maintainers = [ - stdenv.lib.maintainers.marcweber - stdenv.lib.maintainers.andres - stdenv.lib.maintainers.simons - ]; + maintainers = with stdenv.lib.maintainers; [ marcweber andres simons ]; inherit (ghc.meta) license platforms; };