From 4f5d9996a628e44695657f9a8f860a5f111acab3 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Tue, 2 Oct 2018 00:33:30 -0400 Subject: [PATCH] ghc-8.2.2: Fix which hsc2hs is installed on cross These commits all ended up on later GHCs, and are already being patched in for ghc-8.4.3 in nixpkgs. --- pkgs/development/compilers/ghc/8.2.2.nix | 29 ++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/pkgs/development/compilers/ghc/8.2.2.nix b/pkgs/development/compilers/ghc/8.2.2.nix index caf5b941f7c0..b1c615f1ce28 100644 --- a/pkgs/development/compilers/ghc/8.2.2.nix +++ b/pkgs/development/compilers/ghc/8.2.2.nix @@ -98,6 +98,35 @@ stdenv.mkDerivation (rec { sha256 = "03253ci40np1v6k0wmi4aypj3nmj3rdyvb1k6rwqipb30nfc719f"; }) (import ./abi-depends-determinism.nix { inherit fetchpatch runCommand; }) + ] ++ stdenv.lib.optionals (hostPlatform != targetPlatform) [ + # Cherry-pick a few commits from newer hsc2hs so that proper binary is + # installed -- stage 2 normally but stage 1 with cross. + # + # TODO make unconditional next mass rebuild. + (fetchpatch { + url = "https://git.haskell.org/hsc2hs.git/patch/ecdac062b5cf1d284906487849c56f4e149b3c8e"; + sha256 = "1gagswi26j50z44sdx0mk1sb3wr0nrqyaph9j724zp6iwqslxyzm"; + extraPrefix = "utils/hsc2hs/"; + stripLen = 1; + }) + (fetchpatch { + url = "https://git.haskell.org/hsc2hs.git/patch/d1e191766742e9166a90656c94a7cf3bd73444df"; + sha256 = "0q25n0k0sbgji6qvalx5j3lmw80j2k0d2k87k4v4y7xqc4ihpi12"; + extraPrefix = "utils/hsc2hs/"; + stripLen = 1; + }) + (fetchpatch { + url = "https://git.haskell.org/hsc2hs.git/patch/9483ad10064fbbb97ab525280623826b1ef63959"; + sha256 = "1cpfdhfc0cz9xkjzkcgwx4fbyj96dkmd04wpwi1vji7fahw8kmf3"; + extraPrefix = "utils/hsc2hs/"; + stripLen = 1; + }) + (fetchpatch { + url = "https://git.haskell.org/hsc2hs.git/patch/738f3666c878ee9e79c3d5e819ef8b3460288edf"; + sha256 = "0plzsbfaq6vb1023lsarrjglwgr9chld4q3m99rcfzx0yx5mibp3"; + extraPrefix = "utils/hsc2hs/"; + stripLen = 1; + }) ] ++ 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";