|
57 | 57 | };
|
58 | 58 | ghc-patches = version: let
|
59 | 59 | # Returns true iff this derivation's version is strictly older than ver.
|
60 |
| - versionOlder = ver: builtins.compareVersions ver version == 1; |
| 60 | + versionLessThan = ver: builtins.compareVersions ver version == 1; |
61 | 61 | # Returns true iff this derivation's verion is greater than or equal to ver.
|
62 |
| - versionAtLeast = ver: !versionOlder ver; |
63 |
| - # Patches for which we know they have been merged into a public release already |
64 |
| - in self.lib.optional (versionAtLeast "8.4.4" && versionOlder "8.6") ./patches/ghc/ghc-8.4.4-reinstallable-lib-ghc.patch |
65 |
| - ++ self.lib.optional (versionOlder "8.6") ./patches/ghc/move-iserv-8.4.2.patch |
66 |
| - ++ self.lib.optional (versionOlder "8.6") ./patches/ghc/hsc2hs-8.4.2.patch |
67 |
| - ++ self.lib.optional (versionOlder "8.6") ./patches/ghc/various-8.4.2.patch |
68 |
| - ++ self.lib.optional (versionOlder "8.6") ./patches/ghc/lowercase-8.4.2.patch |
69 |
| - ++ self.lib.optional (versionOlder "8.6") ./patches/ghc/cabal-exe-ext-8.4.2.patch |
70 |
| - ++ self.lib.optional (versionOlder "8.6") ./patches/ghc/ghc-8.4.3-Cabal2201-SMP-test-fix.patch |
71 |
| - ++ self.lib.optional (versionOlder "8.6") ./patches/ghc/outputtable-assert-8.4.patch |
72 |
| - ++ self.lib.optional (versionAtLeast "8.6" && versionOlder "8.6.4") ./patches/ghc/MR148--T16104-GhcPlugins.patch |
73 |
| - ++ self.lib.optional (versionOlder "8.6.4") ./patches/ghc/MR95--ghc-pkg-deadlock-fix.patch |
74 |
| - |
75 |
| - # Patches for which we only know a lower bound. |
76 |
| - ++ self.lib.optional (versionAtLeast "8.6") ./patches/ghc/iserv-proxy-cleanup.patch # https://gitlab.haskell.org/ghc/ghc/merge_requests/250 -- merged; ghc-8.8.1 |
77 |
| - ++ self.lib.optional (versionAtLeast "8.2") ./patches/ghc/MR545--ghc-pkg-databases.patch # https://gitlab.haskell.org/ghc/ghc/merge_requests/545 -- merged; ghc-8.8.1 |
78 |
| - ++ self.lib.optional (versionAtLeast "8.6") ./patches/ghc/outputtable-assert-8.6.patch |
79 |
| - ++ self.lib.optional (versionAtLeast "8.6") ./patches/ghc/mistuke-ghc-err_clean_up_error_handler-8ab1a89af89848f1713e6849f189de66c0ed7898.diff # this is part of Phyx- revamped io-manager. |
80 |
| - ++ self.lib.optional (versionAtLeast "8.6.4") ./patches/ghc/ghc-8.6.4-reenable-th-qq-in-stage1.patch |
81 |
| - ++ [ |
82 |
| - ./patches/ghc/ghc-add-keepCAFs-to-rts.patch # https://gitlab.haskell.org/ghc/ghc/merge_requests/950 -- open |
83 |
| - ./patches/ghc/lowercase-8.6.patch # https://gitlab.haskell.org/ghc/ghc/merge_requests/949 -- merged; ghc-8.8.1 |
84 |
| - ./patches/ghc/dll-loader-8.4.2.patch # https://gitlab.haskell.org/ghc/ghc/merge_requests/949 -- open |
85 |
| - ./patches/ghc/0001-Stop-the-linker-panic.patch # https://phabricator.haskell.org/D5012 -- merged; ghc-8.8.1 |
86 |
| - ./patches/ghc/ghc-8.4.3-Cabal2201-no-hackage-tests.patch # ? |
87 |
| - ./patches/ghc/ghc-8.4.3-Cabal2201-allow-test-wrapper.patch # https://github.com/haskell/cabal/pulls/5995 -- merged; cabal-3.0.0 (ghc-8.8.1) |
88 |
| - ./patches/ghc/ghc-8.4.3-Cabal2201-response-file-support.patch # https://github.com/haskell/cabal/pulls/5996 -- merged; cabal-3.0.0 (ghc-8.8.1) |
89 |
| - ./patches/ghc/ghc-8.6-Cabal-fix-datadir.patch # https://github.com/haskell/cabal/issues/5862 |
90 |
| - ./patches/ghc/MR196--ghc-pkg-shut-up.patch # https://gitlab.haskell.org/ghc/ghc/merge_requests/196 -- merged; ghc-8.8.1 |
91 |
| - ./patches/ghc/MR948--32bit-cross-th.patch # https://gitlab.haskell.org/ghc/ghc/merge_requests/948 -- open |
92 |
| - ] |
| 62 | + versionAtLeast = ver: !versionLessThan ver; |
| 63 | + from = start: self.lib.optional (versionAtLeast start); |
| 64 | + fromUntil = start: end: self.lib.optional (versionAtLeast start && versionLessThan end); |
| 65 | + until = end: self.lib.optional (versionLessThan end); |
| 66 | + always = self.lib.optional true; |
| 67 | + # Try to avoid reordering the patches unless a patch is added or changed that |
| 68 | + # will be applied to most versions of the GHC anyway (reordering the patches |
| 69 | + # results in rebuilds of GHC and reduces sharing in /nix/store). |
| 70 | + in fromUntil "8.4.4" "8.6" ./patches/ghc/ghc-8.4.4-reinstallable-lib-ghc.patch |
| 71 | + ++ until "8.6" ./patches/ghc/move-iserv-8.4.2.patch |
| 72 | + ++ until "8.6" ./patches/ghc/hsc2hs-8.4.2.patch |
| 73 | + ++ until "8.6" ./patches/ghc/various-8.4.2.patch |
| 74 | + ++ until "8.6" ./patches/ghc/lowercase-8.4.2.patch |
| 75 | + ++ until "8.6" ./patches/ghc/cabal-exe-ext-8.4.2.patch |
| 76 | + ++ until "8.6" ./patches/ghc/ghc-8.4.3-Cabal2201-SMP-test-fix.patch |
| 77 | + ++ until "8.6" ./patches/ghc/outputtable-assert-8.4.patch |
| 78 | + ++ fromUntil "8.6" "8.6.4" ./patches/ghc/MR148--T16104-GhcPlugins.patch |
| 79 | + ++ until "8.6.4" ./patches/ghc/MR95--ghc-pkg-deadlock-fix.patch |
| 80 | + ++ fromUntil "8.6" "8.8" ./patches/ghc/iserv-proxy-cleanup.patch # https://gitlab.haskell.org/ghc/ghc/merge_requests/250 -- merged; ghc-8.8.1 |
| 81 | + ++ from "8.6" ./patches/ghc/iserv-proxy-cleanup-2.patch |
| 82 | + ++ from "8.8" ./patches/ghc/iserv-proxy-cleanup-3.patch |
| 83 | + ++ fromUntil "8.2" "8.8" ./patches/ghc/MR545--ghc-pkg-databases.patch # https://gitlab.haskell.org/ghc/ghc/merge_requests/545 -- merged; ghc-8.8.1 |
| 84 | + ++ fromUntil "8.6" "8.8" ./patches/ghc/outputtable-assert-8.6.patch |
| 85 | + ++ fromUntil "8.6.4" "8.8" ./patches/ghc/ghc-8.6.4-reenable-th-qq-in-stage1.patch |
| 86 | + ++ until "8.8" ./patches/ghc/0001-Stop-the-linker-panic.patch # https://phabricator.haskell.org/D5012 -- merged; ghc-8.8.1 |
| 87 | + ++ until "8.8" ./patches/ghc/ghc-8.4.3-Cabal2201-allow-test-wrapper.patch # https://github.com/haskell/cabal/pulls/5995 -- merged; cabal-3.0.0 (ghc-8.8.1) |
| 88 | + ++ until "8.8" ./patches/ghc/ghc-8.4.3-Cabal2201-response-file-support.patch # https://github.com/haskell/cabal/pulls/5996 -- merged; cabal-3.0.0 (ghc-8.8.1) |
| 89 | + ++ until "8.8" ./patches/ghc/ghc-8.6-Cabal-fix-datadir.patch # https://github.com/haskell/cabal/issues/5862 |
| 90 | + ++ until "8.8" ./patches/ghc/MR196--ghc-pkg-shut-up.patch # https://gitlab.haskell.org/ghc/ghc/merge_requests/196 -- merged; ghc-8.8.1 |
| 91 | + ++ from "8.6" ./patches/ghc/mistuke-ghc-err_clean_up_error_handler-8ab1a89af89848f1713e6849f189de66c0ed7898.diff # this is part of Phyx- revamped io-manager. |
| 92 | + ++ always ./patches/ghc/ghc-add-keepCAFs-to-rts.patch # https://gitlab.haskell.org/ghc/ghc/merge_requests/950 -- open |
| 93 | + ++ always ./patches/ghc/lowercase-8.6.patch # https://gitlab.haskell.org/ghc/ghc/merge_requests/949 -- merged; ghc-8.8.1 |
| 94 | + ++ always ./patches/ghc/dll-loader-8.4.2.patch # https://gitlab.haskell.org/ghc/ghc/merge_requests/949 -- open |
| 95 | + ++ always ./patches/ghc/ghc-8.4.3-Cabal2201-no-hackage-tests.patch # ? |
| 96 | + ++ always ./patches/ghc/MR948--32bit-cross-th.patch # https://gitlab.haskell.org/ghc/ghc/merge_requests/948 -- open |
| 97 | + ++ from "8.8" ./patches/ghc/cabal-host.patch # https://github.com/haskell/cabal/issues/5887 |
| 98 | + ++ fromUntil "8.6.4" "8.8" ./patches/ghc/ghc-8.6.4-prim-no-arm-atomics.patch |
| 99 | + ++ fromUntil "8.6.4" "8.8" ./patches/ghc/global-offset-table.patch |
| 100 | + ++ fromUntil "8.6.4" "8.8" ./patches/ghc/global-offset-table-2.patch |
93 | 101 |
|
94 | 102 | # Patches for specific ghc versions.
|
95 |
| - ++ self.lib.optional (version == "8.6.3") ./patches/ghc/T16057--ghci-doa-on-windows.patch |
96 |
| - ++ self.lib.optional (version == "8.6.3") ./patches/ghc/ghc-8.6.3-reinstallable-lib-ghc.patch |
97 |
| - ++ self.lib.optional (version == "8.6.4") ./patches/ghc/ghc-8.6.4-reinstallable-lib-ghc.patch |
98 |
| - ++ self.lib.optional (version == "8.6.5") ./patches/ghc/ghc-8.6.5-reinstallable-lib-ghc.patch |
99 |
| - ++ self.lib.optional (version == "8.6.4") ./patches/ghc/ghc-8.6.4-better-plusSimplCountErrors.patch |
| 103 | + ++ self.lib.optional (version == "8.6.3") ./patches/ghc/T16057--ghci-doa-on-windows.patch |
| 104 | + ++ self.lib.optional (version == "8.6.3") ./patches/ghc/ghc-8.6.3-reinstallable-lib-ghc.patch |
| 105 | + ++ self.lib.optional (version == "8.6.4") ./patches/ghc/ghc-8.6.4-reinstallable-lib-ghc.patch |
| 106 | + ++ self.lib.optional (version == "8.6.5") ./patches/ghc/ghc-8.6.5-reinstallable-lib-ghc.patch |
| 107 | + ++ self.lib.optional (version == "8.8.1") ./patches/ghc/ghc-8.8.1-reinstallable-lib-ghc.patch |
| 108 | + ++ self.lib.optional (version == "8.8.2") ./patches/ghc/ghc-8.8.2-reinstallable-lib-ghc.patch |
| 109 | + ++ self.lib.optional (version == "8.6.4") ./patches/ghc/ghc-8.6.4-better-plusSimplCountErrors.patch |
100 | 110 | ++ self.lib.optional (versionAtLeast "8.6.4" && self.stdenv.isDarwin) ./patches/ghc/ghc-macOS-loadArchive-fix.patch
|
101 | 111 | ++ self.lib.optional (versionAtLeast "8.4.4" && self.stdenv.isDarwin) ./patches/ghc/ghc-darwin-gcc-version-fix.patch
|
102 |
| - ++ self.lib.optional (versionAtLeast "8.6.4" && versionOlder "8.8") ./patches/ghc/ghc-8.6.4-prim-no-arm-atomics.patch |
103 |
| - ++ self.lib.optional (versionAtLeast "8.6.4" && versionOlder "8.8") ./patches/ghc/global-offset-table.patch |
104 |
| - ++ self.lib.optional (versionAtLeast "8.6.4" && versionOlder "8.8") ./patches/ghc/global-offset-table-2.patch |
105 | 112 | ;
|
106 | 113 | in ({
|
107 | 114 | ghc844 = self.callPackage ../compiler/ghc {
|
@@ -206,6 +213,38 @@ in {
|
206 | 213 | ghc-patches = ghc-patches "8.6.5"
|
207 | 214 | ++ [ D5123-patch haddock-900-patch ];
|
208 | 215 | };
|
| 216 | + ghc881 = self.callPackage ../compiler/ghc { |
| 217 | + extra-passthru = { buildGHC = self.buildPackages.haskell-nix.compiler.ghc881; }; |
| 218 | + |
| 219 | + inherit bootPkgs sphinx installDeps; |
| 220 | + |
| 221 | + buildLlvmPackages = self.buildPackages.llvmPackages_7; |
| 222 | + llvmPackages = self.llvmPackages_7; |
| 223 | + |
| 224 | + src-spec = rec { |
| 225 | + version = "8.8.1"; |
| 226 | + url = "https://downloads.haskell.org/~ghc/${version}/ghc-${version}-src.tar.xz"; |
| 227 | + sha256 = "06kj4fhvijinjafiy4s873n60qly323rdlz9bmc79nhlp3cq72lh"; |
| 228 | + }; |
| 229 | + |
| 230 | + ghc-patches = ghc-patches "8.8.1"; |
| 231 | + }; |
| 232 | + ghc882 = self.callPackage ../compiler/ghc { |
| 233 | + extra-passthru = { buildGHC = self.buildPackages.haskell-nix.compiler.ghc882; }; |
| 234 | + |
| 235 | + inherit bootPkgs sphinx installDeps; |
| 236 | + |
| 237 | + buildLlvmPackages = self.buildPackages.llvmPackages_7; |
| 238 | + llvmPackages = self.llvmPackages_7; |
| 239 | + |
| 240 | + src-spec = rec { |
| 241 | + version = "8.8.2"; |
| 242 | + url = "https://downloads.haskell.org/~ghc/${version}/ghc-${version}-src.tar.xz"; |
| 243 | + sha256 = "02qa6wgjpxgakg7hv4zfdlrx9k7zxa5i02wnr6y9fsv8j16sbkh1"; |
| 244 | + }; |
| 245 | + |
| 246 | + ghc-patches = ghc-patches "8.8.2"; |
| 247 | + }; |
209 | 248 | } // self.lib.optionalAttrs (self.targetPlatform.isGhcjs or false) {
|
210 | 249 | ghc865 = let ghcjs865 = self.callPackage ../compiler/ghcjs/ghcjs.nix {
|
211 | 250 | ghcjsSrcJson = ../compiler/ghcjs/ghcjs-src.json;
|
|
0 commit comments