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