push sheeet
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s

This commit is contained in:
Dark Steveneq
2025-10-09 14:15:47 +02:00
commit 646b892680
49168 changed files with 5897842 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
{ callPackage, fetchFromGitHub }:
callPackage ./generic.nix {
variant = "3.2";
version = "2019-07-27";
branch = "master";
src = fetchFromGitHub {
owner = "bashup";
repo = "events";
rev = "83744c21bf720afb8325343674c62ab46a8f3d94";
hash = "sha256-0VDjd+1T1JBmSDGovWOOecUZmNztlwG32UcstfdigbI=";
};
fake = {
# Note: __ev.encode is actually defined, but it happens in a
# quoted arg to eval, which resholve currently doesn't (and may
# never) parse into. See abathur/resholve/issues/2.
function = [ "__ev.encode" ];
};
keep = {
# allow vars in eval
eval = [
"e"
"f"
"q"
"r"
];
# allow vars executed as commands
"$f" = true;
"$n" = true;
};
}

View File

@@ -0,0 +1,24 @@
{ callPackage, fetchFromGitHub }:
callPackage ./generic.nix {
variant = "4.4";
version = "2020-04-04";
branch = "bash44";
src = fetchFromGitHub {
owner = "bashup";
repo = "events";
rev = "e97654f5602fc4e31083b27afa18dcc89b3e8296";
hash = "sha256-51OSIod3mEg3MKs4rrMgRcOimDGC+3UIr4Bl/cTRyGM=";
};
keep = {
# allow vars in eval
eval = [
"e"
"bashup_ev"
"n"
];
# allow vars executed as commands
"$f" = true;
"$n" = true;
};
}

View File

@@ -0,0 +1,6 @@
{ callPackage }:
{
bashup-events32 = callPackage ./3.2.nix { };
bashup-events44 = callPackage ./4.4.nix { };
}

View File

@@ -0,0 +1,87 @@
{
# general
lib,
resholve,
bash,
doCheck ? true,
doInstallCheck ? true,
# variant-specific
variant,
version,
branch,
src,
fake ? false,
keep,
}:
let
# extracting this so that it's trivial to test in other shells
installCheck = shell: ''
echo "testing bashup.events in ${shell}"
${shell} <<'EOF'
source $out/bin/bashup.events
neat(){
echo $0: Hi from event \'test event\'. I can have both $1 and $2 arguments.
exit 0
}
event on "test event" @2 neat curried
echo event registered
event emit "test event" runtime
exit 1 # fail if emitting event didn't exit clean
EOF
'';
in
resholve.mkDerivation {
# bashup.events doesn't version yet but it has two variants with
# differing features/performance characteristics:
# - branch master: a variant for bash 3.2+
# - branch bash44: a variant for bash 4.4+
pname = "bashup-events${variant}-unstable";
# should be YYYY-MM-DD
inherit version;
inherit src;
installPhase = ''
runHook preInstall
install -Dt $out/bin bashup.events
runHook postInstall
'';
inherit doCheck;
nativeCheckInputs = [ bash ];
checkPhase = ''
runHook preCheck
${bash}/bin/bash -n ./bashup.events
${bash}/bin/bash ./bashup.events
runHook postCheck
'';
solutions = {
events = {
inputs = [ ];
interpreter = "none";
scripts = [ "bin/bashup.events" ];
inherit keep;
}
// lib.optionalAttrs (lib.isAttrs fake) { inherit fake; };
};
inherit doInstallCheck;
nativeInstallCheckInputs = [ bash ];
installCheckPhase = ''
runHook preInstallCheck
${installCheck "${bash}/bin/bash"}
runHook postInstallCheck
'';
meta = with lib; {
inherit branch;
description = "Event listener/callback API for creating extensible bash programs";
mainProgram = "bashup.events";
homepage = "https://github.com/bashup/events";
license = licenses.cc0;
maintainers = with maintainers; [ abathur ];
platforms = platforms.all;
};
}