From c604863c724ca5a4e5695fd3790b5ee4c7e50966 Mon Sep 17 00:00:00 2001 From: Dan Vargas Date: Mon, 7 Feb 2022 16:06:37 -0700 Subject: [PATCH] piston nix pkg for lolcode --- packages/lolcode/0.11.2/build.sh | 18 --------------- packages/lolcode/0.11.2/environment | 4 ---- packages/lolcode/0.11.2/metadata.json | 5 ---- packages/lolcode/0.11.2/run | 4 ---- packages/lolcode/0.11.2/test.lol | 4 ---- runtimes/default.nix | 1 + runtimes/lolcode.nix | 33 +++++++++++++++++++++++++++ 7 files changed, 34 insertions(+), 35 deletions(-) delete mode 100755 packages/lolcode/0.11.2/build.sh delete mode 100644 packages/lolcode/0.11.2/environment delete mode 100644 packages/lolcode/0.11.2/metadata.json delete mode 100644 packages/lolcode/0.11.2/run delete mode 100644 packages/lolcode/0.11.2/test.lol create mode 100644 runtimes/lolcode.nix diff --git a/packages/lolcode/0.11.2/build.sh b/packages/lolcode/0.11.2/build.sh deleted file mode 100755 index 007fe82..0000000 --- a/packages/lolcode/0.11.2/build.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/usr/bin/env bash - -PREFIX=$(realpath $(dirname $0)) - -mkdir -p build -cd build - -# lolcode release -curl -L "https://github.com/justinmeza/lci/archive/refs/tags/v0.11.2.tar.gz" -o lolcode.tar.gz -tar xzf lolcode.tar.gz --strip-components=1 - -# Building and installing lolcode -cmake -DCMAKE_INSTALL_PREFIX:STRING="$PREFIX" . -make -j$(nproc) -make install -j$(nproc) - -# Cleaning up -cd ../ && rm -rf build diff --git a/packages/lolcode/0.11.2/environment b/packages/lolcode/0.11.2/environment deleted file mode 100644 index 780b668..0000000 --- a/packages/lolcode/0.11.2/environment +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env bash - -# Put 'export' statements here for environment variables -export PATH=$PWD/bin:$PATH diff --git a/packages/lolcode/0.11.2/metadata.json b/packages/lolcode/0.11.2/metadata.json deleted file mode 100644 index 1bd6bbf..0000000 --- a/packages/lolcode/0.11.2/metadata.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "language": "lolcode", - "version": "0.11.2", - "aliases": ["lol", "lci"] -} diff --git a/packages/lolcode/0.11.2/run b/packages/lolcode/0.11.2/run deleted file mode 100644 index d4e6725..0000000 --- a/packages/lolcode/0.11.2/run +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env bash - -# Put instructions to run the runtime -lci "$@" diff --git a/packages/lolcode/0.11.2/test.lol b/packages/lolcode/0.11.2/test.lol deleted file mode 100644 index f93f722..0000000 --- a/packages/lolcode/0.11.2/test.lol +++ /dev/null @@ -1,4 +0,0 @@ -HAI 1.2 - CAN HAS STDIO? - VISIBLE "OK" -KTHXBYE diff --git a/runtimes/default.nix b/runtimes/default.nix index 2d3453a..f97aae1 100644 --- a/runtimes/default.nix +++ b/runtimes/default.nix @@ -35,4 +35,5 @@ args: { "nasm-nasm64" = import ./nasm-nasm64.nix args; "mono-csharp" = import ./mono-csharp.nix args; "lua" = import ./lua.nix args; + "lolcode" = import ./lolcode.nix args; } diff --git a/runtimes/lolcode.nix b/runtimes/lolcode.nix new file mode 100644 index 0000000..7493579 --- /dev/null +++ b/runtimes/lolcode.nix @@ -0,0 +1,33 @@ +{pkgs, piston, ...}: +let + pkg = pkgs.lolcode; +in piston.mkRuntime { + language = "lolcode"; + version = pkg.version; + + aliases = [ + "lol" + "lci" + ]; + + run = '' + ${pkg}/bin/lolcode-lci "$@" + ''; + + tests = [ + (piston.mkTest { + files = { + "test.lol" = '' + HAI 1.2 + CAN HAS STDIO? + VISIBLE "OK" + KTHXBYE + ''; + }; + args = []; + stdin = ""; + packages = []; + main = "test.lol"; + }) + ]; +} \ No newline at end of file