nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ pkgs, haskellLib }:
2
3self: super:
4
5with haskellLib;
6
7let
8 inherit (pkgs) lib;
9
10 warnAfterVersion =
11 ver: pkg:
12 lib.warnIf (lib.versionOlder ver
13 super.${pkg.pname}.version
14 ) "override for haskell.packages.ghc96.${pkg.pname} may no longer be needed" pkg;
15
16in
17
18{
19 # Disable GHC core libraries
20 array = null;
21 base = null;
22 binary = null;
23 bytestring = null;
24 Cabal = null;
25 Cabal-syntax = null;
26 containers = null;
27 deepseq = null;
28 directory = null;
29 exceptions = null;
30 filepath = null;
31 ghc-bignum = null;
32 ghc-boot = null;
33 ghc-boot-th = null;
34 ghc-compact = null;
35 ghc-heap = null;
36 ghc-prim = null;
37 ghci = null;
38 haskeline = null;
39 hpc = null;
40 integer-gmp = null;
41 libiserv = null;
42 mtl = null;
43 parsec = null;
44 pretty = null;
45 process = null;
46 rts = null;
47 stm = null;
48 system-cxx-std-lib = null;
49 template-haskell = null;
50 # terminfo is not built if GHC is a cross compiler
51 terminfo =
52 if pkgs.stdenv.hostPlatform == pkgs.stdenv.buildPlatform then
53 null
54 else
55 doDistribute self.terminfo_0_4_1_7;
56 text = null;
57 time = null;
58 transformers = null;
59 unix = null;
60 xhtml = null;
61 Win32 = null;
62
63 # Becomes a core package in GHC >= 9.8
64 semaphore-compat = doDistribute self.semaphore-compat_1_0_0;
65
66 # Becomes a core package in GHC >= 9.10
67 os-string = doDistribute self.os-string_2_0_8;
68
69 # Becomes a core package in GHC >= 9.10, no release compatible with GHC < 9.10 is available
70 ghc-internal = null;
71 # Become core packages in GHC >= 9.10, but aren't uploaded to Hackage
72 ghc-toolchain = null;
73 ghc-platform = null;
74
75 # Needs base-orphans for GHC < 9.8 / base < 4.19
76 some = addBuildDepend self.base-orphans super.some;
77
78 #
79 # Version deviations from Stackage LTS
80 #
81
82 # Too strict upper bound on template-haskell
83 # https://github.com/mokus0/th-extras/pull/21
84 th-extras = doJailbreak super.th-extras;
85
86 # not in Stackage, needs to match ghc-lib
87 # since expression is generated for 9.8, ghc-lib dep needs to be added manually
88 ghc-tags = doDistribute (addBuildDepends [ self.ghc-lib ] self.ghc-tags_1_8);
89
90 #
91 # Too strict bounds without upstream fix
92 #
93
94 # Forbids transformers >= 0.6
95 quickcheck-classes-base = doJailbreak super.quickcheck-classes-base;
96 # https://github.com/Gabriella439/Haskell-Break-Library/pull/3
97 break = doJailbreak super.break;
98 # Forbids mtl >= 2.3
99 ChasingBottoms = doJailbreak super.ChasingBottoms;
100 # Forbids base >= 4.18
101 cabal-install-solver = doJailbreak super.cabal-install-solver;
102 cabal-install = doJailbreak super.cabal-install;
103
104 # Forbids base >= 4.18, fix proposed: https://github.com/sjakobi/newtype-generics/pull/25
105 newtype-generics = warnAfterVersion "0.6.2" (doJailbreak super.newtype-generics);
106
107 # Jailbreaks for servant <0.20
108 servant-lucid = doJailbreak super.servant-lucid;
109
110 stm-containers = dontCheck super.stm-containers;
111 regex-tdfa = dontCheck super.regex-tdfa;
112 hiedb = dontCheck super.hiedb;
113 # https://github.com/kowainik/relude/issues/436
114 relude = dontCheck (doJailbreak super.relude);
115
116 inherit (pkgs.lib.mapAttrs (_: doJailbreak) super)
117 ghc-trace-events
118 gi-cairo-connector # mtl <2.3
119 ghc-prof # base <4.18
120 env-guard # doctest <0.21
121 package-version # doctest <0.21, tasty-hedgehog <1.4
122 ;
123
124 # Pending text-2.0 support https://github.com/gtk2hs/gtk2hs/issues/327
125 gtk = doJailbreak super.gtk;
126
127 # 2023-12-23: It needs this to build under ghc-9.6.3.
128 # A factor of 100 is insufficient, 200 seems seems to work.
129 hip = appendConfigureFlag "--ghc-options=-fsimpl-tick-factor=200" super.hip;
130
131 # This can be removed once https://github.com/typeclasses/ascii-predicates/pull/1
132 # is merged and in a release that's being tracked.
133 ascii-predicates = appendPatch (pkgs.fetchpatch {
134 url = "https://github.com/typeclasses/ascii-predicates/commit/2e6d9ed45987a8566f3a77eedf7836055c076d1a.patch";
135 name = "ascii-predicates-pull-1.patch";
136 relative = "ascii-predicates";
137 sha256 = "sha256-4JguQFZNRQpjZThLrAo13jNeypvLfqFp6o7c1bnkmZo=";
138 }) super.ascii-predicates;
139
140 # This can be removed once https://github.com/typeclasses/ascii-numbers/pull/1
141 # is merged and in a release that's being tracked.
142 ascii-numbers = appendPatch (pkgs.fetchpatch {
143 url = "https://github.com/typeclasses/ascii-numbers/commit/e9474ad91bc997891f1a46afd5d0bdf9b9f7d768.patch";
144 name = "ascii-numbers-pull-1.patch";
145 relative = "ascii-numbers";
146 sha256 = "sha256-buw1UeW57CFefEfqdDUraSyQ+H/NvCZOv6WF2ORiYQg=";
147 }) super.ascii-numbers;
148
149 # Tests require nothunks < 0.3 (conflicting with Stackage) for GHC < 9.8
150 aeson = dontCheck super.aeson;
151
152 # Tests require skeletest which no longer supports GHC 9.6
153 toml-reader = dontCheck super.toml-reader;
154
155 # Apply patch from PR with mtl-2.3 fix.
156 ConfigFile = overrideCabal (drv: {
157 editedCabalFile = null;
158 buildDepends = drv.buildDepends or [ ] ++ [ self.HUnit ];
159 patches = [
160 (pkgs.fetchpatch {
161 # https://github.com/jgoerzen/configfile/pull/12
162 name = "ConfigFile-pr-12.patch";
163 url = "https://github.com/jgoerzen/configfile/compare/d0a2e654be0b73eadbf2a50661d00574ad7b6f87...83ee30b43f74d2b6781269072cf5ed0f0e00012f.patch";
164 sha256 = "sha256-b7u9GiIAd2xpOrM0MfILHNb6Nt7070lNRIadn2l3DfQ=";
165 })
166 ];
167 }) super.ConfigFile;
168
169 # https://github.com/NixOS/nixpkgs/pull/367998#issuecomment-2598941240
170 libtorch-ffi-helper = unmarkBroken (doDistribute super.libtorch-ffi-helper);
171
172 # Compatibility with core libs of GHC 9.6
173 # Jailbreak to lift bound on time
174 kqueue = doJailbreak (
175 appendPatches [
176 (pkgs.fetchpatch {
177 name = "kqueue-ghc-9.6.patch";
178 url = "https://github.com/hesselink/kqueue/pull/10/commits/a2735e807d761410e776482ec04515d9cf76a7f5.patch";
179 sha256 = "18rilz4nrwcmlvll3acjx2lp7s129pviggb8fy3hdb0z34ls5j84";
180 excludes = [ ".gitignore" ];
181 })
182 ] super.kqueue
183 );
184
185 # This runs into the following GHC bug currently affecting 9.6.* and 9.8.* as
186 # well as 9.10.1: https://gitlab.haskell.org/ghc/ghc/-/issues/24432
187 inherit
188 (lib.mapAttrs (
189 _:
190 overrideCabal (drv: {
191 badPlatforms = drv.badPlatforms or [ ] ++ [ "aarch64-linux" ];
192 })
193 ) super)
194 mueval
195 lambdabot
196 lambdabot-haskell-plugins
197 ;
198
199 singletons-base = dontCheck super.singletons-base;
200
201 # A given major version of ghc-exactprint only supports one version of GHC.
202 ghc-exactprint = addBuildDepend self.extra super.ghc-exactprint_1_7_1_0;
203
204 ghc-lib = doDistribute self.ghc-lib_9_8_5_20250214;
205 ghc-lib-parser = doDistribute self.ghc-lib-parser_9_8_5_20250214;
206 ghc-lib-parser-ex = doDistribute self.ghc-lib-parser-ex_9_8_0_2;
207 haddock-library = doJailbreak super.haddock-library;
208 inherit
209 (
210 let
211 hls_overlay = lself: lsuper: {
212 Cabal-syntax = lself.Cabal-syntax_3_10_3_0;
213 Cabal = lself.Cabal_3_10_3_0;
214 extensions = dontCheck (doJailbreak lself.extensions_0_1_0_1);
215 };
216 in
217 lib.mapAttrs (_: pkg: doDistribute (pkg.overrideScope hls_overlay)) {
218 apply-refact = addBuildDepend self.data-default-class super.apply-refact;
219 floskell = doJailbreak super.floskell;
220 fourmolu = dontCheck (doJailbreak self.fourmolu_0_15_0_0);
221 ghcide = super.ghcide;
222 haskell-language-server = addBuildDepends [
223 self.retrie
224 self.floskell
225 self.markdown-unlit
226 ] super.haskell-language-server;
227 hls-plugin-api = super.hls-plugin-api;
228 hlint = self.hlint_3_8;
229 lsp-types = super.lsp-types;
230 ormolu = self.ormolu_0_7_4_0;
231 retrie = doJailbreak (unmarkBroken super.retrie);
232 stylish-haskell = self.stylish-haskell_0_14_6_0;
233 }
234 )
235 apply-refact
236 floskell
237 fourmolu
238 ghcide
239 haskell-language-server
240 hls-plugin-api
241 hlint
242 lsp-types
243 ormolu
244 retrie
245 stylish-haskell
246 ;
247}