diff --git a/runtimes/default.nix b/runtimes/default.nix index 9b01411..23b997e 100644 --- a/runtimes/default.nix +++ b/runtimes/default.nix @@ -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; } diff --git a/runtimes/gcc-d.nix b/runtimes/gcc-d.nix new file mode 100644 index 0000000..ccec61f --- /dev/null +++ b/runtimes/gcc-d.nix @@ -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"; + }) + ]; +} \ No newline at end of file