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