Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ pkgs, haskellLib }:
2
3self: super:
4
5let
6 inherit (pkgs) lib;
7
8 warnAfterVersion =
9 ver: pkg:
10 lib.warnIf (lib.versionOlder ver
11 super.${pkg.pname}.version
12 ) "override for haskell.packages.ghc912.${pkg.pname} may no longer be needed" pkg;
13
14in
15
16with haskellLib;
17
18{
19 llvmPackages = lib.dontRecurseIntoAttrs self.ghc.llvmPackages;
20
21 # Disable GHC core libraries
22 array = null;
23 base = null;
24 binary = null;
25 bytestring = null;
26 Cabal = null;
27 Cabal-syntax = null;
28 containers = null;
29 deepseq = null;
30 directory = null;
31 exceptions = null;
32 file-io = null;
33 filepath = null;
34 ghc-bignum = null;
35 ghc-boot = null;
36 ghc-boot-th = null;
37 ghc-compact = null;
38 ghc-experimental = null;
39 ghc-heap = null;
40 ghc-internal = null;
41 ghc-platform = null;
42 ghc-prim = null;
43 ghc-toolchain = null;
44 ghci = null;
45 haddock-api = null;
46 haddock-library = null;
47 haskeline = null;
48 hpc = null;
49 integer-gmp = null;
50 mtl = null;
51 os-string = null;
52 parsec = null;
53 pretty = null;
54 process = null;
55 rts = null;
56 semaphore-compat = null;
57 stm = null;
58 system-cxx-std-lib = null;
59 template-haskell = null;
60 # GHC only builds terminfo if it is a native compiler
61 terminfo =
62 if pkgs.stdenv.hostPlatform == pkgs.stdenv.buildPlatform then
63 null
64 else
65 haskellLib.doDistribute self.terminfo_0_4_1_7;
66 text = null;
67 time = null;
68 transformers = null;
69 unix = null;
70 xhtml = null;
71
72 #
73 # Hand pick versions that are compatible with ghc 9.12 and base 4.21
74 #
75
76 extra = doDistribute self.extra_1_8;
77 htree = doDistribute self.htree_0_2_0_0;
78 tagged = doDistribute self.tagged_0_8_9;
79 time-compat = doDistribute self.time-compat_1_9_8;
80 extensions = doDistribute self.extensions_0_1_0_3;
81 doctest = doDistribute self.doctest_0_24_0;
82 ghc-syntax-highlighter = doDistribute self.ghc-syntax-highlighter_0_0_13_0;
83 ghc-lib = doDistribute self.ghc-lib_9_12_2_20250421;
84 ghc-exactprint = doDistribute self.ghc-exactprint_1_12_0_0;
85 ghc-lib-parser = doDistribute self.ghc-lib-parser_9_12_2_20250421;
86 ghc-lib-parser-ex = doDistribute self.ghc-lib-parser-ex_9_12_0_0;
87 hlint = doDistribute self.hlint_3_10;
88 # fourmolu checks require Diff > 1.0, which is not yet supported by various other deps of hls.
89 fourmolu = doDistribute (dontCheck self.fourmolu_0_18_0_0);
90 ormolu = doDistribute self.ormolu_0_8_0_0;
91 stylish-haskell = doDistribute self.stylish-haskell_0_15_1_0;
92 apply-refact = doDistribute self.apply-refact_0_15_0_0;
93
94 #
95 # Jailbreaks
96 #
97
98 large-generics = doJailbreak super.large-generics; # base <4.20
99 time-compat_1_9_8 = doJailbreak super.time-compat_1_9_8; # too strict lower bound on QuickCheck
100 cpphs = overrideCabal (drv: {
101 # jail break manually the conditional dependencies
102 postPatch = ''
103 sed -i 's/time >=1.5 \&\& <1.13/time >=1.5 \&\& <=1.14/g' cpphs.cabal
104 '';
105 }) super.cpphs;
106 vector = doJailbreak super.vector; # doctest >=0.15 && <0.24
107 cabal-install-parsers = doJailbreak super.cabal-install-parsers; # base, Cabal-syntax, etc.
108 ghc-exactprint_1_12_0_0 = addBuildDepends [
109 # somehow buildDepends was missing
110 self.Diff
111 self.extra
112 self.ghc-paths
113 self.silently
114 self.syb
115 self.HUnit
116 ] super.ghc-exactprint_1_12_0_0;
117 timezone-series = doJailbreak super.timezone-series; # time <1.14
118 timezone-olson = doJailbreak super.timezone-olson; # time <1.14
119 cabal-plan = doJailbreak super.cabal-plan; # base <4.21
120 dbus = doJailbreak super.dbus; # template-haskell <2.23
121 xmobar = doJailbreak super.xmobar; # base <4.21
122
123 #
124 # Test suite issues
125 #
126
127 call-stack = dontCheck super.call-stack; # https://github.com/sol/call-stack/issues/19
128
129 relude = dontCheck super.relude;
130
131 doctest_0_24_0 = overrideCabal (drv: {
132 testFlags = drv.testFlags or [ ] ++ [
133 # These tests require cabal-install (would cause infinite recursion)
134 "--skip=/Cabal.Options"
135 "--skip=/Cabal.Paths/paths"
136 "--skip=/Cabal.ReplOptions" # >= 0.23
137 ];
138 }) super.doctest_0_24_0;
139
140 # https://gitlab.haskell.org/ghc/ghc/-/issues/25930
141 generic-lens = dontCheck super.generic-lens;
142
143 # Cabal 3.14 regression (incorrect datadir in tests): https://github.com/haskell/cabal/issues/10717
144 alex = overrideCabal (drv: {
145 preCheck = drv.preCheck or "" + ''
146 export alex_datadir="$(pwd)/data"
147 '';
148 }) super.alex;
149
150 # https://github.com/sjakobi/newtype-generics/pull/28/files
151 newtype-generics = warnAfterVersion "0.6.2" (doJailbreak super.newtype-generics);
152
153 # Test failure because of GHC bug:
154 # https://gitlab.haskell.org/ghc/ghc/-/issues/25937
155 # https://github.com/sol/interpolate/issues/20
156 interpolate =
157 assert super.ghc.version == "9.12.2";
158 dontCheck super.interpolate;
159
160 #
161 # Multiple issues
162 #
163
164 doctest-parallel = overrideCabal (drv: {
165 patches = drv.patches or [ ] ++ [
166 (pkgs.fetchpatch {
167 name = "doctest-0.23.0-ghc-9.12.patch";
168 url = "https://github.com/martijnbastiaan/doctest-parallel/commit/d3df7aa5d223f3daeb676c8a7efe093ee743d54f.patch";
169 sha256 = "sha256-92CtqBCulfOTjLAeC205cIrqL/2CBP1YFLijTVcTD2M=";
170 includes = [ "src/Test/DocTest/Helpers.hs" ];
171 })
172 ];
173 }) (dontCheck (doJailbreak super.doctest-parallel)); # Cabal >=2.4 && <3.13
174
175 haskell-language-server = super.haskell-language-server.override {
176 floskell = null;
177 retrie = null;
178 };
179
180 # Allow Cabal 3.14
181 hpack = doDistribute self.hpack_0_38_0;
182}