From 600d9c463148a771017ce768db9f15d23424b940 Mon Sep 17 00:00:00 2001 From: Hydrazer Date: Fri, 3 Jun 2022 08:17:41 -0600 Subject: [PATCH] forth nix package --- readme.md | 1 + runtimes/default.nix | 1 + runtimes/forth.nix | 30 ++++++++++++++++++++++++++++++ 3 files changed, 32 insertions(+) create mode 100644 runtimes/forth.nix diff --git a/readme.md b/readme.md index 9eafa28..a8e16a9 100644 --- a/readme.md +++ b/readme.md @@ -330,6 +330,7 @@ Content-Type: application/json `erlang`, `file`, `forte`, +`forth`, `fortran`, `freebasic`, `fsharp.net`, diff --git a/runtimes/default.nix b/runtimes/default.nix index e8eb533..61fa994 100644 --- a/runtimes/default.nix +++ b/runtimes/default.nix @@ -64,4 +64,5 @@ args: { "llvm_ir" = import ./llvm_ir.nix args; "mono-basic" = import ./mono-basic.nix args; "j" = import ./j.nix args; + "forth" = import ./forth.nix args; } diff --git a/runtimes/forth.nix b/runtimes/forth.nix new file mode 100644 index 0000000..b9edfa9 --- /dev/null +++ b/runtimes/forth.nix @@ -0,0 +1,30 @@ +{pkgs, piston, ...}: +let + pkg = pkgs.gforth; +in piston.mkRuntime { + language = "forth"; + version = pkg.version; + runtime = "forth"; + + aliases = [ + "gforth" + ]; + + run = '' + ${pkg}/bin/gforth "$@" + ''; + + tests = [ + (piston.mkTest { + files = { + "test.forth" = '' + .( OK) bye + ''; + }; + args = []; + stdin = ""; + packages = []; + main = "test.forth"; + }) + ]; +}