6 inherit (pkgs.stdenv.hostPlatform) isDarwin;
12 llvmPackages = pkgs.lib.dontRecurseIntoAttrs self.ghc.llvmPackages;
14 # Disable GHC 9.0.x core libraries.
42 template-haskell = null;
43 # GHC only builds terminfo if it is a native compiler
44 terminfo = if pkgs.stdenv.hostPlatform == pkgs.stdenv.buildPlatform then null else doDistribute self.terminfo_0_4_1_6;
49 # GHC only bundles the xhtml library if haddock is enabled, check if this is
50 # still the case when updating: https://gitlab.haskell.org/ghc/ghc/-/blob/0198841877f6f04269d6050892b98b5c3807ce4c/ghc.mk#L463
51 xhtml = if self.ghc.hasHaddock or true then null else doDistribute self.xhtml_3000_3_0_0;
53 # Need the Cabal-syntax-3.6.0.0 fake package for Cabal < 3.8 to allow callPackage and the constraint solver to work
54 Cabal-syntax = self.Cabal-syntax_3_6_0_0;
55 # These core package only exist for GHC >= 9.4. The best we can do is feign
56 # their existence to callPackages, but their is no shim for lower GHC versions.
57 system-cxx-std-lib = null;
59 # Jailbreaks & Version Updates
61 # For GHC < 9.4, some packages need data-array-byte as an extra dependency
62 primitive = addBuildDepends [ self.data-array-byte ] super.primitive;
63 # For GHC < 9.2, os-string is not required.
64 hashable = addBuildDepends [
67 ] (super.hashable.override {
71 # Too strict lower bounds on base
72 primitive-addr = doJailbreak super.primitive-addr;
74 hashable-time = doJailbreak super.hashable-time;
75 tuple = addBuildDepend self.base-orphans super.tuple;
76 vector-th-unbox = doJailbreak super.vector-th-unbox;
78 ormolu = self.ormolu_0_5_2_0.override {
79 Cabal-syntax = self.Cabal-syntax_3_8_1_0;
82 stylish-haskell = doJailbreak super.stylish-haskell_0_14_4_0;
84 doctest = dontCheck super.doctest;
86 haskell-language-server = throw "haskell-language-server has dropped support for ghc 9.0 in version 2.4.0.0, please use a newer ghc version or an older nixpkgs version";
88 # Needs to use ghc-lib due to incompatible GHC
89 ghc-tags = doDistribute (addBuildDepend self.ghc-lib self.ghc-tags_1_5);
91 # ghc-lib >= 9.6 and friends no longer build with GHC 9.0
92 ghc-lib-parser = doDistribute self.ghc-lib-parser_9_2_8_20230729;
93 ghc-lib-parser-ex = doDistribute self.ghc-lib-parser-ex_9_2_1_1;
94 ghc-lib = doDistribute self.ghc-lib_9_2_8_20230729;
96 # Test suite sometimes segfaults with GHC 9.0.1 and 9.0.2
97 # https://github.com/ekmett/reflection/issues/51
98 # https://gitlab.haskell.org/ghc/ghc/-/issues/21141
99 reflection = dontCheck super.reflection;
101 # Disable tests pending resolution of
102 # https://github.com/Soostone/retry/issues/71
103 retry = dontCheck super.retry;
105 ghc-api-compat = unmarkBroken super.ghc-api-compat;
107 # 2021-09-18: cabal2nix does not detect the need for ghc-api-compat.
108 hiedb = overrideCabal (old: {
109 libraryHaskellDepends = old.libraryHaskellDepends ++ [self.ghc-api-compat];
112 # https://github.com/lspitzner/butcher/issues/7
113 butcher = doJailbreak super.butcher;
115 # We use a GHC patch to support the fix for https://github.com/fpco/inline-c/issues/127
116 # which means that the upstream cabal file isn't allowed to add the flag.
118 (if isDarwin then appendConfigureFlags ["--ghc-option=-fcompact-unwind"] else x: x)
121 # 2022-05-31: weeder 2.4.* requires GHC 9.2
122 weeder = doDistribute self.weeder_2_3_1;
123 # Unnecessarily strict upper bound on lens
124 weeder_2_3_1 = doJailbreak (super.weeder_2_3_1.override {
125 # weeder < 2.6 only supports algebraic-graphs < 0.7
126 # We no longer have matching test deps for algebraic-graphs 0.6.1 in the set
127 algebraic-graphs = dontCheck self.algebraic-graphs_0_6_1;
130 # Restrictive upper bound on base and containers
131 sv2v = doJailbreak super.sv2v;
133 # Later versions only support GHC >= 9.2
134 ghc-exactprint = self.ghc-exactprint_0_6_4;
136 retrie = dontCheck self.retrie_1_1_0_0;
138 apply-refact = self.apply-refact_0_9_3_0;
140 # Needs OneTuple for ghc < 9.2
141 binary-orphans = addBuildDepends [ self.OneTuple ] super.binary-orphans;
144 ghc-source-gen = doDistribute (unmarkBroken super.ghc-source-gen);
146 hspec-megaparsec = super.hspec-megaparsec_2_2_0;
148 # No instance for (Show B.Builder) arising from a use of ‘print’
149 http-types = dontCheck super.http-types;
151 # Packages which need compat library for GHC < 9.6
154 (_: addBuildDepends [ self.foldable1-classes-compat ])
159 base-compat-batteries = addBuildDepends [
160 self.foldable1-classes-compat
162 ] super.base-compat-batteries;
163 OneTuple = addBuildDepends [
164 self.foldable1-classes-compat