1 # NIX-SPECIFIC OVERRIDES/PATCHES FOR HASKELL PACKAGES
3 # This file contains overrides which are needed because of Nix. For example,
4 # some packages may need help finding the location of native libraries. In
5 # general, overrides in this file are (mostly) due to one of the following reasons:
7 # * packages that hard code the location of native libraries, so they need to be patched/
8 # supplied the patch explicitly
9 # * passing native libraries that are not detected correctly by cabal2nix
10 # * test suites that fail due to some features not available in the nix sandbox
11 # (networking being a common one)
13 # In general, this file should *not* contain overrides that fix build failures that could
14 # also occur on standard, FHS-compliant non-Nix systems. For example, if tests have a compile
15 # error, that is a bug in the package, and that failure has nothing to do with Nix.
17 # Common examples which should *not* be a part of this file:
19 # * overriding a specific version of a haskell library because some package fails
20 # to build with a newer version. Such overrides have nothing to do with Nix itself,
21 # and they would also be neccessary outside of Nix if you use the same set of
23 # * disabling tests that fail due to missing files in the tarball or compile errors
24 # * disabling tests that require too much memory
25 # * enabling/disabling certain features in packages
27 # If you have an override of this kind, see configuration-common.nix instead.
36 # All of the overrides in this set should look like:
38 # foo = ... something involving super.foo ...
40 # but that means that we add `foo` attribute even if there is no `super.foo`! So if
41 # you want to use this configuration for a package set that only contains a subset of
42 # the packages that have overrides defined here, you'll end up with a set that contains
43 # a bunch of attributes that trigger an evaluation error.
45 # To avoid this, we use `intersectAttrs` here so we never add packages that are not present
46 # in the parent package set (`super`).
47 self: super: builtins.intersectAttrs super {
49 # Apply NixOS-specific patches.
50 ghc-paths = appendPatch ./patches/ghc-paths-nix.patch super.ghc-paths;
52 #######################################
53 ### HASKELL-LANGUAGE-SERVER SECTION ###
54 #######################################
56 haskell-language-server = overrideCabal (drv: {
57 # starting with 1.6.1.1 haskell-language-server wants to be linked dynamically
58 # by default. Unless we reflect this in the generic builder, GHC is going to
59 # produce some illegal references to /build/.
60 enableSharedExecutables = true;
61 # The shell script wrapper checks that the runtime ghc and its boot packages match the ghc hls was compiled with.
62 # This prevents linking issues when running TH splices.
64 mv "$out/bin/haskell-language-server" "$out/bin/.haskell-language-server-${self.ghc.version}-unwrapped"
65 BOOT_PKGS=`ghc-pkg-${self.ghc.version} --global list --simple-output`
66 ${pkgs.buildPackages.gnused}/bin/sed \
67 -e "s!@@EXE_DIR@@!$out/bin!" \
68 -e "s/@@EXE_NAME@@/.haskell-language-server-${self.ghc.version}-unwrapped/" \
69 -e "s/@@GHC_VERSION@@/${self.ghc.version}/" \
70 -e "s/@@BOOT_PKGS@@/$BOOT_PKGS/" \
71 -e "s/@@ABI_HASHES@@/$(for dep in $BOOT_PKGS; do printf "%s:" "$dep" && ghc-pkg-${self.ghc.version} field $dep abi --simple-output ; done | tr '\n' ' ' | xargs)/" \
72 -e "s!Consider installing ghc.* via ghcup or build HLS from source.!Visit https://nixos.org/manual/nixpkgs/unstable/#haskell-language-server to learn how to correctly install a matching hls for your ghc with nix.!" \
73 bindist/wrapper.in > "$out/bin/haskell-language-server"
74 ln -s "$out/bin/haskell-language-server" "$out/bin/haskell-language-server-${self.ghc.version}"
75 chmod +x "$out/bin/haskell-language-server"
77 testToolDepends = [ self.cabal-install pkgs.git ];
78 testTarget = "func-test"; # wrapper test accesses internet
80 export PATH=$PATH:$PWD/dist/build/haskell-language-server:$PWD/dist/build/haskell-language-server-wrapper
83 }) super.haskell-language-server;
85 # ghcide-bench tests need network
86 ghcide-bench = dontCheck super.ghcide-bench;
88 # 2023-04-01: TODO: Either reenable at least some tests or remove the preCheck override
89 ghcide = overrideCabal (drv: {
90 # tests depend on executable
91 preCheck = ''export PATH="$PWD/dist/build/ghcide:$PATH"'';
92 # tests disabled because they require network
96 # Test suite needs executable
97 agda2lagda = overrideCabal (drv: {
99 export PATH="$PWD/dist/build/agda2lagda:$PATH"
100 '' + drv.preCheck or "";
103 hiedb = overrideCabal (drv: {
105 export PATH=$PWD/dist/build/hiedb:$PATH
109 # Tests access homeless-shelter.
110 hie-bios = dontCheck super.hie-bios;
112 # PLUGINS WITH ENABLED TESTS
113 # haskell-language-server plugins all use the same test harness so we give them what they want in this loop.
114 # Every hls plugin should either be in the test disabled list below, or up here in the list fixing it’s tests.
115 inherit (pkgs.lib.mapAttrs
116 (_: overrideCabal (drv: {
117 testToolDepends = (drv.testToolDepends or [ ]) ++ [ pkgs.git ];
119 export HOME=$TMPDIR/home
120 '' + (drv.preCheck or "");
126 hls-overloaded-record-dot-plugin
129 # PLUGINS WITH DISABLED TESTS
130 # 2023-04-01: TODO: We should reenable all these tests to figure if they are still broken.
131 inherit (pkgs.lib.mapAttrs (_: dontCheck) super)
132 # Tests have file permissions expections that don’t work with the nix store.
135 # https://github.com/haskell/haskell-language-server/pull/3431
138 hls-code-range-plugin
139 hls-explicit-record-fields-plugin
142 hls-explicit-fixity-plugin
147 hls-alternate-number-format-plugin
148 hls-qualify-imported-names-plugin
149 hls-haddock-comments-plugin
151 hls-call-hierarchy-plugin
152 hls-selection-range-plugin
155 # 2021-05-08: Tests fail: https://github.com/haskell/haskell-language-server/issues/1809
158 # 2021-06-20: Tests fail: https://github.com/haskell/haskell-language-server/issues/1949
159 hls-refine-imports-plugin
161 # 2021-11-20: https://github.com/haskell/haskell-language-server/pull/2373
162 hls-explicit-imports-plugin
164 # 2021-11-20: https://github.com/haskell/haskell-language-server/pull/2374
165 hls-module-name-plugin
167 # 2022-09-19: https://github.com/haskell/haskell-language-server/issues/3200
170 # 2021-09-14: Tests are flaky.
173 # 2021-09-18: https://github.com/haskell/haskell-language-server/issues/2205
174 hls-stylish-haskell-plugin
176 # Necesssary .txt files are not included in sdist.
177 # https://github.com/haskell/haskell-language-server/pull/2887
178 hls-change-type-signature-plugin
180 # 2023-04-03: https://github.com/haskell/haskell-language-server/issues/3549
184 ###########################################
185 ### END HASKELL-LANGUAGE-SERVER SECTION ###
186 ###########################################
188 audacity = enableCabalFlag "buildExamples" (overrideCabal (drv: {
189 executableHaskellDepends = [self.optparse-applicative self.soxlib];
191 # 2023-04-27: Deactivating examples for now because they cause a non-trivial build failure.
192 # med-module = enableCabalFlag "buildExamples" super.med-module;
193 spreadsheet = enableCabalFlag "buildExamples" (overrideCabal (drv: {
194 executableHaskellDepends = [self.optparse-applicative self.shell-utility];
195 }) super.spreadsheet);
197 # fix errors caused by hardening flags
198 epanet-haskell = disableHardening ["format"] super.epanet-haskell;
200 # Link the proper version.
201 zeromq4-haskell = super.zeromq4-haskell.override { zeromq = pkgs.zeromq4; };
203 threadscope = enableSeparateBinOutput super.threadscope;
205 # Use the default version of mysql to build this package (which is actually mariadb).
206 # test phase requires networking
207 mysql = dontCheck super.mysql;
209 # CUDA needs help finding the SDK headers and libraries.
210 cuda = overrideCabal (drv: {
211 extraLibraries = (drv.extraLibraries or []) ++ [pkgs.linuxPackages.nvidia_x11];
212 configureFlags = (drv.configureFlags or []) ++ [
213 "--extra-lib-dirs=${pkgs.cudatoolkit.lib}/lib"
214 "--extra-include-dirs=${pkgs.cudatoolkit}/include"
217 export CUDA_PATH=${pkgs.cudatoolkit}
221 nvvm = overrideCabal (drv: {
223 export CUDA_PATH=${pkgs.cudatoolkit}
230 # Copy hledger man pages from the source tarball into the proper place.
231 # It always contains the relevant man page(s) at the top level. For
232 # hledger it additionally has all the other man pages in embeddedfiles/
234 installHledgerManPages = overrideCabal (drv: {
235 buildTools = drv.buildTools or [] ++ [
236 pkgs.buildPackages.installShellFiles
239 for i in $(seq 1 9); do
243 install -v -Dm644 *.info* -t "$out/share/info/"
247 hledgerWebTestFix = overrideCabal (drv: {
249 ${drv.preCheck or ""}
250 export HOME="$(mktemp -d)"
255 hledger = installHledgerManPages super.hledger;
256 hledger-web = installHledgerManPages (hledgerWebTestFix super.hledger-web);
257 hledger-ui = installHledgerManPages super.hledger-ui;
259 hledger_1_30_1 = installHledgerManPages
260 (doDistribute (super.hledger_1_30_1.override {
261 hledger-lib = self.hledger-lib_1_30;
263 hledger-web_1_30 = installHledgerManPages (hledgerWebTestFix
264 (doDistribute (super.hledger-web_1_30.override {
265 hledger = self.hledger_1_30_1;
266 hledger-lib = self.hledger-lib_1_30;
276 cufft = overrideCabal (drv: {
278 export CUDA_PATH=${pkgs.cudatoolkit}
282 # jni needs help finding libjvm.so because it's in a weird location.
283 jni = overrideCabal (drv: {
285 local libdir=( "${pkgs.jdk}/lib/openjdk/jre/lib/"*"/server" )
286 configureFlags+=" --extra-lib-dir=''${libdir[0]}"
290 # Won't find it's header files without help.
291 sfml-audio = appendConfigureFlag "--extra-include-dirs=${pkgs.openal}/include/AL" super.sfml-audio;
293 # avoid compiling twice by providing executable as a separate output (with small closure size)
294 cabal-fmt = enableSeparateBinOutput super.cabal-fmt;
295 hindent = enableSeparateBinOutput super.hindent;
296 releaser = enableSeparateBinOutput super.releaser;
297 eventlog2html = enableSeparateBinOutput super.eventlog2html;
298 ghc-debug-brick = enableSeparateBinOutput super.ghc-debug-brick;
299 nixfmt = enableSeparateBinOutput super.nixfmt;
300 calligraphy = enableSeparateBinOutput super.calligraphy;
301 niv = enableSeparateBinOutput (self.generateOptparseApplicativeCompletions [ "niv" ] super.niv);
302 ghcid = enableSeparateBinOutput super.ghcid;
303 ormolu = self.generateOptparseApplicativeCompletions [ "ormolu" ] (enableSeparateBinOutput super.ormolu);
304 hnix = self.generateOptparseApplicativeCompletions [ "hnix" ] super.hnix;
306 # Generate shell completion.
307 cabal2nix = self.generateOptparseApplicativeCompletions [ "cabal2nix" ] super.cabal2nix;
309 arbtt = overrideCabal (drv: {
310 # The test suite needs the packages's executables in $PATH to succeed.
312 for i in $PWD/dist/build/*; do
313 export PATH="$i:$PATH"
316 # One test uses timezone data
317 testToolDepends = drv.testToolDepends or [] ++ [
322 hzk = appendConfigureFlag "--extra-include-dirs=${pkgs.zookeeper_mt}/include/zookeeper" super.hzk;
324 # Foreign dependency name clashes with another Haskell package.
325 libarchive-conduit = super.libarchive-conduit.override { archive = pkgs.libarchive; };
327 # Heist's test suite requires system pandoc
328 heist = addTestToolDepend pkgs.pandoc super.heist;
330 # https://github.com/NixOS/cabal2nix/issues/136 and https://github.com/NixOS/cabal2nix/issues/216
331 gio = lib.pipe super.gio
332 [ (disableHardening ["fortify"])
333 (addBuildTool self.buildHaskellPackages.gtk2hs-buildtools)
335 glib = disableHardening ["fortify"] (addPkgconfigDepend pkgs.glib (addBuildTool self.buildHaskellPackages.gtk2hs-buildtools super.glib));
336 gtk3 = disableHardening ["fortify"] (super.gtk3.override { inherit (pkgs) gtk3; });
337 gtk = lib.pipe super.gtk (
338 [ (disableHardening ["fortify"])
339 (addBuildTool self.buildHaskellPackages.gtk2hs-buildtools)
341 ( if pkgs.stdenv.isDarwin then [(appendConfigureFlag "-fhave-quartz-gtk")] else [] )
343 gtksourceview2 = addPkgconfigDepend pkgs.gtk2 super.gtksourceview2;
344 gtk-traymanager = addPkgconfigDepend pkgs.gtk3 super.gtk-traymanager;
346 shelly = overrideCabal (drv: {
347 # /usr/bin/env is unavailable in the sandbox
348 preCheck = drv.preCheck or "" + ''
349 chmod +x ./test/data/*.sh
350 patchShebangs --build test/data
354 # Add necessary reference to gtk3 package
355 gi-dbusmenugtk3 = addPkgconfigDepend pkgs.gtk3 super.gi-dbusmenugtk3;
357 # Doesn't declare boost dependency
358 nix-serve-ng = overrideSrc {
359 src = assert super.nix-serve-ng.version == "1.0.0";
360 # Workaround missing files in sdist
361 # https://github.com/aristanetworks/nix-serve-ng/issues/10
363 # Workaround for libstore incompatibility with Nix 2.13
364 # https://github.com/aristanetworks/nix-serve-ng/issues/22
365 pkgs.fetchFromGitHub {
366 repo = "nix-serve-ng";
367 owner = "aristanetworks";
368 rev = "dabf46d65d8e3be80fa2eacd229eb3e621add4bd";
369 hash = "sha256-SoJJ3rMtDMfUzBSzuGMY538HDIj/s8bPf8CjIkpqY2w=";
371 } (addPkgconfigDepend pkgs.boost.dev super.nix-serve-ng);
373 # These packages try to access the network.
374 amqp = dontCheck super.amqp;
375 amqp-conduit = dontCheck super.amqp-conduit;
376 bitcoin-api = dontCheck super.bitcoin-api;
377 bitcoin-api-extra = dontCheck super.bitcoin-api-extra;
378 bitx-bitcoin = dontCheck super.bitx-bitcoin; # http://hydra.cryp.to/build/926187/log/raw
379 concurrent-dns-cache = dontCheck super.concurrent-dns-cache;
380 digitalocean-kzs = dontCheck super.digitalocean-kzs; # https://github.com/KazumaSATO/digitalocean-kzs/issues/1
381 github-types = dontCheck super.github-types; # http://hydra.cryp.to/build/1114046/nixlog/1/raw
382 hadoop-rpc = dontCheck super.hadoop-rpc; # http://hydra.cryp.to/build/527461/nixlog/2/raw
383 hjsonschema = overrideCabal (drv: { testTarget = "local"; }) super.hjsonschema;
384 marmalade-upload = dontCheck super.marmalade-upload; # http://hydra.cryp.to/build/501904/nixlog/1/raw
385 mongoDB = dontCheck super.mongoDB;
386 network-transport-tcp = dontCheck super.network-transport-tcp;
387 network-transport-zeromq = dontCheck super.network-transport-zeromq; # https://github.com/tweag/network-transport-zeromq/issues/30
388 oidc-client = dontCheck super.oidc-client; # the spec runs openid against google.com
389 persistent-migration = dontCheck super.persistent-migration; # spec requires pg_ctl binary
390 pipes-mongodb = dontCheck super.pipes-mongodb; # http://hydra.cryp.to/build/926195/log/raw
391 pixiv = dontCheck super.pixiv;
392 raven-haskell = dontCheck super.raven-haskell; # http://hydra.cryp.to/build/502053/log/raw
393 riak = dontCheck super.riak; # http://hydra.cryp.to/build/498763/log/raw
394 scotty-binding-play = dontCheck super.scotty-binding-play;
395 servant-router = dontCheck super.servant-router;
396 serversession-backend-redis = dontCheck super.serversession-backend-redis;
397 slack-api = dontCheck super.slack-api; # https://github.com/mpickering/slack-api/issues/5
398 socket = dontCheck super.socket;
399 stackage = dontCheck super.stackage; # http://hydra.cryp.to/build/501867/nixlog/1/raw
400 textocat-api = dontCheck super.textocat-api; # http://hydra.cryp.to/build/887011/log/raw
401 warp = dontCheck super.warp; # http://hydra.cryp.to/build/501073/nixlog/5/raw
402 wreq = dontCheck super.wreq; # http://hydra.cryp.to/build/501895/nixlog/1/raw
403 wreq-sb = dontCheck super.wreq-sb; # http://hydra.cryp.to/build/783948/log/raw
404 wuss = dontCheck super.wuss; # http://hydra.cryp.to/build/875964/nixlog/2/raw
405 download = dontCheck super.download;
406 http-client = dontCheck super.http-client;
407 http-client-openssl = dontCheck super.http-client-openssl;
408 http-client-tls = dontCheck super.http-client-tls;
409 http-conduit = dontCheck super.http-conduit;
410 transient-universe = dontCheck super.transient-universe;
411 telegraph = dontCheck super.telegraph;
412 typed-process = dontCheck super.typed-process;
413 js-jquery = dontCheck super.js-jquery;
414 hPDB-examples = dontCheck super.hPDB-examples;
415 configuration-tools = dontCheck super.configuration-tools; # https://github.com/alephcloud/hs-configuration-tools/issues/40
416 tcp-streams = dontCheck super.tcp-streams;
417 holy-project = dontCheck super.holy-project;
418 mustache = dontCheck super.mustache;
419 arch-web = dontCheck super.arch-web;
421 # Test suite requires running a database server. Testing is done upstream.
422 hasql = dontCheck super.hasql;
423 hasql-dynamic-statements = dontCheck super.hasql-dynamic-statements;
424 hasql-interpolate = dontCheck super.hasql-interpolate;
425 hasql-notifications = dontCheck super.hasql-notifications;
426 hasql-pool = dontCheck super.hasql-pool;
427 hasql-transaction = dontCheck super.hasql-transaction;
429 # Tries to mess with extended POSIX attributes, but can't in our chroot environment.
430 xattr = dontCheck super.xattr;
432 # Needs access to locale data, but looks for it in the wrong place.
433 scholdoc-citeproc = dontCheck super.scholdoc-citeproc;
435 # Disable tests because they require a mattermost server
436 mattermost-api = dontCheck super.mattermost-api;
438 # Expect to find sendmail(1) in $PATH.
439 mime-mail = appendConfigureFlag "--ghc-option=-DMIME_MAIL_SENDMAIL_PATH=\"sendmail\"" super.mime-mail;
441 # Help the test suite find system timezone data.
442 tz = overrideCabal (drv: {
443 preConfigure = "export TZDIR=${pkgs.tzdata}/share/zoneinfo";
446 # https://hydra.nixos.org/build/128665302/nixlog/3
447 # Disable tests because they require a running dbus session
448 xmonad-dbus = dontCheck super.xmonad-dbus;
450 # wxc supports wxGTX >= 3.0, but our current default version points to 2.8.
451 # http://hydra.cryp.to/build/1331287/log/raw
452 wxc = (addBuildDepend self.split super.wxc).override { wxGTK = pkgs.wxGTK32; };
453 wxcore = super.wxcore.override { wxGTK = pkgs.wxGTK32; };
455 shellify = enableSeparateBinOutput super.shellify;
457 # Test suite wants to connect to $DISPLAY.
458 bindings-GLFW = dontCheck super.bindings-GLFW;
459 gi-gtk-declarative = dontCheck super.gi-gtk-declarative;
460 gi-gtk-declarative-app-simple = dontCheck super.gi-gtk-declarative-app-simple;
461 hsqml = dontCheck (addExtraLibraries [pkgs.libGLU pkgs.libGL] (super.hsqml.override { qt5 = pkgs.qt5Full; }));
462 monomer = dontCheck super.monomer;
464 # Wants to check against a real DB, Needs freetds
465 odbc = dontCheck (addExtraLibraries [ pkgs.freetds ] super.odbc);
467 # Tests attempt to use NPM to install from the network into
468 # /homeless-shelter. Disabled.
469 purescript = dontCheck super.purescript;
471 # Hardcoded include path
472 poppler = overrideCabal (drv: {
474 sed -i -e 's,glib/poppler.h,poppler.h,' poppler.cabal
475 sed -i -e 's,glib/poppler.h,poppler.h,' Graphics/UI/Gtk/Poppler/Structs.hsc
479 # Uses OpenGL in testing
480 caramia = dontCheck super.caramia;
482 # requires llvm 9 specifically https://github.com/llvm-hs/llvm-hs/#building-from-source
483 llvm-hs = super.llvm-hs.override { llvm-config = pkgs.llvm_9; };
485 # Needs help finding LLVM.
486 spaceprobe = addBuildTool self.buildHaskellPackages.llvmPackages.llvm super.spaceprobe;
488 # Tries to run GUI in tests
489 leksah = dontCheck (overrideCabal (drv: {
490 executableSystemDepends = (drv.executableSystemDepends or []) ++ (with pkgs; [
491 gnome.adwaita-icon-theme # Fix error: Icon 'window-close' not present in theme ...
492 wrapGAppsHook # Fix error: GLib-GIO-ERROR **: No GSettings schemas are installed on the system
493 gtk3 # Fix error: GLib-GIO-ERROR **: Settings schema 'org.gtk.Settings.FileChooser' is not installed
495 postPatch = (drv.postPatch or "") + ''
496 for f in src/IDE/Leksah.hs src/IDE/Utils/ServerConnection.hs
498 substituteInPlace "$f" --replace "\"leksah-server\"" "\"${self.leksah-server}/bin/leksah-server\""
503 # dyre's tests appear to be trying to directly call GHC.
504 dyre = dontCheck super.dyre;
506 # https://github.com/edwinb/EpiVM/issues/13
507 # https://github.com/edwinb/EpiVM/issues/14
508 epic = addExtraLibraries [pkgs.boehmgc pkgs.gmp] (addBuildTool self.buildHaskellPackages.happy super.epic);
510 # https://github.com/ekmett/wl-pprint-terminfo/issues/7
511 wl-pprint-terminfo = addExtraLibrary pkgs.ncurses super.wl-pprint-terminfo;
513 # https://github.com/bos/pcap/issues/5
514 pcap = addExtraLibrary pkgs.libpcap super.pcap;
516 # https://github.com/NixOS/nixpkgs/issues/53336
517 greenclip = addExtraLibrary pkgs.xorg.libXdmcp super.greenclip;
519 # The cabal files for these libraries do not list the required system dependencies.
520 libjwt-typed = addExtraLibrary pkgs.libjwt super.libjwt-typed;
521 miniball = addExtraLibrary pkgs.miniball super.miniball;
522 SDL-image = addExtraLibrary pkgs.SDL super.SDL-image;
523 SDL-ttf = addExtraLibrary pkgs.SDL super.SDL-ttf;
524 SDL-mixer = addExtraLibrary pkgs.SDL super.SDL-mixer;
525 SDL-gfx = addExtraLibrary pkgs.SDL super.SDL-gfx;
526 SDL-mpeg = appendConfigureFlags [
527 "--extra-lib-dirs=${pkgs.smpeg}/lib"
528 "--extra-include-dirs=${pkgs.smpeg.dev}/include/smpeg"
531 # https://github.com/ivanperez-keera/hcwiid/pull/4
532 hcwiid = overrideCabal (drv: {
533 configureFlags = (drv.configureFlags or []) ++ [
534 "--extra-lib-dirs=${pkgs.bluez.out}/lib"
535 "--extra-lib-dirs=${pkgs.cwiid}/lib"
536 "--extra-include-dirs=${pkgs.cwiid}/include"
537 "--extra-include-dirs=${pkgs.bluez.dev}/include"
539 prePatch = '' sed -i -e "/Extra-Lib-Dirs/d" -e "/Include-Dirs/d" "hcwiid.cabal" '';
542 # cabal2nix doesn't pick up some of the dependencies.
544 g = addBuildDepend pkgs.perl super.ginsu;
545 g' = overrideCabal (drv: {
546 executableSystemDepends = (drv.executableSystemDepends or []) ++ [
552 # Tests require `docker` command in PATH
553 # Tests require running docker service :on localhost
554 docker = dontCheck super.docker;
556 # https://github.com/deech/fltkhs/issues/16
557 fltkhs = overrideCabal (drv: {
558 libraryToolDepends = (drv.libraryToolDepends or []) ++ [pkgs.buildPackages.autoconf];
559 librarySystemDepends = (drv.librarySystemDepends or []) ++ [pkgs.fltk13 pkgs.libGL pkgs.libjpeg];
562 # https://github.com/skogsbaer/hscurses/pull/26
563 hscurses = addExtraLibrary pkgs.ncurses super.hscurses;
565 # Looks like Avahi provides the missing library
566 dnssd = super.dnssd.override { dns_sd = pkgs.avahi.override { withLibdnssdCompat = true; }; };
568 # Tests execute goldplate
569 goldplate = overrideCabal (drv: {
570 preCheck = drv.preCheck or "" + ''
571 export PATH="$PWD/dist/build/goldplate:$PATH"
575 # At least on 1.3.4 version on 32-bit architectures tasty requires
576 # unbounded-delays via .cabal file conditions.
577 tasty = overrideCabal (drv: {
578 libraryHaskellDepends =
579 (drv.libraryHaskellDepends or [])
580 ++ lib.optionals (!(pkgs.stdenv.hostPlatform.isAarch64
581 || pkgs.stdenv.hostPlatform.isx86_64)
582 || (self.ghc.isGhcjs or false)) [
583 self.unbounded-delays
587 tasty-discover = overrideCabal (drv: {
588 # Depends on itself for testing
590 export PATH="$PWD/dist/build/tasty-discover:$PATH"
591 '' + (drv.preBuild or "");
592 }) super.tasty-discover;
594 # GLUT uses `dlopen` to link to freeglut, so we need to set the RUNPATH correctly for
595 # it to find `libglut.so` from the nix store. We do this by patching GLUT.cabal to pkg-config
596 # depend on freeglut, which provides GHC to necessary information to generate a correct RPATH.
598 # Note: Simply patching the dynamic library (.so) of the GLUT build will *not* work, since the
599 # RPATH also needs to be propagated when using static linking. GHC automatically handles this for
600 # us when we patch the cabal file (Link options will be recored in the ghc package registry).
602 # Additional note: nixpkgs' freeglut and macOS's OpenGL implementation do not cooperate,
603 # so disable this on Darwin only
604 ${if pkgs.stdenv.isDarwin then null else "GLUT"} = overrideCabal (drv: {
605 pkg-configDepends = drv.pkg-configDepends or [] ++ [
608 patches = drv.patches or [] ++ [
611 prePatch = drv.prePatch or "" + ''
612 ${lib.getBin pkgs.buildPackages.dos2unix}/bin/dos2unix *.cabal
616 libsystemd-journal = doJailbreak (addExtraLibrary pkgs.systemd super.libsystemd-journal);
618 # does not specify tests in cabal file, instead has custom runTest cabal hook,
619 # so cabal2nix will not detect test dependencies.
620 either-unwrap = overrideCabal (drv: {
621 testHaskellDepends = (drv.testHaskellDepends or []) ++ [ self.test-framework self.test-framework-hunit ];
622 }) super.either-unwrap;
624 # https://github.com/haskell-fswatch/hfsnotify/issues/62
625 fsnotify = dontCheck super.fsnotify;
627 hidapi = addExtraLibrary pkgs.udev super.hidapi;
629 hs-GeoIP = super.hs-GeoIP.override { GeoIP = pkgs.geoipWithDatabase; };
631 discount = super.discount.override { markdown = pkgs.discount; };
633 # tests require working stack installation with all-cabal-hashes cloned in $HOME
634 stackage-curator = dontCheck super.stackage-curator;
636 # hardcodes /usr/bin/tr: https://github.com/snapframework/io-streams/pull/59
637 io-streams = enableCabalFlag "NoInteractiveTests" super.io-streams;
639 # requires autotools to build
640 secp256k1 = addBuildTools [ pkgs.buildPackages.autoconf pkgs.buildPackages.automake pkgs.buildPackages.libtool ] super.secp256k1;
642 # requires libsecp256k1 in pkg-config-depends
643 secp256k1-haskell = addPkgconfigDepend pkgs.secp256k1 super.secp256k1-haskell;
645 # tests require git and zsh
646 hapistrano = addBuildTools [ pkgs.buildPackages.git pkgs.buildPackages.zsh ] super.hapistrano;
648 # This propagates this to everything depending on haskell-gi-base
649 haskell-gi-base = addBuildDepend pkgs.gobject-introspection super.haskell-gi-base;
651 # requires valid, writeable $HOME
652 hatex-guide = overrideCabal (drv: {
654 ${drv.preConfigure or ""}
657 }) super.hatex-guide;
659 # https://github.com/plow-technologies/servant-streaming/issues/12
660 servant-streaming-server = dontCheck super.servant-streaming-server;
662 # https://github.com/haskell-servant/servant/pull/1238
663 servant-client-core = if (pkgs.lib.getVersion super.servant-client-core) == "0.16" then
664 appendPatch ./patches/servant-client-core-redact-auth-header.patch super.servant-client-core
666 super.servant-client-core;
669 # tests run executable, relying on PATH
670 # without this, tests fail with "Couldn't launch intero process"
671 intero = overrideCabal (drv: {
673 export PATH="$PWD/dist/build/intero:$PATH"
677 # Break infinite recursion cycle with criterion and network-uri.
678 js-flot = dontCheck super.js-flot;
680 # Break infinite recursion cycle between QuickCheck and splitmix.
681 splitmix = dontCheck super.splitmix;
683 # Break infinite recursion cycle with OneTuple and quickcheck-instances.
684 foldable1-classes-compat = dontCheck super.foldable1-classes-compat;
686 # Break infinite recursion cycle between tasty and clock.
687 clock = dontCheck super.clock;
689 # Break infinite recursion cycle between devtools and mprelude.
690 devtools = super.devtools.override { mprelude = dontCheck super.mprelude; };
692 # Break dependency cycle between tasty-hedgehog and tasty-expected-failure
693 tasty-hedgehog = dontCheck super.tasty-hedgehog;
695 # Break dependency cycle between hedgehog, tasty-hedgehog and lifted-async
696 lifted-async = dontCheck super.lifted-async;
698 # loc and loc-test depend on each other for testing. Break that infinite cycle:
699 loc-test = super.loc-test.override { loc = dontCheck self.loc; };
701 # The test suites try to run the "fixpoint" and "liquid" executables built just
702 # before and fail because the library search paths aren't configured properly.
703 # Also needs https://github.com/ucsd-progsys/liquidhaskell/issues/1038 resolved.
704 liquid-fixpoint = disableSharedExecutables super.liquid-fixpoint;
705 liquidhaskell = dontCheck (disableSharedExecutables super.liquidhaskell);
707 # Without this override, the builds lacks pkg-config.
708 opencv-extra = addPkgconfigDepend pkgs.opencv3 super.opencv-extra;
710 # Break cyclic reference that results in an infinite recursion.
711 partial-semigroup = dontCheck super.partial-semigroup;
712 colour = dontCheck super.colour;
713 spatial-rotations = dontCheck super.spatial-rotations;
715 LDAP = dontCheck (overrideCabal (drv: {
716 librarySystemDepends = drv.librarySystemDepends or [] ++ [ pkgs.cyrus_sasl.dev ];
719 # Not running the "example" test because it requires a binary from lsps test
720 # suite which is not part of the output of lsp.
721 lsp-test = overrideCabal (old: { testTarget = "tests func-test"; }) super.lsp-test;
723 # the test suite attempts to run the binaries built in this package
724 # through $PATH but they aren't in $PATH
725 dhall-lsp-server = dontCheck super.dhall-lsp-server;
727 # Expects z3 to be on path so we replace it with a hard
729 # The tests expect additional solvers on the path, replace the
730 # available ones also with hard coded paths, and remove the missing
731 # ones from the test.
732 # TODO(@sternenseemann): package cvc5 and re-enable tests
733 sbv = overrideCabal (drv: {
735 sed -i -e 's|"abc"|"${pkgs.abc-verifier}/bin/abc"|' Data/SBV/Provers/ABC.hs
736 sed -i -e 's|"bitwuzla"|"${pkgs.bitwuzla}/bin/bitwuzla"|' Data/SBV/Provers/Bitwuzla.hs
737 sed -i -e 's|"boolector"|"${pkgs.boolector}/bin/boolector"|' Data/SBV/Provers/Boolector.hs
738 sed -i -e 's|"cvc4"|"${pkgs.cvc4}/bin/cvc4"|' Data/SBV/Provers/CVC4.hs
739 sed -i -e 's|"cvc5"|"${pkgs.cvc5}/bin/cvc5"|' Data/SBV/Provers/CVC5.hs
740 sed -i -e 's|"yices-smt2"|"${pkgs.yices}/bin/yices-smt2"|' Data/SBV/Provers/Yices.hs
741 sed -i -e 's|"z3"|"${pkgs.z3}/bin/z3"|' Data/SBV/Provers/Z3.hs
743 # Solvers we don't provide are removed from tests
744 sed -i -e 's|, mathSAT||' SBVTestSuite/SBVConnectionTest.hs
745 sed -i -e 's|, dReal||' SBVTestSuite/SBVConnectionTest.hs
749 # The test-suite requires a running PostgreSQL server.
750 Frames-beam = dontCheck super.Frames-beam;
752 # Compile manpages (which are in RST and are compiled with Sphinx).
756 postBuild = (_drv.postBuild or "") + ''
760 postInstall = (_drv.postInstall or "") + ''
761 mkdir -p $out/share/man/man1
762 mv docs/_build/man/*.1 $out/share/man/man1/
765 (addBuildTools (with pkgs.buildPackages; [makeWrapper python3Packages.sphinx]) super.futhark);
767 git-annex = overrideCabal (drv: {
768 # This is an instance of https://github.com/NixOS/nix/pull/1085
770 # gpg: can't connect to the agent: File name too long
771 postPatch = pkgs.lib.optionalString pkgs.stdenv.isDarwin ''
772 substituteInPlace Test.hs \
773 --replace ', testCase "crypto" test_crypto' ""
774 '' + (drv.postPatch or "");
775 # Ensure git-annex uses the exact same coreutils it saw at build-time.
776 # This is especially important on Darwin but also in Linux environments
777 # where non-GNU coreutils are used by default.
779 wrapProgram $out/bin/git-annex \
780 --prefix PATH : "${pkgs.lib.makeBinPath (with pkgs; [ coreutils lsof ])}"
781 '' + (drv.postFixup or "");
783 pkgs.buildPackages.makeWrapper
784 ] ++ (drv.buildTools or []);
785 }) (super.git-annex.override {
786 dbus = if pkgs.stdenv.isLinux then self.dbus else null;
787 fdo-notify = if pkgs.stdenv.isLinux then self.fdo-notify else null;
788 hinotify = if pkgs.stdenv.isLinux then self.hinotify else self.fsnotify;
791 # The test suite has undeclared dependencies on git.
792 githash = dontCheck super.githash;
794 # Avoid infitite recursion with yaya.
795 yaya-hedgehog = super.yaya-hedgehog.override { yaya = dontCheck self.yaya; };
797 # Avoid infitite recursion with tonatona.
798 tonaparser = dontCheck super.tonaparser;
800 # Needs internet to run tests
801 HTTP = dontCheck super.HTTP;
803 # Break infinite recursions.
804 Dust-crypto = dontCheck super.Dust-crypto;
805 nanospec = dontCheck super.nanospec;
806 options = dontCheck super.options;
807 snap-server = dontCheck super.snap-server;
809 # Tests require internet
810 http-download = dontCheck super.http-download;
811 pantry = dontCheck super.pantry;
812 pantry_0_5_2_1 = dontCheck super.pantry_0_5_2_1;
814 # gtk2hs-buildtools is listed in setupHaskellDepends, but we
815 # need it during the build itself, too.
816 cairo = addBuildTool self.buildHaskellPackages.gtk2hs-buildtools super.cairo;
817 pango = disableHardening ["fortify"] (addBuildTool self.buildHaskellPackages.gtk2hs-buildtools super.pango);
821 docsSearchApp_0_0_10 = pkgs.fetchurl {
822 url = "https://github.com/purescript/purescript-docs-search/releases/download/v0.0.10/docs-search-app.js";
823 sha256 = "0m5ah29x290r0zk19hx2wix2djy7bs4plh9kvjz6bs9r45x25pa5";
826 docsSearchApp_0_0_11 = pkgs.fetchurl {
827 url = "https://github.com/purescript/purescript-docs-search/releases/download/v0.0.11/docs-search-app.js";
828 sha256 = "17qngsdxfg96cka1cgrl3zdrpal8ll6vyhhnazqm4hwj16ywjm02";
831 purescriptDocsSearch_0_0_10 = pkgs.fetchurl {
832 url = "https://github.com/purescript/purescript-docs-search/releases/download/v0.0.10/purescript-docs-search";
833 sha256 = "0wc1zyhli4m2yykc6i0crm048gyizxh7b81n8xc4yb7ibjqwhyj3";
836 purescriptDocsSearch_0_0_11 = pkgs.fetchurl {
837 url = "https://github.com/purescript/purescript-docs-search/releases/download/v0.0.11/purescript-docs-search";
838 sha256 = "1hjdprm990vyxz86fgq14ajn0lkams7i00h8k2i2g1a0hjdwppq6";
841 spagoDocs = overrideCabal (drv: {
842 postUnpack = (drv.postUnpack or "") + ''
843 # Spago includes the following two files directly into the binary
844 # with Template Haskell. They are fetched at build-time from the
845 # `purescript-docs-search` repo above. If they cannot be fetched at
846 # build-time, they are pulled in from the `templates/` directory in
849 # However, they are not actually available in the spago source, so they
850 # need to fetched with nix and put in the correct place.
851 # https://github.com/spacchetti/spago/issues/510
852 cp ${docsSearchApp_0_0_10} "$sourceRoot/templates/docs-search-app-0.0.10.js"
853 cp ${docsSearchApp_0_0_11} "$sourceRoot/templates/docs-search-app-0.0.11.js"
854 cp ${purescriptDocsSearch_0_0_10} "$sourceRoot/templates/purescript-docs-search-0.0.10"
855 cp ${purescriptDocsSearch_0_0_11} "$sourceRoot/templates/purescript-docs-search-0.0.11"
857 # For some weird reason, on Darwin, the open(2) call to embed these files
858 # requires write permissions. The easiest resolution is just to permit that
859 # (doesn't cause any harm on other systems).
861 "$sourceRoot/templates/docs-search-app-0.0.10.js" \
862 "$sourceRoot/templates/purescript-docs-search-0.0.10" \
863 "$sourceRoot/templates/docs-search-app-0.0.11.js" \
864 "$sourceRoot/templates/purescript-docs-search-0.0.11"
868 spagoOldAeson = spagoDocs.overrideScope (hfinal: hprev: {
869 # spago is not yet updated for aeson 2.0
870 aeson = hfinal.aeson_1_5_6_0;
871 # bower-json 1.1.0.0 only supports aeson 2.0, so we pull in the older version here.
872 bower-json = hprev.bower-json_1_0_0_1;
875 # Tests require network access.
876 spagoWithoutChecks = dontCheck spagoOldAeson;
878 # spago doesn't currently build with ghc92. Top-level spago is pulled from
879 # ghc90 and explicitly marked unbroken.
880 markBroken spagoWithoutChecks;
882 # checks SQL statements at compile time, and so requires a running PostgreSQL
883 # database to run it's test suite
884 postgresql-typed = dontCheck super.postgresql-typed;
886 # mplayer-spot uses mplayer at runtime.
888 let path = pkgs.lib.makeBinPath [ pkgs.mplayer ];
889 in overrideCabal (oldAttrs: {
891 wrapProgram $out/bin/mplayer-spot --prefix PATH : "${path}"
893 }) (addBuildTool pkgs.buildPackages.makeWrapper super.mplayer-spot);
895 # break infinite recursion with base-orphans
896 primitive = dontCheck super.primitive;
897 primitive_0_7_1_0 = dontCheck super.primitive_0_7_1_0;
900 let path = pkgs.lib.makeBinPath [ pkgs.ffmpeg pkgs.youtube-dl ];
901 in overrideCabal (_drv: {
903 wrapProgram $out/bin/cut-the-crap \
904 --prefix PATH : "${path}"
906 }) (addBuildTool pkgs.buildPackages.makeWrapper super.cut-the-crap);
908 # Compiling the readme throws errors and has no purpose in nixpkgs
910 disableCabalFlag "build-readme" (doJailbreak super.aeson-gadt-th);
912 # Fix compilation of Setup.hs by removing the module declaration.
913 # See: https://github.com/tippenein/guid/issues/1
914 guid = overrideCabal (drv: {
915 prePatch = "sed -i '1d' Setup.hs"; # 1st line is module declaration, remove it
919 # Tests disabled as recommended at https://github.com/luke-clifton/shh/issues/39
920 shh = dontCheck super.shh;
922 # The test suites fail because there's no PostgreSQL database running in our
924 hasql-queue = dontCheck super.hasql-queue;
925 postgresql-libpq-notify = dontCheck super.postgresql-libpq-notify;
926 postgresql-pure = dontCheck super.postgresql-pure;
928 retrie = addTestToolDepends [pkgs.git pkgs.mercurial] super.retrie;
929 retrie_1_2_0_0 = addTestToolDepends [pkgs.git pkgs.mercurial] super.retrie_1_2_0_0;
930 retrie_1_2_1_1 = addTestToolDepends [pkgs.git pkgs.mercurial] super.retrie_1_2_1_1;
933 # there are three very heavy test suites that need external repos, one requires network access
934 hevm = dontCheck super.hevm;
936 # hadolint enables static linking by default in the cabal file, so we have to explicitly disable it.
937 # https://github.com/hadolint/hadolint/commit/e1305042c62d52c2af4d77cdce5d62f6a0a3ce7b
938 hadolint = disableCabalFlag "static" super.hadolint;
940 # Test suite tries to execute the build product "doctest-driver-gen", but it's not in $PATH.
941 doctest-driver-gen = dontCheck super.doctest-driver-gen;
943 # Tests access internet
944 prune-juice = dontCheck super.prune-juice;
946 citeproc = lib.pipe super.citeproc [
947 enableSeparateBinOutput
948 # Enable executable being built and add missing dependencies
949 (enableCabalFlag "executable")
950 (addBuildDepends [ self.aeson-pretty ])
951 # TODO(@sternenseemann): we may want to enable that for improved performance
952 # Is correctness good enough since 0.5?
953 (disableCabalFlag "icu")
956 # based on https://github.com/gibiansky/IHaskell/blob/aafeabef786154d81ab7d9d1882bbcd06fc8c6c4/release.nix
957 ihaskell = overrideCabal (drv: {
958 # ihaskell's cabal file forces building a shared executable, which we need
959 # to reflect here or RPATH will contain a reference to /build/.
960 enableSharedExecutables = true;
962 export HOME=$TMPDIR/home
963 export PATH=$PWD/dist/build/ihaskell:$PATH
964 export GHC_PACKAGE_PATH=$PWD/dist/package.conf.inplace/:$GHC_PACKAGE_PATH
968 # tests need to execute the built executable
969 stutter = overrideCabal (drv: {
971 export PATH=dist/build/stutter:$PATH
972 '' + (drv.preCheck or "");
975 # Install man page and generate shell completions
976 pinboard-notes-backup = overrideCabal
979 install -D man/pnbackup.1 $out/share/man/man1/pnbackup.1
980 '' + (drv.postInstall or "");
982 (self.generateOptparseApplicativeCompletions [ "pnbackup" ] super.pinboard-notes-backup);
984 # Pass the correct libarchive into the package.
985 streamly-archive = super.streamly-archive.override { archive = pkgs.libarchive; };
987 hlint = overrideCabal (drv: {
989 install -Dm644 data/hlint.1 -t "$out/share/man/man1"
990 '' + drv.postInstall or "";
993 taglib = overrideCabal (drv: {
994 librarySystemDepends = [
996 ] ++ (drv.librarySystemDepends or []);
999 # random 1.2.0 has tests that indirectly depend on
1000 # itself causing an infinite recursion at evaluation
1002 random = dontCheck super.random;
1004 # https://github.com/Gabriella439/nix-diff/pull/74
1005 nix-diff = overrideCabal (drv: {
1007 substituteInPlace src/Nix/Diff/Types.hs \
1008 --replace "{-# OPTIONS_GHC -Wno-orphans #-}" "{-# OPTIONS_GHC -Wno-orphans -fconstraint-solver-iterations=0 #-}"
1010 }) (doJailbreak (dontCheck super.nix-diff));
1012 # mockery's tests depend on hspec-discover which dependso on mockery for its tests
1013 mockery = dontCheck super.mockery;
1014 # same for logging-facade
1015 logging-facade = dontCheck super.logging-facade;
1017 # Since this package is primarily used by nixpkgs maintainers and is probably
1018 # not used to link against by anyone, we can make it’s closure smaller and
1019 # add its runtime dependencies in `haskellPackages` (as opposed to cabal2nix).
1020 cabal2nix-unstable = overrideCabal
1022 buildTools = (drv.buildTools or []) ++ [
1023 pkgs.buildPackages.makeWrapper
1026 wrapProgram $out/bin/cabal2nix \
1027 --prefix PATH ":" "${
1028 pkgs.lib.makeBinPath [ pkgs.nix pkgs.nix-prefetch-scripts ]
1032 (justStaticExecutables super.cabal2nix-unstable);
1034 # test suite needs local redis daemon
1035 nri-redis = dontCheck super.nri-redis;
1037 # Make tophat find itself for _compiling_ its test suite
1038 tophat = overrideCabal (drv: {
1040 sed -i 's|"tophat"|"./dist/build/tophat/tophat"|' app-test-bin/*.hs
1041 '' + (drv.postPatch or "");
1044 # Runtime dependencies and CLI completion
1045 nvfetcher = self.generateOptparseApplicativeCompletions [ "nvfetcher" ] (overrideCabal
1047 # test needs network
1049 buildTools = drv.buildTools or [ ] ++ [ pkgs.buildPackages.makeWrapper ];
1050 postInstall = drv.postInstall or "" + ''
1051 wrapProgram "$out/bin/nvfetcher" --prefix 'PATH' ':' "${
1052 pkgs.lib.makeBinPath [
1054 pkgs.nix # nix-prefetch-url
1055 pkgs.nix-prefetch-git
1056 pkgs.nix-prefetch-docker
1060 }) super.nvfetcher);
1062 rel8 = pkgs.lib.pipe super.rel8 [
1063 (addTestToolDepend pkgs.postgresql)
1064 # https://github.com/NixOS/nixpkgs/issues/198495
1065 (overrideCabal { doCheck = pkgs.postgresql.doCheck; })
1068 # Wants running postgresql database accessible over ip, so postgresqlTestHook
1069 # won't work (or would need to patch test suite).
1070 domaindriven-core = dontCheck super.domaindriven-core;
1072 cachix-api = overrideCabal (drv: {
1074 src = pkgs.fetchFromGitHub {
1078 sha256 = "sha256-6S8EOs7bGTyY4eDXGuTbJMTlaz0n1JYIAPKIB2cVYxg=";
1080 postUnpack = "sourceRoot=$sourceRoot/cachix-api";
1082 sed -i 's/1.6/1.6.1/' cachix-api.cabal
1084 }) super.cachix-api;
1085 cachix = overrideCabal (drv: {
1087 src = pkgs.fetchFromGitHub {
1091 sha256 = "sha256-6S8EOs7bGTyY4eDXGuTbJMTlaz0n1JYIAPKIB2cVYxg=";
1093 postUnpack = "sourceRoot=$sourceRoot/cachix";
1095 sed -i 's/1.6/1.6.1/' cachix.cabal
1098 (super.cachix.override {
1099 hnix-store-core = self.hnix-store-core_0_6_1_0;
1100 nix = self.hercules-ci-cnix-store.nixPackage;
1103 (addBuildTool self.hercules-ci-cnix-store.nixPackage)
1104 (addBuildTool pkgs.pkg-config)
1105 (addBuildDepend self.immortal)
1109 hercules-ci-agent = super.hercules-ci-agent.override { nix = self.hercules-ci-cnix-store.passthru.nixPackage; };
1110 hercules-ci-cnix-expr = addTestToolDepend pkgs.git (super.hercules-ci-cnix-expr.override { nix = self.hercules-ci-cnix-store.passthru.nixPackage; });
1111 hercules-ci-cnix-store = overrideCabal
1113 passthru = old.passthru or { } // {
1114 nixPackage = pkgs.nixVersions.nix_2_16;
1117 (super.hercules-ci-cnix-store.override {
1118 nix = self.hercules-ci-cnix-store.passthru.nixPackage;
1121 # the testsuite fails because of not finding tsc without some help
1122 aeson-typescript = overrideCabal (drv: {
1123 testToolDepends = drv.testToolDepends or [] ++ [ pkgs.typescript ];
1124 # the testsuite assumes that tsc is in the PATH if it thinks it's in
1125 # CI, otherwise trying to install it.
1127 # https://github.com/codedownio/aeson-typescript/blob/ee1a87fcab8a548c69e46685ce91465a7462be89/test/Util.hs#L27-L33
1128 preCheck = "export CI=true";
1129 }) super.aeson-typescript;
1131 # Enable extra optimisations which increase build time, but also
1132 # later compiler performance, so we should do this for user's benefit.
1133 # Flag added in Agda 2.6.2
1134 Agda = appendConfigureFlag "-foptimise-heavily" super.Agda;
1136 # ats-format uses cli-setup in Setup.hs which is quite happy to write
1137 # to arbitrary files in $HOME. This doesn't either not achieve anything
1138 # or even fail, so we prevent it and install everything necessary ourselves.
1139 # See also: https://hackage.haskell.org/package/cli-setup-0.2.1.4/docs/src/Distribution.CommandLine.html#setManpathGeneric
1140 ats-format = self.generateOptparseApplicativeCompletions [ "atsfmt" ] (
1141 justStaticExecutables (
1142 overrideCabal (drv: {
1143 # use vanilla Setup.hs
1144 preCompileBuildDriver = ''
1145 cat > Setup.hs << EOF
1147 import Distribution.Simple
1150 '' + (drv.preCompileBuildDriver or "");
1153 pkgs.buildPackages.installShellFiles
1154 ] ++ (drv.buildTools or []);
1156 installManPage man/atsfmt.1
1157 '' + (drv.postInstall or "");
1162 # Test suite is just the default example executable which doesn't work if not
1163 # executed by Setup.hs, but works if started on a proper TTY
1164 isocline = dontCheck super.isocline;
1166 # Some hash implementations are x86 only, but part of the test suite.
1167 # So executing and building it on non-x86 platforms will always fail.
1168 hashes = overrideCabal {
1169 doCheck = with pkgs.stdenv; hostPlatform == buildPlatform
1170 && buildPlatform.isx86;
1173 # Tries to access network
1174 aws-sns-verify = dontCheck super.aws-sns-verify;
1176 # Test suite requires network access
1177 minicurl = dontCheck super.minicurl;
1179 # procex relies on close_range which has been introduced in Linux 5.9,
1180 # the test suite seems to force the use of this feature (or the fallback
1181 # mechanism is broken), so we can't run the test suite on machines with a
1182 # Kernel < 5.9. To check for this, we use uname -r to obtain the Kernel
1183 # version and sort -V to compare against our minimum version. If the
1184 # Kernel turns out to be older, we disable the test suite.
1185 procex = overrideCabal (drv: {
1188 higherVersion=`printf "%s\n%s\n" "$minimumKernel" "$(uname -r)" | sort -rV | head -n1`
1189 if [[ "$higherVersion" = "$minimumKernel" ]]; then
1190 echo "Used Kernel doesn't support close_range, disabling tests"
1193 '' + (drv.postConfigure or "");
1196 # Test suite wants to run main executable
1197 fourmolu = overrideCabal (drv: {
1198 preCheck = drv.preCheck or "" + ''
1199 export PATH="$PWD/dist/build/fourmolu:$PATH"
1203 # Test suite wants to run main executable
1204 fourmolu_0_10_1_0 = overrideCabal (drv: {
1205 preCheck = drv.preCheck or "" + ''
1206 export PATH="$PWD/dist/build/fourmolu:$PATH"
1208 }) super.fourmolu_0_10_1_0;
1210 # Test suite needs to execute 'disco' binary
1211 disco = overrideCabal (drv: {
1212 preCheck = drv.preCheck or "" + ''
1213 export PATH="$PWD/dist/build/disco:$PATH"
1215 testFlags = drv.testFlags or [] ++ [
1216 # Needs network access
1219 # disco-examples needs network access
1220 testTarget = "disco-tests";
1223 # Apply a patch which hardcodes the store path of graphviz instead of using
1224 # whatever graphviz is in PATH.
1225 graphviz = overrideCabal (drv: {
1227 (pkgs.substituteAll {
1228 src = ./patches/graphviz-hardcode-graphviz-store-path.patch;
1229 inherit (pkgs) graphviz;
1231 ] ++ (drv.patches or []);
1234 # Test suite requires AWS access which requires both a network
1235 # connection and payment.
1236 aws = dontCheck super.aws;
1238 # Test case tries to contact the network
1239 http-api-data-qq = overrideCabal (drv: {
1241 "-p" "!/Can be used with http-client/"
1242 ] ++ drv.testFlags or [];
1243 }) super.http-api-data-qq;
1245 # Additionally install documentation
1246 jacinda = overrideCabal (drv: {
1247 enableSeparateDocOutput = true;
1249 ${drv.postInstall or ""}
1251 docDir="$doc/share/doc/${drv.pname}-${drv.version}"
1253 # man page goes to $out, it's small enough and haskellPackages has no
1254 # support for a man output at the moment and $doc requires downloading
1256 install -Dm644 man/ja.1 -t "$out/share/man/man1"
1257 # language guide and examples
1258 install -Dm644 doc/guide.pdf -t "$docDir"
1259 install -Dm644 test/examples/*.jac -t "$docDir/examples"
1263 # Smoke test can't be executed in sandbox
1264 # https://github.com/georgefst/evdev/issues/25
1265 evdev = overrideCabal (drv: {
1266 testFlags = drv.testFlags or [] ++ [
1271 # Tests assume dist-newstyle build directory is present
1272 cabal-hoogle = dontCheck super.cabal-hoogle;
1274 nfc = lib.pipe super.nfc [
1275 enableSeparateBinOutput
1276 (addBuildDepend self.base16-bytestring)
1277 (appendConfigureFlag "-fbuild-examples")
1280 # Wants to execute cabal-install to (re-)build itself
1281 hint = dontCheck super.hint;
1283 # cabal-install switched to build type simple in 3.2.0.0
1284 # as a result, the cabal(1) man page is no longer installed
1285 # automatically. Instead we need to use the `cabal man`
1286 # command which generates the man page on the fly and
1287 # install it to $out/share/man/man1 ourselves in this
1289 # The commit that introduced this change:
1290 # https://github.com/haskell/cabal/commit/91ac075930c87712eeada4305727a4fa651726e7
1291 # Since cabal-install 3.8, the cabal man (without the raw) command
1292 # uses nroff(1) instead of man(1) for macOS/BSD compatibility. That utility
1293 # is not commonly installed on systems, so we add it to PATH. Closure size
1294 # penalty is about 10MB at the time of writing this (2022-08-20).
1295 cabal-install = overrideCabal (old: {
1296 executableToolDepends = [
1297 pkgs.buildPackages.makeWrapper
1298 ] ++ old.buildToolDepends or [];
1299 postInstall = old.postInstall + ''
1300 mkdir -p "$out/share/man/man1"
1301 "$out/bin/cabal" man --raw > "$out/share/man/man1/cabal.1"
1303 wrapProgram "$out/bin/cabal" \
1304 --prefix PATH : "${pkgs.lib.makeBinPath [ pkgs.groff ]}"
1306 hydraPlatforms = pkgs.lib.platforms.all;
1308 }) super.cabal-install;
1310 tailwind = addBuildDepend
1311 # Overrides for tailwindcss copied from:
1312 # https://github.com/EmaApps/emanote/blob/master/nix/tailwind.nix
1313 (pkgs.nodePackages.tailwindcss.overrideAttrs (oa: {
1315 pkgs.nodePackages."@tailwindcss/aspect-ratio"
1316 pkgs.nodePackages."@tailwindcss/forms"
1317 pkgs.nodePackages."@tailwindcss/line-clamp"
1318 pkgs.nodePackages."@tailwindcss/typography"
1322 emanote = addBuildDepend pkgs.stork super.emanote;
1324 keid-render-basic = addBuildTool pkgs.glslang super.keid-render-basic;
1326 # Disable checks to break dependency loop with SCalendar
1327 scalendar = dontCheck super.scalendar;
1329 halide-haskell = super.halide-haskell.override { Halide = pkgs.halide; };
1331 # Sydtest has a brittle test suite that will only work with the exact
1332 # versions that it ships with.
1333 sydtest = dontCheck super.sydtest;
1335 # Prevent argv limit being exceeded when invoking $CC.
1336 inherit (lib.mapAttrs (_: overrideCabal {
1337 __onlyPropagateKnownPkgConfigModules = true;
1340 webkit2gtk3-javascriptcore
1342 gi-webkit2webextension