migrate ponylang to nix

This commit is contained in:
Dan Vargas 2022-02-06 21:06:32 -07:00
parent a8adca3e18
commit dc2c5f3380
8 changed files with 38 additions and 50 deletions

View file

@ -25,4 +25,5 @@ args: {
"racket" = import ./racket.nix args;
"powershell" = import ./powershell.nix args;
"prolog" = import ./prolog.nix args;
"ponylang" = import ./ponylang.nix args;
}

37
runtimes/ponylang.nix Normal file
View file

@ -0,0 +1,37 @@
{pkgs, piston, ...}:
let
pkg = pkgs.ponyc;
in piston.mkRuntime {
language = "ponylang";
version = pkg.version;
aliases = [
"pony"
"ponyc"
];
compile = ''
rename 's/$/.pony/' "$@" # Add .pony extension
${pkg}/bin/ponyc -b out
'';
run = ''
shift
./out "$@"
'';
tests = [
(piston.mkTest {
files = {
"test.pony" = ''
actor Main
new create(env: Env) =>
env.out.print("OK")
'';
};
args = [];
stdin = "";
packages = [];
main = "test.pony";
})
];
}