6 inherit (pkgs.stdenv.hostPlatform) isDarwin;
12 # ghcjs does not use `llvmPackages` and exposes `null` attribute.
14 if self.ghc.llvmPackages != null
15 then pkgs.lib.dontRecurseIntoAttrs self.ghc.llvmPackages
18 # Disable GHC 8.10.x core libraries.
45 template-haskell = null;
46 # GHC only builds terminfo if it is a native compiler
47 terminfo = if pkgs.stdenv.hostPlatform == pkgs.stdenv.buildPlatform then null else doDistribute self.terminfo_0_4_1_6;
52 # GHC only bundles the xhtml library if haddock is enabled, check if this is
53 # still the case when updating: https://gitlab.haskell.org/ghc/ghc/-/blob/0198841877f6f04269d6050892b98b5c3807ce4c/ghc.mk#L463
54 xhtml = if self.ghc.hasHaddock or true then null else doDistribute self.xhtml_3000_3_0_0;
56 # Need the Cabal-syntax-3.6.0.0 fake package for Cabal < 3.8 to allow callPackage and the constraint solver to work
57 Cabal-syntax = self.Cabal-syntax_3_6_0_0;
58 # These core package only exist for GHC >= 9.4. The best we can do is feign
59 # their existence to callPackages, but their is no shim for lower GHC versions.
60 system-cxx-std-lib = null;
62 # For GHC < 9.4, some packages need data-array-byte as an extra dependency
63 # For GHC < 9.2, os-string is not required.
64 primitive = addBuildDepends [ self.data-array-byte ] super.primitive;
65 hashable = addBuildDepends [
68 ] (super.hashable.override {
71 hashable-time = doDistribute (unmarkBroken super.hashable-time);
73 # Too strict lower bounds on base
74 primitive-addr = doJailbreak super.primitive-addr;
76 # Pick right versions for GHC-specific packages
77 ghc-api-compat = doDistribute (unmarkBroken self.ghc-api-compat_8_10_7);
79 # Needs to use ghc-lib due to incompatible GHC
80 ghc-tags = doDistribute (addBuildDepend self.ghc-lib self.ghc-tags_1_5);
82 # Jailbreak to fix the build.
83 base-noprelude = doJailbreak super.base-noprelude;
84 unliftio-core = doJailbreak super.unliftio-core;
86 # Jailbreak to fix the build.
87 brick = doJailbreak super.brick;
88 exact-pi = doJailbreak super.exact-pi;
89 serialise = doJailbreak super.serialise;
90 setlocale = doJailbreak super.setlocale;
91 shellmet = doJailbreak super.shellmet;
92 shower = doJailbreak super.shower;
94 # hnix 0.9.0 does not provide an executable for ghc < 8.10, so define completions here for now.
95 hnix = self.generateOptparseApplicativeCompletions [ "hnix" ]
96 (overrideCabal (drv: {
97 # executable is allowed for ghc >= 8.10 and needs repline
98 executableHaskellDepends = drv.executableToolDepends or [] ++ [ self.repline ];
101 haskell-language-server = throw "haskell-language-server dropped support for ghc 8.10 in version 2.3.0.0 please use a newer ghc version or an older nixpkgs version";
103 ghc-lib-parser = doDistribute self.ghc-lib-parser_9_2_8_20230729;
104 ghc-lib-parser-ex = doDistribute self.ghc-lib-parser-ex_9_2_1_1;
105 ghc-lib = doDistribute self.ghc-lib_9_2_8_20230729;
107 path-io = doJailbreak super.path-io;
109 hlint = self.hlint_3_4_1;
111 mime-string = disableOptimization super.mime-string;
113 # weeder 2.3.* no longer supports GHC 8.10
114 weeder = doDistribute (doJailbreak self.weeder_2_2_0);
115 # Unnecessarily strict upper bound on lens
116 weeder_2_2_0 = doJailbreak (super.weeder_2_2_0.override {
117 # weeder < 2.6 only supports algebraic-graphs < 0.7
118 # We no longer have matching test deps for algebraic-graphs 0.6.1 in the set
119 algebraic-graphs = dontCheck self.algebraic-graphs_0_6_1;
122 # Uses haddock placement that isn't supported by the versions of haddock
123 # bundled with GHC < 9.0.
124 wai-extra = dontHaddock super.wai-extra;
126 # Overly-strict bounds introducted by a revision in version 0.3.2.
127 text-metrics = doJailbreak super.text-metrics;
129 # Doesn't build with 9.0, see https://github.com/yi-editor/yi/issues/1125
130 yi-core = doDistribute (markUnbroken super.yi-core);
132 # Temporarily disabled blaze-textual for GHC >= 9.0 causing hackage2nix ignoring it
133 # https://github.com/paul-rouse/mysql-simple/blob/872604f87044ff6d1a240d9819a16c2bdf4ed8f5/Database/MySQL/Internal/Blaze.hs#L4-L10
134 mysql-simple = addBuildDepends [
136 ] super.mysql-simple;
138 taffybar = markUnbroken (doDistribute super.taffybar);
140 # https://github.com/fpco/inline-c/issues/127 (recommend to upgrade to Nixpkgs GHC >=9.0)
141 inline-c-cpp = (if isDarwin then dontCheck else x: x) super.inline-c-cpp;
143 # Depends on OneTuple for GHC < 9.0
144 universe-base = addBuildDepends [ self.OneTuple ] super.universe-base;
146 # Not possible to build in the main GHC 9.0 package set
147 # https://github.com/awakesecurity/spectacle/issues/49
148 spectacle = doDistribute (markUnbroken super.spectacle);
150 # doctest-parallel dependency requires newer Cabal
151 regex-tdfa = dontCheck super.regex-tdfa;
153 # Unnecessarily strict lower bound on base
154 # https://github.com/mrkkrp/megaparsec/pull/485#issuecomment-1250051823
155 megaparsec = doJailbreak super.megaparsec;
157 retrie = dontCheck self.retrie_1_1_0_0;
159 # Later versions only support GHC >= 9.2
160 ghc-exactprint = self.ghc-exactprint_0_6_4;
162 apply-refact = self.apply-refact_0_9_3_0;
164 # Needs OneTuple for ghc < 9.2
165 binary-orphans = addBuildDepends [ self.OneTuple ] super.binary-orphans;
168 ghc-source-gen = doDistribute (unmarkBroken super.ghc-source-gen);
170 # No instance for (Show B.Builder) arising from a use of ‘print’
171 http-types = dontCheck super.http-types;
173 # Packages which need compat library for GHC < 9.6
176 (_: addBuildDepends [ self.foldable1-classes-compat ])
181 base-compat-batteries = addBuildDepends [
182 self.foldable1-classes-compat
184 ] super.base-compat-batteries;
186 # OneTuple needs hashable (instead of ghc-prim) and foldable1-classes-compat for GHC < 9
187 OneTuple = addBuildDepends [
188 self.foldable1-classes-compat
190 ] (super.OneTuple.override {
191 ghc-prim = self.hashable;