4 inherit (pkgs) fetchpatch lib;
5 checkAgainAfter = pkg: ver: msg: act:
6 if builtins.compareVersions pkg.version ver <= 0 then act
8 builtins.throw "Check if '${msg}' was resolved in ${pkg.pname} ${pkg.version} and update or remove this";
13 jailbreakForCurrentVersion = p: v: checkAgainAfter p v "bad bounds" (doJailbreak p);
15 llvmPackages = lib.dontRecurseIntoAttrs self.ghc.llvmPackages;
17 # Disable GHC core libraries.
46 system-cxx-std-lib = null;
47 template-haskell = null;
48 # GHC only builds terminfo if it is a native compiler
49 terminfo = if pkgs.stdenv.hostPlatform == pkgs.stdenv.buildPlatform then null else doDistribute self.terminfo_0_4_1_6;
54 # GHC only bundles the xhtml library if haddock is enabled, check if this is
55 # still the case when updating: https://gitlab.haskell.org/ghc/ghc/-/blob/0198841877f6f04269d6050892b98b5c3807ce4c/ghc.mk#L463
56 xhtml = if self.ghc.hasHaddock or true then null else doDistribute self.xhtml_3000_3_0_0;
58 # Jailbreaks & Version Updates
60 hashable-time = doJailbreak super.hashable-time;
61 libmpd = doJailbreak super.libmpd;
63 # generically needs base-orphans for 9.4 only
64 base-orphans = dontCheck (doDistribute super.base-orphans);
65 generically = addBuildDepends [
69 # the dontHaddock is due to a GHC panic. might be this bug, not sure.
70 # https://gitlab.haskell.org/ghc/ghc/-/issues/21619
71 hedgehog = dontHaddock super.hedgehog;
73 hpack = overrideCabal (drv: {
74 # Cabal 3.6 seems to preserve comments when reading, which makes this test fail
75 # 2021-10-10: 9.2.1 is not yet supported (also no issue)
77 "--skip=/Hpack/renderCabalFile/is inverse to readCabalFile/"
78 ] ++ drv.testFlags or [];
79 }) (doJailbreak super.hpack);
81 # https://github.com/sjakobi/bsb-http-chunked/issues/38
82 bsb-http-chunked = dontCheck super.bsb-http-chunked;
84 # 2022-08-01: Tests are broken on ghc 9.2.4: https://github.com/wz1000/HieDb/issues/46
85 hiedb = dontCheck super.hiedb;
87 # 2022-10-06: https://gitlab.haskell.org/ghc/ghc/-/issues/22260
88 ghc-check = dontHaddock super.ghc-check;
90 ghc-tags = self.ghc-tags_1_6;
92 # A given major version of ghc-exactprint only supports one version of GHC.
93 ghc-exactprint = super.ghc-exactprint_1_6_1_3;
95 # Too strict upper bound on template-haskell
96 # https://github.com/mokus0/th-extras/issues/18
97 th-extras = doJailbreak super.th-extras;
99 # https://github.com/kowainik/relude/issues/436
100 relude = dontCheck super.relude;
105 hls_overlay = lself: lsuper: {
106 Cabal-syntax = lself.Cabal-syntax_3_10_3_0;
109 lib.mapAttrs (_: pkg: doDistribute (pkg.overrideScope hls_overlay)) {
110 haskell-language-server = allowInconsistentDependencies super.haskell-language-server;
111 fourmolu = super.fourmolu;
112 ormolu = super.ormolu;
114 stylish-haskell = super.stylish-haskell;
117 haskell-language-server
124 # Packages which need compat library for GHC < 9.6
127 (_: addBuildDepends [ self.foldable1-classes-compat ])
133 base-compat-batteries = addBuildDepends [
134 self.foldable1-classes-compat
136 ] super.base-compat-batteries;
138 # Too strict lower bound on base
139 primitive-addr = doJailbreak super.primitive-addr;