piston/runtimes/gcc-d.nix

40 lines
711 B
Nix
Raw Normal View History

2022-02-16 18:46:31 +01:00
{pkgs, piston, ...}:
let
pkg = pkgs.gdc;
in piston.mkRuntime {
language = "d";
version = pkg.version;
runtime = "gcc";
aliases = [
"gdc"
];
compile = ''
rename 's/.code$/\.d/' "$@" # Add .d
${pkg}/bin/gdc *.d
'';
run = ''
shift
./a.out "$@"
'';
tests = [
(piston.mkTest {
files = {
"test.d" = ''
import std.stdio;
void main() {
writeln("OK");
}
'';
};
args = [];
stdin = "";
packages = [];
main = "test.d";
})
];
}