1{ haskell
2, lib
3
4# The following are only needed for the passthru.tests:
5, cacert
6, git
7, nodejs
8, purescript
9, runCommand
10}:
11
12let
13 spago =
14 lib.pipe
15 haskell.packages.ghc90.spago
16 [ haskell.lib.compose.justStaticExecutables
17 (haskell.lib.compose.overrideCabal (oldAttrs: {
18 maintainers = (oldAttrs.maintainers or []) ++ [ lib.maintainers.cdepillabout ];
19 changelog = "https://github.com/purescript/spago/releases/tag/${oldAttrs.version}";
20 }))
21 haskell.lib.compose.unmarkBroken
22 haskell.lib.compose.doDistribute
23 ];
24in
25
26spago.overrideAttrs (oldAttrs: {
27 passthru = (oldAttrs.passthru or {}) // {
28 updateScript = ./update.sh;
29
30 # These tests can be run with the following command. The tests access the
31 # network, so they cannot be run in the nix sandbox. sudo is needed in
32 # order to change the sandbox option.
33 #
34 # $ sudo nix-build -A spago.passthru.tests --option sandbox relaxed
35 #
36 tests =
37 runCommand
38 "spago-tests"
39 {
40 __noChroot = true;
41 nativeBuildInputs = [
42 cacert
43 git
44 nodejs
45 purescript
46 spago
47 ];
48 }
49 ''
50 # spago expects HOME to be set because it creates a cache file under
51 # home.
52 HOME=$(pwd)
53
54 spago --verbose init
55 spago --verbose build
56 spago --verbose test
57
58 touch $out
59 '';
60 };
61})