6 inherit (pkgs.stdenv.hostPlatform) isDarwin;
11 llvmPackages = pkgs.lib.dontRecurseIntoAttrs self.ghc.llvmPackages;
13 # Disable GHC 8.10.x core libraries.
40 template-haskell = null;
41 # GHC only builds terminfo if it is a native compiler
42 terminfo = if pkgs.stdenv.hostPlatform == pkgs.stdenv.buildPlatform then null else self.terminfo_0_4_1_6;
47 # GHC only bundles the xhtml library if haddock is enabled, check if this is
48 # still the case when updating: https://gitlab.haskell.org/ghc/ghc/-/blob/0198841877f6f04269d6050892b98b5c3807ce4c/ghc.mk#L463
49 xhtml = if self.ghc.hasHaddock or true then null else self.xhtml_3000_3_0_0;
51 # Need the Cabal-syntax-3.6.0.0 fake package for Cabal < 3.8 to allow callPackage and the constraint solver to work
52 Cabal-syntax = self.Cabal-syntax_3_6_0_0;
53 # These core package only exist for GHC >= 9.4. The best we can do is feign
54 # their existence to callPackages, but their is no shim for lower GHC versions.
55 system-cxx-std-lib = null;
57 # Additionally depends on OneTuple for GHC < 9.0
58 base-compat-batteries = addBuildDepend self.OneTuple super.base-compat-batteries;
60 # For GHC < 9.4, some packages need data-array-byte as an extra dependency
61 primitive = addBuildDepends [ self.data-array-byte ] super.primitive;
62 hashable = addBuildDepends [
67 # Pick right versions for GHC-specific packages
68 ghc-api-compat = doDistribute (unmarkBroken self.ghc-api-compat_8_10_7);
70 # Needs to use ghc-lib due to incompatible GHC
71 ghc-tags = doDistribute (addBuildDepend self.ghc-lib self.ghc-tags_1_5);
73 # Jailbreak to fix the build.
74 base-noprelude = doJailbreak super.base-noprelude;
75 unliftio-core = doJailbreak super.unliftio-core;
77 # Jailbreaking because monoidal-containers hasn’t bumped it's base dependency for 8.10.
78 monoidal-containers = doJailbreak super.monoidal-containers;
80 # Jailbreak to fix the build.
81 brick = doJailbreak super.brick;
82 exact-pi = doJailbreak super.exact-pi;
83 serialise = doJailbreak super.serialise;
84 setlocale = doJailbreak super.setlocale;
85 shellmet = doJailbreak super.shellmet;
86 shower = doJailbreak super.shower;
88 # Apply patch from https://github.com/finnsson/template-helper/issues/12#issuecomment-611795375 to fix the build.
89 language-haskell-extract = appendPatch (pkgs.fetchpatch {
90 name = "language-haskell-extract-0.2.4.patch";
91 url = "https://gitlab.haskell.org/ghc/head.hackage/-/raw/e48738ee1be774507887a90a0d67ad1319456afc/patches/language-haskell-extract-0.2.4.patch?inline=false";
92 sha256 = "0rgzrq0513nlc1vw7nw4km4bcwn4ivxcgi33jly4a7n3c1r32v1f";
93 }) (doJailbreak super.language-haskell-extract);
95 # hnix 0.9.0 does not provide an executable for ghc < 8.10, so define completions here for now.
96 hnix = self.generateOptparseApplicativeCompletions [ "hnix" ]
97 (overrideCabal (drv: {
98 # executable is allowed for ghc >= 8.10 and needs repline
99 executableHaskellDepends = drv.executableToolDepends or [] ++ [ self.repline ];
102 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";
104 ghc-lib-parser = doDistribute self.ghc-lib-parser_9_2_8_20230729;
105 ghc-lib-parser-ex = doDistribute self.ghc-lib-parser-ex_9_2_1_1;
106 ghc-lib = doDistribute self.ghc-lib_9_2_8_20230729;
108 mod = super.mod_0_1_2_2;
109 path-io = doJailbreak super.path-io;
112 ormolu = self.ormolu_0_5_0_1;
113 fourmolu = dontCheck self.fourmolu_0_9_0_0;
114 hlint = self.hlint_3_4_1;
115 stylish-haskell = doJailbreak self.stylish-haskell_0_14_3_0;
117 mime-string = disableOptimization super.mime-string;
119 # weeder 2.3.* no longer supports GHC 8.10
120 weeder = doDistribute (doJailbreak self.weeder_2_2_0);
121 # Unnecessarily strict upper bound on lens
122 weeder_2_2_0 = doJailbreak (super.weeder_2_2_0.override {
123 # weeder < 2.6 only supports algebraic-graphs < 0.7
124 # We no longer have matching test deps for algebraic-graphs 0.6.1 in the set
125 algebraic-graphs = dontCheck self.algebraic-graphs_0_6_1;
128 # Overly-strict bounds introducted by a revision in version 0.3.2.
129 text-metrics = doJailbreak super.text-metrics;
131 # OneTuple needs hashable (instead of ghc-prim) and foldable1-classes-compat for GHC < 9
132 OneTuple = addBuildDepends [
133 self.foldable1-classes-compat
134 ] (super.OneTuple.override {
135 ghc-prim = self.hashable;
138 # Doesn't build with 9.0, see https://github.com/yi-editor/yi/issues/1125
139 yi-core = doDistribute (markUnbroken super.yi-core);
141 # Temporarily disabled blaze-textual for GHC >= 9.0 causing hackage2nix ignoring it
142 # https://github.com/paul-rouse/mysql-simple/blob/872604f87044ff6d1a240d9819a16c2bdf4ed8f5/Database/MySQL/Internal/Blaze.hs#L4-L10
143 mysql-simple = addBuildDepends [
145 ] super.mysql-simple;
147 taffybar = markUnbroken (doDistribute super.taffybar);
149 # https://github.com/fpco/inline-c/issues/127 (recommend to upgrade to Nixpkgs GHC >=9.0)
150 inline-c-cpp = (if isDarwin then dontCheck else x: x) super.inline-c-cpp;
152 # Depends on OneTuple for GHC < 9.0
153 universe-base = addBuildDepends [ self.OneTuple ] super.universe-base;
155 # Not possible to build in the main GHC 9.0 package set
156 # https://github.com/awakesecurity/spectacle/issues/49
157 spectacle = doDistribute (markUnbroken super.spectacle);
159 # doctest-parallel dependency requires newer Cabal
160 regex-tdfa = dontCheck super.regex-tdfa;
162 # Unnecessarily strict lower bound on base
163 # https://github.com/mrkkrp/megaparsec/pull/485#issuecomment-1250051823
164 megaparsec = doJailbreak super.megaparsec;
166 retrie = dontCheck self.retrie_1_1_0_0;
168 # Later versions only support GHC >= 9.2
169 ghc-exactprint = self.ghc-exactprint_0_6_4;
171 apply-refact = self.apply-refact_0_9_3_0;
173 # Needs OneTuple for ghc < 9.2
174 binary-orphans = addBuildDepends [ self.OneTuple ] super.binary-orphans;
177 ghc-source-gen = doDistribute (unmarkBroken super.ghc-source-gen);