From ad8c10e246bd019407861fd5b23d8d698f86fbb3 Mon Sep 17 00:00:00 2001 From: Moritz Angermann Date: Sun, 15 Jul 2018 16:25:09 +0800 Subject: [PATCH 1/4] [ghc] assert gmp --- pkgs/development/compilers/ghc/8.4.3.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/development/compilers/ghc/8.4.3.nix b/pkgs/development/compilers/ghc/8.4.3.nix index 182afa6b349..a5cac666e58 100644 --- a/pkgs/development/compilers/ghc/8.4.3.nix +++ b/pkgs/development/compilers/ghc/8.4.3.nix @@ -32,6 +32,8 @@ ghcFlavour ? stdenv.lib.optionalString (targetPlatform != hostPlatform) "perf-cross" }: +assert !enableIntegerSimple -> gmp != null; + let inherit (bootPkgs) ghc; From b84ac074fcadc735911fe41458e7f7fee42df434 Mon Sep 17 00:00:00 2001 From: Moritz Angermann Date: Sun, 15 Jul 2018 16:25:31 +0800 Subject: [PATCH 2/4] [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 a5cac666e58..d27dab96fd9 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" From 3f762923aabe7459c291d7400497b48842c3b3e5 Mon Sep 17 00:00:00 2001 From: Moritz Angermann Date: Wed, 18 Jul 2018 10:20:46 +0800 Subject: [PATCH 3/4] [ghc] Backport gmp stuff --- pkgs/development/compilers/ghc/8.0.2.nix | 7 ++++--- pkgs/development/compilers/ghc/8.2.2.nix | 9 +++++---- pkgs/development/compilers/ghc/8.4.3.nix | 4 +--- pkgs/development/compilers/ghc/8.6.1.nix | 9 +++++---- 4 files changed, 15 insertions(+), 14 deletions(-) diff --git a/pkgs/development/compilers/ghc/8.0.2.nix b/pkgs/development/compilers/ghc/8.0.2.nix index 8062e93df54..459686cfcc0 100644 --- a/pkgs/development/compilers/ghc/8.0.2.nix +++ b/pkgs/development/compilers/ghc/8.0.2.nix @@ -29,6 +29,8 @@ ghcFlavour ? stdenv.lib.optionalString (targetPlatform != hostPlatform) "perf-cross" }: +assert !enableIntegerSimple -> gmp != null; + let inherit (bootPkgs) ghc; @@ -43,8 +45,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 = YES HADDOCK_DOCS = NO @@ -127,7 +128,7 @@ stdenv.mkDerivation rec { "--datadir=$doc/share/doc/ghc" "--with-curses-includes=${ncurses.dev}/include" "--with-curses-libraries=${ncurses.out}/lib" ] ++ stdenv.lib.optional (targetPlatform == hostPlatform && ! enableIntegerSimple) [ - "--with-gmp-includes=${gmp.dev}/include" "--with-gmp-libraries=${gmp.out}/lib" + "--with-gmp-includes=${targetPackages.gmp.dev}/include" "--with-gmp-libraries=${targetPackages.gmp.out}/lib" ] ++ stdenv.lib.optional (targetPlatform == hostPlatform && hostPlatform.libc != "glibc") [ "--with-iconv-includes=${libiconv}/include" "--with-iconv-libraries=${libiconv}/lib" ] ++ stdenv.lib.optionals (targetPlatform != hostPlatform) [ diff --git a/pkgs/development/compilers/ghc/8.2.2.nix b/pkgs/development/compilers/ghc/8.2.2.nix index d740a7ee673..8216623e299 100644 --- a/pkgs/development/compilers/ghc/8.2.2.nix +++ b/pkgs/development/compilers/ghc/8.2.2.nix @@ -34,6 +34,8 @@ deterministicProfiling ? false }: +assert !enableIntegerSimple -> gmp != null; + let inherit (bootPkgs) ghc; @@ -48,8 +50,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} @@ -160,8 +161,8 @@ stdenv.mkDerivation rec { "--datadir=$doc/share/doc/ghc" ] ++ stdenv.lib.optional (targetPlatform == hostPlatform) [ "--with-curses-includes=${ncurses.dev}/include" "--with-curses-libraries=${ncurses.out}/lib" - ] ++ stdenv.lib.optional (targetPlatform == hostPlatform && ! enableIntegerSimple) [ - "--with-gmp-includes=${gmp.dev}/include" "--with-gmp-libraries=${gmp.out}/lib" + ] ++ stdenv.lib.optional (targetPlatform == hostPlatform && !enableIntegerSimple) [ + "--with-gmp-includes=${targetPackages.gmp.dev}/include" "--with-gmp-libraries=${targetPackages.gmp.out}/lib" ] ++ stdenv.lib.optional (targetPlatform == hostPlatform && hostPlatform.libc != "glibc") [ "--with-iconv-includes=${libiconv}/include" "--with-iconv-libraries=${libiconv}/lib" ] ++ stdenv.lib.optionals (targetPlatform != hostPlatform) [ diff --git a/pkgs/development/compilers/ghc/8.4.3.nix b/pkgs/development/compilers/ghc/8.4.3.nix index d27dab96fd9..c0ac16608f8 100644 --- a/pkgs/development/compilers/ghc/8.4.3.nix +++ b/pkgs/development/compilers/ghc/8.4.3.nix @@ -150,9 +150,7 @@ stdenv.mkDerivation (rec { configureFlags = [ "--datadir=$doc/share/doc/ghc" "--with-curses-includes=${ncurses.dev}/include" "--with-curses-libraries=${ncurses.out}/lib" - ] ++ (if (targetPlatform == hostPlatform && !enableIntegerSimple) then [ - "--with-gmp-includes=${gmp.dev}/include" "--with-gmp-libraries=${gmp.out}/lib" - ] else [ + ] ++ stdenv.lib.optional (targetPlatform == hostPlatform && !enableIntegerSimple) [ "--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" diff --git a/pkgs/development/compilers/ghc/8.6.1.nix b/pkgs/development/compilers/ghc/8.6.1.nix index 522ad32e69f..d52ebea0d01 100644 --- a/pkgs/development/compilers/ghc/8.6.1.nix +++ b/pkgs/development/compilers/ghc/8.6.1.nix @@ -32,6 +32,8 @@ ghcFlavour ? stdenv.lib.optionalString (targetPlatform != hostPlatform) "perf-cross" }: +assert !enableIntegerSimple -> gmp != null; + let inherit (bootPkgs) ghc; @@ -46,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} @@ -141,8 +142,8 @@ 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) [ - "--with-gmp-includes=${gmp.dev}/include" "--with-gmp-libraries=${gmp.out}/lib" + ] ++ stdenv.lib.optional (targetPlatform == hostPlatform && !enableIntegerSimple) [ + "--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) [ From c034dea090caf37d8f4973557283cba9b4df0f0d Mon Sep 17 00:00:00 2001 From: Moritz Angermann Date: Wed, 18 Jul 2018 12:04:39 +0800 Subject: [PATCH 4/4] Update 8.4.3.nix --- pkgs/development/compilers/ghc/8.4.3.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/compilers/ghc/8.4.3.nix b/pkgs/development/compilers/ghc/8.4.3.nix index c0ac16608f8..f5b5a83c57d 100644 --- a/pkgs/development/compilers/ghc/8.4.3.nix +++ b/pkgs/development/compilers/ghc/8.4.3.nix @@ -152,7 +152,7 @@ stdenv.mkDerivation (rec { "--with-curses-includes=${ncurses.dev}/include" "--with-curses-libraries=${ncurses.out}/lib" ] ++ stdenv.lib.optional (targetPlatform == hostPlatform && !enableIntegerSimple) [ "--with-gmp-includes=${targetPackages.gmp.dev}/include" "--with-gmp-libraries=${targetPackages.gmp.out}/lib" - ]) ++ stdenv.lib.optional (targetPlatform == hostPlatform && hostPlatform.libc != "glibc" && !targetPlatform.isWindows) [ + ] ++ 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"