add piston nix pkg for gcc-d

This commit is contained in:
Dan Vargas 2022-02-16 10:46:31 -07:00
parent 28dca3ec44
commit 11882b2085
2 changed files with 41 additions and 0 deletions

View File

@ -47,4 +47,5 @@ args: {
"go" = import ./go.nix args;
"gcc-c" = import ./gcc-c.nix args;
"gcc-c++" = import ./gcc-c++.nix args;
"gcc-d" = import ./gcc-d.nix args;
}

40
runtimes/gcc-d.nix Normal file
View File

@ -0,0 +1,40 @@
{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";
})
];
}