nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ pkgs, haskellLib }:
2
3let
4 inherit (pkgs) fetchpatch lib;
5in
6
7with haskellLib;
8self: super: {
9 # Disable GHC core libraries.
10 array = null;
11 base = null;
12 binary = null;
13 bytestring = null;
14 Cabal = null;
15 Cabal-syntax = null;
16 containers = null;
17 deepseq = null;
18 directory = null;
19 exceptions = null;
20 filepath = null;
21 ghc-bignum = null;
22 ghc-boot = null;
23 ghc-boot-th = null;
24 ghc-compact = null;
25 ghc-heap = null;
26 ghc-prim = null;
27 ghci = null;
28 haskeline = null;
29 hpc = null;
30 integer-gmp = null;
31 libiserv = null;
32 mtl = null;
33 parsec = null;
34 pretty = null;
35 process = null;
36 rts = null;
37 stm = null;
38 system-cxx-std-lib = null;
39 template-haskell = null;
40 # GHC only builds terminfo if it is a native compiler
41 terminfo =
42 if pkgs.stdenv.hostPlatform == pkgs.stdenv.buildPlatform then
43 null
44 else
45 doDistribute self.terminfo_0_4_1_7;
46 text = null;
47 time = null;
48 transformers = null;
49 unix = null;
50 # GHC only bundles the xhtml library if haddock is enabled, check if this is
51 # still the case when updating: https://gitlab.haskell.org/ghc/ghc/-/blob/0198841877f6f04269d6050892b98b5c3807ce4c/ghc.mk#L463
52 xhtml = if self.ghc.hasHaddock or true then null else doDistribute self.xhtml_3000_4_0_0;
53 Win32 = null;
54
55 # Becomes a core package in GHC >= 9.8
56 semaphore-compat = doDistribute self.semaphore-compat_1_0_0;
57
58 # Becomes a core package in GHC >= 9.10
59 os-string = doDistribute self.os-string_2_0_8;
60
61 # Becomes a core package in GHC >= 9.10, no release compatible with GHC < 9.10 is available
62 ghc-internal = null;
63 # Become core packages in GHC >= 9.10, but aren't uploaded to Hackage
64 ghc-toolchain = null;
65 ghc-platform = null;
66
67 # only broken for >= 9.6
68 calligraphy = doDistribute (unmarkBroken super.calligraphy);
69
70 # Jailbreaks & Version Updates
71
72 # hashable >= 1.5 needs base >= 4.18
73 hashable = self.hashable_1_4_7_0;
74 hashable-time = doJailbreak super.hashable-time;
75 libmpd = doJailbreak super.libmpd;
76
77 # generically needs base-orphans for 9.4 only
78 base-orphans = dontCheck (doDistribute super.base-orphans);
79 generically = addBuildDepends [
80 self.base-orphans
81 ] super.generically;
82
83 # Needs base-orphans for GHC < 9.8 / base < 4.19
84 some = addBuildDepend self.base-orphans super.some;
85
86 # the dontHaddock is due to a GHC panic. might be this bug, not sure.
87 # https://gitlab.haskell.org/ghc/ghc/-/issues/21619
88 hedgehog = dontHaddock super.hedgehog;
89
90 hpack = overrideCabal (drv: {
91 # Cabal 3.6 seems to preserve comments when reading, which makes this test fail
92 # 2021-10-10: 9.2.1 is not yet supported (also no issue)
93 testFlags = [
94 "--skip=/Hpack/renderCabalFile/is inverse to readCabalFile/"
95 ]
96 ++ drv.testFlags or [ ];
97 }) (doJailbreak super.hpack);
98
99 # Later versions require unix >= 2.8 which is tricky to provide with GHC 9.4
100 crypton-x509-store = doDistribute self.crypton-x509-store_1_6_11;
101
102 # 2022-08-01: Tests are broken on ghc 9.2.4: https://github.com/wz1000/HieDb/issues/46
103 hiedb = dontCheck super.hiedb;
104
105 # Tests require skeletest which doesn't support GHC 9.4
106 toml-reader = dontCheck super.toml-reader;
107
108 # 2022-10-06: https://gitlab.haskell.org/ghc/ghc/-/issues/22260
109 ghc-check = dontHaddock super.ghc-check;
110
111 ghc-tags = doDistribute (doJailbreak self.ghc-tags_1_7); # aeson < 2.2
112
113 # ghc-lib >= 9.8 and friends no longer build with GHC 9.4 since they require semaphore-compat
114 ghc-lib-parser = doDistribute (
115 self.ghc-lib-parser_9_6_7_20250325.override {
116 happy = self.happy_1_20_1_1; # wants happy < 1.21
117 }
118 );
119 ghc-lib-parser-ex = doDistribute self.ghc-lib-parser-ex_9_6_0_2;
120 ghc-lib = doDistribute (
121 self.ghc-lib_9_6_7_20250325.override {
122 happy = self.happy_1_20_1_1; # wants happy < 1.21
123 }
124 );
125
126 # Last version to not depend on file-io and directory-ospath-streaming,
127 # which both need unix >= 2.8.
128 tar = self.tar_0_6_3_0;
129
130 # A given major version of ghc-exactprint only supports one version of GHC.
131 ghc-exactprint = dontCheck super.ghc-exactprint_1_6_1_3;
132
133 # Too strict upper bound on template-haskell
134 # https://github.com/mokus0/th-extras/issues/18
135 th-extras = doJailbreak super.th-extras;
136
137 # https://github.com/kowainik/relude/issues/436
138 relude = dontCheck super.relude;
139
140 haddock-library = doJailbreak super.haddock-library;
141 path = self.path_0_9_5;
142
143 haskell-language-server =
144 lib.throwIf pkgs.config.allowAliases
145 "haskell-language-server has dropped support for ghc 9.4 in version 2.12.0.0, please use a newer ghc version or an older nixpkgs"
146 (markBroken super.haskell-language-server);
147
148 hlint = doDistribute self.hlint_3_6_1;
149
150 # directory-ospath-streaming requires the ospath API in core packages
151 # filepath, directory and unix.
152 stan = super.stan.override {
153 directory-ospath-streaming = null;
154 };
155
156 # Packages which need compat library for GHC < 9.6
157 inherit (lib.mapAttrs (_: addBuildDepends [ self.foldable1-classes-compat ]) super)
158 indexed-traversable
159 OneTuple
160 these
161 ;
162 base-compat-batteries = addBuildDepends [
163 self.foldable1-classes-compat
164 self.OneTuple
165 ] super.base-compat-batteries;
166
167 # Tests require nothunks < 0.3 (conflicting with Stackage) for GHC < 9.8
168 aeson = dontCheck super.aeson;
169
170 # Too strict lower bound on base
171 primitive-addr = doJailbreak super.primitive-addr;
172}