2022-02-02 19:13:33 +01:00
|
|
|
{pkgs, piston, ...}:
|
|
|
|
let
|
|
|
|
pkg = pkgs.vlang;
|
|
|
|
in piston.mkRuntime {
|
|
|
|
language = "vlang";
|
|
|
|
version = pkg.version;
|
|
|
|
|
|
|
|
aliases = [
|
|
|
|
"v"
|
|
|
|
];
|
|
|
|
|
|
|
|
run = ''
|
|
|
|
# vlang env
|
|
|
|
export VMODULES="$PWD"
|
|
|
|
export TMPDIR="$PWD"
|
|
|
|
|
|
|
|
# modify file extension
|
2022-02-04 17:34:01 +01:00
|
|
|
filename="$1"
|
|
|
|
rename 's/$/.v/' "$filename"
|
2022-02-02 19:13:33 +01:00
|
|
|
shift
|
|
|
|
|
2022-02-04 17:34:01 +01:00
|
|
|
${pkg}/bin/v run "$filename.v" "$@"
|
2022-02-02 19:13:33 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
tests = [
|
|
|
|
(piston.mkTest {
|
|
|
|
files = {
|
|
|
|
"file0.code" = ''
|
|
|
|
fn main() {
|
|
|
|
println('OK')
|
|
|
|
}
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
args = [];
|
|
|
|
stdin = "";
|
|
|
|
packages = [];
|
|
|
|
main = "file0.code";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
}
|