Merge pull request #40210 from ElvishJerricco/fix-android-prebuilt-ghc

Fix android prebuilt ghc [Fixes #40194]
This commit is contained in:
John Ericson 2018-05-10 00:10:11 -04:00 committed by GitHub
commit 83fdfb9837
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 3 deletions

View File

@ -3,7 +3,7 @@
# build-tools
, bootPkgs, alex, happy
, autoconf, automake, coreutils, fetchurl, perl, python3
, autoconf, automake, coreutils, fetchurl, fetchpatch, perl, python3
, libffi, libiconv ? null, ncurses
@ -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 ? !targetPlatform.useAndroidPrebuilt
, version ? "8.4.2"
}:
@ -50,6 +50,8 @@ let
'' + stdenv.lib.optionalString enableRelocatedStaticLibs ''
GhcLibHcOpts += -fPIC
GhcRtsHcOpts += -fPIC
'' + stdenv.lib.optionalString targetPlatform.useAndroidPrebuilt ''
EXTRA_CC_OPTS += -std=gnu99
'';
# Splicer will pull out correct variations
@ -79,6 +81,13 @@ stdenv.mkDerivation rec {
outputs = [ "out" "doc" ];
patches = [(fetchpatch {
url = "https://git.haskell.org/hsc2hs.git/patch/738f3666c878ee9e79c3d5e819ef8b3460288edf";
sha256 = "0plzsbfaq6vb1023lsarrjglwgr9chld4q3m99rcfzx0yx5mibp3";
extraPrefix = "utils/hsc2hs/";
stripLen = 1;
})];
postPatch = "patchShebangs .";
# GHC is a bit confused on its cross terminology.

View File

@ -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 ? !targetPlatform.useAndroidPrebuilt
, version ? "8.5.20180118"
}:
@ -50,6 +50,8 @@ let
'' + stdenv.lib.optionalString enableRelocatedStaticLibs ''
GhcLibHcOpts += -fPIC
GhcRtsHcOpts += -fPIC
'' + stdenv.lib.optionalString targetPlatform.useAndroidPrebuilt ''
EXTRA_CC_OPTS += -std=gnu99
'';
# Splicer will pull out correct variations