8 , doInstallCheck ? true
18 # extracting this so that it's trivial to test in other shells
21 echo "testing bashup.events in ${shell}"
23 source $out/bin/bashup.events
25 echo $0: Hi from event \'test event\'. I can have both $1 and $2 arguments.
28 event on "test event" @2 neat curried
30 event emit "test event" runtime
31 exit 1 # fail if emitting event didn't exit clean
37 # bashup.events doesn't version yet but it has two variants with
38 # differing features/performance characteristics:
39 # - branch master: a variant for bash 3.2+
40 # - branch bash44: a variant for bash 4.4+
41 pname = "bashup-events${variant}-unstable";
42 # should be YYYY-MM-DD
48 install -Dt $out/bin bashup.events
53 checkInputs = [ shellcheck bash ];
55 # check based on https://github.com/bashup/events/blob/master/.dkrc
58 SHELLCHECK_OPTS='-e SC2016,SC2145' ${shellcheck}/bin/shellcheck ./bashup.events
59 ${bash}/bin/bash -n ./bashup.events
60 ${bash}/bin/bash ./bashup.events
68 scripts = [ "bin/bashup.events" ];
70 } // lib.optionalAttrs (lib.isAttrs fake) { inherit fake; };
73 inherit doInstallCheck;
74 installCheckInputs = [ bash ];
75 installCheckPhase = ''
76 runHook preInstallCheck
77 ${installCheck "${bash}/bin/bash"}
78 runHook postInstallCheck
83 description = "An event listener/callback API for creating extensible bash programs";
84 homepage = "https://github.com/bashup/events";
85 license = licenses.cc0;
86 maintainers = with maintainers; [ abathur ];
87 platforms = platforms.all;