Added ADA via GNAT 11.2.0

This commit is contained in:
Omar Brikaa 2022-02-21 14:48:43 +02:00
parent d244f0138c
commit 6161997f49
2 changed files with 42 additions and 0 deletions

View File

@ -51,4 +51,5 @@ args: {
"gcc-fortran" = import ./gcc-fortran.nix args; "gcc-fortran" = import ./gcc-fortran.nix args;
"yabasic" = import ./yabasic.nix args; "yabasic" = import ./yabasic.nix args;
"emacs" = import ./emacs.nix args; "emacs" = import ./emacs.nix args;
"gnat-ada" = import ./gnat-ada.nix args;
} }

41
runtimes/gnat-ada.nix Normal file
View File

@ -0,0 +1,41 @@
{pkgs, piston, ...}:
let
pkg = pkgs.gnat;
in piston.mkRuntime {
language = "ada";
version = pkg.version;
runtime = "gnat";
aliases = [
"adb"
"ads"
];
compile = ''
${pkg}/bin/gnatmake "$@" -o a.out
'';
run = ''
shift
./a.out "$@"
'';
tests = [
(piston.mkTest {
files = {
"test.adb" = ''
with Text_IO; use Text_IO;
with Ada.Command_line; use Ada.Command_Line;
procedure hello is
begin
Put_Line(Argument(1));
end hello;
'';
};
args = ["OK"];
stdin = "";
packages = [];
main = "test.adb";
})
];
}