triptych.nvim: add plenary-nvim as required dependency (#358924)
[NixPkgs.git] / pkgs / development / haskell-modules / configuration-common.nix
blobbd174babd549fab671f8e6c069157a45d7937497
1 # COMMON OVERRIDES FOR THE HASKELL PACKAGE SET IN NIXPKGS
3 # This file contains haskell package overrides that are shared by all
4 # haskell package sets provided by nixpkgs and distributed via the official
5 # NixOS hydra instance.
7 # Overrides that would also make sense for custom haskell package sets not provided
8 # as part of nixpkgs and that are specific to Nix should go in configuration-nix.nix
10 # See comment at the top of configuration-nix.nix for more information about this
11 # distinction.
12 { pkgs, haskellLib }:
14 let
15   inherit (pkgs) fetchpatch lib;
16   inherit (lib) throwIfNot versionOlder;
19 with haskellLib;
21 self: super: {
22   # enable list-transformer, jailbreaking is necessary until next release >0.13.0: https://github.com/ivanperez-keera/dunai/issues/427
23   dunai = doJailbreak (addBuildDepend self.list-transformer (enableCabalFlag "list-transformer" super.dunai));
25   # Make sure that Cabal_* can be built as-is
26   Cabal_3_10_3_0 = doDistribute (super.Cabal_3_10_3_0.override {
27     Cabal-syntax = self.Cabal-syntax_3_10_3_0;
28   });
29   Cabal_3_12_1_0 = doDistribute (super.Cabal_3_12_1_0.override {
30     Cabal-syntax = self.Cabal-syntax_3_12_1_0;
31   });
32   Cabal_3_14_0_0 = doDistribute (super.Cabal_3_14_0_0.override {
33     Cabal-syntax = self.Cabal-syntax_3_14_0_0;
34   });
36   # hackage-security == 0.6.2.6 has a wider support range in theory, but it only
37   # makes sense to use the non Stackage version if we want to use Cabal* >= 3.12
38   hackage-security_0_6_2_6 = super.hackage-security_0_6_2_6.override {
39     Cabal = self.Cabal_3_12_1_0;
40     Cabal-syntax = self.Cabal-syntax_3_12_1_0;
41   };
43   # cabal-install needs most recent versions of Cabal and Cabal-syntax,
44   # so we need to put some extra work for non-latest GHCs
45   inherit (
46     let
47       # !!! Use cself/csuper inside for the actual overrides
48       cabalInstallOverlay = cself: csuper:
49         {
50           hackage-security = self.hackage-security_0_6_2_6;
51         } // lib.optionalAttrs (lib.versionOlder self.ghc.version "9.10.2") {
52           Cabal = cself.Cabal_3_12_1_0;
53           Cabal-syntax = cself.Cabal-syntax_3_12_1_0;
54         };
55     in
56     {
57       cabal-install =
58         let
59           cabal-install = super.cabal-install.overrideScope cabalInstallOverlay;
60           scope = cabal-install.scope;
61         in
62         # Some dead code is not properly eliminated on aarch64-darwin, leading
63         # to bogus references to some dependencies.
64         overrideCabal (old: lib.optionalAttrs (pkgs.stdenv.hostPlatform.isDarwin && pkgs.stdenv.hostPlatform.isAarch64) {
65           postInstall = ''
66             ${old.postInstall or ""}
67             remove-references-to -t ${scope.HTTP} "$out/bin/.cabal-wrapped"
68             remove-references-to -t ${scope.Cabal} "$out/bin/.cabal-wrapped"
69           '';
70         }) cabal-install;
72       cabal-install-solver = super.cabal-install-solver.overrideScope cabalInstallOverlay;
74       # Needs cabal-install >= 3.8 /as well as/ matching Cabal
75       guardian =
76         lib.pipe
77           (super.guardian.overrideScope cabalInstallOverlay)
78           [
79             # Tests need internet access (run stack)
80             dontCheck
81             # May as well…
82             (self.generateOptparseApplicativeCompletions [ "guardian" ])
83           ];
84     }
85   ) cabal-install
86     cabal-install-solver
87     guardian
88   ;
90   # Extensions wants the latest version of Cabal for its list of Haskell
91   # language extensions.
92   # 2024-01-15: jailbreak to allow hspec-hedgehog 0.1.1.0 https://github.com/kowainik/extensions/pull/92
93   extensions = doJailbreak (super.extensions.override {
94     Cabal =
95       if versionOlder self.ghc.version "9.6"
96       then self.Cabal_3_10_3_0
97       else null; # use GHC bundled version
98   });
100   #######################################
101   ### HASKELL-LANGUAGE-SERVER SECTION ###
102   #######################################
104   # All jailbreaks in this section due to: https://github.com/haskell/haskell-language-server/pull/4316#discussion_r1667684895
105   haskell-language-server = doJailbreak (dontCheck (super.haskell-language-server.overrideScope (lself: lsuper: {
106     # For most ghc versions, we overrideScope Cabal in the configuration-ghc-???.nix,
107     # because some packages, like ormolu, need a newer Cabal version.
108     # ghc-paths is special because it depends on Cabal for building
109     # its Setup.hs, and therefor declares a Cabal dependency, but does
110     # not actually use it as a build dependency.
111     # That means ghc-paths can just use the ghc included Cabal version,
112     # without causing package-db incoherence and we should do that because
113     # otherwise we have different versions of ghc-paths
114     # around which have the same abi-hash, which can lead to confusions and conflicts.
115     ghc-paths = lsuper.ghc-paths.override { Cabal = null; };
116   })));
117   hls-plugin-api = doJailbreak super.hls-plugin-api;
118   ghcide = doJailbreak super.ghcide;
120   # For -f-auto see cabal.project in haskell-language-server.
121   ghc-lib-parser-ex = addBuildDepend self.ghc-lib-parser (disableCabalFlag "auto" super.ghc-lib-parser-ex);
123   ###########################################
124   ### END HASKELL-LANGUAGE-SERVER SECTION ###
125   ###########################################
127   # Test ldap server test/ldap.js is missing from sdist
128   # https://github.com/supki/ldap-client/issues/18
129   ldap-client-og = dontCheck super.ldap-client-og;
131   # Support for template-haskell >= 2.16
132   language-haskell-extract = appendPatch (pkgs.fetchpatch {
133     url = "https://gitlab.haskell.org/ghc/head.hackage/-/raw/dfd024c9a336c752288ec35879017a43bd7e85a0/patches/language-haskell-extract-0.2.4.patch";
134     sha256 = "0w4y3v69nd3yafpml4gr23l94bdhbmx8xky48a59lckmz5x9fgxv";
135   }) (doJailbreak super.language-haskell-extract);
137   vector = overrideCabal (old: {
138     # Too strict bounds on doctest which isn't used, but is part of the configuration
139     jailbreak = true;
140     # vector-doctest seems to be broken when executed via ./Setup test
141     testTarget = lib.concatStringsSep " " [
142       "vector-tests-O0"
143       "vector-tests-O2"
144     ];
145   }) super.vector;
147   # Too strict bounds on base
148   # https://github.com/lspitzner/butcher/issues/7#issuecomment-1681394943
149   butcher = doJailbreak super.butcher;
150   # https://github.com/lspitzner/data-tree-print/issues/4
151   data-tree-print = doJailbreak super.data-tree-print;
152   # … and template-haskell.
153   # https://github.com/lspitzner/czipwith/issues/5
154   czipwith = doJailbreak super.czipwith;
156   # jacinda needs latest version of alex
157   jacinda = super.jacinda.override {
158     alex = self.alex_3_5_1_0;
159   };
161   # 2024-07-09: rhine 1.4.* needs newer monad-schedule than stackage (and is only consumer)
162   monad-schedule = assert super.monad-schedule.version == "0.1.2.2"; doDistribute self.monad-schedule_0_2_0_1;
164   aeson =
165     # aeson's test suite includes some tests with big numbers that fail on 32bit
166     # https://github.com/haskell/aeson/issues/1060
167     dontCheckIf pkgs.stdenv.hostPlatform.is32bit
168     # Deal with infinite and NaN values generated by QuickCheck-2.14.3
169     (appendPatches [
170       (pkgs.fetchpatch {
171         name = "aeson-quickcheck-2.14.3-double-workaround.patch";
172         url = "https://github.com/haskell/aeson/commit/58766a1916b4980792763bab74f0c86e2a7ebf20.patch";
173         sha256 = "1jk2xyi9g6dfjsi6hvpvkpmag3ivimipwy1izpbidf3wvc9cixs3";
174       })
175     ] super.aeson);
177   # 2023-06-28: Test error: https://hydra.nixos.org/build/225565149
178   orbits = dontCheck super.orbits;
180   # Too strict bounds on hspec < 2.11
181   http-api-data = doJailbreak super.http-api-data;
182   tasty-discover = doJailbreak super.tasty-discover;
184   # Out of date test data: https://github.com/ocharles/weeder/issues/176
185   weeder = appendPatch (pkgs.fetchpatch {
186     name = "weeder-2.9.0-test-fix-expected.patch";
187     url = "https://github.com/ocharles/weeder/commit/56028d0c80fe89d4f2ae25275aedb72714fec7da.patch";
188     sha256 = "10zkvclyir3zf21v41zdsvg68vrkq89n64kv9k54742am2i4aygf";
189   }) super.weeder;
191   # Allow aeson == 2.1.*
192   # https://github.com/hdgarrood/aeson-better-errors/issues/23
193   aeson-better-errors = lib.pipe super.aeson-better-errors [
194     doJailbreak
195     (appendPatches [
196       # https://github.com/hdgarrood/aeson-better-errors/pull/25
197       (fetchpatch {
198         name = "mtl-2-3.patch";
199         url = "https://github.com/hdgarrood/aeson-better-errors/commit/1ec49ab7d1472046b680b5a64ae2930515b47714.patch";
200         hash = "sha256-xuuocWxSoBDclVp0bJ9UrDamVcDVOAFgJIi/un1xBvk=";
201       })
202     ])
203   ];
205   # Version 2.1.1 is deprecated, but part of Stackage LTS at the moment.
206   # https://github.com/commercialhaskell/stackage/issues/7500
207   # https://github.com/yesodweb/shakespeare/issues/280
208   shakespeare = doDistribute self.shakespeare_2_1_0_1;
210   # 2023-08-09: Jailbreak because of vector < 0.13
211   # 2023-11-09: don't check because of https://github.com/tweag/monad-bayes/pull/326
212   monad-bayes = dontCheck (doJailbreak super.monad-bayes);
214   # Disable tests failing on odd floating point numbers generated by QuickCheck 2.14.3
215   # https://github.com/haskell/statistics/issues/205
216   statistics = overrideCabal (drv: {
217     testFlags = [
218       "-p" "! (/Pearson correlation/ || /t_qr/ || /Tests for: FDistribution.1-CDF is correct/)"
219     ];
220   }) super.statistics;
222   # There are numerical tests on random data, that may fail occasionally
223   lapack = dontCheck super.lapack;
225   # currently, cabal-plan seems to get not much maintenance
226   cabal-plan = doJailbreak super.cabal-plan;
228   # test dependency has incorrect upper bound but still supports the newer dependency
229   # https://github.com/fused-effects/fused-effects/issues/451
230   # https://github.com/fused-effects/fused-effects/pull/452
231   fused-effects = doJailbreak super.fused-effects;
233   # support for transformers >= 0.6
234   fused-effects-random = doJailbreak super.fused-effects-random;
235   fused-effects-readline = doJailbreak super.fused-effects-readline;
237   leveldb-haskell = overrideCabal (drv: {
238     version = "2024-05-05-unstable";
239     # Fix tests on mtl ≥ 2.3
240     # https://github.com/kim/leveldb-haskell/pull/42
241     src = pkgs.fetchFromGitHub {
242       owner = "kim";
243       repo = "leveldb-haskell";
244       rev = "3a505f3a7de0f5d14463538d7c2c9a9881a60eb9";
245       sha256 = "sha256-okUn5ZuWcj8vPr0GWXvO1LygNCrDfttkDaUoOt+FLA0=";
246     };
247   }) super.leveldb-haskell;
249   # 2024-06-23: Hourglass is archived and had its last commit 6 years ago.
250   # Patch is needed to add support for time 1.10, which is only used in the tests
251   # https://github.com/vincenthz/hs-hourglass/pull/56
252   # Jailbreak is needed because a hackage revision added the (correct) time <1.10 bound.
253   hourglass = doJailbreak
254     (appendPatches [
255       (pkgs.fetchpatch {
256         name = "hourglass-pr-56.patch";
257         url =
258           "https://github.com/vincenthz/hs-hourglass/commit/cfc2a4b01f9993b1b51432f0a95fa6730d9a558a.patch";
259         sha256 = "sha256-gntZf7RkaR4qzrhjrXSC69jE44SknPDBmfs4z9rVa5Q=";
260       })
261     ] super.hourglass);
263   # Arion's test suite needs a Nixpkgs, which is cumbersome to do from Nixpkgs
264   # itself. For instance, pkgs.path has dirty sources and puts a huge .git in the
265   # store. Testing is done upstream.
266   arion-compose = dontCheck super.arion-compose;
268   # 2023-07-17: Outdated base bound https://github.com/srid/lvar/issues/5
269   lvar = doJailbreak super.lvar;
271   # This used to be a core package provided by GHC, but then the compiler
272   # dropped it. We define the name here to make sure that old packages which
273   # depend on this library still evaluate (even though they won't compile
274   # successfully with recent versions of the compiler).
275   bin-package-db = null;
277   # Unnecessarily requires alex >= 3.3
278   # https://github.com/glguy/config-value/commit/c5558c8258598fab686c259bff510cc1b19a0c50#commitcomment-119514821
279   config-value = doJailbreak super.config-value;
281   # path-io bound is adjusted in 0.6.1 release
282   # https://github.com/tek/hix/commit/019426f6a3db256e4c96558ffe6fa2114e2f19a0
283   hix = doJailbreak super.hix;
285   # waiting for release: https://github.com/jwiegley/c2hsc/issues/41
286   c2hsc = appendPatch (fetchpatch {
287     url = "https://github.com/jwiegley/c2hsc/commit/490ecab202e0de7fc995eedf744ad3cb408b53cc.patch";
288     sha256 = "1c7knpvxr7p8c159jkyk6w29653z5yzgjjqj11130bbb8mk9qhq7";
289   }) super.c2hsc;
291   ghc-debug-client = doJailbreak super.ghc-debug-client;
293   # Test failure.  Tests also disabled in Stackage:
294   # https://github.com/jtdaugherty/brick/issues/499
295   brick = dontCheck super.brick;
297   # Needs older QuickCheck version
298   attoparsec-varword = dontCheck super.attoparsec-varword;
300   # These packages (and their reverse deps) cannot be built with profiling enabled.
301   ghc-heap-view = disableLibraryProfiling super.ghc-heap-view;
302   ghc-datasize = disableLibraryProfiling super.ghc-datasize;
303   ghc-vis = disableLibraryProfiling super.ghc-vis;
305   # Fixes compilation for basement on i686 for GHC >= 9.4
306   # https://github.com/haskell-foundation/foundation/pull/573
307   # Patch would not work for GHC >= 9.2 where it breaks compilation on x86_64
308   # https://github.com/haskell-foundation/foundation/pull/573#issuecomment-1669468867
309   # TODO(@sternenseemann): make unconditional
310   basement = appendPatches (lib.optionals pkgs.stdenv.hostPlatform.is32bit [
311     (fetchpatch {
312       name = "basement-i686-ghc-9.4.patch";
313       url = "https://github.com/haskell-foundation/foundation/pull/573/commits/38be2c93acb6f459d24ed6c626981c35ccf44095.patch";
314       sha256 = "17kz8glfim29vyhj8idw8bdh3id5sl9zaq18zzih3schfvyjppj7";
315       stripLen = 1;
316     })
317   ]) super.basement;
319   # Fixes compilation of memory with GHC >= 9.4 on 32bit platforms
320   # https://github.com/vincenthz/hs-memory/pull/99
321   memory = appendPatches (lib.optionals pkgs.stdenv.hostPlatform.is32bit [
322     (fetchpatch {
323       name = "memory-i686-ghc-9.4.patch";
324       url = "https://github.com/vincenthz/hs-memory/pull/99/commits/2738929ce15b4c8704bbbac24a08539b5d4bf30e.patch";
325       sha256 = "196rj83iq2k249132xsyhbbl81qi1j23h9pa6mmk6zvxpcf63yfw";
326     })
327   ]) super.memory;
329   # Depends on outdated deps hedgehog < 1.4, doctest < 0.12 for tests
330   # As well as deepseq < 1.5 (so it forbids GHC 9.8)
331   hw-fingertree = doJailbreak super.hw-fingertree;
333   # 2024-03-10: Maintainance stalled, fixes unmerged: https://github.com/haskell/ThreadScope/pull/130
334   threadscope = overrideCabal (drv: {
335     prePatch = drv.prePatch or "" + ''
336       ${pkgs.buildPackages.dos2unix}/bin/dos2unix *.cabal
337     '';
338     editedCabalFile = null;
339     revision = null;
340   })
341   (appendPatches [
342     (fetchpatch {
343       name = "loosen-bounds-1.patch";
344       url = "https://github.com/haskell/ThreadScope/commit/8f9f21449adb3af07eed539dcaf267c9c9ee987b.patch";
345       sha256 = "sha256-egKM060QplSmUeDptHXoSom1vf5KBrvNcjb2Vk59N7A=";
346     })
347     (fetchpatch {
348       name = "loosen-bounds-2.patch";
349       url = "https://github.com/haskell/ThreadScope/commit/f366a9ee455eda16cd6a4dc26f0275e2cf2b5798.patch";
350       sha256 = "sha256-DaPTK5LRbZZS1KDIr5X/eXQasqtofrCteTbUQUZPu0Q=";
351     })
352     (fetchpatch {
353       name = "loosen-bounds-3.patch";
354       url = "https://github.com/haskell/ThreadScope/commit/12819abaa2322976004b7582e598db1cf952707a.patch";
355       sha256 = "sha256-r7MVw8wwKU4R5VmcypBzhOBfTlRCISoRJtwie3+2Vb0=";
356     })
357     (fetchpatch {
358       name = "import-monad.patch";
359       url = "https://github.com/haskell/ThreadScope/commit/8846508e9769a8dfd82b3ff66259ba4d58255932.patch";
360       sha256 = "sha256-wBqDJWmqvmU1sFuw/ZlxHOb8xPhZO2RBuyYFP9bJCVI=";
361     })
362   ]
363     super.threadscope);
365   # The latest release on hackage has an upper bound on containers which
366   # breaks the build, though it works with the version of containers present
367   # and the upper bound doesn't exist in code anymore:
368   # > https://github.com/roelvandijk/numerals
369   numerals = doJailbreak (dontCheck super.numerals);
371   # Bound on containers is too strict but jailbreak doesn't work with conditional flags
372   # https://github.com/NixOS/jailbreak-cabal/issues/24
373   containers-unicode-symbols = overrideCabal {
374     postPatch = ''
375       substituteInPlace containers-unicode-symbols.cabal \
376         --replace 'containers >= 0.5 && < 0.6.5' 'containers'
377     '';
378   } super.containers-unicode-symbols;
380   # Test file not included on hackage
381   numerals-base = dontCheck (doJailbreak super.numerals-base);
383   # This test keeps being aborted because it runs too quietly for too long
384   Lazy-Pbkdf2 = if pkgs.stdenv.hostPlatform.isi686 then dontCheck super.Lazy-Pbkdf2 else super.Lazy-Pbkdf2;
386   # check requires mysql server
387   mysql-simple = dontCheck super.mysql-simple;
388   mysql-haskell = dontCheck super.mysql-haskell;
390   # Test data missing
391   # https://github.com/FPtje/GLuaFixer/issues/165
392   glualint = dontCheck super.glualint;
394   # The Hackage tarball is purposefully broken, because it's not intended to be, like, useful.
395   # https://git-annex.branchable.com/bugs/bash_completion_file_is_missing_in_the_6.20160527_tarball_on_hackage/
396   git-annex = overrideCabal (drv: {
397     src = pkgs.fetchgit {
398       name = "git-annex-${super.git-annex.version}-src";
399       url = "git://git-annex.branchable.com/";
400       rev = "refs/tags/" + super.git-annex.version;
401       sha256 = "sha256-hPZTcl3kWeUnSVYOE1W+FDwR3LYg6gaJfEBIY6VSfxY=";
402       # delete android and Android directories which cause issues on
403       # darwin (case insensitive directory). Since we don't need them
404       # during the build process, we can delete it to prevent a hash
405       # mismatch on darwin.
406       postFetch = ''
407         rm -r $out/doc/?ndroid*
408       '';
409     };
411     patches = drv.patches or [ ] ++ [
412       # Prevent .desktop files from being installed to $out/usr/share.
413       # TODO(@sternenseemann): submit upstreamable patch resolving this
414       # (this should be possible by also taking PREFIX into account).
415       ./patches/git-annex-no-usr-prefix.patch
416     ];
418     postPatch = ''
419       substituteInPlace Makefile \
420         --replace-fail 'InstallDesktopFile $(PREFIX)/bin/git-annex' \
421                        'InstallDesktopFile git-annex'
422     '';
423   }) super.git-annex;
425   # Too strict bounds on servant
426   # Pending a hackage revision: https://github.com/berberman/arch-web/commit/5d08afee5b25e644f9e2e2b95380a5d4f4aa81ea#commitcomment-89230555
427   arch-web = doJailbreak super.arch-web;
429   # Too strict upper bound on hedgehog
430   # https://github.com/circuithub/rel8/issues/248
431   rel8 = doJailbreak super.rel8;
433   # Fix test trying to access /home directory
434   shell-conduit = overrideCabal (drv: {
435     postPatch = "sed -i s/home/tmp/ test/Spec.hs";
436   }) super.shell-conduit;
438   # https://github.com/serokell/nixfmt/issues/130
439   nixfmt = doJailbreak super.nixfmt;
441   # Too strict upper bounds on turtle and text
442   # https://github.com/awakesecurity/nix-deploy/issues/35
443   nix-deploy = doJailbreak super.nix-deploy;
445   # Too strict upper bound on algebraic-graphs
446   # https://github.com/awakesecurity/nix-graph/issues/5
447   nix-graph = doJailbreak super.nix-graph;
449   # Manually maintained
450   cachix-api = overrideCabal (drv: {
451     version = "1.7.5";
452     src = pkgs.fetchFromGitHub {
453       owner = "cachix";
454       repo = "cachix";
455       rev = "v1.7.5";
456       sha256 = "sha256-KxuGSoVUFnQLB2ZcYODW7AVPAh9JqRlD5BrfsC/Q4qs=";
457     };
458     postUnpack = "sourceRoot=$sourceRoot/cachix-api";
459   }) super.cachix-api;
460   cachix = (overrideCabal (drv: {
461     version = "1.7.5";
462     src = pkgs.fetchFromGitHub {
463       owner = "cachix";
464       repo = "cachix";
465       rev = "v1.7.5";
466       sha256 = "sha256-KxuGSoVUFnQLB2ZcYODW7AVPAh9JqRlD5BrfsC/Q4qs=";
467     };
468     postUnpack = "sourceRoot=$sourceRoot/cachix";
469   }) (lib.pipe
470         (super.cachix.override {
471           nix = self.hercules-ci-cnix-store.nixPackage;
472           hnix-store-core = self.hnix-store-core_0_8_0_0;
473         })
474         [
475          (addBuildTool self.hercules-ci-cnix-store.nixPackage)
476          (addBuildTool pkgs.buildPackages.pkg-config)
477          (addBuildDepend self.hnix-store-nar)
478         ]
479   ));
481   # https://github.com/froozen/kademlia/issues/2
482   kademlia = dontCheck super.kademlia;
484   # Tests require older versions of tasty.
485   hzk = dontCheck super.hzk;
487   # Test suite doesn't compile with 9.6, 9.8
488   # https://github.com/sebastiaanvisser/fclabels/issues/45
489   # https://github.com/sebastiaanvisser/fclabels/issues/46
490   fclabels = dontCheck super.fclabels;
492   # Tests require a Kafka broker running locally
493   haskakafka = dontCheck super.haskakafka;
495   bindings-levmar = addExtraLibrary pkgs.blas super.bindings-levmar;
497   # Requires wrapQtAppsHook
498   qtah-cpp-qt5 = overrideCabal (drv: {
499     buildDepends = [ pkgs.qt5.wrapQtAppsHook ];
500   }) super.qtah-cpp-qt5;
502   # The Haddock phase fails for one reason or another.
503   deepseq-magic = dontHaddock super.deepseq-magic;
504   feldspar-signal = dontHaddock super.feldspar-signal; # https://github.com/markus-git/feldspar-signal/issues/1
505   hoodle-core = dontHaddock super.hoodle-core;
506   hsc3-db = dontHaddock super.hsc3-db;
508   # Fix build with time >= 1.10 while retaining compat with time < 1.9
509   mbox = appendPatch ./patches/mbox-time-1.10.patch
510     (overrideCabal { editedCabalFile = null; revision = null; } super.mbox);
512   # https://github.com/techtangents/ablist/issues/1
513   ABList = dontCheck super.ABList;
515   inline-c-cpp = overrideCabal (drv: {
516     postPatch = (drv.postPatch or "") + ''
517       substituteInPlace inline-c-cpp.cabal --replace "-optc-std=c++11" ""
518     '';
519   }) super.inline-c-cpp;
521   inline-java = addBuildDepend pkgs.jdk super.inline-java;
523   # Too strict upper bound on unicode-transforms
524   # <https://gitlab.com/ngua/ipa-hs/-/issues/1>
525   ipa = doJailbreak super.ipa;
527   # Upstream notified by e-mail.
528   permutation = dontCheck super.permutation;
530   # https://github.com/jputcu/serialport/issues/25
531   serialport = dontCheck super.serialport;
533   # Test suite depends on source code being available
534   simple-affine-space = dontCheck super.simple-affine-space;
536   # Fails no apparent reason. Upstream has been notified by e-mail.
537   assertions = dontCheck super.assertions;
539   # 2023-01-29: Restrictive base bound already loosened on master but not released: https://github.com/sebastiaanvisser/clay/commit/4483bdf7a452903f177220958f1610030ab7f28a
540   clay = throwIfNot (super.clay.version == "0.14.0") "Remove clay jailbreak in configuration-common.nix when you see this eval error." (doJailbreak super.clay);
542   # These packages try to execute non-existent external programs.
543   cmaes = dontCheck super.cmaes;                        # http://hydra.cryp.to/build/498725/log/raw
544   dbmigrations = dontCheck super.dbmigrations;
545   filestore = dontCheck super.filestore;
546   graceful = dontCheck super.graceful;
547   HList = dontCheck super.HList;
548   ide-backend = dontCheck super.ide-backend;
549   marquise = dontCheck super.marquise;                  # https://github.com/anchor/marquise/issues/69
550   memcached-binary = dontCheck super.memcached-binary;
551   msgpack-rpc = dontCheck super.msgpack-rpc;
552   persistent-zookeeper = dontCheck super.persistent-zookeeper;
553   pocket-dns = dontCheck super.pocket-dns;
554   squeal-postgresql = dontCheck super.squeal-postgresql;
555   postgrest-ws = dontCheck super.postgrest-ws;
556   snowball = dontCheck super.snowball;
557   sophia = dontCheck super.sophia;
558   test-sandbox = dontCheck super.test-sandbox;
559   texrunner = dontCheck super.texrunner;
560   wai-middleware-hmac = dontCheck super.wai-middleware-hmac;
561   xkbcommon = dontCheck super.xkbcommon;
562   xmlgen = dontCheck super.xmlgen;
563   HerbiePlugin = dontCheck super.HerbiePlugin;
564   wai-cors = dontCheck super.wai-cors;
566   # 2024-05-18: Upstream tests against a different pandoc version
567   pandoc-crossref = dontCheck super.pandoc-crossref;
569   # base bound
570   digit = doJailbreak super.digit;
572   # 2022-01-29: Tests require package to be in ghc-db.
573   aeson-schemas = dontCheck super.aeson-schemas;
575   matterhorn = doJailbreak super.matterhorn;
577   # Too strict bounds on transformers and resourcet
578   # https://github.com/alphaHeavy/lzma-conduit/issues/23
579   lzma-conduit = doJailbreak super.lzma-conduit;
581   # 2020-06-05: HACK: does not pass own build suite - `dontCheck`
582   # 2024-01-15: too strict bound on free < 5.2
583   hnix = doJailbreak (dontCheck (super.hnix.override {
584     # 2023-12-11: Needs older core due to remote
585     hnix-store-core = self.hnix-store-core_0_6_1_0;
586   }));
589   # Too strict bounds on algebraic-graphs
590   # https://github.com/haskell-nix/hnix-store/issues/180
591   hnix-store-core_0_6_1_0 = doJailbreak super.hnix-store-core_0_6_1_0;
593   # 2024-09-27: dependent-sum-template pinned to 0.1.1.1, however 0.2.0.1+ required
594   hnix-store-core_0_8_0_0 = super.hnix-store-core_0_8_0_0.override { dependent-sum-template = self.dependent-sum-template_0_2_0_1; };
596   # 2023-12-11: Needs older core
597   hnix-store-remote = super.hnix-store-remote.override { hnix-store-core = self.hnix-store-core_0_6_1_0; };
599   # Fails for non-obvious reasons while attempting to use doctest.
600   focuslist = dontCheck super.focuslist;
601   search = dontCheck super.search;
603   # https://github.com/ekmett/structures/issues/3
604   structures = dontCheck super.structures;
606   # Disable test suites to fix the build.
607   acme-year = dontCheck super.acme-year;                # http://hydra.cryp.to/build/497858/log/raw
608   aeson-lens = dontCheck super.aeson-lens;              # http://hydra.cryp.to/build/496769/log/raw
609   aeson-schema = dontCheck super.aeson-schema;          # https://github.com/timjb/aeson-schema/issues/9
610   angel = dontCheck super.angel;
611   apache-md5 = dontCheck super.apache-md5;              # http://hydra.cryp.to/build/498709/nixlog/1/raw
612   app-settings = dontCheck super.app-settings;          # http://hydra.cryp.to/build/497327/log/raw
613   aws-kinesis = dontCheck super.aws-kinesis;            # needs aws credentials for testing
614   binary-protocol = dontCheck super.binary-protocol;    # http://hydra.cryp.to/build/499749/log/raw
615   binary-search = dontCheck super.binary-search;
616   bloodhound = dontCheck super.bloodhound;              # https://github.com/plow-technologies/quickcheck-arbitrary-template/issues/10
617   buildwrapper = dontCheck super.buildwrapper;
618   burst-detection = dontCheck super.burst-detection;    # http://hydra.cryp.to/build/496948/log/raw
619   cabal-meta = dontCheck super.cabal-meta;              # http://hydra.cryp.to/build/497892/log/raw
620   camfort = dontCheck super.camfort;
621   cjk = dontCheck super.cjk;
622   CLI = dontCheck super.CLI;                            # Upstream has no issue tracker.
623   command-qq = dontCheck super.command-qq;              # http://hydra.cryp.to/build/499042/log/raw
624   conduit-connection = dontCheck super.conduit-connection;
625   craftwerk = dontCheck super.craftwerk;
626   crc = dontCheck super.crc;                            # https://github.com/MichaelXavier/crc/issues/2
627   css-text = dontCheck super.css-text;
628   damnpacket = dontCheck super.damnpacket;              # http://hydra.cryp.to/build/496923/log
629   data-hash = dontCheck super.data-hash;
630   Deadpan-DDP = dontCheck super.Deadpan-DDP;            # http://hydra.cryp.to/build/496418/log/raw
631   DigitalOcean = dontCheck super.DigitalOcean;
632   direct-sqlite = dontCheck super.direct-sqlite;
633   directory-layout = dontCheck super.directory-layout;
634   dlist = dontCheck super.dlist;
635   docopt = dontCheck super.docopt;                      # http://hydra.cryp.to/build/499172/log/raw
636   dom-selector = dontCheck super.dom-selector;          # http://hydra.cryp.to/build/497670/log/raw
637   dotenv = dontCheck super.dotenv;                      # Tests fail because of missing test file on version 0.8.0.2 fixed on version 0.8.0.4
638   dotfs = dontCheck super.dotfs;                        # http://hydra.cryp.to/build/498599/log/raw
639   DRBG = dontCheck super.DRBG;                          # http://hydra.cryp.to/build/498245/nixlog/1/raw
640   ed25519 = dontCheck super.ed25519;
641   etcd = dontCheck super.etcd;
642   fb = dontCheck super.fb;                              # needs credentials for Facebook
643   fptest = dontCheck super.fptest;                      # http://hydra.cryp.to/build/499124/log/raw
644   friday-juicypixels = dontCheck super.friday-juicypixels; #tarball missing test/rgba8.png
645   ghc-events-parallel = dontCheck super.ghc-events-parallel;    # http://hydra.cryp.to/build/496828/log/raw
646   ghc-imported-from = dontCheck super.ghc-imported-from;
647   ghc-parmake = dontCheck super.ghc-parmake;
648   git-vogue = dontCheck super.git-vogue;
649   github-rest = dontCheck super.github-rest;  # test suite needs the network
650   gitlib-cmdline = dontCheck super.gitlib-cmdline;
651   GLFW-b = dontCheck super.GLFW-b;                      # https://github.com/bsl/GLFW-b/issues/50
652   hackport = dontCheck super.hackport;
653   hadoop-formats = dontCheck super.hadoop-formats;
654   haeredes = dontCheck super.haeredes;
655   hashed-storage = dontCheck super.hashed-storage;
656   hashring = dontCheck super.hashring;
657   hath = dontCheck super.hath;
658   haxl = dontCheck super.haxl;                          # non-deterministic failure https://github.com/facebook/Haxl/issues/85
659   haxl-facebook = dontCheck super.haxl-facebook;        # needs facebook credentials for testing
660   hdbi-postgresql = dontCheck super.hdbi-postgresql;
661   hedis = dontCheck super.hedis;
662   hedis-pile = dontCheck super.hedis-pile;
663   hedis-tags = dontCheck super.hedis-tags;
664   hedn = dontCheck super.hedn;
665   hgdbmi = dontCheck super.hgdbmi;
666   hi = dontCheck super.hi;
667   hierarchical-clustering = dontCheck super.hierarchical-clustering;
668   hlibgit2 = disableHardening [ "format" ] super.hlibgit2;
669   hmatrix-tests = dontCheck super.hmatrix-tests;
670   hquery = dontCheck super.hquery;
671   hs2048 = dontCheck super.hs2048;
672   hsbencher = dontCheck super.hsbencher;
673   hsexif = dontCheck super.hsexif;
674   hspec-server = dontCheck super.hspec-server;
675   HTF = overrideCabal (orig: {
676     # The scripts in scripts/ are needed to build the test suite.
677     preBuild = "patchShebangs --build scripts";
678     # test suite doesn't compile with aeson >= 2.0
679     # https://github.com/skogsbaer/HTF/issues/114
680     doCheck = false;
681   }) super.HTF;
682   htsn = dontCheck super.htsn;
683   htsn-import = dontCheck super.htsn-import;
684   http-link-header = dontCheck super.http-link-header; # non deterministic failure https://hydra.nixos.org/build/75041105
685   influxdb = dontCheck super.influxdb;
686   integer-roots = dontCheck super.integer-roots; # requires an old version of smallcheck, will be fixed in > 1.0
687   itanium-abi = dontCheck super.itanium-abi;
688   katt = dontCheck super.katt;
689   language-slice = dontCheck super.language-slice;
691   # Group of libraries by same upstream maintainer for interacting with
692   # Telegram messenger. Bit-rotted a bit since 2020.
693   tdlib = appendPatch (fetchpatch {
694     # https://github.com/poscat0x04/tdlib/pull/3
695     url = "https://github.com/poscat0x04/tdlib/commit/8eb9ecbc98c65a715469fdb8b67793ab375eda31.patch";
696     hash = "sha256-vEI7fTsiafNGBBl4VUXVCClW6xKLi+iK53fjcubgkpc=";
697   }) (doJailbreak super.tdlib) ;
698   tdlib-types = doJailbreak super.tdlib-types;
699   tdlib-gen = doJailbreak super.tdlib-gen;
700   # https://github.com/poscat0x04/language-tl/pull/1
701   language-tl = doJailbreak super.language-tl;
703   ldap-client = dontCheck super.ldap-client;
704   lensref = dontCheck super.lensref;
705   lvmrun = disableHardening ["format"] (dontCheck super.lvmrun);
706   matplotlib = dontCheck super.matplotlib;
707   memcache = dontCheck super.memcache;
708   metrics = dontCheck super.metrics;
709   milena = dontCheck super.milena;
710   modular-arithmetic = dontCheck super.modular-arithmetic; # tests require a very old Glob (0.7.*)
711   nats-queue = dontCheck super.nats-queue;
712   netpbm = dontCheck super.netpbm;
713   network = dontCheck super.network;
714   network-dbus = dontCheck super.network-dbus;
715   notcpp = dontCheck super.notcpp;
716   ntp-control = dontCheck super.ntp-control;
717   odpic-raw = dontCheck super.odpic-raw; # needs a running oracle database server
718   opaleye = dontCheck super.opaleye;
719   openpgp = dontCheck super.openpgp;
720   optional = dontCheck super.optional;
721   orgmode-parse = dontCheck super.orgmode-parse;
722   os-release = dontCheck super.os-release;
723   parameterized = dontCheck super.parameterized; # https://github.com/louispan/parameterized/issues/2
724   persistent-redis = dontCheck super.persistent-redis;
725   pipes-extra = dontCheck super.pipes-extra;
726   pipes-websockets = dontCheck super.pipes-websockets;
727   posix-pty = dontCheck super.posix-pty; # https://github.com/merijn/posix-pty/issues/12
728   postgresql-binary = dontCheck super.postgresql-binary; # needs a running postgresql server
729   powerdns = dontCheck super.powerdns; # Tests require networking and external services
730   process-streaming = dontCheck super.process-streaming;
731   punycode = dontCheck super.punycode;
732   pwstore-cli = dontCheck super.pwstore-cli;
733   quantities = dontCheck super.quantities;
734   redis-io = dontCheck super.redis-io;
735   rethinkdb = dontCheck super.rethinkdb;
736   Rlang-QQ = dontCheck super.Rlang-QQ;
737   safecopy = dontCheck super.safecopy;
738   sai-shape-syb = dontCheck super.sai-shape-syb;
739   scp-streams = dontCheck super.scp-streams;
740   sdl2 = dontCheck super.sdl2; # the test suite needs an x server
741   separated = dontCheck super.separated;
742   shadowsocks = dontCheck super.shadowsocks;
743   shake-language-c = dontCheck super.shake-language-c;
744   snap-core = doJailbreak (dontCheck super.snap-core); # attoparsec bound is too strict. This has been fixed on master
745   snap-server = doJailbreak super.snap-server; # attoparsec bound is too strict
746   sourcemap = dontCheck super.sourcemap;
747   static-resources = dontCheck super.static-resources;
748   strive = dontCheck super.strive;                      # fails its own hlint test with tons of warnings
749   svndump = dontCheck super.svndump;
750   tar = dontCheck super.tar; #https://hydra.nixos.org/build/25088435/nixlog/2 (fails only on 32-bit)
751   th-printf = dontCheck super.th-printf;
752   thumbnail-plus = dontCheck super.thumbnail-plus;
753   tickle = dontCheck super.tickle;
754   tpdb = dontCheck super.tpdb;
755   translatable-intset = dontCheck super.translatable-intset;
756   ua-parser = dontCheck super.ua-parser;
757   unagi-chan = dontCheck super.unagi-chan;
758   universe-some = dontCheck super.universe-some;
759   wai-logger = dontCheck super.wai-logger;
760   WebBits = dontCheck super.WebBits;                    # http://hydra.cryp.to/build/499604/log/raw
761   webdriver = dontCheck super.webdriver;
762   webdriver-angular = dontCheck super.webdriver-angular;
763   xsd = dontCheck super.xsd;
764   zip-archive = dontCheck super.zip-archive;  # https://github.com/jgm/zip-archive/issues/57
766   # These test suites run for ages, even on a fast machine. This is nuts.
767   Random123 = dontCheck super.Random123;
768   systemd = dontCheck super.systemd;
770   # https://github.com/eli-frey/cmdtheline/issues/28
771   cmdtheline = dontCheck super.cmdtheline;
773   # https://github.com/bos/snappy/issues/1
774   # https://github.com/bos/snappy/pull/10
775   snappy = appendPatches [
776     (pkgs.fetchpatch {
777       url = "https://github.com/bos/snappy/commit/8687802c0b85ed7fbbb1b1945a75f14fb9a9c886.patch";
778       sha256 = "sha256-p6rMzkjPAZVljsC1Ubj16/mNr4mq5JpxfP5xwT+Gt5M=";
779     })
780     (pkgs.fetchpatch {
781       url = "https://github.com/bos/snappy/commit/21c3250c1f3d273cdcf597e2b7909a22aeaa710f.patch";
782       sha256 = "sha256-qHEQ8FFagXGxvtblBvo7xivRARzXlaMLw8nt0068nt0=";
783     })
784   ] (dontCheck super.snappy);
786   # https://github.com/vincenthz/hs-crypto-pubkey/issues/20
787   crypto-pubkey = dontCheck super.crypto-pubkey;
789   # https://github.com/Philonous/xml-picklers/issues/5
790   xml-picklers = dontCheck super.xml-picklers;
792   # https://github.com/joeyadams/haskell-stm-delay/issues/3
793   stm-delay = dontCheck super.stm-delay;
795   # https://github.com/pixbi/duplo/issues/25
796   duplo = doJailbreak super.duplo;
798   # https://github.com/evanrinehart/mikmod/issues/1
799   mikmod = addExtraLibrary pkgs.libmikmod super.mikmod;
801   # Missing module.
802   rematch = dontCheck super.rematch;            # https://github.com/tcrayford/rematch/issues/5
803   rematch-text = dontCheck super.rematch-text;  # https://github.com/tcrayford/rematch/issues/6
805   # Package exists only to be example of documentation, yet it has restrictive
806   # "base" dependency.
807   haddock-cheatsheet = doJailbreak super.haddock-cheatsheet;
809   # no haddock since this is an umbrella package.
810   cloud-haskell = dontHaddock super.cloud-haskell;
812   # This packages compiles 4+ hours on a fast machine. That's just unreasonable.
813   CHXHtml = dontDistribute super.CHXHtml;
815   # https://github.com/NixOS/nixpkgs/issues/6350
816   paypal-adaptive-hoops = overrideCabal (drv: { testTarget = "local"; }) super.paypal-adaptive-hoops;
818   # Avoid "QuickCheck >=2.3 && <2.10" dependency we cannot fulfill in lts-11.x.
819   test-framework = dontCheck super.test-framework;
821   # Depends on broken test-framework-quickcheck.
822   apiary = dontCheck super.apiary;
823   apiary-authenticate = dontCheck super.apiary-authenticate;
824   apiary-clientsession = dontCheck super.apiary-clientsession;
825   apiary-cookie = dontCheck super.apiary-cookie;
826   apiary-eventsource = dontCheck super.apiary-eventsource;
827   apiary-logger = dontCheck super.apiary-logger;
828   apiary-memcached = dontCheck super.apiary-memcached;
829   apiary-mongoDB = dontCheck super.apiary-mongoDB;
830   apiary-persistent = dontCheck super.apiary-persistent;
831   apiary-purescript = dontCheck super.apiary-purescript;
832   apiary-session = dontCheck super.apiary-session;
833   apiary-websockets = dontCheck super.apiary-websockets;
835   # https://github.com/junjihashimoto/test-sandbox-compose/issues/2
836   test-sandbox-compose = dontCheck super.test-sandbox-compose;
838   # Test suite won't compile against tasty-hunit 0.10.x.
839   binary-parsers = dontCheck super.binary-parsers;
841   # https://github.com/ndmitchell/shake/issues/804
842   shake = dontCheck super.shake;
844   # https://github.com/nushio3/doctest-prop/issues/1
845   doctest-prop = dontCheck super.doctest-prop;
847   # Missing file in source distribution:
848   # - https://github.com/karun012/doctest-discover/issues/22
849   # - https://github.com/karun012/doctest-discover/issues/23
850   #
851   # When these are fixed the following needs to be enabled again:
852   #
853   # # Depends on itself for testing
854   # doctest-discover = addBuildTool super.doctest-discover
855   #   (if pkgs.stdenv.buildPlatform != pkgs.stdenv.hostPlatform
856   #    then self.buildHaskellPackages.doctest-discover
857   #    else dontCheck super.doctest-discover);
858   doctest-discover = dontCheck super.doctest-discover;
860   # Too strict lower bound on tasty-hedgehog
861   # https://github.com/qfpl/tasty-hedgehog/issues/70
862   tasty-sugar = doJailbreak super.tasty-sugar;
864   # Too strict lower bound on aeson
865   # https://github.com/input-output-hk/hedgehog-extras/issues/39
866   hedgehog-extras = doJailbreak super.hedgehog-extras;
868   # Known issue with nondeterministic test suite failure
869   # https://github.com/nomeata/tasty-expected-failure/issues/21
870   tasty-expected-failure = dontCheck super.tasty-expected-failure;
872   # Waiting on https://github.com/RaphaelJ/friday/pull/36
873   friday = doJailbreak super.friday;
875   # Won't compile with recent versions of QuickCheck.
876   inilist = dontCheck super.inilist;
878   # https://github.com/yaccz/saturnin/issues/3
879   Saturnin = dontCheck super.Saturnin;
881   # https://github.com/kkardzis/curlhs/issues/6
882   curlhs = dontCheck super.curlhs;
884   # curl 7.87.0 introduces a preprocessor typechecker of sorts which fails on
885   # incorrect usages of curl_easy_getopt and similar functions. Presumably
886   # because the wrappers in curlc.c don't use static values for the different
887   # arguments to curl_easy_getinfo, it complains and needs to be disabled.
888   # https://github.com/GaloisInc/curl/issues/28
889   curl = appendConfigureFlags [
890     "--ghc-option=-DCURL_DISABLE_TYPECHECK"
891   ] super.curl;
893   # https://github.com/hvr/token-bucket/issues/3
894   token-bucket = dontCheck super.token-bucket;
896   # https://github.com/alphaHeavy/lzma-enumerator/issues/3
897   lzma-enumerator = dontCheck super.lzma-enumerator;
899   # FPCO's fork of Cabal won't succeed its test suite.
900   Cabal-ide-backend = dontCheck super.Cabal-ide-backend;
902   # This package can't be built on non-Windows systems.
903   Win32 = overrideCabal (drv: { broken = !pkgs.stdenv.hostPlatform.isCygwin; }) super.Win32;
904   inline-c-win32 = dontDistribute super.inline-c-win32;
905   Southpaw = dontDistribute super.Southpaw;
907   # https://ghc.haskell.org/trac/ghc/ticket/9825
908   vimus = overrideCabal (drv: { broken = pkgs.stdenv.hostPlatform.isLinux && pkgs.stdenv.hostPlatform.isi686; }) super.vimus;
910   # https://github.com/kazu-yamamoto/logger/issues/42
911   logger = dontCheck super.logger;
913   # vector dependency < 0.12
914   imagemagick = doJailbreak super.imagemagick;
916   # Elm is no longer actively maintained on Hackage: https://github.com/NixOS/nixpkgs/pull/9233.
917   Elm = markBroken super.Elm;
918   elm-build-lib = markBroken super.elm-build-lib;
919   elm-compiler = markBroken super.elm-compiler;
920   elm-get = markBroken super.elm-get;
921   elm-make = markBroken super.elm-make;
922   elm-package = markBroken super.elm-package;
923   elm-reactor = markBroken super.elm-reactor;
924   elm-repl = markBroken super.elm-repl;
925   elm-server = markBroken super.elm-server;
926   elm-yesod = markBroken super.elm-yesod;
928   # https://github.com/Euterpea/Euterpea2/issues/40
929   Euterpea = doJailbreak super.Euterpea;
931   # Byte-compile elisp code for Emacs.
932   ghc-mod = overrideCabal (drv: {
933     preCheck = "export HOME=$TMPDIR";
934     testToolDepends = drv.testToolDepends or [] ++ [self.cabal-install];
935     doCheck = false;            # https://github.com/kazu-yamamoto/ghc-mod/issues/335
936     executableToolDepends = drv.executableToolDepends or [] ++ [pkgs.buildPackages.emacs];
937     postInstall = ''
938       local lispdir=( "$data/share/${self.ghc.targetPrefix}${self.ghc.haskellCompilerName}/*/${drv.pname}-${drv.version}/elisp" )
939       make -C $lispdir
940       mkdir -p $data/share/emacs/site-lisp
941       ln -s "$lispdir/"*.el{,c} $data/share/emacs/site-lisp/
942     '';
943   }) super.ghc-mod;
945   # 2022-03-19: Testsuite is failing: https://github.com/puffnfresh/haskell-jwt/issues/2
946   jwt = dontCheck super.jwt;
948   # Build Selda with the latest git version.
949   # See https://github.com/valderman/selda/issues/187
950   inherit (let
951     mkSeldaPackage = name: overrideCabal (drv: {
952       version = "2024-05-05-unstable";
953       src = pkgs.fetchFromGitHub {
954         owner = "valderman";
955         repo = "selda";
956         rev = "50c3ba5c5da72bb758a4112363ba2fe1c0e968ea";
957         hash = "sha256-LEAJsSsDL0mmVHntnI16fH8m5DmePfcU0hFw9ErqTgQ=";
958       } + "/${name}";
959     }) super.${name};
960   in
961     lib.genAttrs [ "selda" "selda-sqlite" "selda-json" ] mkSeldaPackage
962   )
963   selda
964   selda-sqlite
965   selda-json
966   ;
968   # 2024-03-10: Getting the test suite to run requires a correctly crafted GHC_ENVIRONMENT variable.
969   graphql-client = dontCheck super.graphql-client;
971   # Build the latest git version instead of the official release. This isn't
972   # ideal, but Chris doesn't seem to make official releases any more.
973   structured-haskell-mode = overrideCabal (drv: {
974     src = pkgs.fetchFromGitHub {
975       owner = "projectional-haskell";
976       repo = "structured-haskell-mode";
977       rev = "7f9df73f45d107017c18ce4835bbc190dfe6782e";
978       sha256 = "1jcc30048j369jgsbbmkb63whs4wb37bq21jrm3r6ry22izndsqa";
979     };
980     version = "20170205-git";
981     editedCabalFile = null;
982     # Make elisp files available at a location where people expect it. We
983     # cannot easily byte-compile these files, unfortunately, because they
984     # depend on a new version of haskell-mode that we don't have yet.
985     postInstall = ''
986       local lispdir=( "$data/share/${self.ghc.targetPrefix}${self.ghc.haskellCompilerName}/"*"/${drv.pname}-"*"/elisp" )
987       mkdir -p $data/share/emacs
988       ln -s $lispdir $data/share/emacs/site-lisp
989     '';
990   }) super.structured-haskell-mode;
992   # Make elisp files available at a location where people expect it.
993   hindent = (overrideCabal (drv: {
994     # We cannot easily byte-compile these files, unfortunately, because they
995     # depend on a new version of haskell-mode that we don't have yet.
996     postInstall = ''
997       local lispdir=( "$data/share/${self.ghc.targetPrefix}${self.ghc.haskellCompilerName}/"*"/${drv.pname}-"*"/elisp" )
998       mkdir -p $data/share/emacs
999       ln -s $lispdir $data/share/emacs/site-lisp
1000     '';
1001     doCheck = false; # https://github.com/chrisdone/hindent/issues/299
1002   }) super.hindent);
1004   # https://github.com/basvandijk/concurrent-extra/issues/12
1005   concurrent-extra = dontCheck super.concurrent-extra;
1007   # https://github.com/pxqr/base32-bytestring/issues/4
1008   base32-bytestring = dontCheck super.base32-bytestring;
1010   # Djinn's last release was 2014, incompatible with Semigroup-Monoid Proposal
1011   # https://github.com/augustss/djinn/pull/8
1012   djinn = overrideSrc {
1013     version = "unstable-2023-11-20";
1014     src = pkgs.fetchFromGitHub {
1015       owner = "augustss";
1016       repo = "djinn";
1017       rev = "69b3fbad9f42f0b1b2c49977976b8588c967d76e";
1018       hash = "sha256-ibxn6DXk4pqsOsWhi8KcrlH/THnuMWvIu5ENOn3H3So=";
1019     };
1020   } super.djinn;
1022   mueval = doJailbreak super.mueval;
1024   # We cannot build this package w/o the C library from <http://www.phash.org/>.
1025   phash = markBroken super.phash;
1027   # https://github.com/Philonous/hs-stun/pull/1
1028   # Remove if a version > 0.1.0.1 ever gets released.
1029   stunclient = overrideCabal (drv: {
1030     postPatch = (drv.postPatch or "") + ''
1031       substituteInPlace source/Network/Stun/MappedAddress.hs --replace "import Network.Endian" ""
1032     '';
1033   }) super.stunclient;
1035   d-bus = let
1036     # The latest release on hackage is missing necessary patches for recent compilers
1037     # https://github.com/Philonous/d-bus/issues/24
1038     newer = overrideSrc {
1039       version = "unstable-2021-01-08";
1040       src = pkgs.fetchFromGitHub {
1041         owner = "Philonous";
1042         repo = "d-bus";
1043         rev = "fb8a948a3b9d51db618454328dbe18fb1f313c70";
1044         hash = "sha256-R7/+okb6t9DAkPVUV70QdYJW8vRcvBdz4zKJT13jb3A=";
1045       };
1046     } super.d-bus;
1047   # Add now required extension on recent compilers.
1048   # https://github.com/Philonous/d-bus/pull/23
1049   in appendPatch (fetchpatch {
1050     url = "https://github.com/Philonous/d-bus/commit/e5f37900a3a301c41d98bdaa134754894c705681.patch";
1051     sha256 = "6rQ7H9t483sJe1x95yLPAZ0BKTaRjgqQvvrQv7HkJRE=";
1052   }) newer;
1054   # * The standard libraries are compiled separately.
1055   # * We need a few patches from master to fix compilation with
1056   #   updated dependencies which can be
1057   #   removed when the next idris release comes around.
1058   idris = lib.pipe super.idris [
1059     dontCheck
1060     doJailbreak
1061     (appendPatch (fetchpatch {
1062       name = "idris-bumps.patch";
1063       url = "https://github.com/idris-lang/Idris-dev/compare/c99bc9e4af4ea32d2172f873152b76122ee4ee14...cf78f0fb337d50f4f0dba235b6bbe67030f1ff47.patch";
1064       hash = "sha256-RCMIRHIAK1PCm4B7v+5gXNd2buHXIqyAxei4bU8+eCk=";
1065     }))
1066     (self.generateOptparseApplicativeCompletions [ "idris" ])
1067   ];
1069   # Too strict bound on hspec
1070   # https://github.com/lspitzner/multistate/issues/9#issuecomment-1367853016
1071   multistate = doJailbreak super.multistate;
1073   # https://github.com/pontarius/pontarius-xmpp/issues/105
1074   pontarius-xmpp = dontCheck super.pontarius-xmpp;
1076   # fails with sandbox
1077   yi-keymap-vim = dontCheck super.yi-keymap-vim;
1079   # https://github.com/bmillwood/applicative-quoters/issues/6
1080   applicative-quoters = doJailbreak super.applicative-quoters;
1082   # https://hydra.nixos.org/build/42769611/nixlog/1/raw
1083   # note: the library is unmaintained, no upstream issue
1084   dataenc = doJailbreak super.dataenc;
1086   # horribly outdated (X11 interface changed a lot)
1087   sindre = markBroken super.sindre;
1089   # Test suite occasionally runs for 1+ days on Hydra.
1090   distributed-process-tests = dontCheck super.distributed-process-tests;
1092   # https://github.com/mulby/diff-parse/issues/9
1093   diff-parse = doJailbreak super.diff-parse;
1095   # No upstream issue tracker
1096   hspec-expectations-pretty-diff = dontCheck super.hspec-expectations-pretty-diff;
1098   # Don't depend on chell-quickcheck, which doesn't compile due to restricting
1099   # QuickCheck to versions ">=2.3 && <2.9".
1100   system-filepath = dontCheck super.system-filepath;
1102   # The tests spuriously fail
1103   libmpd = dontCheck super.libmpd;
1105   # https://github.com/xu-hao/namespace/issues/1
1106   namespace = doJailbreak super.namespace;
1108   # https://github.com/danidiaz/streaming-eversion/issues/1
1109   streaming-eversion = dontCheck super.streaming-eversion;
1111   # https://github.com/danidiaz/tailfile-hinotify/issues/2
1112   tailfile-hinotify = doJailbreak (dontCheck super.tailfile-hinotify);
1114   # Test suite fails: https://github.com/lymar/hastache/issues/46.
1115   # Don't install internal mkReadme tool.
1116   hastache = overrideCabal (drv: {
1117     doCheck = false;
1118     postInstall = "rm $out/bin/mkReadme && rmdir $out/bin";
1119   }) super.hastache;
1121   # Has a dependency on outdated versions of directory.
1122   cautious-file = doJailbreak (dontCheck super.cautious-file);
1124   # missing dependencies: blaze-html >=0.5 && <0.9, blaze-markup >=0.5 && <0.8
1125   digestive-functors-blaze = doJailbreak super.digestive-functors-blaze;
1126   digestive-functors = doJailbreak super.digestive-functors;
1128   # Wrap the generated binaries to include their run-time dependencies in
1129   # $PATH. Also, cryptol needs a version of sbl that's newer than what we have
1130   # in LTS-13.x.
1131   cryptol = overrideCabal (drv: {
1132     buildTools = drv.buildTools or [] ++ [ pkgs.buildPackages.makeWrapper ];
1133     postInstall = drv.postInstall or "" + ''
1134       for b in $out/bin/cryptol $out/bin/cryptol-html; do
1135         wrapProgram $b --prefix 'PATH' ':' "${lib.getBin pkgs.z3}/bin"
1136       done
1137     '';
1138   }) super.cryptol;
1140   # Tests try to invoke external process and process == 1.4
1141   grakn = dontCheck (doJailbreak super.grakn);
1143   # test suite requires git and does a bunch of git operations
1144   restless-git = dontCheck super.restless-git;
1146   # patch out a flaky test that depends on output from hspec >= v2.11.7.
1147   # https://github.com/hspec/sensei/issues/125
1148   sensei = appendPatch (fetchpatch {
1149     url = "https://github.com/hspec/sensei/commit/5c11026fa48e13ea1c351ab882765eb0966f2e97.patch";
1150     hash = "sha256-eUCDvypj2bxTRnHLzrcembLMKHg5c3W3quNfclBDsso=";
1151   }) (overrideCabal (drv: {
1152     # sensei passes `-package hspec-meta` to GHC in the tests, but doesn't
1153     # depend on it itself.
1154     testHaskellDepends = drv.testHaskellDepends or [] ++ [ self.hspec-meta ];
1155     # requires git at test-time *and* runtime, but we'll just rely on users to
1156     # bring their own git at runtime.
1157     testToolDepends = drv.testToolDepends or [] ++ [ pkgs.git ];
1158   }) super.sensei);
1160   # Depends on broken fluid.
1161   fluid-idl-http-client = markBroken super.fluid-idl-http-client;
1162   fluid-idl-scotty = markBroken super.fluid-idl-scotty;
1164   # Work around https://github.com/haskell/c2hs/issues/192.
1165   c2hs = dontCheck super.c2hs;
1167   # Needs pginit to function and pgrep to verify.
1168   tmp-postgres = overrideCabal (drv: {
1169     # Flaky tests: https://github.com/jfischoff/tmp-postgres/issues/274
1170     doCheck = false;
1172     preCheck = ''
1173       export HOME="$TMPDIR"
1174     '' + (drv.preCheck or "");
1175     libraryToolDepends = drv.libraryToolDepends or [] ++ [pkgs.buildPackages.postgresql];
1176     testToolDepends = drv.testToolDepends or [] ++ [pkgs.procps];
1177   }) super.tmp-postgres;
1179   # Needs QuickCheck <2.10, which we don't have.
1180   edit-distance = doJailbreak super.edit-distance;
1181   int-cast = doJailbreak super.int-cast;
1183   # Needs QuickCheck <2.10, HUnit <1.6 and base <4.10
1184   pointfree = doJailbreak super.pointfree;
1186   # Needs tasty-quickcheck ==0.8.*, which we don't have.
1187   gitHUD = dontCheck super.gitHUD;
1188   githud = dontCheck super.githud;
1190   # Test suite fails due to trying to create directories
1191   path-io = dontCheck super.path-io;
1193   # Duplicate instance with smallcheck.
1194   store = dontCheck super.store;
1196   # With ghc-8.2.x haddock would time out for unknown reason
1197   # See https://github.com/haskell/haddock/issues/679
1198   language-puppet = dontHaddock super.language-puppet;
1200   # https://github.com/alphaHeavy/protobuf/issues/34
1201   protobuf = dontCheck super.protobuf;
1203   # jailbreak tasty < 1.2 until servant-docs > 0.11.3 is on hackage.
1204   snap-templates = doJailbreak super.snap-templates; # https://github.com/snapframework/snap-templates/issues/22
1206   # The test suite does not know how to find the 'alex' binary.
1207   alex = overrideCabal (drv: {
1208     testSystemDepends = (drv.testSystemDepends or []) ++ [pkgs.which];
1209     preCheck = ''export PATH="$PWD/dist/build/alex:$PATH"'';
1210   }) super.alex;
1212   # 2023-07-14: Restrictive upper bounds: https://github.com/luke-clifton/shh/issues/76
1213   shh = doJailbreak super.shh;
1215   # This package refers to the wrong library (itself in fact!)
1216   vulkan = super.vulkan.override { vulkan = pkgs.vulkan-loader; };
1218   # Compiles some C or C++ source which requires these headers
1219   VulkanMemoryAllocator = addExtraLibrary pkgs.vulkan-headers super.VulkanMemoryAllocator;
1220   # dontCheck can be removed on the next package set bump
1221   vulkan-utils = dontCheck (addExtraLibrary pkgs.vulkan-headers super.vulkan-utils);
1223   # https://github.com/dmwit/encoding/pull/3
1224   encoding = doJailbreak (appendPatch ./patches/encoding-Cabal-2.0.patch super.encoding);
1226   # Work around overspecified constraint on github ==0.18.
1227   github-backup = doJailbreak super.github-backup;
1229   # dontCheck: https://github.com/haskell-servant/servant-auth/issues/113
1230   servant-auth-client = dontCheck super.servant-auth-client;
1231   # Allow lens-aeson >= 1.2 https://github.com/haskell-servant/servant/issues/1703
1232   servant-auth-server = doJailbreak super.servant-auth-server;
1233   # Allow hspec >= 2.10 https://github.com/haskell-servant/servant/issues/1704
1234   servant-foreign = doJailbreak super.servant-foreign;
1236   # Generate cli completions for dhall.
1237   dhall = self.generateOptparseApplicativeCompletions [ "dhall" ] super.dhall;
1238   dhall-json = self.generateOptparseApplicativeCompletions ["dhall-to-json" "dhall-to-yaml"] super.dhall-json;
1239   # 2023-12-19: jailbreaks due to hnix-0.17 https://github.com/dhall-lang/dhall-haskell/pull/2559
1240   # until dhall-nix 1.1.26+, dhall-nixpkgs 1.0.10+
1241   dhall-nix = self.generateOptparseApplicativeCompletions [ "dhall-to-nix" ] (doJailbreak super.dhall-nix);
1242   dhall-nixpkgs = self.generateOptparseApplicativeCompletions [ "dhall-to-nixpkgs" ] (doJailbreak super.dhall-nixpkgs);
1243   dhall-yaml = self.generateOptparseApplicativeCompletions ["dhall-to-yaml-ng" "yaml-to-dhall"] super.dhall-yaml;
1245   # musl fixes
1246   # dontCheck: use of non-standard strptime "%s" which musl doesn't support; only used in test
1247   unix-time = if pkgs.stdenv.hostPlatform.isMusl then dontCheck super.unix-time else super.unix-time;
1249   # Workaround for https://github.com/sol/hpack/issues/528
1250   # The hpack test suite can't deal with the CRLF line endings hackage revisions insert
1251   hpack = overrideCabal (drv: {
1252     postPatch = drv.postPatch or "" + ''
1253       "${lib.getBin pkgs.buildPackages.dos2unix}/bin/dos2unix" *.cabal
1254     '';
1255   }) super.hpack;
1257   stack = super.stack.overrideScope (lself: lsuper: {
1258     # stack-3.1.1 requires the latest versions of these libraries
1259     pantry = lself.pantry_0_10_0;
1260     static-bytes = lself.static-bytes_0_1_1; # for pantry_0_10_0
1261     tar = lself.tar_0_6_3_0;
1263     # Upstream stack-3.1.1 is compiled with hpack-0.37.0, and we make sure to
1264     # keep the same hpack version in Nixpkgs.
1265     hpack = self.hpack_0_37_0;
1266   });
1268   # hslua has tests that break when using musl.
1269   # https://github.com/hslua/hslua/issues/106
1270   hslua-core = if pkgs.stdenv.hostPlatform.isMusl then dontCheck super.hslua-core else super.hslua-core;
1272   # Missing files required by the test suite.
1273   # https://github.com/deemp/flakes/issues/4
1274   lima = dontCheck super.lima;
1276   # The test suite runs for 20+ minutes on a very fast machine, which feels kinda disproportionate.
1277   prettyprinter = dontCheck super.prettyprinter;
1279   # Fix with Cabal 2.2, https://github.com/guillaume-nargeot/hpc-coveralls/pull/73
1280   hpc-coveralls = appendPatch (fetchpatch {
1281     url = "https://github.com/guillaume-nargeot/hpc-coveralls/pull/73/commits/344217f513b7adfb9037f73026f5d928be98d07f.patch";
1282     sha256 = "056rk58v9h114mjx62f41x971xn9p3nhsazcf9zrcyxh1ymrdm8j";
1283   }) super.hpc-coveralls;
1285   # sexpr is old, broken and has no issue-tracker. Let's fix it the best we can.
1286   sexpr = appendPatch ./patches/sexpr-0.2.1.patch
1287     (overrideCabal (drv: {
1288       isExecutable = false;
1289       libraryHaskellDepends = drv.libraryHaskellDepends ++ [self.QuickCheck];
1290     }) super.sexpr);
1292   # https://github.com/haskell/hoopl/issues/50
1293   hoopl = dontCheck super.hoopl;
1295   # https://github.com/DanielG/cabal-helper/pull/123
1296   cabal-helper = doJailbreak super.cabal-helper;
1298   # TODO(Profpatsch): factor out local nix store setup from
1299   # lib/tests/release.nix and use that for the tests of libnix
1300   # libnix = overrideCabal (old: {
1301   #   testToolDepends = old.testToolDepends or [] ++ [ pkgs.nix ];
1302   # }) super.libnix;
1303   libnix = dontCheck super.libnix;
1305   # dontCheck: The test suite tries to mess with ALSA, which doesn't work in the build sandbox.
1306   xmobar = dontCheck super.xmobar;
1308   # https://github.com/mgajda/json-autotype/issues/25
1309   json-autotype = dontCheck super.json-autotype;
1311   postgresql-simple-migration = overrideCabal (drv: {
1312       preCheck = ''
1313         PGUSER=test
1314         PGDATABASE=test
1315       '';
1316       testToolDepends = drv.testToolDepends or [] ++ [
1317         pkgs.postgresql
1318         pkgs.postgresqlTestHook
1319       ];
1320     }) (doJailbreak super.postgresql-simple-migration);
1322   postgresql-simple = addTestToolDepends [
1323     pkgs.postgresql
1324     pkgs.postgresqlTestHook
1325   ] super.postgresql-simple;
1327   beam-postgres = lib.pipe super.beam-postgres [
1328     # Requires pg_ctl command during tests
1329     (addTestToolDepends [pkgs.postgresql])
1330     (dontCheckIf (!pkgs.postgresql.doCheck))
1331   ];
1333   # Requires pqueue <1.5 but it works fine with pqueue-1.5.0.0
1334   # https://github.com/haskell-beam/beam/pull/705
1335   beam-migrate = doJailbreak super.beam-migrate;
1337   users-postgresql-simple = addTestToolDepends [
1338     pkgs.postgresql
1339     pkgs.postgresqlTestHook
1340   ] super.users-postgresql-simple;
1342   gargoyle-postgresql-nix = addBuildTool [pkgs.postgresql] super.gargoyle-postgresql-nix;
1344   # PortMidi needs an environment variable to have ALSA find its plugins:
1345   # https://github.com/NixOS/nixpkgs/issues/6860
1346   PortMidi = overrideCabal (drv: {
1347     patches = (drv.patches or []) ++ [ ./patches/portmidi-alsa-plugins.patch ];
1348     postPatch = (drv.postPatch or "") + ''
1349       substituteInPlace portmidi/pm_linux/pmlinuxalsa.c \
1350         --replace @alsa_plugin_dir@ "${pkgs.alsa-plugins}/lib/alsa-lib"
1351     '';
1352   }) super.PortMidi;
1354   scat = overrideCabal (drv: {
1355     patches = [
1356       # Fix build with base >= 4.11 (https://github.com/redelmann/scat/pull/6)
1357       (fetchpatch {
1358         url = "https://github.com/redelmann/scat/commit/429f22944b7634b8789cb3805292bcc2b23e3e9f.diff";
1359         hash = "sha256-FLr1KfBaSYzI6MiZIBY1CkgAb5sThvvgjrSAN8EV0h4=";
1360       })
1361       # Fix build with vector >= 0.13, mtl >= 2.3 (https://github.com/redelmann/scat/pull/8)
1362       (fetchpatch {
1363         url = "https://github.com/redelmann/scat/compare/e8e064f7e6a152fe25a6ccd743573a16974239d0..c6a3636548d628f32d8edc73a333188ce24141a7.patch";
1364         hash = "sha256-BU4MUn/TnZHpZBlX1vDHE7QZva5yhlLTb8zwpx7UScI";
1365       })
1366     ];
1367   }) super.scat;
1369   # Fix build with attr-2.4.48 (see #53716)
1370   xattr = appendPatch ./patches/xattr-fix-build.patch super.xattr;
1372   esqueleto =
1373     overrideCabal
1374       (drv: {
1375         postPatch = drv.postPatch or "" + ''
1376           # patch out TCP usage: https://nixos.org/manual/nixpkgs/stable/#sec-postgresqlTestHook-tcp
1377           sed -i test/PostgreSQL/Test.hs \
1378             -e s^host=localhost^^
1379         '';
1380         # Match the test suite defaults (or hardcoded values?)
1381         preCheck = drv.preCheck or "" + ''
1382           PGUSER=esqutest
1383           PGDATABASE=esqutest
1384         '';
1385         testFlags = drv.testFlags or [] ++ [
1386           # We don't have a MySQL test hook yet
1387           "--skip=/Esqueleto/MySQL"
1388         ];
1389         testToolDepends = drv.testToolDepends or [] ++ [
1390           pkgs.postgresql
1391           pkgs.postgresqlTestHook
1392         ];
1393       })
1394       # https://github.com/NixOS/nixpkgs/issues/198495
1395       (dontCheckIf (!pkgs.postgresql.doCheck) super.esqueleto);
1397   # Requires API keys to run tests
1398   algolia = dontCheck super.algolia;
1399   openai-hs = dontCheck super.openai-hs;
1401   # antiope-s3's latest stackage version has a hspec < 2.6 requirement, but
1402   # hspec which isn't in stackage is already past that
1403   antiope-s3 = doJailbreak super.antiope-s3;
1405   # Has tasty < 1.2 requirement, but works just fine with 1.2
1406   temporary-resourcet = doJailbreak super.temporary-resourcet;
1408   # Test suite doesn't work with current QuickCheck
1409   # https://github.com/pruvisto/heap/issues/11
1410   heap = dontCheck super.heap;
1412   # Test suite won't link for no apparent reason.
1413   constraints-deriving = dontCheck super.constraints-deriving;
1415   # https://github.com/elliottt/hsopenid/issues/15
1416   openid = markBroken super.openid;
1418   # https://github.com/erikd/hjsmin/issues/32
1419   hjsmin = dontCheck super.hjsmin;
1421   # too strict bounds on text in the test suite
1422   # https://github.com/audreyt/string-qq/pull/3
1423   string-qq = doJailbreak super.string-qq;
1425   # Remove for hail > 0.2.0.0
1426   hail = overrideCabal (drv: {
1427     patches = [
1428       (fetchpatch {
1429         # Relax dependency constraints,
1430         # upstream PR: https://github.com/james-preston/hail/pull/13
1431         url = "https://patch-diff.githubusercontent.com/raw/james-preston/hail/pull/13.patch";
1432         sha256 = "039p5mqgicbhld2z44cbvsmam3pz0py3ybaifwrjsn1y69ldsmkx";
1433       })
1434       (fetchpatch {
1435         # Relax dependency constraints,
1436         # upstream PR: https://github.com/james-preston/hail/pull/16
1437         url = "https://patch-diff.githubusercontent.com/raw/james-preston/hail/pull/16.patch";
1438         sha256 = "0dpagpn654zjrlklihsg911lmxjj8msylbm3c68xa5aad1s9gcf7";
1439       })
1440     ];
1441   }) super.hail;
1443   # https://github.com/kazu-yamamoto/dns/issues/150
1444   dns = dontCheck super.dns;
1446   # https://github.com/haskell-servant/servant-ekg/issues/15
1447   servant-ekg = doJailbreak super.servant-ekg;
1449   # the test suite has an overly tight restriction on doctest
1450   # See https://github.com/ekmett/perhaps/pull/5
1451   perhaps = doJailbreak super.perhaps;
1453   # it wants to build a statically linked binary by default
1454   hledger-flow = overrideCabal (drv: {
1455     postPatch = (drv.postPatch or "") + ''
1456       substituteInPlace hledger-flow.cabal --replace "-static" ""
1457     '';
1458   }) super.hledger-flow;
1460   # xmonad-contrib >= 0.18.1 for latest XMonad
1461   xmonad-contrib_0_18_1 = super.xmonad-contrib_0_18_1.override {
1462     xmonad = self.xmonad_0_18_0;
1463   };
1465   # Chart-tests needs and compiles some modules from Chart itself
1466   Chart-tests = overrideCabal (old: {
1467     # https://github.com/timbod7/haskell-chart/issues/233
1468     jailbreak = true;
1469     preCheck = old.preCheck or "" + ''
1470       tar --one-top-level=../chart --strip-components=1 -xf ${self.Chart.src}
1471     '';
1472   }) (addExtraLibrary self.QuickCheck super.Chart-tests);
1474   # This breaks because of version bounds, but compiles and runs fine.
1475   # Last commit is 5 years ago, so we likely won't get upstream fixed soon.
1476   # https://bitbucket.org/rvlm/hakyll-contrib-hyphenation/src/master/
1477   # Therefore we jailbreak it.
1478   hakyll-contrib-hyphenation = doJailbreak super.hakyll-contrib-hyphenation;
1480   # The test suite depends on an impure cabal-install installation in
1481   # $HOME, which we don't have in our build sandbox.
1482   # 2022-08-31: Jailbreak is done to allow aeson 2.0.*:
1483   # https://github.com/haskell-CI/haskell-ci/commit/6ad0d5d701cbe101013335d597acaf5feadd3ab9#r82681900
1484   cabal-install-parsers = doJailbreak (dontCheck (super.cabal-install-parsers.override {
1485     Cabal-syntax = self.Cabal-syntax_3_10_3_0;
1486   }));
1488   # Test suite requires database
1489   persistent-mysql = dontCheck super.persistent-mysql;
1490   persistent-postgresql =
1491     # TODO: move this override to configuration-nix.nix
1492     overrideCabal
1493       (drv: {
1494         postPatch = drv.postPath or "" + ''
1495           # patch out TCP usage: https://nixos.org/manual/nixpkgs/stable/#sec-postgresqlTestHook-tcp
1496           # NOTE: upstream host variable takes only two values...
1497           sed -i test/PgInit.hs \
1498             -e s^'host=" <> host <> "'^^
1499         '';
1500         # https://github.com/commercialhaskell/stackage/issues/6884
1501         # persistent-postgresql-2.13.5.1 needs persistent-test >= 2.13.1.3 which
1502         # is incompatible with the stackage version of persistent, so the tests
1503         # are disabled temporarily.
1504         doCheck = false;
1505         preCheck = drv.preCheck or "" + ''
1506           PGDATABASE=test
1507           PGUSER=test
1508         '';
1509         testToolDepends = drv.testToolDepends or [] ++ [
1510           pkgs.postgresql
1511           pkgs.postgresqlTestHook
1512         ];
1513       })
1514       # https://github.com/NixOS/nixpkgs/issues/198495
1515       (dontCheckIf (!pkgs.postgresql.doCheck) super.persistent-postgresql);
1517   # Test suite requires a later version of persistent-test which depends on persistent 2.14
1518   # https://github.com/commercialhaskell/stackage/issues/6884
1519   persistent-sqlite = dontCheck super.persistent-sqlite;
1521   # Needs matching lsp-types
1522   lsp_2_4_0_0 = super.lsp_2_4_0_0.override {
1523     lsp-types = self.lsp-types_2_1_1_0;
1524   };
1526   # 2024-02-28: The Hackage version dhall-lsp-server-1.1.3 requires
1527   # lsp-1.4.0.0 which is hard to build with this LTS. However, the latest
1528   # git version of dhall-lsp-server works with lsp-2.1.0.0, and only
1529   # needs jailbreaking to build successfully.
1530   dhall-lsp-server = lib.pipe
1531     (super.dhall-lsp-server.overrideScope (lself: lsuper: {
1532       lsp = doJailbreak lself.lsp_2_1_0_0;  # sorted-list <0.2.2
1533       lsp-types = lself.lsp-types_2_0_2_0;
1534     }))
1535     [
1536       # Use latest main branch version of dhall-lsp-server.
1537       (assert super.dhall-lsp-server.version == "1.1.3"; overrideSrc {
1538         version = "unstable-2024-02-19";
1539         src = pkgs.fetchFromGitHub {
1540           owner = "dhall-lang";
1541           repo = "dhall-haskell";
1542           rev = "277d8b1b3637ba2ce125783cc1936dc9591e67a7";
1543           hash = "sha256-YvL3XEltU9sdU45ULHeD3j1mPGZoO1J81MW7f2+10ok=";
1544         } + "/dhall-lsp-server";
1545       })
1546       # New version needs an extra dependency
1547       (addBuildDepend self.text-rope)
1548       # bounds too strict: mtl <2.3, transformers <0.6
1549       doJailbreak
1550     ];
1552   ghcjs-dom-hello = appendPatches [
1553     (fetchpatch {
1554       url = "https://github.com/ghcjs/ghcjs-dom-hello/commit/53991df6a4eba9f1e9633eb22f6a0486a79491c3.patch";
1555       sha256 = "sha256-HQeUgjvzYyY14+CDYiMahAMn7fBcy2d7p8/kqGq+rnI=";
1556     })
1557     (fetchpatch {
1558       url = "https://github.com/ghcjs/ghcjs-dom-hello/commit/d766d937121f7ea5c4c154bd533a1eae47f531c9.patch";
1559       sha256 = "sha256-QTkH+L+JMwGyuoqzHBnrokT7KzpHC4YiAWoeiaFBLUw=";
1560     })
1561     (fetchpatch {
1562       url = "https://github.com/ghcjs/ghcjs-dom-hello/commit/831464d995f4033c9aa84f9ed9fb37a268f34d4e.patch";
1563       sha256 = "sha256-hQMy+78geTuxd3kbdiyYqoAFrauu90HbpPi0EEKjMzM=";
1564     })
1565    ] super.ghcjs-dom-hello;
1567   # Needs https://github.com/ghcjs/jsaddle-hello/pull/5 and hackage release
1568   jsaddle-hello = appendPatches [
1569     (fetchpatch {
1570       url = "https://github.com/ghcjs/jsaddle-hello/commit/c4de837675117b821c50a5079d20d84ec16ff26a.patch";
1571       sha256 = "sha256-NsM7QqNLt5V8i5bveYgMrawGnZVsIuAoJfBF75jBwV0=";
1572     })
1573     (fetchpatch {
1574       url = "https://github.com/ghcjs/jsaddle-hello/commit/5c437363833684ea951ec74a0d0fdf5b6fbaca85.patch";
1575       sha256 = "sha256-CUyZsts0FAQ3c8Z+zfvwbmlAJCMcidV80n8dA/SoRls=";
1576     })
1577     (fetchpatch {
1578       url = "https://github.com/ghcjs/jsaddle-hello/commit/e2da9e266fbfa8f7fcf3009ab6cfbf825a8bcf7a.patch";
1579       sha256 = "sha256-WL0CcnlMt6KI7MOZMg74fNN/I4gYSO3n+GiaXB2BOP0=";
1580     })
1581   ] super.jsaddle-hello;
1583   # Too strict upper bounds on text
1584   lsql-csv = doJailbreak super.lsql-csv;
1586   reflex-dom = lib.pipe super.reflex-dom [
1587       (appendPatch
1588         (fetchpatch {
1589           name = "bump-reflex-dom-bounds.patch";
1590           url = "https://github.com/reflex-frp/reflex-dom/commit/70ff88942f9d2bcd364e301c70df8702f452df38.patch";
1591           sha256 = "sha256-xzk1+6CnfhEBfXdL5RUFbLRSn7knMwydmV8v2F2W5gE=";
1592           relative = "reflex-dom";
1593         })
1594       )
1595       (overrideCabal (drv: {
1596         editedCabalFile = null;
1597         revision = null;
1598       }))
1599     ];
1601   # Tests disabled and broken override needed because of missing lib chrome-test-utils: https://github.com/reflex-frp/reflex-dom/issues/392
1602   # 2022-03-16: Pullrequest for ghc 9 compat https://github.com/reflex-frp/reflex-dom/pull/433
1603   reflex-dom-core = lib.pipe super.reflex-dom-core [
1604       doDistribute
1605       unmarkBroken
1606       dontCheck
1607       (appendPatches [
1608         (fetchpatch {
1609           name = "fix-th-build-order.patch";
1610           url = "https://github.com/reflex-frp/reflex-dom/commit/1814640a14c6c30b1b2299e74d08fb6fcaadfb94.patch";
1611           sha256 = "sha256-QyX2MLd7Tk0M1s0DU0UV3szXs8ngz775i3+KI62Q3B8=";
1612           relative = "reflex-dom-core";
1613         })
1614         (fetchpatch {
1615           name = "bump-reflex-dom-core-bounds.patch";
1616           url = "https://github.com/reflex-frp/reflex-dom/commit/51cdd96dde9d65fcde326a16a797397bf62102d9.patch";
1617           sha256 = "sha256-Ct8gMbXqN+6vqTwFiqnKxddAfs+YFaBocF4G7PPMzFo=";
1618           relative = "reflex-dom-core";
1619         })
1620         (fetchpatch {
1621           name = "new-mtl-compat.patch";
1622           url = "https://github.com/reflex-frp/reflex-dom/commit/df95bfc0b9baf70492f20daddfe6bb180f80c413.patch";
1623           sha256 = "sha256-zkLZtcnfqpfiv6zDEmkZjWHr2b7lOnZ4zujm0/pkxQg=";
1624           relative = "reflex-dom-core";
1625         })
1626       ])
1627     ];
1629   # Tests disabled because they assume to run in the whole jsaddle repo and not the hackage tarball of jsaddle-warp.
1630   jsaddle-warp = dontCheck super.jsaddle-warp;
1632   # 2020-06-24: Jailbreaking because of restrictive test dep bounds
1633   # Upstream issue: https://github.com/kowainik/trial/issues/62
1634   trial = doJailbreak super.trial;
1636   # 2024-03-19: Fix for mtl >= 2.3
1637   pattern-arrows = lib.pipe super.pattern-arrows [
1638     doJailbreak
1639     (appendPatches [./patches/pattern-arrows-add-fix-import.patch])
1640   ];
1642   # 2024-03-19: Fix for mtl >= 2.3
1643   cheapskate = lib.pipe super.cheapskate [
1644     doJailbreak
1645     (appendPatches [./patches/cheapskate-mtl-2-3-support.patch])
1646   ];
1648   # 2020-06-24: Tests are broken in hackage distribution.
1649   # See: https://github.com/robstewart57/rdf4h/issues/39
1650   rdf4h = dontCheck super.rdf4h;
1652   # hasn't bumped upper bounds
1653   # test fails because of a "Warning: Unused LANGUAGE pragma"
1654   # https://github.com/ennocramer/monad-dijkstra/issues/4
1655   monad-dijkstra = dontCheck super.monad-dijkstra;
1657   # Fixed upstream but not released to Hackage yet:
1658   # https://github.com/k0001/hs-libsodium/issues/2
1659   libsodium = overrideCabal (drv: {
1660     libraryToolDepends = (drv.libraryToolDepends or []) ++ [self.buildHaskellPackages.c2hs];
1661   }) super.libsodium;
1663   svgcairo = overrideCabal (drv: {
1664     patches = drv.patches or [ ] ++ [
1665       # Remove when https://github.com/gtk2hs/svgcairo/pull/12 goes in.
1666       (fetchpatch {
1667         url = "https://github.com/gtk2hs/svgcairo/commit/348c60b99c284557a522baaf47db69322a0a8b67.patch";
1668         sha256 = "0akhq6klmykvqd5wsbdfnnl309f80ds19zgq06sh1mmggi54dnf3";
1669       })
1670       # Remove when https://github.com/gtk2hs/svgcairo/pull/13 goes in.
1671       (fetchpatch {
1672         url = "https://github.com/dalpd/svgcairo/commit/d1e0d7ae04c1edca83d5b782e464524cdda6ae85.patch";
1673         sha256 = "1pq9ld9z67zsxj8vqjf82qwckcp69lvvnrjb7wsyb5jc6jaj3q0a";
1674       })
1675     ];
1676     editedCabalFile = null;
1677     revision = null;
1678   }) super.svgcairo;
1680   # Upstream PR: https://github.com/jkff/splot/pull/9
1681   splot = appendPatch (fetchpatch {
1682     url = "https://github.com/jkff/splot/commit/a6710b05470d25cb5373481cf1cfc1febd686407.patch";
1683     sha256 = "1c5ck2ibag2gcyag6rjivmlwdlp5k0dmr8nhk7wlkzq2vh7zgw63";
1684   }) super.splot;
1686   # 2023-07-27: Fix build with newer monad-logger: https://github.com/obsidiansystems/monad-logger-extras/pull/5
1687   # 2024-03-02: jailbreak for ansi-terminal <0.12, mtl <2.3
1688   monad-logger-extras = appendPatch (fetchpatch {
1689     url = "https://github.com/obsidiansystems/monad-logger-extras/commit/55d414352e740a5ecacf313732074d9b4cf2a6b3.patch";
1690     sha256 = "sha256-xsQbr/QIrgWR0uwDPtV0NRTbVvP0tR9bY9NMe1JzqOw=";
1691   }) (doJailbreak super.monad-logger-extras);
1693   # Fails with encoding problems, likely needs locale data.
1694   # Test can be executed by adding which to testToolDepends and
1695   # $PWD/dist/build/haskeline-examples-Test to $PATH.
1696   haskeline_0_8_2_1 = doDistribute (dontCheck super.haskeline_0_8_2_1);
1698   # Too strict upper bound on HTF
1699   # https://github.com/nikita-volkov/stm-containers/issues/29
1700   stm-containers = doJailbreak super.stm-containers;
1702   # Test suite fails to compile https://github.com/agrafix/Spock/issues/177
1703   Spock = dontCheck super.Spock;
1705   Spock-core = appendPatches [
1706     (fetchpatch {
1707       url = "https://github.com/agrafix/Spock/commit/d0b51fa60a83bfa5c1b5fc8fced18001e7321701.patch";
1708       sha256 = "sha256-l9voiczOOdYVBP/BNEUvqARb21t0Rp2kpsNbRFUWSLg=";
1709       stripLen = 1;
1710     })
1711   ] (doJailbreak super.Spock-core);
1713   # https://github.com/strake/filtrable.hs/issues/6
1714   filtrable = doJailbreak super.filtrable;
1716   # hasura packages need some extra care
1717   graphql-engine = overrideCabal (drv: {
1718     patches = [
1719       # Compat with unordered-containers >= 0.2.15.0
1720       (fetchpatch {
1721         name = "hasura-graphql-engine-updated-deps.patch";
1722         url = "https://github.com/hasura/graphql-engine/commit/d50aae87a58794bc1fc66c7a60acb0c34b5e70c7.patch";
1723         stripLen = 1;
1724         excludes = [ "cabal.project.freeze" ];
1725         sha256 = "0lb5l9vfynr85i9xs53w4mpgczp04ncxz7846n3y91ri34fa87v3";
1726       })
1727       # Compat with hashable >= 1.3.4.0
1728       (fetchpatch {
1729         name = "hasura-graphql-engine-hashable-1.3.4.0.patch";
1730         url = "https://github.com/hasura/graphql-engine/commit/e48b2287315fb09005ffd52c0a686dc321171ae2.patch";
1731         sha256 = "1jppnanmsyl8npyf59s0d8bgjy7bq50vkh5zx4888jy6jqh27jb6";
1732         stripLen = 1;
1733       })
1734       # Compat with unordered-containers >= 0.2.17.0
1735       (fetchpatch {
1736         name = "hasura-graphql-engine-unordered-containers-0.2.17.0.patch";
1737         url = "https://github.com/hasura/graphql-engine/commit/3a1eb3128a2ded2da7c5fef089738890828cce03.patch";
1738         sha256 = "0vz7s8m8mjvv728vm4q0dvvrirvydaw7xks30b5ddj9f6a72a2f1";
1739         stripLen = 1;
1740       })
1741     ];
1742     doHaddock = false;
1743     version = "2.3.1";
1744   }) (super.graphql-engine.override {
1745     immortal = self.immortal_0_2_2_1;
1746     resource-pool = self.hasura-resource-pool;
1747     ekg-core = self.hasura-ekg-core;
1748     ekg-json = self.hasura-ekg-json;
1749   });
1750   hasura-ekg-json = super.hasura-ekg-json.override {
1751     ekg-core = self.hasura-ekg-core;
1752   };
1753   pg-client = lib.pipe
1754     (super.pg-client.override {
1755       resource-pool = self.hasura-resource-pool;
1756       ekg-core = self.hasura-ekg-core;
1757     }) [
1758       (overrideCabal (drv: {
1759         librarySystemDepends = with pkgs; [ postgresql krb5.dev openssl.dev ];
1760         testToolDepends = drv.testToolDepends or [] ++ [
1761           pkgs.postgresql pkgs.postgresqlTestHook
1762         ];
1763         preCheck = drv.preCheck or "" + ''
1764           # empty string means use default connection
1765           export DATABASE_URL=""
1766         '';
1767       }))
1768       # https://github.com/NixOS/nixpkgs/issues/198495
1769       (dontCheckIf (!pkgs.postgresql.doCheck))
1770     ];
1772   hcoord = overrideCabal (drv: {
1773     # Remove when https://github.com/danfran/hcoord/pull/8 is merged.
1774     patches = [
1775       (fetchpatch {
1776         url = "https://github.com/danfran/hcoord/pull/8/commits/762738b9e4284139f5c21f553667a9975bad688e.patch";
1777         sha256 = "03r4jg9a6xh7w3jz3g4bs7ff35wa4rrmjgcggq51y0jc1sjqvhyz";
1778       })
1779     ];
1780     # Remove when https://github.com/danfran/hcoord/issues/9 is closed.
1781     doCheck = false;
1782   }) super.hcoord;
1784   # Break infinite recursion via tasty
1785   temporary = dontCheck super.temporary;
1787   # Break infinite recursion via doctest-lib
1788   utility-ht = dontCheck super.utility-ht;
1790   # Break infinite recursion via optparse-applicative (alternatively, dontCheck syb)
1791   prettyprinter-ansi-terminal = dontCheck super.prettyprinter-ansi-terminal;
1793   # Tests rely on `Int` being 64-bit: https://github.com/hspec/hspec/issues/431.
1794   # Also, we need QuickCheck-2.14.x to build the test suite, which isn't easy in LTS-16.x.
1795   # So let's not go there and just disable the tests altogether.
1796   hspec-core = dontCheck super.hspec-core;
1798   # tests seem to require a different version of hspec-core
1799   hspec-contrib = dontCheck super.hspec-contrib;
1801   # The test suite attempts to read `/etc/resolv.conf`, which doesn't work in the sandbox.
1802   domain-auth = dontCheck super.domain-auth;
1804   # - Deps are required during the build for testing and also during execution,
1805   #   so add them to build input and also wrap the resulting binary so they're in
1806   #   PATH.
1807   # - Patch can be removed on next package set bump (for v0.2.11)
1809   # 2023-06-26: Test failure: https://hydra.nixos.org/build/225081865
1810   update-nix-fetchgit = let
1811       deps = [ pkgs.git pkgs.nix pkgs.nix-prefetch-git ];
1812     in lib.pipe  super.update-nix-fetchgit [
1813       dontCheck
1814       (self.generateOptparseApplicativeCompletions [ "update-nix-fetchgit" ])
1815       (overrideCabal (drv: {
1816         buildTools = drv.buildTools or [ ] ++ [ pkgs.buildPackages.makeWrapper ];
1817         postInstall = drv.postInstall or "" + ''
1818           wrapProgram "$out/bin/update-nix-fetchgit" --prefix 'PATH' ':' "${
1819             lib.makeBinPath deps
1820           }"
1821         '';
1822       }))
1823       (addTestToolDepends deps)
1824       # Patch for hnix compat.
1825       (appendPatch (fetchpatch {
1826         url = "https://github.com/expipiplus1/update-nix-fetchgit/commit/dfa34f9823e282aa8c5a1b8bc95ad8def0e8d455.patch";
1827         sha256 = "sha256-yBjn1gVihVTlLewKgJc2I9gEj8ViNBAmw0bcsb5rh1A=";
1828         excludes = [ "cabal.project" ];
1829       }))
1830     ];
1832   # Raise version bounds: https://github.com/idontgetoutmuch/binary-low-level/pull/16
1833   binary-strict = appendPatches [
1834     (fetchpatch {
1835       url = "https://github.com/idontgetoutmuch/binary-low-level/pull/16/commits/c16d06a1f274559be0dea0b1f7497753e1b1a8ae.patch";
1836       sha256 = "sha256-deSbudy+2je1SWapirWZ1IVWtJ0sJVR5O/fnaAaib2g=";
1837     })
1838   ] super.binary-strict;
1840   # The tests for semver-range need to be updated for the MonadFail change in
1841   # ghc-8.8:
1842   # https://github.com/adnelson/semver-range/issues/15
1843   semver-range = dontCheck super.semver-range;
1845   # 2022-06-19: Disable checks because of https://github.com/reflex-frp/reflex/issues/475
1846   reflex = doJailbreak (dontCheck super.reflex);
1848   # 2024-03-02: vty <5.39 - https://github.com/reflex-frp/reflex-ghci/pull/33
1849   reflex-ghci = assert super.reflex-ghci.version == "0.2.0.1"; doJailbreak super.reflex-ghci;
1851   # 2024-09-18: transformers <0.5  https://github.com/reflex-frp/reflex-gloss/issues/6
1852   reflex-gloss = assert super.reflex-gloss.version == "0.2"; doJailbreak super.reflex-gloss;
1854   # 2024-09-18: primitive <0.8  https://gitlab.com/Kritzefitz/reflex-gi-gtk/-/merge_requests/20
1855   reflex-gi-gtk = assert super.reflex-gi-gtk.version == "0.2.0.1"; doJailbreak super.reflex-gi-gtk;
1857   # Due to tests restricting base in 0.8.0.0 release
1858   http-media = doJailbreak super.http-media;
1860   # 2022-03-19: strict upper bounds https://github.com/poscat0x04/hinit/issues/2
1861   hinit = doJailbreak
1862     (self.generateOptparseApplicativeCompletions [ "hi" ]
1863       (super.hinit.override { haskeline = self.haskeline_0_8_2_1; }));
1865   # 2020-11-23: https://github.com/Rufflewind/blas-hs/issues/8
1866   blas-hs = dontCheck super.blas-hs;
1868   # Strange doctest problems
1869   # https://github.com/biocad/servant-openapi3/issues/30
1870   servant-openapi3 = dontCheck super.servant-openapi3;
1872   # Point hspec 2.7.10 to correct dependencies
1873   hspec_2_7_10 = super.hspec_2_7_10.override {
1874     hspec-discover = self.hspec-discover_2_7_10;
1875     hspec-core = self.hspec-core_2_7_10;
1876   };
1877   hspec-discover_2_7_10 = super.hspec-discover_2_7_10.override {
1878     hspec-meta = self.hspec-meta_2_7_8;
1879   };
1880   hspec-core_2_7_10 = doJailbreak (dontCheck super.hspec-core_2_7_10);
1882   # waiting for aeson bump
1883   servant-swagger-ui-core = doJailbreak super.servant-swagger-ui-core;
1885   hercules-ci-agent = self.generateOptparseApplicativeCompletions [ "hercules-ci-agent" ] super.hercules-ci-agent;
1887   # Test suite doesn't compile with aeson 2.0
1888   # https://github.com/hercules-ci/hercules-ci-agent/pull/387
1889   hercules-ci-api-agent = dontCheck super.hercules-ci-api-agent;
1891   hercules-ci-cli = lib.pipe super.hercules-ci-cli [
1892     unmarkBroken
1893     (overrideCabal (drv: { hydraPlatforms = super.hercules-ci-cli.meta.platforms; }))
1894     # See hercules-ci-optparse-applicative in non-hackage-packages.nix.
1895     (addBuildDepend super.hercules-ci-optparse-applicative)
1896     (self.generateOptparseApplicativeCompletions [ "hci" ])
1897   ];
1899   # https://github.com/k0001/pipes-aeson/pull/21
1900   pipes-aeson = appendPatch (fetchpatch {
1901     url = "https://github.com/k0001/pipes-aeson/commit/08c25865ef557b41d7e4a783f52e655d2a193e18.patch";
1902     relative = "pipes-aeson";
1903     sha256 = "sha256-kFV6CcwKdMq+qSgyc+eIApnaycq5A++pEEVr2A9xvts=";
1904   }) super.pipes-aeson;
1906   # 2024-09-18: transformers <0.6  https://github.com/Gabriella439/Haskell-Pipes-Extras-Library/pull/19
1907   pipes-extras = assert super.pipes-extras.version == "1.0.15"; doJailbreak super.pipes-extras;
1909   moto-postgresql = appendPatches [
1910     # https://gitlab.com/k0001/moto/-/merge_requests/3
1911     (fetchpatch {
1912       name = "moto-postgresql-monadfail.patch";
1913       url = "https://gitlab.com/k0001/moto/-/commit/09cc1c11d703c25f6e81325be6482dc7ec6cbf58.patch";
1914       relative = "moto-postgresql";
1915       sha256 = "sha256-f2JVX9VveShCeV+T41RQgacpUoh1izfyHlE6VlErkZM=";
1916     })
1917   ] super.moto-postgresql;
1919   moto = appendPatches [
1920     # https://gitlab.com/k0001/moto/-/merge_requests/3
1921     (fetchpatch {
1922       name = "moto-ghc-9.0.patch";
1923       url = "https://gitlab.com/k0001/moto/-/commit/5b6f015a1271765005f03762f1f1aaed3a3198ed.patch";
1924       relative = "moto";
1925       sha256 = "sha256-RMa9tk+2ip3Ks73UFv9Ea9GEnElRtzIjdpld1Fx+dno=";
1926     })
1927   ] super.moto;
1929   # Readline uses Distribution.Simple from Cabal 2, in a way that is not
1930   # compatible with Cabal 3. No upstream repository found so far
1931   readline = appendPatch ./patches/readline-fix-for-cabal-3.patch super.readline;
1933   # https://github.com/jgm/pandoc/issues/9589
1934   pandoc = assert super.pandoc.version == "3.1.11.1"; lib.pipe super.pandoc
1935     [
1936       dontCheck
1937       (appendPatch
1938         (pkgs.fetchpatch {
1939           name = "drop-usage-known-bad-actor-cdn.patch";
1940           url = "https://github.com/jgm/pandoc/commit/5877ec546df29115163b36de32837f5e08506092.patch";
1941           hash = "sha256-2ffdL2dS/hHWBjJcIHbae5OdL/VKlHNKUMDHRy3hqvc=";
1942         })
1943       )
1944     ];
1946   # 2020-12-06: Restrictive upper bounds w.r.t. pandoc-types (https://github.com/owickstrom/pandoc-include-code/issues/27)
1947   pandoc-include-code = doJailbreak super.pandoc-include-code;
1949   # 2023-07-08: Restrictive upper bounds on text: https://github.com/owickstrom/pandoc-emphasize-code/pull/14
1950   # 2023-07-08: Missing test dependency: https://github.com/owickstrom/pandoc-emphasize-code/pull/13
1951   pandoc-emphasize-code = dontCheck (doJailbreak super.pandoc-emphasize-code);
1953   # DerivingVia is not allowed in safe Haskell
1954   # https://github.com/strake/util.hs/issues/1
1955   util = appendConfigureFlags [
1956     "--ghc-option=-fno-safe-haskell"
1957     "--haddock-option=--optghc=-fno-safe-haskell"
1958   ] super.util;
1959   category = appendConfigureFlags [
1960     "--ghc-option=-fno-safe-haskell"
1961     "--haddock-option=--optghc=-fno-safe-haskell"
1962   ] super.category;
1963   alg = appendConfigureFlags [
1964     "--ghc-option=-fno-safe-haskell"
1965     "--haddock-option=--optghc=-fno-safe-haskell"
1966   ] super.alg;
1968   # Missing test files in 1.8.1.0, fixed in 1.8.1.1
1969   sequence-formats = dontCheck super.sequence-formats;
1971   # Windows.normalise changed in filepath >= 1.4.100.4 which fails the equivalency
1972   # test suite. This is of no great consequence for us, though.
1973   # Patch solving this has been submitted to upstream by me (@sternenseemann).
1974   filepath-bytestring =
1975     lib.warnIf
1976       (lib.versionAtLeast super.filepath-bytestring.version "1.4.100.4")
1977       "filepath-bytestring override may be obsolete"
1978       dontCheck super.filepath-bytestring;
1980   # Break out of overspecified constraint on QuickCheck.
1981   haddock-library = doJailbreak super.haddock-library;
1983   # Test suite has overly strict bounds on tasty, jailbreaking fails.
1984   # https://github.com/input-output-hk/nothunks/issues/9
1985   nothunks = dontCheck super.nothunks;
1987   # Allow building with older versions of http-client.
1988   http-client-restricted = doJailbreak super.http-client-restricted;
1990   # Test suite fails, upstream not reachable for simple fix (not responsive on github)
1991   vivid-osc = dontCheck super.vivid-osc;
1992   vivid-supercollider = dontCheck super.vivid-supercollider;
1994   # Test suite does not compile.
1995   feed = dontCheck super.feed;
1997   spacecookie = overrideCabal (old: {
1998     buildTools = (old.buildTools or []) ++ [ pkgs.buildPackages.installShellFiles ];
1999     # let testsuite discover the resulting binary
2000     preCheck = ''
2001       export SPACECOOKIE_TEST_BIN=./dist/build/spacecookie/spacecookie
2002     '' + (old.preCheck or "");
2003     # install man pages shipped in the sdist
2004     postInstall = ''
2005       installManPage docs/man/*
2006     '' + (old.postInstall or "");
2007   }) super.spacecookie;
2009   # Patch and jailbreak can be removed at next release, chatter > 0.9.1.0
2010   # * Remove dependency on regex-tdfa-text
2011   # * Jailbreak as bounds on cereal are too strict
2012   # * Disable test suite which doesn't compile
2013   #   https://github.com/creswick/chatter/issues/38
2014   chatter = appendPatch
2015     (fetchpatch {
2016       url = "https://github.com/creswick/chatter/commit/e8c15a848130d7d27b8eb5e73e8a0db1366b2e62.patch";
2017       sha256 = "1dzak8d12h54vss5fxnrclygz0fz9ygbqvxd5aifz5n3vrwwpj3g";
2018     })
2019     (dontCheck (doJailbreak (super.chatter.override { regex-tdfa-text = null; })));
2021   # test suite doesn't compile anymore due to changed hunit/tasty APIs
2022   fullstop = dontCheck super.fullstop;
2024   # * doctests don't work without cabal
2025   #   https://github.com/noinia/hgeometry/issues/132
2026   # * Too strict version bound on vector-builder
2027   #   https://github.com/noinia/hgeometry/commit/a6abecb1ce4a7fd96b25cc1a5c65cd4257ecde7a#commitcomment-49282301
2028   hgeometry-combinatorial = dontCheck (doJailbreak super.hgeometry-combinatorial);
2030   # Too strict version bounds on ansi-terminal
2031   # https://github.com/kowainik/co-log/pull/218
2032   co-log = doJailbreak super.co-log;
2034   # Test suite has a too strict bound on base
2035   # https://github.com/jswebtools/language-ecmascript/pull/88
2036   # Test suite doesn't compile anymore
2037   language-ecmascript = dontCheck (doJailbreak super.language-ecmascript);
2039   # Too strict bounds on containers
2040   # https://github.com/jswebtools/language-ecmascript-analysis/issues/1
2041   language-ecmascript-analysis = doJailbreak super.language-ecmascript-analysis;
2043   # Too strict bounds on optparse-applicative
2044   # https://github.com/faylang/fay/pull/474
2045   fay = doJailbreak super.fay;
2047   # Requests latest versions of crypton-connection and tls
2048   darcs = super.darcs.overrideScope (self: super: {
2049     crypton-connection = self.crypton-connection_0_4_1;
2050     tls = self.tls_2_0_6;
2051   });
2053   # Requests version 2 of tls, can be removed once it's the default
2054   diohsc = super.diohsc.overrideScope (self: super: {
2055     tls = self.tls_2_0_6;
2056   });
2058   # Need https://github.com/obsidiansystems/cli-extras/pull/12 and more
2059   cli-extras = doJailbreak super.cli-extras;
2061   cli-git = lib.pipe super.cli-git [
2062     doJailbreak
2063     (addBuildTool pkgs.git)
2064   ];
2066   # Need https://github.com/obsidiansystems/cli-nix/pull/5 and more
2067   cli-nix = addBuildTools [
2068     pkgs.nix
2069     pkgs.nix-prefetch-git
2070   ] (doJailbreak super.cli-nix);
2072   nix-thunk = doJailbreak super.nix-thunk;
2074   # list `modbus` in librarySystemDepends, correct to `libmodbus`
2075   libmodbus = doJailbreak (addExtraLibrary pkgs.libmodbus super.libmodbus);
2077   ginger = doJailbreak super.ginger;
2079   # 2024-05-05 syntax changes: https://github.com/obsidiansystems/haveibeenpwned/pull/9
2080   haveibeenpwned = appendPatch
2081     (fetchpatch {
2082       url = "https://github.com/obsidiansystems/haveibeenpwned/pull/9/commits/14c134eec7de12f755b2d4667727762a8a1a6476.patch";
2083       sha256 = "sha256-fau5+b6tufJ+MscrLgbYvvBsekPe8R6QAy/4H31dcQ4";
2084     })
2085     (doJailbreak super.haveibeenpwned);
2088   # Too strict version bounds on ghc-events
2089   # https://github.com/mpickering/hs-speedscope/issues/16
2090   hs-speedscope = doJailbreak super.hs-speedscope;
2092   # Test suite doesn't support base16-bytestring >= 1.0
2093   # https://github.com/centromere/blake2/issues/6
2094   blake2 = dontCheck super.blake2;
2096   # Test suite doesn't support base16-bytestring >= 1.0
2097   # https://github.com/serokell/haskell-crypto/issues/25
2098   crypto-sodium = dontCheck super.crypto-sodium;
2100   # Polyfill for GHCs from the integer-simple days that don't bundle ghc-bignum
2101   ghc-bignum = super.ghc-bignum or self.mkDerivation {
2102     pname = "ghc-bignum";
2103     version = "1.0";
2104     sha256 = "0xl848q8z6qx2bi6xil0d35lra7wshwvysyfblki659d7272b1im";
2105     description = "GHC BigNum library";
2106     license = lib.licenses.bsd3;
2107     # ghc-bignum is not buildable if none of the three backends
2108     # is explicitly enabled. We enable Native for now as it doesn't
2109     # depend on anything else as oppossed to GMP and FFI.
2110     # Apply patch which fixes a compilation failure we encountered.
2111     # Will need to be kept until we can drop ghc-bignum entirely,
2112     # i. e. if GHC 8.10.* and 8.8.* have been removed.
2113     configureFlags = [ "-f" "Native" ];
2114     patches = [
2115       (fetchpatch {
2116         url = "https://gitlab.haskell.org/ghc/ghc/-/commit/08d1588bf38d83140a86817a7a615db486357d4f.patch";
2117         sha256 = "sha256-Y9WW0KDQ/qY2L9ObPvh1i/6lxXIlprbxzdSBDfiaMtE=";
2118         relative = "libraries/ghc-bignum";
2119       })
2120     ];
2121   };
2123   # 2021-04-09: too strict time bound
2124   # PR pending https://github.com/zohl/cereal-time/pull/2
2125   cereal-time = doJailbreak super.cereal-time;
2127   # 2021-04-16: too strict bounds on QuickCheck and tasty
2128   # https://github.com/hasufell/lzma-static/issues/1
2129   lzma-static = doJailbreak super.lzma-static;
2131   # Too strict version bounds on base:
2132   # https://github.com/obsidiansystems/database-id/issues/1
2133   database-id-class = doJailbreak super.database-id-class;
2135   # https://github.com/softwarefactory-project/matrix-client-haskell/issues/36
2136   # Restrictive bounds on aeson
2137   matrix-client = doJailbreak super.matrix-client;
2139   cabal2nix-unstable = overrideCabal {
2140     passthru = {
2141       updateScript = ../../../maintainers/scripts/haskell/update-cabal2nix-unstable.sh;
2143       # This is used by regenerate-hackage-packages.nix to supply the configuration
2144       # values we can easily generate automatically without checking them in.
2145       compilerConfig =
2146         pkgs.runCommand
2147           "hackage2nix-${self.ghc.haskellCompilerName}-config.yaml"
2148           {
2149             nativeBuildInputs = [
2150               self.ghc
2151             ];
2152           }
2153           ''
2154             cat > "$out" << EOF
2155             # generated by haskellPackages.cabal2nix-unstable.compilerConfig
2156             compiler: ${self.ghc.haskellCompilerName}
2158             core-packages:
2159             EOF
2161             ghc-pkg list \
2162               | tail -n '+2' \
2163               | sed -e 's/[()]//g' -e 's/\s\+/  - /' \
2164               >> "$out"
2165           '';
2166     };
2167   } super.cabal2nix-unstable;
2169   # Too strict version bounds on base
2170   # https://github.com/gibiansky/IHaskell/issues/1217
2171   ihaskell-display = doJailbreak super.ihaskell-display;
2172   ihaskell-basic = doJailbreak super.ihaskell-basic;
2174   # Fixes too strict version bounds on regex libraries
2175   # Presumably to be removed at the next release
2176   # Test suite doesn't support hspec 2.8
2177   # https://github.com/yi-editor/yi/issues/1124
2178   yi-language = appendPatch (fetchpatch {
2179     url = "https://github.com/yi-editor/yi/commit/0d3bcb5ba4c237d57ce33a3dc39b63c56d890765.patch";
2180     relative = "yi-language";
2181     sha256 = "sha256-AVQLvul3ufxGQyoXud05qauclNanf6kunip0oJ/9lWQ=";
2182   }) (dontCheck super.yi-language);
2184   # Tests need to lookup target triple x86_64-unknown-linux
2185   # https://github.com/llvm-hs/llvm-hs/issues/334
2186   llvm-hs = dontCheckIf (pkgs.stdenv.targetPlatform.system != "x86_64-linux") super.llvm-hs;
2188   # Fix build with bytestring >= 0.11 (GHC 9.2)
2189   # https://github.com/llvm-hs/llvm-hs/pull/389
2190   llvm-hs-pure = appendPatches [
2191     (fetchpatch {
2192       name = "llvm-hs-pure-bytestring-0.11.patch";
2193       url = "https://github.com/llvm-hs/llvm-hs/commit/fe8fd556e8d2cc028f61d4d7b4b6bf18c456d090.patch";
2194       sha256 = "sha256-1d4wQg6JEJL3GwmXQpvbW7VOY5DwjUPmIsLEEur0Kps=";
2195       relative = "llvm-hs-pure";
2196       excludes = [ "**/Triple.hs" ]; # doesn't exist in 9.0.0
2197     })
2198   ] (overrideCabal {
2199     # Hackage Revision prevents patch from applying. Revision 1 does not allow
2200     # bytestring-0.11.4 which is bundled with 9.2.6.
2201     editedCabalFile = null;
2202     revision = null;
2203   } super.llvm-hs-pure);
2205   # Too strict bounds on dimensional
2206   # https://github.com/enomsg/science-constants-dimensional/pull/1
2207   science-constants-dimensional = doJailbreak super.science-constants-dimensional;
2209   # Tests are flaky on busy machines, upstream doesn't intend to fix
2210   # https://github.com/merijn/paramtree/issues/4
2211   paramtree = dontCheck super.paramtree;
2213   # 2024-09-18: Make compatible with haskell-gi 0.26.10
2214   # https://github.com/owickstrom/gi-gtk-declarative/pull/118
2215   gi-gtk-declarative = overrideCabal (drv: assert drv.version == "0.7.1"; {
2216     jailbreak = true;
2217     postPatch = ''
2218       sed -i '1 i {-# LANGUAGE FlexibleContexts #-}' \
2219         src/GI/Gtk/Declarative/Widget/Conversions.hs
2220     '';
2221   }) super.gi-gtk-declarative;
2222   gi-gtk-declarative-app-simple = doJailbreak super.gi-gtk-declarative-app-simple;
2224   gi-gtk_4 = self.gi-gtk_4_0_9;
2225   gi-gtk_4_0_9 = doDistribute (super.gi-gtk_4_0_9.override {
2226     gi-gdk = self.gi-gdk_4;
2227   });
2228   gi-gdk_4 = self.gi-gdk_4_0_9;
2229   gi-gdk_4_0_9 = doDistribute super.gi-gdk_4_0_9;
2230   # GSK is only used for GTK 4.
2231   gi-gsk = super.gi-gsk.override {
2232     gi-gdk = self.gi-gdk_4;
2233   };
2234   gi-adwaita = super.gi-adwaita.override {
2235     gi-gdk = self.gi-gdk_4;
2236     gi-gtk = self.gi-gtk_4;
2237   };
2239   # 2023-04-09: haskell-ci needs Cabal-syntax 3.10
2240   # 2024-03-21: pins specific version of ShellCheck
2241   haskell-ci = super.haskell-ci.overrideScope (self: super: {
2242     Cabal-syntax = self.Cabal-syntax_3_10_3_0;
2243     ShellCheck = self.ShellCheck_0_9_0;
2244   });
2246   # ShellCheck < 0.10.0 needs to be adjusted for changes in fgl >= 5.8
2247   # https://github.com/koalaman/shellcheck/issues/2677
2248   ShellCheck_0_9_0 = doJailbreak (appendPatches [
2249     (fetchpatch {
2250       name = "shellcheck-fgl-5.8.1.1.patch";
2251       url = "https://github.com/koalaman/shellcheck/commit/c05380d518056189412e12128a8906b8ca6f6717.patch";
2252       sha256 = "0gbx46x1a2sh5mvgpqxlx9xkqcw4wblpbgqdkqccxdzf7vy50xhm";
2253     })
2254   ] super.ShellCheck_0_9_0);
2256   # Too strict bound on hspec (<2.11)
2257   utf8-light = doJailbreak super.utf8-light;
2259   # BSON defaults to requiring network instead of network-bsd which is
2260   # required nowadays: https://github.com/mongodb-haskell/bson/issues/26
2261   bson = appendConfigureFlag "-f-_old_network" (super.bson.override {
2262     network = self.network-bsd;
2263   });
2265   # Disable flaky tests
2266   # https://github.com/DavidEichmann/alpaca-netcode/issues/2
2267   alpaca-netcode = overrideCabal {
2268     testFlags = [ "--pattern" "!/[NOCI]/" ];
2269   } super.alpaca-netcode;
2271   # 2021-05-22: Tests fail sometimes (even consistently on hydra)
2272   # when running a fs-related test with >= 12 jobs. To work around
2273   # this, run tests with only a single job.
2274   # https://github.com/vmchale/libarchive/issues/20
2275   libarchive = overrideCabal {
2276     testFlags = [ "-j1" ];
2277   } super.libarchive;
2279   # Too strict bounds on QuickCheck
2280   # https://github.com/muesli4/table-layout/issues/16
2281   table-layout = doJailbreak super.table-layout;
2283   # https://github.com/plow-technologies/hspec-golden-aeson/issues/17
2284   hspec-golden-aeson = dontCheck super.hspec-golden-aeson;
2286   # To strict bound on hspec
2287   # https://github.com/dagit/zenc/issues/5
2288   zenc = doJailbreak super.zenc;
2290   # https://github.com/ajscholl/basic-cpuid/pull/1
2291   basic-cpuid = appendPatch (fetchpatch {
2292     url = "https://github.com/ajscholl/basic-cpuid/commit/2f2bd7a7b53103fb0cf26883f094db9d7659887c.patch";
2293     sha256 = "0l15ccfdys100jf50s9rr4p0d0ikn53bkh7a9qlk9i0y0z5jc6x1";
2294   }) super.basic-cpuid;
2296   # 2021-08-18: streamly-posix was released with hspec 2.8.2, but it works with older versions too.
2297   streamly-posix = doJailbreak super.streamly-posix;
2299   # Fix from https://github.com/brendanhay/gogol/pull/144 which has seen no release
2300   # Can't use fetchpatch as it required tweaking the line endings as the .cabal
2301   # file revision on hackage was gifted CRLF line endings
2302   gogol-core = appendPatch ./patches/gogol-core-144.patch super.gogol-core;
2304   # Stackage LTS 19 still has 10.*
2305   hadolint = super.hadolint.override {
2306     language-docker = self.language-docker_11_0_0;
2307   };
2309   # Too strict lower bounds on (test) deps
2310   # https://github.com/phadej/puresat/issues/6
2311   puresat = doJailbreak super.puresat;
2312   # https://github.com/phadej/spdx/issues/62
2313   spdx = doJailbreak super.spdx;
2315   # test suite requires stack to run, https://github.com/dino-/photoname/issues/24
2316   photoname = dontCheck super.photoname;
2318   # Upgrade of unordered-containers in Stackage causes ordering-sensitive test to fail
2319   # https://github.com/commercialhaskell/stackage/issues/6366
2320   # https://github.com/kapralVV/Unique/issues/9
2321   # Too strict bounds on hashable
2322    # https://github.com/kapralVV/Unique/pull/10
2323   Unique = assert super.Unique.version == "0.4.7.9"; overrideCabal (drv: {
2324     testFlags = [
2325       "--skip" "/Data.List.UniqueUnsorted.removeDuplicates/removeDuplicates: simple test/"
2326       "--skip" "/Data.List.UniqueUnsorted.repeatedBy,repeated,unique/unique: simple test/"
2327       "--skip" "/Data.List.UniqueUnsorted.repeatedBy,repeated,unique/repeatedBy: simple test/"
2328     ] ++ drv.testFlags or [];
2329   }) (doJailbreak super.Unique);
2331   # https://github.com/AndrewRademacher/aeson-casing/issues/8
2332   aeson-casing = assert super.aeson-casing.version == "0.2.0.0"; overrideCabal (drv: {
2333     testFlags = [
2334       "-p" "! /encode train/"
2335     ] ++ drv.testFlags or [];
2336   }) super.aeson-casing;
2338   # https://github.com/emc2/HUnit-Plus/issues/26
2339   HUnit-Plus = dontCheck super.HUnit-Plus;
2340   # https://github.com/ewestern/haskell-postgis/issues/7
2341   haskell-postgis = overrideCabal (drv: {
2342     testFlags = [
2343       "--skip" "/Geo/Hexable/Encodes a linestring/"
2344     ] ++ drv.testFlags or [];
2345   }) super.haskell-postgis;
2346   # https://github.com/ChrisPenner/json-to-haskell/issues/5
2347   json-to-haskell = overrideCabal (drv: {
2348     testFlags = [
2349       "--match" "/should sanitize weird field and record names/"
2350     ] ++ drv.testFlags or [];
2351   }) super.json-to-haskell;
2352   # https://github.com/fieldstrength/aeson-deriving/issues/5
2353   aeson-deriving = dontCheck super.aeson-deriving;
2354   # https://github.com/morpheusgraphql/morpheus-graphql/issues/660
2355   morpheus-graphql-core = overrideCabal (drv: {
2356     testFlags = [
2357       "-p" "!/field.unexpected-value/&&!/field.missing-field/&&!/argument.unexpected-value/&&!/argument.missing-field/"
2358     ] ++ drv.testFlags or [];
2359   }) super.morpheus-graphql-core;
2360   morpheus-graphql = overrideCabal (drv: {
2361     testFlags = [
2362       "-p" "!/Test Rendering/"
2363     ] ++ drv.testFlags or [];
2364   }) super.morpheus-graphql;
2365   drunken-bishop = doJailbreak super.drunken-bishop;
2366   # https://github.com/SupercedeTech/dropbox-client/issues/1
2367   dropbox = overrideCabal (drv: {
2368     testFlags = [
2369       "--skip" "/Dropbox/Dropbox aeson aeson/encodes list folder correctly/"
2370     ] ++ drv.testFlags or [];
2371   }) super.dropbox;
2372   # https://github.com/alonsodomin/haskell-schema/issues/11
2373   hschema-aeson = overrideCabal (drv: {
2374     testFlags = [
2375       "--skip" "/toJsonSerializer/should generate valid JSON/"
2376     ] ++ drv.testFlags or [];
2377   }) super.hschema-aeson;
2378   # https://github.com/minio/minio-hs/issues/165
2379   # https://github.com/minio/minio-hs/pull/191 Use crypton-connection instead of unmaintained connection
2380   minio-hs = overrideCabal (drv: {
2381     testFlags = [
2382       "-p" "!/Test mkSelectRequest/"
2383     ] ++ drv.testFlags or [];
2384     patches = drv.patches or [ ] ++ [
2385       (pkgs.fetchpatch {
2386         name = "use-crypton-connection.patch";
2387         url = "https://github.com/minio/minio-hs/commit/786cf1881f0b62b7539e63547e76afc3c1ade36a.patch";
2388         sha256 = "sha256-zw0/jhKzShpqV1sUyxWTl73sQOzm6kA/yQOZ9n0L1Ag";
2389       })
2390     ];
2391   }) (super.minio-hs.override { connection = self.crypton-connection; });
2393   # Invalid CPP in test suite: https://github.com/cdornan/memory-cd/issues/1
2394   memory-cd = dontCheck super.memory-cd;
2396   # https://github.com/haskell/fgl/pull/99
2397   fgl = doJailbreak super.fgl;
2398   fgl-arbitrary = doJailbreak super.fgl-arbitrary;
2400   # raaz-0.3 onwards uses backpack and it does not play nicely with
2401   # parallel builds using -j
2402   #
2403   # See: https://gitlab.haskell.org/ghc/ghc/-/issues/17188
2404   #
2405   # Overwrite the build cores
2406   raaz = disableParallelBuilding super.raaz;
2408   # https://github.com/andreymulik/sdp/issues/3
2409   sdp = disableLibraryProfiling super.sdp;
2410   sdp-binary = disableLibraryProfiling super.sdp-binary;
2411   sdp-deepseq = disableLibraryProfiling super.sdp-deepseq;
2412   sdp-hashable = disableLibraryProfiling super.sdp-hashable;
2413   sdp-io = disableLibraryProfiling super.sdp-io;
2414   sdp-quickcheck = disableLibraryProfiling super.sdp-quickcheck;
2415   sdp4bytestring = disableLibraryProfiling super.sdp4bytestring;
2416   sdp4text = disableLibraryProfiling super.sdp4text;
2417   sdp4unordered = disableLibraryProfiling super.sdp4unordered;
2418   sdp4vector = disableLibraryProfiling super.sdp4vector;
2420   # Unnecessarily strict bound on template-haskell
2421   # https://github.com/tree-sitter/haskell-tree-sitter/issues/298
2422   tree-sitter = doJailbreak super.tree-sitter;
2424   # 2022-08-07: Bounds are too restrictive: https://github.com/marcin-rzeznicki/libjwt-typed/issues/2
2425   # Also, the tests fail.
2426   libjwt-typed = dontCheck (doJailbreak super.libjwt-typed);
2428   # Test suite fails to compile
2429   # https://github.com/kuribas/mfsolve/issues/8
2430   mfsolve = dontCheck super.mfsolve;
2432   # Fixes compilation with GHC 9.0 and above
2433   # https://hub.darcs.net/shelarcy/regex-compat-tdfa/issue/3
2434   regex-compat-tdfa = appendPatches [
2435     ./patches/regex-compat-tdfa-ghc-9.0.patch
2436   ] (overrideCabal {
2437     # Revision introduces bound base < 4.15
2438     revision = null;
2439     editedCabalFile = null;
2440   } super.regex-compat-tdfa);
2442   # https://github.com/kowainik/validation-selective/issues/64
2443   validation-selective = doJailbreak super.validation-selective;
2444   # https://github.com/system-f/validation/issues/57
2445   validation = doJailbreak super.validation;
2447   # 2022-03-16: strict upper bounds https://github.com/monadfix/shower/issues/18
2448   shower = doJailbreak super.shower;
2450   # Test suite isn't supposed to succeed yet, apparently…
2451   # https://github.com/andrewufrank/uniform-error/blob/f40629ad119e90f8dae85e65e93d7eb149bddd53/test/Uniform/Error_test.hs#L124
2452   # https://github.com/andrewufrank/uniform-error/issues/2
2453   uniform-error = dontCheck super.uniform-error;
2454   # https://github.com/andrewufrank/uniform-fileio/issues/2
2455   uniform-fileio = dontCheck super.uniform-fileio;
2457   # The shipped Setup.hs file is broken.
2458   csv = overrideCabal (drv: { preCompileBuildDriver = "rm Setup.hs"; }) super.csv;
2459   # Build-type is simple, but ships a broken Setup.hs
2460   digits = overrideCabal (drv: { preCompileBuildDriver = "rm Setup.lhs"; }) super.digits;
2462   cabal-fmt = doJailbreak (super.cabal-fmt.override {
2463     # Needs newer Cabal-syntax version.
2464     Cabal-syntax = self.Cabal-syntax_3_10_3_0;
2465   });
2467   # 2023-07-18: https://github.com/srid/ema/issues/156
2468   ema = doJailbreak super.ema;
2470   # 2024-03-02: base <=4.18.0.0  https://github.com/srid/url-slug/pull/2
2471   url-slug = doJailbreak super.url-slug;
2473   glirc = super.glirc.override {
2474     vty = self.vty_6_2;
2475     vty-unix = super.vty-unix.override {
2476       vty = self.vty_6_2;
2477     };
2478   };
2480   # Too strict bounds on text and tls
2481   # https://github.com/barrucadu/irc-conduit/issues/54
2482   # Use crypton-connection instead of connection
2483   # https://github.com/barrucadu/irc-conduit/pull/60 https://github.com/barrucadu/irc-client/pull/101
2484   irc-conduit = appendPatch (pkgs.fetchpatch {
2485     url = "https://github.com/barrucadu/irc-conduit/pull/60/commits/58f6b5ee0c23a0615e43292dbbacf40636dcd7a6.patch";
2486     hash = "sha256-d08tb9iL07mBWdlZ7PCfTLVFJLgcxeGVPzJ+jOej8io=";
2487   }) (doJailbreak (super.irc-conduit.override {
2488     connection = self.crypton-connection;
2489     x509-validation = self.crypton-x509-validation;
2490   }));
2491   irc-client = appendPatch (pkgs.fetchpatch {
2492     url = "https://github.com/barrucadu/irc-client/pull/101/commits/0440b7e2ce943d960234c50957a55025771f567a.patch";
2493     hash = "sha256-iZyZMrodgViXFCMH9y2wIJZRnjd6WhkqInAdykqTdkY=";
2494   }) (doJailbreak (super.irc-client.override {
2495     connection = self.crypton-connection;
2496     x509 = self.crypton-x509;
2497     x509-store = self.crypton-x509-store;
2498     x509-validation = self.crypton-x509-validation;
2499   }));
2501   # 2022-02-25: Unmaintained and to strict upper bounds
2502   paths = doJailbreak super.paths;
2504   # 2022-03-16: Upstream stopped updating bounds https://github.com/haskell-hvr/base-noprelude/pull/15
2505   base-noprelude = doJailbreak super.base-noprelude;
2507   # https://github.com/obsidiansystems/dependent-sum/pull/73
2508   dependent-sum-template = appendPatch (fetchpatch {
2509     url = "https://github.com/obsidiansystems/dependent-sum/commit/619727ba1792e39a68d23c62e75a923672e87a54.patch";
2510     hash = "sha256-SyD1/KrX1KUjrR82fvI+BRcqLC2Q3AbvSeKNrdGstjg=";
2511     relative = "dependent-sum-template";
2512   }) super.dependent-sum-template;
2514   # doJailbreak: too strict bounds on chell: https://github.com/fpco/haskell-filesystem/issues/24
2515   # dontCheck:   tests don't typecheck after ghc 8.4 (possibly introduced by api change of unix library)
2516   system-fileio = doJailbreak (dontCheck super.system-fileio);
2518   # Bounds too strict on base and ghc-prim: https://github.com/tibbe/ekg-core/pull/43 (merged); waiting on hackage release
2519   ekg-core = assert super.ekg-core.version == "0.1.1.7"; doJailbreak super.ekg-core;
2520   hasura-ekg-core = doJailbreak super.hasura-ekg-core;
2522   # Test suite doesn't support hspec 2.8
2523   # https://github.com/zellige/hs-geojson/issues/29
2524   geojson = dontCheck super.geojson;
2526   # Test data missing from sdist
2527   # https://github.com/ngless-toolkit/ngless/issues/152
2528   NGLess = dontCheck super.NGLess;
2530   # Raise version bounds: https://github.com/kosmikus/records-sop/pull/15
2531   records-sop = appendPatch (fetchpatch {
2532     url = "https://github.com/kosmikus/records-sop/commit/fb149f453a816ff14d0cb20b3ea56b80ff49d9f1.patch";
2533     sha256 = "sha256-iHiF4EWL/GjJFnr/6aR+yMZKLMLAZK+gsgSxG8YaeDI=";
2534   }) super.records-sop;
2536   # Fix build failures for ghc 9 (https://github.com/mokus0/polynomial/pull/20)
2537   polynomial = appendPatch (fetchpatch {
2538     name = "haskell-polynomial.20.patch";
2539     url = "https://github.com/mokus0/polynomial/pull/20.diff";
2540     sha256 = "1bwivimpi2hiil3zdnl5qkds1inyn239wgxbn3y8l2pwyppnnfl0";
2541   })
2542   (overrideCabal (drv: {
2543     revision = null;
2544     editedCabalFile = null;
2545     doCheck = false; # Source dist doesn't include the checks
2546   })
2547   super.polynomial);
2549   # Tests likely broke because of https://github.com/nick8325/quickcheck/issues/359,
2550   # but fft is not on GitHub, so no issue reported.
2551   fft = dontCheck super.fft;
2553   # lucid-htmx has restrictive upper bounds on lucid and servant:
2554   #
2555   #   Setup: Encountered missing or private dependencies:
2556   #   lucid >=2.9.12.1 && <=2.11, servant >=0.18.3 && <0.19
2557   #
2558   # Can be removed once
2559   #
2560   # > https://github.com/MonadicSystems/lucid-htmx/issues/6
2561   #
2562   # has been resolved.
2563   lucid-htmx = doJailbreak super.lucid-htmx;
2565   # doctest-parallel is broken with v1-style cabal-install / Setup.hs
2566   # https://github.com/martijnbastiaan/doctest-parallel/issues/22
2567   doctest-parallel = dontCheck super.doctest-parallel;
2568   clash-prelude = dontCheck super.clash-prelude;
2570   # Ships a broken Setup.hs
2571   # https://github.com/lehins/conduit-aeson/issues/1
2572   conduit-aeson = overrideCabal (drv: {
2573     postPatch = ''
2574       ${drv.postPatch or ""}
2575       rm Setup.hs
2576     '';
2577     # doctest suite uses doctest-parallel which still doesn't work in nixpkgs
2578     testTarget = "tests";
2579   }) super.conduit-aeson;
2581   # Upper bounds are too strict:
2582   # https://github.com/velveteer/hermes/pull/22
2583   hermes-json = doJailbreak super.hermes-json;
2585   # Disabling doctests.
2586   regex-tdfa = overrideCabal {
2587     testTarget = "regex-tdfa-unittest";
2588   } super.regex-tdfa;
2590   # Missing test files https://github.com/kephas/xdg-basedir-compliant/issues/1
2591   xdg-basedir-compliant = dontCheck super.xdg-basedir-compliant;
2593   # Test failure after libxcrypt migration, reported upstrem at
2594   # https://github.com/phadej/crypt-sha512/issues/13
2595   crypt-sha512 = dontCheck super.crypt-sha512;
2597   # Too strict upper bound on HTTP
2598   oeis = doJailbreak super.oeis;
2600   inherit
2601     (let
2602       # We need to build purescript with these dependencies and thus also its reverse
2603       # dependencies to avoid version mismatches in their dependency closure.
2604       # TODO: maybe unify with the spago overlay in configuration-nix.nix?
2605       purescriptOverlay = self: super: {
2606         # As of 2021-11-08, the latest release of `language-javascript` is 0.7.1.0,
2607         # but it has a problem with parsing the `async` keyword.  It doesn't allow
2608         # `async` to be used as an object key:
2609         # https://github.com/erikd/language-javascript/issues/131
2610         language-javascript = self.language-javascript_0_7_0_0;
2611       };
2612     in {
2613       purescript =
2614         lib.pipe
2615           (super.purescript.overrideScope purescriptOverlay)
2616           [
2617             # https://github.com/purescript/purescript/pull/4547
2618             (appendPatches [
2619               (pkgs.fetchpatch {
2620                 name = "purescript-import-fix";
2621                 url = "https://github.com/purescript/purescript/commit/c610ec18391139a67dc9dcf19233f57d2c5413f7.patch";
2622                 hash = "sha256-7s/ygzAFJ1ocZIj3OSd3TbsmGki46WViPIZOU1dfQFg=";
2623               })
2624             ])
2625             # PureScript uses nodejs to run tests, so the tests have been disabled
2626             # for now.  If someone is interested in figuring out how to get this
2627             # working, it seems like it might be possible.
2628             dontCheck
2629             # The current version of purescript (0.14.5) has version bounds for LTS-17,
2630             # but it compiles cleanly using deps in LTS-18 as well.  This jailbreak can
2631             # likely be removed when purescript-0.14.6 is released.
2632             doJailbreak
2633             # Generate shell completions
2634             (self.generateOptparseApplicativeCompletions [ "purs" ])
2635           ];
2637       purenix =
2638         lib.pipe
2639           (super.purenix.overrideScope purescriptOverlay)
2640           [
2641             (appendPatches [
2642               # https://github.com/purenix-org/purenix/pull/63
2643               (pkgs.fetchpatch {
2644                 name = "purenix-purescript-0_15_12";
2645                 url = "https://github.com/purenix-org/purenix/commit/2dae563f887c7c8daf3dd3e292ee3580cb70d528.patch";
2646                 hash = "sha256-EZXf95BJINyqnRb2t/Ao/9C8ttNp3A27rpKiEKJjO6Y=";
2647               })
2648               (pkgs.fetchpatch {
2649                 name = "purenix-import-fix";
2650                 url = "https://github.com/purenix-org/purenix/commit/f1890690264e7e5ce7f5b0a32d73d910ce2cbd73.patch";
2651                 hash = "sha256-MRITcNOiaWmzlTd9l7sIz/LhlnpW8T02CXdcc1qQt3c=";
2652               })
2653             ])
2654           ];
2655     })
2656     purescript
2657     purenix
2658     ;
2660   # We provide newer dependencies than upstream expects.
2661   swarm = doJailbreak super.swarm;
2663   # Too strict upper bound on bytestring
2664   # https://github.com/TravisWhitaker/rdf/issues/8
2665   rdf = doJailbreak super.rdf;
2667   # random <1.2
2668   unfoldable = doJailbreak super.unfoldable;
2670   # containers <0.6, semigroupoids <5.3
2671   data-lens = doJailbreak super.data-lens;
2673   # transformers <0.3
2674   monads-fd = doJailbreak super.monads-fd;
2676   # HTF <0.15
2677   cases = doJailbreak super.cases;
2679   # exceptions <0.9
2680   eprocess = doJailbreak super.eprocess;
2682   # hashable <1.4, mmorph <1.2
2683   composite-aeson = doJailbreak super.composite-aeson;
2685   # composite-aeson <0.8, composite-base <0.8
2686   compdoc = doJailbreak super.compdoc;
2688   # composite-aeson <0.8, composite-base <0.8
2689   haskell-coffee = doJailbreak super.haskell-coffee;
2691   # Test suite doesn't compile anymore
2692   twitter-types = dontCheck super.twitter-types;
2694   # base <4.14
2695   numbered-semigroups = doJailbreak super.numbered-semigroups;
2697   # Tests open file "data/test_vectors_aserti3-2d_run01.txt" but it doesn't exist
2698   haskoin-core = dontCheck super.haskoin-core;
2700   # base <4.9, transformers <0.5
2701   MonadCatchIO-transformers = doJailbreak super.MonadCatchIO-transformers;
2703   # unix-compat <0.5
2704   hxt-cache = doJailbreak super.hxt-cache;
2706   # base <4.16
2707   fast-builder = doJailbreak super.fast-builder;
2709   # QuickCheck <2.14
2710   term-rewriting = doJailbreak super.term-rewriting;
2712   # tests can't find the test binary anymore - parseargs-example
2713   parseargs = dontCheck super.parseargs;
2715   # base <4.14
2716   decimal-literals = doJailbreak super.decimal-literals;
2718   # 2024-06-22: hevm ghc96 fixes
2719   hevm = lib.pipe super.hevm [
2720     (appendPatch (fetchpatch {
2721       url = "https://github.com/ethereum/hevm/compare/02c072f...hellwolf:hevm:c29d3a7.patch";
2722       hash = "sha256-cL26HD77vXsiKqo5G6PXgK0q19MUGMwaNium5x93CBI=";
2723     }))
2724     (overrideCabal (old: {
2725       postPatch = old.postPatch or "" + ''
2726         sed -i 's/^ *brick .*,/brick,/' hevm.cabal
2727         sed -i 's/^ *vty .*,/vty,/' hevm.cabal
2728       '';
2729     }))
2730     doJailbreak
2731   ];
2733   # multiple bounds too strict
2734   snaplet-sqlite-simple = doJailbreak super.snaplet-sqlite-simple;
2736   # Test failure https://gitlab.com/lysxia/ap-normalize/-/issues/2
2737   ap-normalize = dontCheck super.ap-normalize;
2739   heist-extra = doJailbreak super.heist-extra;  # base <4.18.0.0.0
2740   unionmount = doJailbreak super.unionmount;  # base <4.18
2741   path-tree = doJailbreak super.path-tree;  # base <4.18  https://github.com/srid/pathtree/pull/1
2742   tailwind = doJailbreak super.tailwind;  # base <=4.17.0.0
2743   tagtree = doJailbreak super.tagtree;  # base <=4.17  https://github.com/srid/tagtree/issues/1
2744   commonmark-wikilink = doJailbreak super.commonmark-wikilink; # base <4.18.0.0.0
2746   # 2024-03-02: Apply unreleased changes necessary for compatibility
2747   # with commonmark-extensions-0.2.5.3.
2748   commonmark-simple = assert super.commonmark-simple.version == "0.1.0.0";
2749     appendPatches (map ({ rev, hash }: fetchpatch {
2750       name = "commonmark-simple-${lib.substring 0 7 rev}.patch";
2751       url = "https://github.com/srid/commonmark-simple/commit/${rev}.patch";
2752       includes = [ "src/Commonmark/Simple.hs" ];
2753       inherit hash;
2754     }) [
2755       {
2756         rev = "71f5807ed4cbd8da915bf5ba04cd115b49980bcb";
2757         hash = "sha256-ibDQbyTd2BoA0V+ldMOr4XYurnqk1nWzbJ15tKizHrM=";
2758       }
2759       {
2760         rev = "fc106c94f781f6a35ef66900880edc08cbe3b034";
2761         hash = "sha256-9cpgRNFWhpSuSttAvnwPiLmi1sIoDSYbp0sMwcKWgDQ=";
2762       }
2763     ])
2764       (doJailbreak super.commonmark-simple);
2766   # Test files missing from sdist
2767   # https://github.com/tweag/webauthn/issues/166
2768   webauthn = dontCheck super.webauthn;
2770   # doctest <0.19
2771   polysemy = doJailbreak super.polysemy;
2773   # multiple bounds too strict
2774   co-log-polysemy = doJailbreak super.co-log-polysemy;
2775   co-log-polysemy-formatting = doJailbreak super.co-log-polysemy-formatting;
2777   # calls ghc in tests
2778   # https://github.com/brandonchinn178/tasty-autocollect/issues/54
2779   tasty-autocollect = dontCheck super.tasty-autocollect;
2781   postgrest = lib.pipe super.postgrest [
2782     # 2023-12-20: New version needs extra dependencies
2783     (addBuildDepends [ self.extra self.fuzzyset_0_2_4 self.cache self.timeit ])
2784     # 2022-12-02: Too strict bounds.
2785     doJailbreak
2786     # 2022-12-02: Hackage release lags behind actual releases: https://github.com/PostgREST/postgrest/issues/2275
2787     (overrideSrc rec {
2788       version = "12.0.3";
2789       src = pkgs.fetchFromGitHub {
2790         owner = "PostgREST";
2791         repo = "postgrest";
2792         rev = "v${version}";
2793         hash = "sha256-peXM5/K034Phcy5vNhc5AT3/9oGXohVogFN9gRsSosY=";
2794       };
2795     })
2796     # 2024-11-03: Needed for the patch below. Can be dropped after updating to 12.2+.
2797     (appendPatches [
2798       (fetchpatch {
2799         url = "https://github.com/PostgREST/postgrest/commit/d311fb17c46ad2ab9064c7aba1954d3500ef0e54.patch";
2800         hash = "sha256-O/bBm93V6GIPSB5dwhNUFgX3vXA01LPJapZQoeJmbIU=";
2801       })
2802     ])
2803     # 2024-11-03: Fixes build on aarch64-darwin. Can be removed after updating to 13+.
2804     (appendPatches [
2805       (fetchpatch {
2806         url = "https://github.com/PostgREST/postgrest/commit/c045b261c4f7d2c2514e858120950be6b3ddfba8.patch";
2807         hash = "sha256-6SeteL5sb+/K1y3f9XL7yNzXDdD1KQp91RNP4kutSLE=";
2808       })
2809     ])
2810   ];
2812   # Too strict bounds on hspec < 2.11
2813   fuzzyset_0_2_4 = doJailbreak super.fuzzyset_0_2_4;
2814   swagger2 = doJailbreak super.swagger2;
2816   html-charset = dontCheck super.html-charset;
2818   # true-name-0.1.0.4 has been tagged, but has not been released to Hackage.
2819   # Also, beyond 0.1.0.4 an additional patch is required to make true-name
2820   # compatible with current versions of template-haskell
2821   # https://github.com/liyang/true-name/pull/4
2822   true-name = appendPatch (fetchpatch {
2823     url = "https://github.com/liyang/true-name/compare/0.1.0.3...nuttycom:true-name:update_template_haskell.patch";
2824     hash = "sha256-ZMBXGGc2X5AKXYbqgkLXkg5BhEwyj022E37sUEWahtc=";
2825   }) (overrideCabal (drv: {
2826     revision = null;
2827     editedCabalFile = null;
2828   }) super.true-name);
2830   # 2024-08-15: primitive >=0.9 && <0.10
2831   posix-api = doJailbreak super.posix-api;
2833   # bytestring <0.11.0, optparse-applicative <0.13.0
2834   # https://github.com/kseo/sfnt2woff/issues/1
2835   sfnt2woff = doJailbreak super.sfnt2woff;
2837   # libfuse3 fails to mount fuse file systems within the build environment
2838   libfuse3 = dontCheck super.libfuse3;
2840   # Merged upstream, but never released. Allows both intel and aarch64 darwin to build.
2841   # https://github.com/vincenthz/hs-gauge/pull/106
2842   gauge = appendPatch (pkgs.fetchpatch {
2843     name = "darwin-aarch64-fix.patch";
2844     url = "https://github.com/vincenthz/hs-gauge/commit/3d7776f41187c70c4f0b4517e6a7dde10dc02309.patch";
2845     hash = "sha256-4osUMo0cvTvyDTXF8lY9tQbFqLywRwsc3RkHIhqSriQ=";
2846   }) super.gauge;
2848   # Flaky QuickCheck tests
2849   # https://github.com/Haskell-Things/ImplicitCAD/issues/441
2850   implicit = dontCheck super.implicit;
2852   # The hackage source is somehow missing a file present in the repo (tests/ListStat.hs).
2853   sym = dontCheck super.sym;
2855   # 2024-01-23: https://github.com/composewell/unicode-data/issues/118
2856   unicode-data = dontCheck super.unicode-data;
2858   # 2024-01-24: https://github.com/haskellari/tree-diff/issues/79
2859   tree-diff = dontCheck super.tree-diff;
2861   # Too strict bounds on base, ghc-prim, primitive
2862   # https://github.com/kowainik/typerep-map/pull/128
2863   typerep-map = doJailbreak super.typerep-map;
2865   # Too strict bounds on base
2866   kewar = doJailbreak super.kewar;
2868   # Too strict bounds on mtl, servant and servant-client
2869   unleash-client-haskell = doJailbreak super.unleash-client-haskell;
2871   # Requires a newer zlib version than stackage provides
2872   futhark = super.futhark.override {
2873     zlib = self.zlib_0_7_1_0;
2874   };
2876   # Tests rely on (missing) submodule
2877   unleash-client-haskell-core = dontCheck super.unleash-client-haskell-core;
2879   # Workaround for Cabal failing to find nonexistent SDL2 library?!
2880   # https://github.com/NixOS/nixpkgs/issues/260863
2881   sdl2-gfx = overrideCabal { __propagatePkgConfigDepends = false; } super.sdl2-gfx;
2883   # Needs git for compile-time insertion of commit hash into --version string.
2884   kmonad = overrideCabal (drv: {
2885     libraryToolDepends = (drv.libraryToolDepends or []) ++ [pkgs.buildPackages.git];
2886   }) super.kmonad;
2888   ghc-syntax-highlighter_0_0_12_0 = super.ghc-syntax-highlighter_0_0_12_0.overrideScope(self: super: {
2889     ghc-lib-parser = self.ghc-lib-parser_9_10_1_20240511;
2890   });
2892   # 2024-03-17: broken
2893   vaultenv = dontDistribute super.vaultenv;
2895   # Support base16 1.0
2896   nix-serve-ng = appendPatch (fetchpatch {
2897     url = "https://github.com/aristanetworks/nix-serve-ng/commit/4d9eacfcf753acbcfa0f513bec725e9017076270.patch";
2898     hash = "sha256-zugyUpEq/iVkxghrvguL95+lJDEpE8MLvZivken0p24=";
2899   }) super.nix-serve-ng;
2901   # 2024-01-24: support optparse-applicative 0.18
2902   niv = appendPatches [
2903     (fetchpatch {
2904       # needed for the following patch to apply
2905       url = "https://github.com/nmattia/niv/commit/7b76374b2b44152bfbf41fcb60162c2ce9182e7a.patch";
2906       includes = [ "src/*" ];
2907       hash = "sha256-3xG+GD6fUCGgi2EgS7WUpjfn6gvc2JurJcIrnyy4ys8=";
2908     })
2909     (fetchpatch {
2910       # Update to optparse-applicative 0.18
2911       url = "https://github.com/nmattia/niv/commit/290965abaa02be33b601032d850c588a6bafb1a5.patch";
2912       hash = "sha256-YxUdv4r/Fx+8YxHhqEuS9uZR1XKzVCPrLmj5+AY5GRA=";
2913     })
2914   ] super.niv;
2916   # 2024-03-25: HSH broken because of the unix-2.8.0.0 breaking change
2917   HSH = appendPatches [./patches/HSH-unix-openFd.patch] super.HSH;
2919   # Support unix < 2.8 to build in older ghc than 9.6
2920   linux-namespaces = appendPatch
2921     (fetchpatch {
2922       url = "https://github.com/redneb/hs-linux-namespaces/commit/f4a3546541bb6c7172fdd03e177a961da60e3951.patch";
2923       sha256 = "sha256-6Qv7NWIbzR3ktMGFogw5597bIqPH7Z4hoFvvBQAoquY=";
2924     })
2925     super.linux-namespaces;
2927   inherit
2928     (let
2929       unbreakRepa = packageName: drv: lib.pipe drv [
2930         # 2023-12-23: Apply build fixes for ghc >=9.4
2931         (appendPatches (lib.optionals (lib.versionAtLeast self.ghc.version "9.4") (repaPatches.${packageName} or [])))
2932         # 2023-12-23: jailbreak for base <4.17, vector <0.13
2933         doJailbreak
2934       ];
2935       # https://github.com/haskell-repa/repa/pull/27
2936       repaPatches = lib.mapAttrs (relative: hash: lib.singleton (pkgs.fetchpatch {
2937         name = "repa-pr-27.patch";
2938         url = "https://github.com/haskell-repa/repa/pull/27/commits/40cb2866bb4da51a8cac5e3792984744a64b016e.patch";
2939         inherit relative hash;
2940      })) {
2941         repa = "sha256-bcSnzvCJmmSBts9UQHA2dYL0Q+wXN9Fbz5LfkrmhCo8=";
2942         repa-io = "sha256-KsIN7NPWCyTpVzhR+xaBKGl8vC6rYH94llvlTawSxFk=";
2943         repa-examples = "sha256-//2JG1CW1h2sKS2BSJadVAujSE3v1TfS0F8zgcNkPI8=";
2944         repa-algorithms = "sha256-z/a7DpT3xJrIsif4cbciYcTSjapAtCoNNVX7PrZtc4I=";
2945       };
2946     in
2947       lib.mapAttrs unbreakRepa super)
2948     repa
2949     repa-io
2950     repa-examples
2951     repa-algorithms
2952     # The following packages aren't fixed yet, sorry:
2953     #   repa-array, repa-convert, repa-eval, repa-flow,
2954     #   repa-query, repa-scalar, repa-store, repa-stream
2955   ;
2957   # Use recent git version as the hackage version is outdated and not building on recent GHC versions
2958   haskell-to-elm = overrideSrc {
2959     version = "unstable-2023-12-02";
2960     src = pkgs.fetchFromGitHub {
2961       owner = "haskell-to-elm";
2962       repo = "haskell-to-elm";
2963       rev = "52ab086a320a14051aa38d0353d957fb6b2525e9";
2964       hash = "sha256-j6F4WplJy7NyhTAuiDd/tHT+Agk1QdyPjOEkceZSxq8=";
2965     };
2966   } super.haskell-to-elm;
2968   # https://github.com/dpwright/HaskellNet-SSL/pull/33 Use crypton-connection instead of connection
2969   HaskellNet-SSL = appendPatch (pkgs.fetchpatch {
2970     name = "HaskellNet-SSL-crypton-connection.patch";
2971     url = "https://github.com/dpwright/HaskellNet-SSL/pull/34/commits/cab639143efb65acf96abb35ae6c48db8d37867c.patch";
2972     hash = "sha256-hT4IZw70DxTw6iMofQHjPycz6IE6U76df72ftR2UB6Q=";
2973   }) (super.HaskellNet-SSL.override { connection = self.crypton-connection; });
2975   # https://github.com/isovector/type-errors/issues/9
2976   type-errors = dontCheck super.type-errors;
2978   # 2024-05-15: Hackage distribution is missing files needed for tests
2979   # https://github.com/isovector/cornelis/issues/150
2980   cornelis = dontCheck super.cornelis;
2982   lzma = doJailbreak (super.lzma.overrideScope (self: super: {
2983     tasty = super.tasty_1_5;
2984   }));
2986   # Fixes build on some platforms: https://github.com/obsidiansystems/commutative-semigroups/pull/18
2987   commutative-semigroups = appendPatch (fetchpatch {
2988     url = "https://github.com/obsidiansystems/commutative-semigroups/commit/e031495dd24ae73ffb808eca34e993f5df8e8d76.patch";
2989     hash = "sha256-d7AwvGGUJlh/sOXaAbfQLCay6+JyNInb73TTGKkBDz8=";
2990   }) super.commutative-semigroups;
2992   # Too strict bounds on text. Can be removed after https://github.com/alx741/currencies/pull/3 is merged
2993   currencies = doJailbreak super.currencies;
2995   argon2 = appendPatch (fetchpatch {
2996     # https://github.com/haskell-hvr/argon2/pull/20
2997     url = "https://github.com/haskell-hvr/argon2/commit/f7cc92f18e233e6b1dabf1798dd099e17b6a81a1.patch";
2998     hash = "sha256-JxraFWzErJT4EhELa3PWBGHaLT9OLgEPNSnxwpdpHd0=";
2999   }) (doJailbreak super.argon2); # Unmaintained
3001   # 2024-07-09: zinza has bumped their QuickCheck and tasty dependencies beyond stackage lts.
3002   # Can possibly be removed once QuickCheck >= 2.15 and tasty >= 1.5
3003   zinza = dontCheck super.zinza;
3005   # Doesn't officially support hedgehog > 1.3 yet: https://github.com/coot/free-algebras/pull/33
3006   free-algebras = doJailbreak super.free-algebras;
3008   pdftotext = overrideCabal (drv: {
3009       postPatch = ''
3010         # Fixes https://todo.sr.ht/~geyaeb/haskell-pdftotext/6
3011         substituteInPlace pdftotext.cabal --replace-quiet c-sources cxx-sources
3013         # Fix cabal ignoring cxx because the cabal format version is too old
3014         substituteInPlace pdftotext.cabal --replace-quiet ">=1.10" 2.2
3016         # Fix wrong license name that breaks recent cabal version
3017         substituteInPlace pdftotext.cabal --replace-quiet BSD3 BSD-3-Clause
3018       '' + (drv.postPatch or "");
3019     }) (doJailbreak (addExtraLibrary pkgs.pkg-config (addExtraLibrary pkgs.poppler super.pdftotext)));
3021   # 2024-07-27: building test component requires non-trivial custom build steps
3022   # https://github.com/awakesecurity/proto3-suite/blob/bec9d40e2767143deed5b2d451197191f1d8c7d5/nix/overlays/haskell-packages.nix#L311
3023   proto3-suite = lib.pipe super.proto3-suite [
3024     dontCheck # Hackage release trails a good deal behind master
3025     doJailbreak
3026   ];
3028   # 2024-08-09: Apply optparse-applicative compat fix from master branch
3029   # https://github.com/NorfairKing/feedback/commit/9368468934a4d8bd94709bdcb1116210b162bab8
3030   feedback = overrideCabal (drv: assert drv.version == "0.1.0.5"; {
3031     postPatch = drv.postPatch or "" + ''
3032       substituteInPlace src/Feedback/Loop/OptParse.hs \
3033         --replace-fail '(uncurry loopConfigLine)' '(pure . uncurry loopConfigLine)'
3034     '';
3035   }) (doDistribute (super.feedback.overrideScope (self: super: {
3036     # 2024-08-09: The stackage versions of safe-coloured-text* are old and broken
3037     safe-coloured-text = unmarkBroken self.safe-coloured-text_0_3_0_2;
3038     safe-coloured-text-gen = unmarkBroken self.safe-coloured-text-gen_0_0_0_3;
3039     safe-coloured-text-layout = unmarkBroken self.safe-coloured-text-layout_0_2_0_1;
3040     safe-coloured-text-layout-gen = unmarkBroken self.safe-coloured-text-layout-gen_0_0_0_1;
3041     safe-coloured-text-terminfo = unmarkBroken self.safe-coloured-text-terminfo_0_3_0_0;
3042   })));
3044   quickcheck-state-machine = overrideCabal (drv: {
3045     # 2024-08-18: Remove a test which fails to build due to API changes.
3046     #   This is fixed in quickcheck-state-machine-0.10.0.
3047     postPatch = assert drv.version == "0.8.0"; ''
3048       sed -i '/SQLite/d' quickcheck-state-machine.cabal
3049       sed -i -e '/import.*SQLite/d' -e 's/\[.*prop_parallel_sqlite/[/' test/Spec.hs
3050       ${drv.postPatch or ""}
3051      '';
3052   }) super.quickcheck-state-machine;
3054 } // import ./configuration-tensorflow.nix {inherit pkgs haskellLib;} self super