Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1# GHCJS package fixes
2#
3# Please insert new packages *alphabetically*
4# in the OTHER PACKAGES section.
5{ pkgs, haskellLib }:
6
7let
8 removeLibraryHaskellDepends =
9 pnames: depends: builtins.filter (e: !(builtins.elem (e.pname or "") pnames)) depends;
10in
11
12with haskellLib;
13
14self: super:
15
16## GENERAL SETUP BASE PACKAGES
17{
18 inherit (self.ghc.bootPkgs)
19 jailbreak-cabal
20 alex
21 happy
22 gtk2hs-buildtools
23 rehoo
24 hoogle
25 ;
26
27 # Test suite fails; https://github.com/ghcjs/ghcjs-base/issues/133
28 ghcjs-base = dontCheck (
29 self.callPackage ../compilers/ghcjs/ghcjs-base.nix {
30 fetchFromGitHub = pkgs.buildPackages.fetchFromGitHub;
31 aeson = self.aeson_1_5_6_0;
32 }
33 );
34
35 # Included in ghcjs itself
36 ghcjs-prim = null;
37
38 ghcjs-websockets = markUnbroken super.ghcjs-websockets;
39
40 # GHCJS does not ship with the same core packages as GHC.
41 # https://github.com/ghcjs/ghcjs/issues/676
42 stm = doJailbreak self.stm_2_5_3_1;
43 exceptions = dontCheck self.exceptions_0_10_9;
44
45 ## OTHER PACKAGES
46
47 # Runtime exception in tests, missing C API h$realloc
48 base-compat-batteries = dontCheck super.base-compat-batteries;
49
50 # nodejs crashes during test
51 ChasingBottoms = dontCheck super.ChasingBottoms;
52
53 # runs forever
54 text-short = dontCheck super.text-short;
55
56 # doctest doesn't work on ghcjs, but sometimes dontCheck doesn't seem to get rid of the dependency
57 doctest = pkgs.lib.warn "ignoring dependency on doctest" null;
58
59 ghcjs-dom = overrideCabal (drv: {
60 libraryHaskellDepends = with self; [
61 ghcjs-base
62 ghcjs-dom-jsffi
63 text
64 transformers
65 ];
66 configureFlags = [
67 "-fjsffi"
68 "-f-webkit"
69 ];
70 }) super.ghcjs-dom;
71
72 ghcjs-dom-jsffi = overrideCabal (drv: {
73 libraryHaskellDepends = (drv.libraryHaskellDepends or [ ]) ++ [
74 self.ghcjs-base
75 self.text
76 ];
77 broken = false;
78 }) super.ghcjs-dom-jsffi;
79
80 # https://github.com/Deewiant/glob/issues/39
81 Glob = dontCheck super.Glob;
82
83 # Test fails to compile during the hsc2hs stage
84 hashable = dontCheck super.hashable;
85
86 # uses doctest
87 http-types = dontCheck super.http-types;
88
89 jsaddle = overrideCabal (drv: {
90 libraryHaskellDepends = (drv.libraryHaskellDepends or [ ]) ++ [ self.ghcjs-base ];
91 }) super.jsaddle;
92
93 # Tests hang, possibly some issue with tasty and race(async) usage in the nonTerminating tests
94 logict = dontCheck super.logict;
95
96 patch = dontCheck super.patch;
97
98 # TODO: tests hang
99 pcre-light = dontCheck super.pcre-light;
100
101 # Terminal test not supported on ghcjs
102 QuickCheck = dontCheck super.QuickCheck;
103
104 reflex = overrideCabal (drv: {
105 libraryHaskellDepends = (drv.libraryHaskellDepends or [ ]) ++ [ self.ghcjs-base ];
106 }) super.reflex;
107
108 reflex-dom = overrideCabal (drv: {
109 libraryHaskellDepends = removeLibraryHaskellDepends [ "jsaddle-webkit2gtk" ] (
110 drv.libraryHaskellDepends or [ ]
111 );
112 }) super.reflex-dom;
113
114 # https://github.com/dreixel/syb/issues/21
115 syb = dontCheck super.syb;
116
117 # nodejs crashes during test
118 scientific = dontCheck super.scientific;
119
120 # Tests use TH which gives error
121 tasty-quickcheck = dontCheck super.tasty-quickcheck;
122
123 temporary = dontCheck super.temporary;
124
125 # TODO: The tests have a TH error, which has been fixed in ghc
126 # https://gitlab.haskell.org/ghc/ghc/-/issues/15481 but somehow the issue is
127 # still present here https://github.com/glguy/th-abstraction/issues/53
128 th-abstraction = dontCheck super.th-abstraction;
129
130 # Need hedgehog for tests, which fails to compile due to dep on concurrent-output
131 zenc = dontCheck super.zenc;
132
133 hspec = self.hspec_2_7_10;
134 hspec-core = self.hspec-core_2_7_10;
135 hspec-meta = self.hspec-meta_2_7_8;
136 hspec-discover = self.hspec-discover_2_7_10;
137
138 # ReferenceError: h$primop_ShrinkSmallMutableArrayOp_Char is not defined
139 unordered-containers = dontCheck super.unordered-containers;
140
141 # Without this revert, test suites using tasty fail with:
142 # ReferenceError: h$getMonotonicNSec is not defined
143 # https://github.com/UnkindPartition/tasty/pull/345#issuecomment-1538216407
144 tasty = appendPatch (pkgs.fetchpatch {
145 name = "tasty-ghcjs.patch";
146 url = "https://github.com/UnkindPartition/tasty/commit/e692065642fd09b82acccea610ad8f49edd207df.patch";
147 revert = true;
148 relative = "core";
149 hash = "sha256-ryABU2ywkVOEPC/jWv8humT3HaRpCwMYEk+Ux3hhi/M=";
150 }) super.tasty;
151
152 # Tests take unacceptably long.
153 vector = dontCheck super.vector;
154}