From d4b5df711a08f773755b575849b26b562045a9cb Mon Sep 17 00:00:00 2001 From: John Ericson Date: Mon, 1 Oct 2018 20:46:37 +0000 Subject: [PATCH 1/3] ghcHEAD: Force INTEGER_LIBRARY like the other GHCs We really need to abstract to avoid these copy-paste errors. --- pkgs/development/compilers/ghc/head.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkgs/development/compilers/ghc/head.nix b/pkgs/development/compilers/ghc/head.nix index af5efbd7df8..dcb1aabaf09 100644 --- a/pkgs/development/compilers/ghc/head.nix +++ b/pkgs/development/compilers/ghc/head.nix @@ -32,6 +32,8 @@ ghcFlavour ? stdenv.lib.optionalString (stdenv.targetPlatform != stdenv.hostPlatform) "perf-cross" }: +assert !enableIntegerSimple -> gmp != null; + let inherit (stdenv) buildPlatform hostPlatform targetPlatform; @@ -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} From cb442d93459a16812fd2ae5d3598223ca799a198 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Mon, 1 Oct 2018 20:46:37 +0000 Subject: [PATCH 2/3] ghcHEAD: Copy android hack that other GHCs have Not sure why this one doesn't --- pkgs/development/compilers/ghc/head.nix | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pkgs/development/compilers/ghc/head.nix b/pkgs/development/compilers/ghc/head.nix index dcb1aabaf09..1339edf0afd 100644 --- a/pkgs/development/compilers/ghc/head.nix +++ b/pkgs/development/compilers/ghc/head.nix @@ -78,7 +78,7 @@ let targetCC = builtins.head toolsForTarget; in -stdenv.mkDerivation rec { +stdenv.mkDerivation (rec { inherit version; inherit (src) rev; name = "${targetPrefix}ghc-${version}"; @@ -207,4 +207,8 @@ stdenv.mkDerivation rec { inherit (ghc.meta) license platforms; }; -} +} // stdenv.lib.optionalAttrs targetPlatform.useAndroidPrebuilt { + dontStrip = true; + dontPatchELF = true; + noAuditTmpdir = true; +}) From b19113380f0de343e4b18ae06ef5fd64681caa55 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Mon, 1 Oct 2018 20:47:27 +0000 Subject: [PATCH 3/3] ghc 8.2.2: Backport cross fixes from 8.4.3 Other patches are also needed for a working build, but that doesn't mean these patches are any less necessary. --- pkgs/development/compilers/ghc/8.2.2.nix | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/pkgs/development/compilers/ghc/8.2.2.nix b/pkgs/development/compilers/ghc/8.2.2.nix index 6a1914a9c2c..caf5b941f7c 100644 --- a/pkgs/development/compilers/ghc/8.2.2.nix +++ b/pkgs/development/compilers/ghc/8.2.2.nix @@ -22,7 +22,7 @@ , # Whether to build dynamic libs for the standard library (on the target # platform). Static libs are always built. - enableShared ? true + enableShared ? !stdenv.targetPlatform.useiOSPrebuilt , # What flavour to build. An empty string indicates no # specific flavour and falls back to ghc default values. @@ -79,7 +79,7 @@ let targetCC = builtins.head toolsForTarget; in -stdenv.mkDerivation rec { +stdenv.mkDerivation (rec { version = "8.2.2"; name = "${targetPrefix}ghc-${version}"; @@ -239,4 +239,8 @@ stdenv.mkDerivation rec { inherit (ghc.meta) license platforms; }; -} +} // stdenv.lib.optionalAttrs targetPlatform.useAndroidPrebuilt { + dontStrip = true; + dontPatchELF = true; + noAuditTmpdir = true; +})