piston nix pkg for lolcode

This commit is contained in:
Dan Vargas 2022-02-07 16:06:37 -07:00
parent 27e59923f2
commit c604863c72
7 changed files with 34 additions and 35 deletions

View File

@ -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

View File

@ -1,4 +0,0 @@
#!/usr/bin/env bash
# Put 'export' statements here for environment variables
export PATH=$PWD/bin:$PATH

View File

@ -1,5 +0,0 @@
{
"language": "lolcode",
"version": "0.11.2",
"aliases": ["lol", "lci"]
}

View File

@ -1,4 +0,0 @@
#!/usr/bin/env bash
# Put instructions to run the runtime
lci "$@"

View File

@ -1,4 +0,0 @@
HAI 1.2
CAN HAS STDIO?
VISIBLE "OK"
KTHXBYE

View File

@ -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;
}

33
runtimes/lolcode.nix Normal file
View File

@ -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";
})
];
}