6 inherit (pkgs.stdenv.hostPlatform) isDarwin;
12 llvmPackages = pkgs.lib.dontRecurseIntoAttrs self.ghc.llvmPackages;
14 # Disable GHC 9.2.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 # weeder >= 2.5 requires GHC 9.4
60 weeder = doDistribute self.weeder_2_4_1;
62 weeder_2_4_1 = doJailbreak (super.weeder_2_4_1.override {
63 # weeder < 2.6 only supports algebraic-graphs < 0.7
64 # We no longer have matching test deps for algebraic-graphs 0.6.1 in the set
65 algebraic-graphs = dontCheck self.algebraic-graphs_0_6_1;
69 haskell-language-server = lib.pipe super.haskell-language-server [
70 (disableCabalFlag "fourmolu")
71 (disableCabalFlag "ormolu")
72 (disableCabalFlag "cabal")
73 (disableCabalFlag "stylishHaskell")
81 # For GHC < 9.4, some packages need data-array-byte as an extra dependency
82 hashable = addBuildDepends [ self.data-array-byte ] super.hashable;
83 primitive = addBuildDepends [ self.data-array-byte ] super.primitive;
84 primitive-unlifted = super.primitive-unlifted_0_1_3_1;
85 # Too strict lower bound on base
86 primitive-addr = doJailbreak super.primitive-addr;
88 # Jailbreaks & Version Updates
89 hashable-time = doJailbreak super.hashable-time;
91 # Depends on utf8-light which isn't maintained / doesn't support base >= 4.16
92 # https://github.com/haskell-infra/hackage-trustees/issues/347
93 # https://mail.haskell.org/pipermail/haskell-cafe/2022-October/135613.html
94 language-javascript_0_7_0_0 = dontCheck super.language-javascript_0_7_0_0;
96 # Needs to match ghc version
97 ghc-tags = doDistribute self.ghc-tags_1_5;
99 # For "ghc-lib" flag see https://github.com/haskell/haskell-language-server/issues/3185#issuecomment-1250264515
100 hlint = enableCabalFlag "ghc-lib" super.hlint;
102 # 0.2.2.3 requires Cabal >= 3.8
103 shake-cabal = doDistribute self.shake-cabal_0_2_2_2;
105 # https://github.com/sjakobi/bsb-http-chunked/issues/38
106 bsb-http-chunked = dontCheck super.bsb-http-chunked;
108 # https://github.com/NixOS/cabal2nix/issues/554
109 # https://github.com/clash-lang/clash-compiler/blob/f0f6275e19b8c672f042026c478484c5fd45191d/README.md#ghc-compatibility
110 clash-prelude = dontDistribute (markBroken super.clash-prelude);
112 # Too strict upper bound on bytestring, relevant for GHC 9.2.6 specifically
113 # https://github.com/protolude/protolude/issues/127#issuecomment-1428807874
114 protolude = doJailbreak super.protolude;
116 # https://github.com/fpco/inline-c/pull/131
118 (if isDarwin then appendConfigureFlags ["--ghc-option=-fcompact-unwind"] else x: x)
121 # A given major version of ghc-exactprint only supports one version of GHC.
122 ghc-exactprint = super.ghc-exactprint_1_5_0;
125 ghc-source-gen = doDistribute (unmarkBroken super.ghc-source-gen);
127 # Packages which need compat library for GHC < 9.6
130 (_: addBuildDepends [ self.foldable1-classes-compat ])
136 base-compat-batteries = addBuildDepends [
137 self.foldable1-classes-compat
139 ] super.base-compat-batteries;