From 27e59923f28347ed3cd04a693ae367f8ccac27aa Mon Sep 17 00:00:00 2001 From: Dan Vargas Date: Mon, 7 Feb 2022 15:52:18 -0700 Subject: [PATCH] piston nix pkg for lua --- packages/lua/5.4.2/build.sh | 14 -------------- packages/lua/5.4.2/environment | 4 ---- packages/lua/5.4.2/metadata.json | 5 ----- packages/lua/5.4.2/run | 4 ---- packages/lua/5.4.2/test.lua | 1 - runtimes/default.nix | 1 + runtimes/lua.nix | 26 ++++++++++++++++++++++++++ 7 files changed, 27 insertions(+), 28 deletions(-) delete mode 100755 packages/lua/5.4.2/build.sh delete mode 100644 packages/lua/5.4.2/environment delete mode 100644 packages/lua/5.4.2/metadata.json delete mode 100644 packages/lua/5.4.2/run delete mode 100644 packages/lua/5.4.2/test.lua create mode 100644 runtimes/lua.nix diff --git a/packages/lua/5.4.2/build.sh b/packages/lua/5.4.2/build.sh deleted file mode 100755 index 8b02f7d..0000000 --- a/packages/lua/5.4.2/build.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/env bash - -# Put instructions to build your package in here -curl -R -O -L http://www.lua.org/ftp/lua-5.4.2.tar.gz -tar zxf lua-5.4.2.tar.gz -rm lua-5.4.2.tar.gz - -cd lua-5.4.2 -# Building Lua -make linux -# To check that Lua has been built correctly -make test -# Installing Lua -make linux install diff --git a/packages/lua/5.4.2/environment b/packages/lua/5.4.2/environment deleted file mode 100644 index 936b3b6..0000000 --- a/packages/lua/5.4.2/environment +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env bash - -# Put 'export' statements here for environment variables -export PATH="$PWD/lua-5.4.2/src:$PATH" diff --git a/packages/lua/5.4.2/metadata.json b/packages/lua/5.4.2/metadata.json deleted file mode 100644 index f0396db..0000000 --- a/packages/lua/5.4.2/metadata.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "language": "lua", - "version": "5.4.2", - "aliases": ["lua"] -} diff --git a/packages/lua/5.4.2/run b/packages/lua/5.4.2/run deleted file mode 100644 index d23038b..0000000 --- a/packages/lua/5.4.2/run +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env bash - -# Put instructions to run the runtime -lua "$@" diff --git a/packages/lua/5.4.2/test.lua b/packages/lua/5.4.2/test.lua deleted file mode 100644 index 3f2688f..0000000 --- a/packages/lua/5.4.2/test.lua +++ /dev/null @@ -1 +0,0 @@ -print("OK") \ No newline at end of file diff --git a/runtimes/default.nix b/runtimes/default.nix index d25201b..2d3453a 100644 --- a/runtimes/default.nix +++ b/runtimes/default.nix @@ -34,4 +34,5 @@ args: { "nasm" = import ./nasm.nix args; "nasm-nasm64" = import ./nasm-nasm64.nix args; "mono-csharp" = import ./mono-csharp.nix args; + "lua" = import ./lua.nix args; } diff --git a/runtimes/lua.nix b/runtimes/lua.nix new file mode 100644 index 0000000..96c1025 --- /dev/null +++ b/runtimes/lua.nix @@ -0,0 +1,26 @@ +{pkgs, piston, ...}: +let + pkg = pkgs.lua5_4; # latest lua as of now +in piston.mkRuntime { + language = "lua"; + version = pkg.version; + aliases = []; + + run = '' + ${pkg}/bin/lua "$@" + ''; + + tests = [ + (piston.mkTest { + files = { + "test.lua" = '' + print("OK") + ''; + }; + args = []; + stdin = ""; + packages = []; + main = "test.lua"; + }) + ]; +} \ No newline at end of file