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