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.
32 # All of the overrides in this set should look like:
34 # foo = ... something involving super.foo ...
36 # but that means that we add `foo` attribute even if there is no `super.foo`! So if
37 # you want to use this configuration for a package set that only contains a subset of
38 # the packages that have overrides defined here, you'll end up with a set that contains
39 # a bunch of attributes that trigger an evaluation error.
41 # To avoid this, we use `intersectAttrs` here so we never add packages that are not present
42 # in the parent package set (`super`).
43 self: super: builtins.intersectAttrs super {
45 # Apply NixOS-specific patches.
46 ghc-paths = appendPatch super.ghc-paths ./patches/ghc-paths-nix.patch;
48 # fix errors caused by hardening flags
49 epanet-haskell = disableHardening super.epanet-haskell ["format"];
51 # Link the proper version.
52 zeromq4-haskell = super.zeromq4-haskell.override { zeromq = pkgs.zeromq4; };
54 # Use the default version of mysql to build this package (which is actually mariadb).
55 # test phase requires networking
56 mysql = dontCheck (super.mysql.override { mysql = pkgs.libmysqlclient; });
58 # CUDA needs help finding the SDK headers and libraries.
59 cuda = overrideCabal super.cuda (drv: {
60 extraLibraries = (drv.extraLibraries or []) ++ [pkgs.linuxPackages.nvidia_x11];
61 configureFlags = (drv.configureFlags or []) ++ [
62 "--extra-lib-dirs=${pkgs.cudatoolkit.lib}/lib"
63 "--extra-include-dirs=${pkgs.cudatoolkit}/include"
66 export CUDA_PATH=${pkgs.cudatoolkit}
70 nvvm = overrideCabal super.nvvm (drv: {
72 export CUDA_PATH=${pkgs.cudatoolkit}
76 cufft = overrideCabal super.cufft (drv: {
78 export CUDA_PATH=${pkgs.cudatoolkit}
82 # jni needs help finding libjvm.so because it's in a weird location.
83 jni = overrideCabal super.jni (drv: {
85 local libdir=( "${pkgs.jdk}/lib/openjdk/jre/lib/"*"/server" )
86 configureFlags+=" --extra-lib-dir=''${libdir[0]}"
90 # The package doesn't know about the AL include hierarchy.
91 # https://github.com/phaazon/al/issues/1
92 al = appendConfigureFlag super.al "--extra-include-dirs=${pkgs.openal}/include/AL";
94 # Won't find it's header files without help.
95 sfml-audio = appendConfigureFlag super.sfml-audio "--extra-include-dirs=${pkgs.openal}/include/AL";
97 hercules-ci-agent = disableLibraryProfiling super.hercules-ci-agent;
99 # avoid compiling twice by providing executable as a separate output (with small closure size)
100 niv = enableSeparateBinOutput super.niv;
101 ormolu = enableSeparateBinOutput super.ormolu;
102 ghcid = enableSeparateBinOutput super.ghcid;
104 # Ensure the necessary frameworks for Darwin.
105 OpenAL = if pkgs.stdenv.isDarwin
106 then addExtraLibrary super.OpenAL pkgs.darwin.apple_sdk.frameworks.OpenAL
109 # Ensure the necessary frameworks for Darwin.
110 proteaaudio = if pkgs.stdenv.isDarwin
111 then addExtraLibrary super.proteaaudio pkgs.darwin.apple_sdk.frameworks.AudioToolbox
112 else super.proteaaudio;
115 hzk = overrideCabal super.hzk (drv: {
116 preConfigure = "sed -i -e /include-dirs/d hzk.cabal";
117 configureFlags = [ "--extra-include-dirs=${pkgs.zookeeper_mt}/include/zookeeper" ];
120 haskakafka = overrideCabal super.haskakafka (drv: {
121 preConfigure = "sed -i -e /extra-lib-dirs/d -e /include-dirs/d haskakafka.cabal";
122 configureFlags = [ "--extra-include-dirs=${pkgs.rdkafka}/include/librdkafka" ];
125 # library has hard coded directories that need to be removed. Reported upstream here https://github.com/haskell-works/hw-kafka-client/issues/32
126 hw-kafka-client = dontCheck (overrideCabal super.hw-kafka-client (drv: {
127 preConfigure = "sed -i -e /extra-lib-dirs/d -e /include-dirs/d -e /librdkafka/d hw-kafka-client.cabal";
128 configureFlags = [ "--extra-include-dirs=${pkgs.rdkafka}/include/librdkafka" ];
131 # Foreign dependency name clashes with another Haskell package.
132 libarchive-conduit = super.libarchive-conduit.override { archive = pkgs.libarchive; };
135 halive = if pkgs.stdenv.isDarwin
136 then addBuildDepend super.halive pkgs.darwin.apple_sdk.frameworks.AppKit
139 # Heist's test suite requires system pandoc
140 heist = overrideCabal super.heist (drv: {
141 testToolDepends = [pkgs.pandoc];
144 # the system-fileio tests use canonicalizePath, which fails in the sandbox
145 system-fileio = if pkgs.stdenv.isDarwin then dontCheck super.system-fileio else super.system-fileio;
147 # Prevents needing to add `security_tool` as a run-time dependency for
148 # everything using x509-system to give access to the `security` executable.
150 if pkgs.stdenv.hostPlatform.isDarwin && !pkgs.stdenv.cc.nativeLibc
152 # darwin.security_tool is broken in Mojave (#45042)
154 # We will use the system provided security for now.
155 # Beware this WILL break in sandboxes!
157 # TODO(matthewbauer): If someone really needs this to work in sandboxes,
158 # I think we can add a propagatedImpureHost dep here, but I’m hoping to
159 # get a proper fix available soonish.
160 overrideCabal super.x509-system (drv: {
161 postPatch = (drv.postPatch or "") + ''
162 substituteInPlace System/X509/MacOS.hs --replace security /usr/bin/security
165 else super.x509-system;
167 # https://github.com/NixOS/cabal2nix/issues/136 and https://github.com/NixOS/cabal2nix/issues/216
168 gio = disableHardening (addPkgconfigDepend (addBuildTool super.gio self.buildHaskellPackages.gtk2hs-buildtools) pkgs.glib) ["fortify"];
169 glib = disableHardening (addPkgconfigDepend (addBuildTool super.glib self.buildHaskellPackages.gtk2hs-buildtools) pkgs.glib) ["fortify"];
170 gtk3 = disableHardening (super.gtk3.override { inherit (pkgs) gtk3; }) ["fortify"];
171 gtk = let gtk1 = addBuildTool super.gtk self.buildHaskellPackages.gtk2hs-buildtools;
172 gtk2 = addPkgconfigDepend gtk1 pkgs.gtk2;
173 gtk3 = disableHardening gtk1 ["fortify"];
174 gtk4 = if pkgs.stdenv.isDarwin then appendConfigureFlag gtk3 "-fhave-quartz-gtk" else gtk4;
176 gtksourceview2 = addPkgconfigDepend super.gtksourceview2 pkgs.gtk2;
177 gtk-traymanager = addPkgconfigDepend super.gtk-traymanager pkgs.gtk3;
179 # Add necessary reference to gtk3 package
180 gi-dbusmenugtk3 = addPkgconfigDepend super.gi-dbusmenugtk3 pkgs.gtk3;
182 # Need WebkitGTK, not just webkit.
183 webkit = super.webkit.override { webkit = pkgs.webkitgtk24x-gtk2; };
184 websnap = super.websnap.override { webkit = pkgs.webkitgtk24x-gtk3; };
186 hs-mesos = overrideCabal super.hs-mesos (drv: {
187 # Pass _only_ mesos; the correct protobuf is propagated.
188 extraLibraries = [ pkgs.mesos ];
189 preConfigure = "sed -i -e /extra-lib-dirs/d -e 's|, /usr/include, /usr/local/include/mesos||' hs-mesos.cabal";
192 # These packages try to access the network.
193 amqp = dontCheck super.amqp;
194 amqp-conduit = dontCheck super.amqp-conduit;
195 bitcoin-api = dontCheck super.bitcoin-api;
196 bitcoin-api-extra = dontCheck super.bitcoin-api-extra;
197 bitx-bitcoin = dontCheck super.bitx-bitcoin; # http://hydra.cryp.to/build/926187/log/raw
198 concurrent-dns-cache = dontCheck super.concurrent-dns-cache;
199 digitalocean-kzs = dontCheck super.digitalocean-kzs; # https://github.com/KazumaSATO/digitalocean-kzs/issues/1
200 github-types = dontCheck super.github-types; # http://hydra.cryp.to/build/1114046/nixlog/1/raw
201 hadoop-rpc = dontCheck super.hadoop-rpc; # http://hydra.cryp.to/build/527461/nixlog/2/raw
202 hasql = dontCheck super.hasql; # http://hydra.cryp.to/build/502489/nixlog/4/raw
203 hasql-transaction = dontCheck super.hasql-transaction; # wants to connect to postgresql
204 hjsonschema = overrideCabal super.hjsonschema (drv: { testTarget = "local"; });
205 marmalade-upload = dontCheck super.marmalade-upload; # http://hydra.cryp.to/build/501904/nixlog/1/raw
206 mongoDB = dontCheck super.mongoDB;
207 network-transport-tcp = dontCheck super.network-transport-tcp;
208 network-transport-zeromq = dontCheck super.network-transport-zeromq; # https://github.com/tweag/network-transport-zeromq/issues/30
209 pipes-mongodb = dontCheck super.pipes-mongodb; # http://hydra.cryp.to/build/926195/log/raw
210 pixiv = dontCheck super.pixiv;
211 raven-haskell = dontCheck super.raven-haskell; # http://hydra.cryp.to/build/502053/log/raw
212 riak = dontCheck super.riak; # http://hydra.cryp.to/build/498763/log/raw
213 scotty-binding-play = dontCheck super.scotty-binding-play;
214 servant-router = dontCheck super.servant-router;
215 serversession-backend-redis = dontCheck super.serversession-backend-redis;
216 slack-api = dontCheck super.slack-api; # https://github.com/mpickering/slack-api/issues/5
217 socket = dontCheck super.socket;
218 stackage = dontCheck super.stackage; # http://hydra.cryp.to/build/501867/nixlog/1/raw
219 textocat-api = dontCheck super.textocat-api; # http://hydra.cryp.to/build/887011/log/raw
220 warp = dontCheck super.warp; # http://hydra.cryp.to/build/501073/nixlog/5/raw
221 wreq = dontCheck super.wreq; # http://hydra.cryp.to/build/501895/nixlog/1/raw
222 wreq-sb = dontCheck super.wreq-sb; # http://hydra.cryp.to/build/783948/log/raw
223 wuss = dontCheck super.wuss; # http://hydra.cryp.to/build/875964/nixlog/2/raw
224 download = dontCheck super.download;
225 http-client = dontCheck super.http-client;
226 http-client-openssl = dontCheck super.http-client-openssl;
227 http-client-tls = dontCheck super.http-client-tls;
228 http-conduit = dontCheck super.http-conduit;
229 transient-universe = dontCheck super.transient-universe;
230 telegraph = dontCheck super.telegraph;
231 typed-process = dontCheck super.typed-process;
232 js-jquery = dontCheck super.js-jquery;
233 hPDB-examples = dontCheck super.hPDB-examples;
234 configuration-tools = dontCheck super.configuration-tools; # https://github.com/alephcloud/hs-configuration-tools/issues/40
235 tcp-streams = dontCheck super.tcp-streams;
236 holy-project = dontCheck super.holy-project;
237 mustache = dontCheck super.mustache;
239 # Tries to mess with extended POSIX attributes, but can't in our chroot environment.
240 xattr = dontCheck super.xattr;
242 # Needs access to locale data, but looks for it in the wrong place.
243 scholdoc-citeproc = dontCheck super.scholdoc-citeproc;
245 # Disable tests because they require a mattermost server
246 mattermost-api = dontCheck super.mattermost-api;
248 # Expect to find sendmail(1) in $PATH.
249 mime-mail = appendConfigureFlag super.mime-mail "--ghc-option=-DMIME_MAIL_SENDMAIL_PATH=\"sendmail\"";
251 # Help the test suite find system timezone data.
252 tz = overrideCabal super.tz (drv: { preConfigure = "export TZDIR=${pkgs.tzdata}/share/zoneinfo"; });
254 # Nix-specific workaround
255 xmonad = appendPatch (dontCheck super.xmonad) ./patches/xmonad-nix.patch;
257 # wxc supports wxGTX >= 3.0, but our current default version points to 2.8.
258 # http://hydra.cryp.to/build/1331287/log/raw
259 wxc = (addBuildDepend super.wxc self.split).override { wxGTK = pkgs.wxGTK30; };
260 wxcore = super.wxcore.override { wxGTK = pkgs.wxGTK30; };
262 # Test suite wants to connect to $DISPLAY.
263 hsqml = dontCheck (addExtraLibraries (super.hsqml.override { qt5 = pkgs.qt5Full; }) [pkgs.libGLU pkgs.libGL]);
265 # Tests attempt to use NPM to install from the network into
266 # /homeless-shelter. Disabled.
267 purescript = dontCheck super.purescript;
269 # https://github.com/haskell-foundation/foundation/pull/412
271 if pkgs.stdenv.isDarwin
272 then dontCheck super.foundation
273 else super.foundation;
275 # Hardcoded include path
276 poppler = overrideCabal super.poppler (drv: {
278 sed -i -e 's,glib/poppler.h,poppler.h,' poppler.cabal
279 sed -i -e 's,glib/poppler.h,poppler.h,' Graphics/UI/Gtk/Poppler/Structs.hsc
283 # Uses OpenGL in testing
284 caramia = dontCheck super.caramia;
287 let llvmHsWithLlvm9 = super.llvm-hs.override { llvm-config = pkgs.llvm_9; };
289 if pkgs.stdenv.isDarwin
291 overrideCabal llvmHsWithLlvm9 (oldAttrs: {
292 # One test fails on darwin.
294 # llvm-hs's Setup.hs file tries to add the lib/ directory from LLVM8 to
295 # the DYLD_LIBRARY_PATH environment variable. This messes up clang
296 # when called from GHC, probably because clang is version 7, but we are
298 preCompileBuildDriver = oldAttrs.preCompileBuildDriver or "" + ''
299 substituteInPlace Setup.hs --replace "addToLdLibraryPath libDir" "pure ()"
302 else llvmHsWithLlvm9;
304 # Needs help finding LLVM.
305 spaceprobe = addBuildTool super.spaceprobe self.llvmPackages.llvm;
307 # Tries to run GUI in tests
308 leksah = dontCheck (overrideCabal super.leksah (drv: {
309 executableSystemDepends = (drv.executableSystemDepends or []) ++ (with pkgs; [
310 gnome3.adwaita-icon-theme # Fix error: Icon 'window-close' not present in theme ...
311 wrapGAppsHook # Fix error: GLib-GIO-ERROR **: No GSettings schemas are installed on the system
312 gtk3 # Fix error: GLib-GIO-ERROR **: Settings schema 'org.gtk.Settings.FileChooser' is not installed
314 postPatch = (drv.postPatch or "") + ''
315 for f in src/IDE/Leksah.hs src/IDE/Utils/ServerConnection.hs
317 substituteInPlace "$f" --replace "\"leksah-server\"" "\"${self.leksah-server}/bin/leksah-server\""
322 # Patch to consider NIX_GHC just like xmonad does
323 dyre = appendPatch super.dyre ./patches/dyre-nix.patch;
325 yesod-bin = if pkgs.stdenv.isDarwin
326 then addBuildDepend super.yesod-bin pkgs.darwin.apple_sdk.frameworks.Cocoa
327 else super.yesod-bin;
329 hmatrix = if pkgs.stdenv.isDarwin
330 then addBuildDepend super.hmatrix pkgs.darwin.apple_sdk.frameworks.Accelerate
333 # https://github.com/edwinb/EpiVM/issues/13
334 # https://github.com/edwinb/EpiVM/issues/14
335 epic = addExtraLibraries (addBuildTool super.epic self.buildHaskellPackages.happy) [pkgs.boehmgc pkgs.gmp];
337 # https://github.com/ekmett/wl-pprint-terminfo/issues/7
338 wl-pprint-terminfo = addExtraLibrary super.wl-pprint-terminfo pkgs.ncurses;
340 # https://github.com/bos/pcap/issues/5
341 pcap = addExtraLibrary super.pcap pkgs.libpcap;
343 # https://github.com/NixOS/nixpkgs/issues/53336
344 greenclip = addExtraLibrary super.greenclip pkgs.xorg.libXdmcp;
346 # The cabal files for these libraries do not list the required system dependencies.
347 miniball = overrideCabal super.miniball (drv: {
348 librarySystemDepends = [ pkgs.miniball ];
350 SDL-image = overrideCabal super.SDL-image (drv: {
351 librarySystemDepends = [ pkgs.SDL pkgs.SDL_image ] ++ drv.librarySystemDepends or [];
353 SDL-ttf = overrideCabal super.SDL-ttf (drv: {
354 librarySystemDepends = [ pkgs.SDL pkgs.SDL_ttf ];
356 SDL-mixer = overrideCabal super.SDL-mixer (drv: {
357 librarySystemDepends = [ pkgs.SDL pkgs.SDL_mixer ];
359 SDL-gfx = overrideCabal super.SDL-gfx (drv: {
360 librarySystemDepends = [ pkgs.SDL pkgs.SDL_gfx ];
362 SDL-mpeg = overrideCabal super.SDL-mpeg (drv: {
363 configureFlags = (drv.configureFlags or []) ++ [
364 "--extra-lib-dirs=${pkgs.smpeg}/lib"
365 "--extra-include-dirs=${pkgs.smpeg}/include/smpeg"
369 # https://github.com/ivanperez-keera/hcwiid/pull/4
370 hcwiid = overrideCabal super.hcwiid (drv: {
371 configureFlags = (drv.configureFlags or []) ++ [
372 "--extra-lib-dirs=${pkgs.bluez.out}/lib"
373 "--extra-lib-dirs=${pkgs.cwiid}/lib"
374 "--extra-include-dirs=${pkgs.cwiid}/include"
375 "--extra-include-dirs=${pkgs.bluez.dev}/include"
377 prePatch = '' sed -i -e "/Extra-Lib-Dirs/d" -e "/Include-Dirs/d" "hcwiid.cabal" '';
380 # cabal2nix doesn't pick up some of the dependencies.
382 g = addBuildDepend super.ginsu pkgs.perl;
383 g' = overrideCabal g (drv: {
384 executableSystemDepends = (drv.executableSystemDepends or []) ++ [
390 # Tests require `docker` command in PATH
391 # Tests require running docker service :on localhost
392 docker = dontCheck super.docker;
394 # https://github.com/deech/fltkhs/issues/16
395 fltkhs = overrideCabal super.fltkhs (drv: {
396 libraryToolDepends = (drv.libraryToolDepends or []) ++ [pkgs.autoconf];
397 librarySystemDepends = (drv.librarySystemDepends or []) ++ [pkgs.fltk13 pkgs.libGL pkgs.libjpeg];
400 # https://github.com/skogsbaer/hscurses/pull/26
401 hscurses = overrideCabal super.hscurses (drv: {
402 librarySystemDepends = (drv.librarySystemDepends or []) ++ [ pkgs.ncurses ];
405 # Looks like Avahi provides the missing library
406 dnssd = super.dnssd.override { dns_sd = pkgs.avahi.override { withLibdnssdCompat = true; }; };
408 # Ensure the necessary frameworks are propagatedBuildInputs on darwin
409 OpenGLRaw = overrideCabal super.OpenGLRaw (drv: {
410 librarySystemDepends =
411 pkgs.lib.optionals (!pkgs.stdenv.isDarwin) drv.librarySystemDepends;
412 libraryHaskellDepends = drv.libraryHaskellDepends
413 ++ pkgs.lib.optionals pkgs.stdenv.isDarwin
414 [ pkgs.darwin.apple_sdk.frameworks.OpenGL ];
415 preConfigure = pkgs.lib.optionalString pkgs.stdenv.isDarwin ''
416 frameworkPaths=($(for i in $nativeBuildInputs; do if [ -d "$i"/Library/Frameworks ]; then echo "-F$i/Library/Frameworks"; fi done))
417 frameworkPaths=$(IFS=, ; echo "''${frameworkPaths[@]}")
418 configureFlags+=$(if [ -n "$frameworkPaths" ]; then echo -n "--ghc-options=-optl=$frameworkPaths"; fi)
421 GLURaw = overrideCabal super.GLURaw (drv: {
422 librarySystemDepends =
423 pkgs.lib.optionals (!pkgs.stdenv.isDarwin) drv.librarySystemDepends;
424 libraryHaskellDepends = drv.libraryHaskellDepends
425 ++ pkgs.lib.optionals pkgs.stdenv.isDarwin
426 [ pkgs.darwin.apple_sdk.frameworks.OpenGL ];
428 bindings-GLFW = overrideCabal super.bindings-GLFW (drv: {
429 doCheck = false; # requires an active X11 display
430 librarySystemDepends =
431 pkgs.lib.optionals (!pkgs.stdenv.isDarwin) drv.librarySystemDepends;
432 libraryHaskellDepends = drv.libraryHaskellDepends
433 ++ pkgs.lib.optionals pkgs.stdenv.isDarwin
434 (with pkgs.darwin.apple_sdk.frameworks;
435 [ AGL Cocoa OpenGL IOKit Kernel CoreVideo
438 OpenCL = overrideCabal super.OpenCL (drv: {
439 librarySystemDepends =
440 pkgs.lib.optionals (!pkgs.stdenv.isDarwin) drv.librarySystemDepends;
441 libraryHaskellDepends = drv.libraryHaskellDepends
442 ++ pkgs.lib.optionals pkgs.stdenv.isDarwin
443 [ pkgs.darwin.apple_sdk.frameworks.OpenCL ];
446 # requires an X11 display in test suite
447 gi-gtk-declarative = dontCheck super.gi-gtk-declarative;
448 gi-gtk-declarative-app-simple = dontCheck super.gi-gtk-declarative-app-simple;
450 # tests depend on executable
451 ghcide = overrideCabal super.ghcide (drv: {
452 preCheck = ''export PATH="$PWD/dist/build/ghcide:$PATH"'';
455 # GLUT uses `dlopen` to link to freeglut, so we need to set the RUNPATH correctly for
456 # it to find `libglut.so` from the nix store. We do this by patching GLUT.cabal to pkg-config
457 # depend on freeglut, which provides GHC to necessary information to generate a correct RPATH.
459 # Note: Simply patching the dynamic library (.so) of the GLUT build will *not* work, since the
460 # RPATH also needs to be propagated when using static linking. GHC automatically handles this for
461 # us when we patch the cabal file (Link options will be recored in the ghc package registry).
463 # Additional note: nixpkgs' freeglut and macOS's OpenGL implementation do not cooperate,
464 # so disable this on Darwin only
465 ${if pkgs.stdenv.isDarwin then null else "GLUT"} = addPkgconfigDepend (appendPatch super.GLUT ./patches/GLUT.patch) pkgs.freeglut;
467 libsystemd-journal = overrideCabal super.libsystemd-journal (old: {
468 librarySystemDepends = old.librarySystemDepends or [] ++ [ pkgs.systemd ];
471 # does not specify tests in cabal file, instead has custom runTest cabal hook,
472 # so cabal2nix will not detect test dependencies.
473 either-unwrap = overrideCabal super.either-unwrap (drv: {
474 testHaskellDepends = (drv.testHaskellDepends or []) ++ [ self.test-framework self.test-framework-hunit ];
477 # cabal2nix likes to generate dependencies on hinotify when hfsevents is really required
478 # on darwin: https://github.com/NixOS/cabal2nix/issues/146.
479 hinotify = if pkgs.stdenv.isDarwin then self.hfsevents else super.hinotify;
481 # FSEvents API is very buggy and tests are unreliable. See
482 # http://openradar.appspot.com/10207999 and similar issues.
483 # https://github.com/haskell-fswatch/hfsnotify/issues/62
484 fsnotify = if pkgs.stdenv.isDarwin
485 then addBuildDepend (dontCheck super.fsnotify) pkgs.darwin.apple_sdk.frameworks.Cocoa
486 else dontCheck super.fsnotify;
488 hidapi = addExtraLibrary super.hidapi pkgs.udev;
490 hs-GeoIP = super.hs-GeoIP.override { GeoIP = pkgs.geoipWithDatabase; };
492 discount = super.discount.override { markdown = pkgs.discount; };
494 # tests require working stack installation with all-cabal-hashes cloned in $HOME
495 stackage-curator = dontCheck super.stackage-curator;
497 # hardcodes /usr/bin/tr: https://github.com/snapframework/io-streams/pull/59
498 io-streams = enableCabalFlag super.io-streams "NoInteractiveTests";
500 # requires autotools to build
501 secp256k1 = addBuildTools super.secp256k1 [ pkgs.buildPackages.autoconf pkgs.buildPackages.automake pkgs.buildPackages.libtool ];
503 # requires libsecp256k1 in pkg-config-depends
504 secp256k1-haskell = addPkgconfigDepend super.secp256k1-haskell pkgs.secp256k1;
506 # tests require git and zsh
507 hapistrano = addBuildTools super.hapistrano [ pkgs.buildPackages.git pkgs.buildPackages.zsh ];
509 # This propagates this to everything depending on haskell-gi-base
510 haskell-gi-base = addBuildDepend super.haskell-gi-base pkgs.gobject-introspection;
512 # requires valid, writeable $HOME
513 hatex-guide = overrideCabal super.hatex-guide (drv: {
515 ${drv.preConfigure or ""}
520 # https://github.com/plow-technologies/servant-streaming/issues/12
521 servant-streaming-server = dontCheck super.servant-streaming-server;
523 # https://github.com/haskell-servant/servant/pull/1238
524 servant-client-core = if (pkgs.lib.getVersion super.servant-client-core) == "0.16" then
525 appendPatch super.servant-client-core ./patches/servant-client-core-redact-auth-header.patch
527 super.servant-client-core;
530 # tests run executable, relying on PATH
531 # without this, tests fail with "Couldn't launch intero process"
532 intero = overrideCabal super.intero (drv: {
534 export PATH="$PWD/dist/build/intero:$PATH"
538 # Break infinite recursion cycle with criterion and network-uri.
539 js-flot = dontCheck super.js-flot;
541 # Break infinite recursion cycle between QuickCheck and splitmix.
542 splitmix = dontCheck super.splitmix;
544 # Break infinite recursion cycle between tasty and clock.
545 clock = dontCheck super.clock;
547 # Break infinite recursion cycle between devtools and mprelude.
548 devtools = super.devtools.override { mprelude = dontCheck super.mprelude; };
550 # Break dependency cycle between tasty-hedgehog and tasty-expected-failure
551 tasty-hedgehog = dontCheck super.tasty-hedgehog;
553 # Break dependency cycle between hedgehog, tasty-hedgehog and lifted-async
554 lifted-async = dontCheck super.lifted-async;
556 # loc and loc-test depend on each other for testing. Break that infinite cycle:
557 loc-test = super.loc-test.override { loc = dontCheck self.loc; };
559 # The test suites try to run the "fixpoint" and "liquid" executables built just
560 # before and fail because the library search paths aren't configured properly.
561 # Also needs https://github.com/ucsd-progsys/liquidhaskell/issues/1038 resolved.
562 liquid-fixpoint = disableSharedExecutables super.liquid-fixpoint;
563 liquidhaskell = dontCheck (disableSharedExecutables super.liquidhaskell);
565 # Without this override, the builds lacks pkg-config.
566 opencv-extra = addPkgconfigDepend super.opencv-extra pkgs.opencv3;
568 # Break cyclic reference that results in an infinite recursion.
569 partial-semigroup = dontCheck super.partial-semigroup;
570 colour = dontCheck super.colour;
571 spatial-rotations = dontCheck super.spatial-rotations;
573 LDAP = dontCheck (overrideCabal super.LDAP (drv: {
574 librarySystemDepends = drv.librarySystemDepends or [] ++ [ pkgs.cyrus_sasl.dev ];
577 # Expects z3 to be on path so we replace it with a hard
579 # The tests expect additional solvers on the path, replace the
580 # available ones also with hard coded paths, and remove the missing
581 # ones from the test.
582 sbv = overrideCabal super.sbv (drv: {
584 sed -i -e 's|"abc"|"${pkgs.abc-verifier}/bin/abc"|' Data/SBV/Provers/ABC.hs
585 sed -i -e 's|"boolector"|"${pkgs.boolector}/bin/boolector"|' Data/SBV/Provers/Boolector.hs
586 sed -i -e 's|"cvc4"|"${pkgs.cvc4}/bin/cvc4"|' Data/SBV/Provers/CVC4.hs
587 sed -i -e 's|"yices-smt2"|"${pkgs.yices}/bin/yices-smt2"|' Data/SBV/Provers/Yices.hs
588 sed -i -e 's|"z3"|"${pkgs.z3}/bin/z3"|' Data/SBV/Provers/Z3.hs
590 sed -i -e 's|\[abc, boolector, cvc4, mathSAT, yices, z3, dReal\]|[abc, boolector, cvc4, yices, z3]|' SBVTestSuite/SBVConnectionTest.hs
594 # The test-suite requires a running PostgreSQL server.
595 Frames-beam = dontCheck super.Frames-beam;
597 # Compile manpages (which are in RST and are compiled with Sphinx).
599 overrideCabal (addBuildTools super.futhark [makeWrapper python37Packages.sphinx])
601 postBuild = (_drv.postBuild or "") + ''
605 postInstall = (_drv.postInstall or "") + ''
606 mkdir -p $out/share/man/man1
607 mv docs/_build/man/*.1 $out/share/man/man1/
611 git-annex = with pkgs;
612 if (!stdenv.isLinux) then
613 let path = lib.makeBinPath [ coreutils ];
614 in overrideCabal (addBuildTool super.git-annex makeWrapper) (_drv: {
615 # This is an instance of https://github.com/NixOS/nix/pull/1085
617 # gpg: can't connect to the agent: File name too long
618 postPatch = lib.optionalString stdenv.isDarwin ''
619 substituteInPlace Test.hs \
620 --replace ', testCase "crypto" test_crypto' ""
622 # On Darwin, git-annex mis-detects options to `cp`, so we wrap the
623 # binary to ensure it uses Nixpkgs' coreutils.
625 wrapProgram $out/bin/git-annex \
626 --prefix PATH : "${path}"
629 else super.git-annex;
631 # The test suite has undeclared dependencies on git.
632 githash = dontCheck super.githash;
634 # Avoid infitite recursion with yaya.
635 yaya-hedgehog = super.yaya-hedgehog.override { yaya = dontCheck self.yaya; };
637 # Avoid infitite recursion with tonatona.
638 tonaparser = dontCheck super.tonaparser;
640 # Needs internet to run tests
641 HTTP = dontCheck super.HTTP;
643 # Break infinite recursions.
644 Dust-crypto = dontCheck super.Dust-crypto;
645 nanospec = dontCheck super.nanospec;
646 options = dontCheck super.options;
647 snap-server = dontCheck super.snap-server;
649 # Tests require internet
650 http-download = dontCheck super.http-download;
651 pantry = dontCheck super.pantry;
653 # gtk2hs-buildtools is listed in setupHaskellDepends, but we
654 # need it during the build itself, too.
655 cairo = addBuildTool super.cairo self.buildHaskellPackages.gtk2hs-buildtools;
656 pango = disableHardening (addBuildTool super.pango self.buildHaskellPackages.gtk2hs-buildtools) ["fortify"];
660 # spago requires an older version of megaparsec, but it appears to work
661 # fine with newer versions.
662 spagoWithOverrides = doJailbreak super.spago;
664 # This defines the version of the purescript-docs-search release we are using.
665 # This is defined in the src/Spago/Prelude.hs file in the spago source.
666 docsSearchVersion = "v0.0.10";
668 docsSearchAppJsFile = pkgs.fetchurl {
669 url = "https://github.com/spacchetti/purescript-docs-search/releases/download/${docsSearchVersion}/docs-search-app.js";
670 sha256 = "0m5ah29x290r0zk19hx2wix2djy7bs4plh9kvjz6bs9r45x25pa5";
673 purescriptDocsSearchFile = pkgs.fetchurl {
674 url = "https://github.com/spacchetti/purescript-docs-search/releases/download/${docsSearchVersion}/purescript-docs-search";
675 sha256 = "0wc1zyhli4m2yykc6i0crm048gyizxh7b81n8xc4yb7ibjqwhyj3";
678 spagoFixHpack = overrideCabal spagoWithOverrides (drv: {
679 postUnpack = (drv.postUnpack or "") + ''
680 # The source for spago is pulled directly from GitHub. It uses a
681 # package.yaml file with hpack, not a .cabal file. In the package.yaml file,
682 # it uses defaults from the master branch of the hspec repo. It will try to
683 # fetch these at build-time (but it will fail if running in the sandbox).
685 # The following line modifies the package.yaml to not pull in
686 # defaults from the hspec repo.
687 substituteInPlace "$sourceRoot/package.yaml" --replace 'defaults: hspec/hspec@master' ""
689 # Spago includes the following two files directly into the binary
690 # with Template Haskell. They are fetched at build-time from the
691 # `purescript-docs-search` repo above. If they cannot be fetched at
692 # build-time, they are pulled in from the `templates/` directory in
695 # However, they are not actually available in the spago source, so they
696 # need to fetched with nix and put in the correct place.
697 # https://github.com/spacchetti/spago/issues/510
698 cp ${docsSearchAppJsFile} "$sourceRoot/templates/docs-search-app.js"
699 cp ${purescriptDocsSearchFile} "$sourceRoot/templates/purescript-docs-search"
701 # For some weird reason, on Darwin, the open(2) call to embed these files
702 # requires write permissions. The easiest resolution is just to permit that
703 # (doesn't cause any harm on other systems).
704 chmod u+w "$sourceRoot/templates/docs-search-app.js" "$sourceRoot/templates/purescript-docs-search"
708 # Because of the problem above with pulling in hspec defaults to the
709 # package.yaml file, the tests are disabled.
710 spagoWithoutChecks = dontCheck spagoFixHpack;
714 # checks SQL statements at compile time, and so requires a running PostgreSQL
715 # database to run it's test suite
716 postgresql-typed = dontCheck super.postgresql-typed;
718 # mplayer-spot uses mplayer at runtime.
720 let path = pkgs.lib.makeBinPath [ pkgs.mplayer ];
721 in overrideCabal (addBuildTool super.mplayer-spot pkgs.makeWrapper) (oldAttrs: {
723 wrapProgram $out/bin/mplayer-spot --prefix PATH : "${path}"
727 # break infinite recursion with base-orphans
728 primitive = dontCheck super.primitive;
729 primitive_0_7_1_0 = dontCheck super.primitive_0_7_1_0;
732 let path = pkgs.lib.makeBinPath [ pkgs.ffmpeg_3 pkgs.youtube-dl ];
733 in overrideCabal (addBuildTool super.cut-the-crap pkgs.makeWrapper) (_drv: {
735 wrapProgram $out/bin/cut-the-crap \
736 --prefix PATH : "${path}"
740 # Tests access homeless-shelter.
741 hie-bios = dontCheck super.hie-bios;
742 hie-bios_0_5_0 = dontCheck super.hie-bios_0_5_0;
744 # Compiling the readme throws errors and has no purpose in nixpkgs
746 disableCabalFlag (doJailbreak (super.aeson-gadt-th)) "build-readme";
748 neuron = overrideCabal (super.neuron) (drv: {
749 # neuron expects the neuron-search script to be in PATH at built-time.
750 buildTools = [ pkgs.makeWrapper ];
753 cp src-bash/neuron-search $out/bin/neuron-search
754 chmod +x $out/bin/neuron-search
755 wrapProgram $out/bin/neuron-search --prefix 'PATH' ':' ${
757 lib.makeBinPath [ fzf ripgrep gawk bat findutils envsubst ]
763 # Fix compilation of Setup.hs by removing the module declaration.
764 # See: https://github.com/tippenein/guid/issues/1
765 guid = overrideCabal (super.guid) (drv: {
766 prePatch = "sed -i '1d' Setup.hs"; # 1st line is module declaration, remove it
770 # Tests disabled as recommended at https://github.com/luke-clifton/shh/issues/39
771 shh = dontCheck super.shh;
773 # The test suites fail because there's no PostgreSQL database running in our
775 hasql-queue = dontCheck super.hasql-queue;
776 postgresql-libpq-notify = dontCheck super.postgresql-libpq-notify;
777 postgresql-pure = dontCheck super.postgresql-pure;
779 retrie = overrideCabal super.retrie (drv: {
780 testToolDepends = [ pkgs.git pkgs.mercurial ];
783 nix-output-monitor = overrideCabal super.nix-output-monitor {
784 # Can't ran the golden-tests with nix, because they call nix
785 testTarget = "unit-tests";
788 haskell-language-server = enableCabalFlag (enableCabalFlag (overrideCabal super.haskell-language-server (drv: {
790 inherit (pkgs.lib) concatStringsSep take splitString;
791 ghc_version = self.ghc.version;
792 ghc_major_version = concatStringsSep "." (take 2 (splitString "." ghc_version));
794 ln -s $out/bin/haskell-language-server $out/bin/haskell-language-server-${ghc_version}
795 ln -s $out/bin/haskell-language-server $out/bin/haskell-language-server-${ghc_major_version}
797 testToolDepends = [ self.cabal-install pkgs.git ];
798 testTarget = "func-test"; # wrapper test accesses internet
800 export PATH=$PATH:$PWD/dist/build/haskell-language-server:$PWD/dist/build/haskell-language-server-wrapper
803 })) "all-plugins") "all-formatters";
805 # tests depend on a specific version of solc
806 hevm = dontCheck (doJailbreak super.hevm);
808 # hadolint enables static linking by default in the cabal file, so we have to explicitly disable it.
809 # https://github.com/hadolint/hadolint/commit/e1305042c62d52c2af4d77cdce5d62f6a0a3ce7b
810 hadolint = disableCabalFlag super.hadolint "static";
812 # Test suite tries to execute the build product "doctest-driver-gen", but it's not in $PATH.
813 doctest-driver-gen = dontCheck super.doctest-driver-gen;
815 # Tests access internet
816 prune-juice = dontCheck super.prune-juice;