mirror of
https://github.com/engineer-man/piston.git
synced 2025-04-20 12:07:49 +02:00
add piston nix pkg for gcc-d
This commit is contained in:
parent
28dca3ec44
commit
11882b2085
2 changed files with 41 additions and 0 deletions
|
@ -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
40
runtimes/gcc-d.nix
Normal 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";
|
||||
})
|
||||
];
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue