From b84ac074fcadc735911fe41458e7f7fee42df434 Mon Sep 17 00:00:00 2001 From: Moritz Angermann Date: Sun, 15 Jul 2018 16:25:31 +0800 Subject: [PATCH] [ghc] proper handling of integer libraries --- pkgs/development/compilers/ghc/8.4.3.nix | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pkgs/development/compilers/ghc/8.4.3.nix b/pkgs/development/compilers/ghc/8.4.3.nix index a5cac666e587..d27dab96fd9e 100644 --- a/pkgs/development/compilers/ghc/8.4.3.nix +++ b/pkgs/development/compilers/ghc/8.4.3.nix @@ -48,8 +48,7 @@ let include mk/flavours/\$(BuildFlavour).mk endif DYNAMIC_GHC_PROGRAMS = ${if enableShared then "YES" else "NO"} - '' + stdenv.lib.optionalString enableIntegerSimple '' - INTEGER_LIBRARY = integer-simple + INTEGER_LIBRARY = ${if enableIntegerSimple then "integer-simple" else "integer-gmp"} '' + stdenv.lib.optionalString (targetPlatform != hostPlatform) '' Stage1Only = ${if targetPlatform.system == hostPlatform.system then "NO" else "YES"} CrossCompilePrefix = ${targetPrefix} @@ -151,9 +150,11 @@ stdenv.mkDerivation (rec { configureFlags = [ "--datadir=$doc/share/doc/ghc" "--with-curses-includes=${ncurses.dev}/include" "--with-curses-libraries=${ncurses.out}/lib" - ] ++ stdenv.lib.optional (targetPlatform == hostPlatform && ! enableIntegerSimple) [ + ] ++ (if (targetPlatform == hostPlatform && !enableIntegerSimple) then [ "--with-gmp-includes=${gmp.dev}/include" "--with-gmp-libraries=${gmp.out}/lib" - ] ++ stdenv.lib.optional (targetPlatform == hostPlatform && hostPlatform.libc != "glibc" && !targetPlatform.isWindows) [ + ] else [ + "--with-gmp-includes=${targetPackages.gmp.dev}/include" "--with-gmp-libraries=${targetPackages.gmp.out}/lib" + ]) ++ stdenv.lib.optional (targetPlatform == hostPlatform && hostPlatform.libc != "glibc" && !targetPlatform.isWindows) [ "--with-iconv-includes=${libiconv}/include" "--with-iconv-libraries=${libiconv}/lib" ] ++ stdenv.lib.optionals (targetPlatform != hostPlatform) [ "--enable-bootstrap-with-devel-snapshot"