Skip to content

Commit

Permalink
Merge pull request #37598 from dtzWill/feature/ghc-cross-musl
Browse files Browse the repository at this point in the history
ghc-{8.2.2,8.4.1}: fixups mostly for 2-stage cross, musl
  • Loading branch information
Ericson2314 authored Jun 18, 2018
2 parents b3d9576 + 6cc5483 commit 07ff2c2
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 2 deletions.
25 changes: 24 additions & 1 deletion pkgs/development/compilers/ghc/8.2.2.nix
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ let
'' + stdenv.lib.optionalString enableIntegerSimple ''
INTEGER_LIBRARY = integer-simple
'' + stdenv.lib.optionalString (targetPlatform != hostPlatform) ''
Stage1Only = YES
Stage1Only = ${if targetPlatform.system == hostPlatform.system then "NO" else "YES"}
CrossCompilePrefix = ${targetPrefix}
HADDOCK_DOCS = NO
BUILD_SPHINX_HTML = NO
BUILD_SPHINX_PDF = NO
Expand Down Expand Up @@ -93,6 +94,27 @@ stdenv.mkDerivation rec {
sha256 = "03253ci40np1v6k0wmi4aypj3nmj3rdyvb1k6rwqipb30nfc719f";
})
(import ./abi-depends-determinism.nix { inherit fetchpatch runCommand; })
] ++ stdenv.lib.optionals (hostPlatform != targetPlatform && targetPlatform.system == hostPlatform.system) [
(fetchpatch {
url = "https://raw.githubusercontent.com/gentoo/gentoo/08a41d2dff99645af6ac5a7bb4774f5f193b6f20/dev-lang/ghc/files/ghc-8.2.1_rc1-unphased-cross.patch";
sha256 = "1hxj80bjx0x3w0f35cj3k2wipppr1ald03jwfy5q0xlxygdha17w";
})
(fetchpatch {
url = "https://raw.githubusercontent.com/gentoo/gentoo/08a41d2dff99645af6ac5a7bb4774f5f193b6f20/dev-lang/ghc/files/ghc-8.2.1_rc1-staged-cross.patch";
sha256 = "12xsln3zyfpvml8bwdpbc003h6zl1qh2qcq1rhdrw02n45dz8lvc";
})
(fetchpatch {
url = "https://raw.githubusercontent.com/gentoo/gentoo/08a41d2dff99645af6ac5a7bb4774f5f193b6f20/dev-lang/ghc/files/ghc-8.2.1_rc1-ghci-cross.patch";
sha256 = "03dcqf5af3vjhrky3f2z26j4d9h8qd9nkv76xp0l97h4cqk7vfqb";
})
(fetchpatch {
url = "https://raw.githubusercontent.com/gentoo/gentoo/08a41d2dff99645af6ac5a7bb4774f5f193b6f20/dev-lang/ghc/files/ghc-8.2.1_rc1-stage2-cross.patch";
sha256 = "0pi2m85wjxaaablq6n4q5vyn9qxvry5d7nmja4b28i68yb4ly9g1";
})
(fetchpatch {
url = "https://raw.githubusercontent.com/gentoo/gentoo/08a41d2dff99645af6ac5a7bb4774f5f193b6f20/dev-lang/ghc/files/ghc-8.2.1_rc1-hp2ps-cross.patch";
sha256 = "1fszfavf1cvrf02x500mi7jykcpvpl2i7i4qzr2qz9sbmyq063f0";
})
] ++ stdenv.lib.optional deterministicProfiling
(fetchpatch { # Backport of https://phabricator.haskell.org/D4388 for more determinism
url = "https://github.com/shlevy/ghc/commit/fec1b8d3555c447c0d8da0e96b659be67c8bb4bc.patch";
Expand Down Expand Up @@ -134,6 +156,7 @@ stdenv.mkDerivation rec {
# `--with` flags for libraries needed for RTS linker
configureFlags = [
"--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"
Expand Down
4 changes: 3 additions & 1 deletion pkgs/development/compilers/ghc/8.4.2.nix
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ let
'' + stdenv.lib.optionalString enableIntegerSimple ''
INTEGER_LIBRARY = integer-simple
'' + stdenv.lib.optionalString (targetPlatform != hostPlatform) ''
Stage1Only = YES
Stage1Only = ${if targetPlatform.system == hostPlatform.system then "NO" else "YES"}
CrossCompilePrefix = ${targetPrefix}
HADDOCK_DOCS = NO
BUILD_SPHINX_HTML = NO
BUILD_SPHINX_PDF = NO
Expand Down Expand Up @@ -129,6 +130,7 @@ stdenv.mkDerivation rec {
# `--with` flags for libraries needed for RTS linker
configureFlags = [
"--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"
Expand Down

0 comments on commit 07ff2c2

Please sign in to comment.