8 jailbreakWhileRevision = rev:
10 jailbreak = assert old.revision or "0" == toString rev; true;
12 checkAgainAfter = pkg: ver: msg: act:
13 if builtins.compareVersions pkg.version ver <= 0 then act
15 builtins.throw "Check if '${msg}' was resolved in ${pkg.pname} ${pkg.version} and update or remove this";
16 jailbreakForCurrentVersion = p: v: checkAgainAfter p v "bad bounds" (doJailbreak p);
21 llvmPackages = lib.dontRecurseIntoAttrs self.ghc.llvmPackages;
23 # Disable GHC core libraries
52 system-cxx-std-lib = null;
53 template-haskell = null;
54 # terminfo is not built if GHC is a cross compiler
55 terminfo = if pkgs.stdenv.hostPlatform == pkgs.stdenv.buildPlatform then null else doDistribute self.terminfo_0_4_1_6;
63 # Version deviations from Stackage LTS
66 # Too strict upper bound on template-haskell
67 # https://github.com/mokus0/th-extras/pull/21
68 th-extras = doJailbreak super.th-extras;
70 # not in Stackage, needs to match ghc-lib
71 ghc-tags = doDistribute self.ghc-tags_1_7;
74 # Too strict bounds without upstream fix
77 # Forbids transformers >= 0.6
78 quickcheck-classes-base = doJailbreak super.quickcheck-classes-base;
79 # https://github.com/Gabriella439/Haskell-Break-Library/pull/3
80 break = doJailbreak super.break;
82 ChasingBottoms = doJailbreak super.ChasingBottoms;
83 # Forbids base >= 4.18
84 cabal-install-solver = doJailbreak super.cabal-install-solver;
85 cabal-install = doJailbreak super.cabal-install;
87 # Forbids base >= 4.18, fix proposed: https://github.com/sjakobi/newtype-generics/pull/25
88 newtype-generics = jailbreakForCurrentVersion super.newtype-generics "0.6.2";
90 # Jailbreaks for servant <0.20
91 servant-lucid = doJailbreak super.servant-lucid;
93 lifted-base = dontCheck super.lifted-base;
94 hw-prim = dontCheck (doJailbreak super.hw-prim);
95 stm-containers = dontCheck super.stm-containers;
96 regex-tdfa = dontCheck super.regex-tdfa;
97 hiedb = dontCheck super.hiedb;
98 retrie = dontCheck super.retrie;
99 # https://github.com/kowainik/relude/issues/436
100 relude = dontCheck (doJailbreak super.relude);
102 inherit (pkgs.lib.mapAttrs (_: doJailbreak ) super)
104 gi-cairo-connector # mtl <2.3
105 ghc-prof # base <4.18
106 env-guard # doctest <0.21
107 package-version # doctest <0.21, tasty-hedgehog <1.4
110 # Pending text-2.0 support https://github.com/gtk2hs/gtk2hs/issues/327
111 gtk = doJailbreak super.gtk;
113 # 2023-12-23: It needs this to build under ghc-9.6.3.
114 # A factor of 100 is insufficent, 200 seems seems to work.
115 hip = appendConfigureFlag "--ghc-options=-fsimpl-tick-factor=200" super.hip;
117 # Doctest comments have bogus imports.
118 bsb-http-chunked = dontCheck super.bsb-http-chunked;
120 # This can be removed once https://github.com/typeclasses/ascii-predicates/pull/1
121 # is merged and in a release that's being tracked.
122 ascii-predicates = appendPatch
124 { url = "https://github.com/typeclasses/ascii-predicates/commit/2e6d9ed45987a8566f3a77eedf7836055c076d1a.patch";
125 name = "ascii-predicates-pull-1.patch";
126 relative = "ascii-predicates";
127 sha256 = "sha256-4JguQFZNRQpjZThLrAo13jNeypvLfqFp6o7c1bnkmZo=";
129 super.ascii-predicates;
131 # This can be removed once https://github.com/typeclasses/ascii-numbers/pull/1
132 # is merged and in a release that's being tracked.
133 ascii-numbers = appendPatch
135 { url = "https://github.com/typeclasses/ascii-numbers/commit/e9474ad91bc997891f1a46afd5d0bdf9b9f7d768.patch";
136 name = "ascii-numbers-pull-1.patch";
137 relative = "ascii-numbers";
138 sha256 = "sha256-buw1UeW57CFefEfqdDUraSyQ+H/NvCZOv6WF2ORiYQg=";
142 # Apply patch from PR with mtl-2.3 fix.
143 ConfigFile = overrideCabal (drv: {
144 editedCabalFile = null;
145 buildDepends = drv.buildDepends or [] ++ [ self.HUnit ];
146 patches = [(pkgs.fetchpatch {
147 # https://github.com/jgoerzen/configfile/pull/12
148 name = "ConfigFile-pr-12.patch";
149 url = "https://github.com/jgoerzen/configfile/compare/d0a2e654be0b73eadbf2a50661d00574ad7b6f87...83ee30b43f74d2b6781269072cf5ed0f0e00012f.patch";
150 sha256 = "sha256-b7u9GiIAd2xpOrM0MfILHNb6Nt7070lNRIadn2l3DfQ=";
154 # Compatibility with core libs of GHC 9.6
155 # Jailbreak to lift bound on time
156 kqueue = doJailbreak (appendPatches [
158 name = "kqueue-ghc-9.6.patch";
159 url = "https://github.com/hesselink/kqueue/pull/10/commits/a2735e807d761410e776482ec04515d9cf76a7f5.patch";
160 sha256 = "18rilz4nrwcmlvll3acjx2lp7s129pviggb8fy3hdb0z34ls5j84";
161 excludes = [ ".gitignore" ];
165 # This runs into the following GHC bug currently affecting 9.6.* and 9.8.* as
166 # well as 9.10.1: https://gitlab.haskell.org/ghc/ghc/-/issues/24432
167 inherit (lib.mapAttrs (_: overrideCabal (drv: {
168 badPlatforms = drv.badPlatforms or [ ] ++ [ "aarch64-linux" ];
172 lambdabot-haskell-plugins
175 singletons-base = dontCheck super.singletons-base;
177 # super.ghc is required to break infinite recursion as Nix is strict in the attrNames
178 // lib.optionalAttrs (pkgs.stdenv.hostPlatform.isAarch64 && lib.versionOlder super.ghc.version "9.6.4") {
179 # The NCG backend for aarch64 generates invalid jumps in some situations,
180 # the workaround on 9.6 is to revert to the LLVM backend (which is used
181 # for these sorts of situations even on 9.2 and 9.4).
182 # https://gitlab.haskell.org/ghc/ghc/-/issues/23746#note_525318
183 inherit (lib.mapAttrs (_: self.forceLlvmCodegenBackend) super)