From 96ffdb63ddc8f8a1dd34f6d559a236ba6630082d Mon Sep 17 00:00:00 2001 From: Dan Vargas Date: Fri, 18 Mar 2022 10:11:16 -0600 Subject: [PATCH 1/5] add piston nix pkg for brainfuck --- packages/brainfuck/2.7.3/build.sh | 22 ----------- packages/brainfuck/2.7.3/environment | 4 -- packages/brainfuck/2.7.3/metadata.json | 5 --- packages/brainfuck/2.7.3/run | 4 -- packages/brainfuck/2.7.3/test.bf | 1 - runtimes/brainfuck.nix | 55 ++++++++++++++++++++++++++ runtimes/default.nix | 1 + 7 files changed, 56 insertions(+), 36 deletions(-) delete mode 100644 packages/brainfuck/2.7.3/build.sh delete mode 100644 packages/brainfuck/2.7.3/environment delete mode 100644 packages/brainfuck/2.7.3/metadata.json delete mode 100644 packages/brainfuck/2.7.3/run delete mode 100644 packages/brainfuck/2.7.3/test.bf create mode 100644 runtimes/brainfuck.nix diff --git a/packages/brainfuck/2.7.3/build.sh b/packages/brainfuck/2.7.3/build.sh deleted file mode 100644 index 50c1868..0000000 --- a/packages/brainfuck/2.7.3/build.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env bash - -# Put instructions to build your package in here -PREFIX=$(realpath $(dirname $0)) - -git clone https://github.com/fabianishere/brainfuck.git - -cd brainfuck -git checkout 06f84462e0a96487670a4b8024e3ec531e0377ee - - -mkdir -p build - -cd build - -cmake .. -DCMAKE_INSTALL_PREFIX=$PREFIX/ -DENABLE_EDITLINE=OFF - -make -j$(nproc) -make install -j$(nproc) - -cd ../../ -rm -rf brainfuck diff --git a/packages/brainfuck/2.7.3/environment b/packages/brainfuck/2.7.3/environment deleted file mode 100644 index 780b668..0000000 --- a/packages/brainfuck/2.7.3/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/brainfuck/2.7.3/metadata.json b/packages/brainfuck/2.7.3/metadata.json deleted file mode 100644 index a9f3083..0000000 --- a/packages/brainfuck/2.7.3/metadata.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "language": "brainfuck", - "version": "2.7.3", - "aliases": ["bf"] -} diff --git a/packages/brainfuck/2.7.3/run b/packages/brainfuck/2.7.3/run deleted file mode 100644 index 7c4e7dd..0000000 --- a/packages/brainfuck/2.7.3/run +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env bash - -# Put instructions to run the runtime -fold -w1 | brainfuck $1 diff --git a/packages/brainfuck/2.7.3/test.bf b/packages/brainfuck/2.7.3/test.bf deleted file mode 100644 index d0c07ec..0000000 --- a/packages/brainfuck/2.7.3/test.bf +++ /dev/null @@ -1 +0,0 @@ --[--->+<]>------.----. \ No newline at end of file diff --git a/runtimes/brainfuck.nix b/runtimes/brainfuck.nix new file mode 100644 index 0000000..3acf84b --- /dev/null +++ b/runtimes/brainfuck.nix @@ -0,0 +1,55 @@ +{pkgs, piston, ...}: +let + # All other BF packages are either marked as broken in nix-pkgs + # or have missing functionality. Yabi isn't perfect either. + pkg = pkgs.haskellPackages.yabi; +in piston.mkRuntime { + language = "brainfuck"; + version = pkg.version; + + aliases = [ + "bf" + "yabi" + ]; + + run = '' + # Yabi produces messages when parsing the BF file that are sent to stderr + # Yabi will also break when trying to take more input at EOF + ${pkg}/bin/yabi "$1" 2> /dev/null + ''; + + tests = [ + # stdout test + (piston.mkTest { + files = { + "test.bf" = ''-[--->+<]>------.----.''; + }; + args = []; + stdin = ""; + packages = []; + main = "test.bf"; + }) + + # stdin test + (piston.mkTest { + files = { + "test.bf" = '',.,.''; + }; + args = []; + stdin = "OK"; + packages = []; + main = "test.bf"; + }) + + # bf doesn't take args test + (piston.mkTest { + files = { + "test.bf" = ''-[--->+<]>------.----.''; + }; + args = ["OK"]; + stdin = ""; + packages = []; + main = "test.bf"; + }) + ]; +} \ No newline at end of file diff --git a/runtimes/default.nix b/runtimes/default.nix index b2cf206..2f230c9 100644 --- a/runtimes/default.nix +++ b/runtimes/default.nix @@ -58,4 +58,5 @@ args: { "dotnet-sdk-fsharp-interactive" = import ./dotnet-sdk-fsharp-interactive.nix args; "dotnet-sdk-visual-basic" = import ./dotnet-sdk-visual-basic.nix args; "fpc-pascal" = import ./fpc-pascal.nix args; + "brainfuck" = import ./brainfuck.nix args; } From 2490833ef1dfb6eb75675708cd08f7412725b76c Mon Sep 17 00:00:00 2001 From: Dan Vargas Date: Fri, 18 Mar 2022 11:16:41 -0600 Subject: [PATCH 2/5] add piston nix pkg for coffeescript] --- packages/coffeescript/2.5.1/build.sh | 10 ---- packages/coffeescript/2.5.1/environment | 1 - packages/coffeescript/2.5.1/metadata.json | 5 -- packages/coffeescript/2.5.1/run | 3 -- packages/coffeescript/2.5.1/test.coffee | 1 - runtimes/default.nix | 1 + runtimes/node-coffeescript.nix | 57 +++++++++++++++++++++++ 7 files changed, 58 insertions(+), 20 deletions(-) delete mode 100755 packages/coffeescript/2.5.1/build.sh delete mode 100644 packages/coffeescript/2.5.1/environment delete mode 100644 packages/coffeescript/2.5.1/metadata.json delete mode 100644 packages/coffeescript/2.5.1/run delete mode 100644 packages/coffeescript/2.5.1/test.coffee create mode 100644 runtimes/node-coffeescript.nix diff --git a/packages/coffeescript/2.5.1/build.sh b/packages/coffeescript/2.5.1/build.sh deleted file mode 100755 index 58d99b2..0000000 --- a/packages/coffeescript/2.5.1/build.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash - -# Download and install NodeJS -curl "https://nodejs.org/dist/v15.10.0/node-v15.10.0-linux-x64.tar.xz" -o node.tar.xz -tar xf node.tar.xz --strip-components=1 -rm node.tar.xz -export PATH=$PWD/bin:$PATH - -# Install CoffeeScript via npm and done -npm install --global coffeescript@2.5.1 diff --git a/packages/coffeescript/2.5.1/environment b/packages/coffeescript/2.5.1/environment deleted file mode 100644 index bd0ff98..0000000 --- a/packages/coffeescript/2.5.1/environment +++ /dev/null @@ -1 +0,0 @@ -export PATH=$PWD/bin:$PATH \ No newline at end of file diff --git a/packages/coffeescript/2.5.1/metadata.json b/packages/coffeescript/2.5.1/metadata.json deleted file mode 100644 index 23380d1..0000000 --- a/packages/coffeescript/2.5.1/metadata.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "language": "coffeescript", - "version": "2.5.1", - "aliases": ["coffeescript", "coffee"] -} diff --git a/packages/coffeescript/2.5.1/run b/packages/coffeescript/2.5.1/run deleted file mode 100644 index 5d8cc03..0000000 --- a/packages/coffeescript/2.5.1/run +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -coffee "$@" diff --git a/packages/coffeescript/2.5.1/test.coffee b/packages/coffeescript/2.5.1/test.coffee deleted file mode 100644 index b3a8f72..0000000 --- a/packages/coffeescript/2.5.1/test.coffee +++ /dev/null @@ -1 +0,0 @@ -console.log "OK" \ No newline at end of file diff --git a/runtimes/default.nix b/runtimes/default.nix index 2f230c9..372ec79 100644 --- a/runtimes/default.nix +++ b/runtimes/default.nix @@ -59,4 +59,5 @@ args: { "dotnet-sdk-visual-basic" = import ./dotnet-sdk-visual-basic.nix args; "fpc-pascal" = import ./fpc-pascal.nix args; "brainfuck" = import ./brainfuck.nix args; + "node-coffeescript" = import ./node-coffeescript.nix args; } diff --git a/runtimes/node-coffeescript.nix b/runtimes/node-coffeescript.nix new file mode 100644 index 0000000..8f006ea --- /dev/null +++ b/runtimes/node-coffeescript.nix @@ -0,0 +1,57 @@ +{pkgs, piston, ...}: +let + pkg = pkgs.nodePackages.coffee-script; +in piston.mkRuntime { + language = "coffeescript"; + version = pkg.version; + runtime = "node"; + + aliases = [ + "coffee" + ]; + + run = '' + ${pkg}/bin/coffee "$@" + ''; + + tests = [ + # stdout test + (piston.mkTest { + files = { + "test.coffee" = '' + console.log "OK" + ''; + }; + args = []; + stdin = ""; + packages = []; + main = "test.coffee"; + }) + + # args test + (piston.mkTest { + files = { + "test.coffee" = '' + console.log process.argv[2] + ''; + }; + args = ["OK"]; + stdin = ""; + packages = []; + main = "test.coffee"; + }) + + # stdin test + (piston.mkTest { + files = { + "test.coffee" = '' + process.stdin.on('data', (data) => console.log(data.toString())) + ''; + }; + args = []; + stdin = "OK"; + packages = []; + main = "test.coffee"; + }) + ]; +} \ No newline at end of file From 560b4ac1eea1d58cbc64ca1f2efe83706925bdb4 Mon Sep 17 00:00:00 2001 From: Dan Vargas Date: Sun, 20 Mar 2022 12:25:29 -0600 Subject: [PATCH 3/5] add piston nix pkg for scala --- packages/scala/3.0.0/build.sh | 11 ------ packages/scala/3.0.0/compile | 15 --------- packages/scala/3.0.0/environment | 5 --- packages/scala/3.0.0/metadata.json | 5 --- packages/scala/3.0.0/run | 5 --- packages/scala/3.0.0/test.scala | 3 -- runtimes/default.nix | 1 + runtimes/jvm-scala.nix | 54 ++++++++++++++++++++++++++++++ 8 files changed, 55 insertions(+), 44 deletions(-) delete mode 100755 packages/scala/3.0.0/build.sh delete mode 100644 packages/scala/3.0.0/compile delete mode 100644 packages/scala/3.0.0/environment delete mode 100644 packages/scala/3.0.0/metadata.json delete mode 100644 packages/scala/3.0.0/run delete mode 100644 packages/scala/3.0.0/test.scala create mode 100644 runtimes/jvm-scala.nix diff --git a/packages/scala/3.0.0/build.sh b/packages/scala/3.0.0/build.sh deleted file mode 100755 index 4cbf363..0000000 --- a/packages/scala/3.0.0/build.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/env bash - -# Download and extract JDK8 -curl -L "https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u292-b10/OpenJDK8U-jdk_x64_linux_hotspot_8u292b10.tar.gz" -o jdk.tar.gz -tar xzf jdk.tar.gz --strip-components=1 -rm jdk.tar.gz - -# Download and extract Scala 3 -curl -L "https://github.com/lampepfl/dotty/releases/download/3.0.0/scala3-3.0.0.tar.gz" -o scala.tar.gz -tar -xzf scala.tar.gz --strip-components=1 -rm scala.tar.gz diff --git a/packages/scala/3.0.0/compile b/packages/scala/3.0.0/compile deleted file mode 100644 index 25853ef..0000000 --- a/packages/scala/3.0.0/compile +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/env bash - -# Compile scala classes into a jar file -scalac "$@" -d out.jar - -# Create the Manifest and include scala lib jars: -# NOTE: - entry point will only consider @main and App traits from the main file -# - scala lib jars will be added to the class path in order to run the jar properly -echo "Main-Class: $(grep -oP '\@main\s+def\s+\K[a-zA-Z][a-zA-Z0-9]*|object\s+\K[a-zA-Z][a-zA-Z0-9]*(?=\s+extends\s+App)' $1) -Class-Path: $(echo $JAVA_HOME/lib/*.jar | sed 's/\s/\n /g') - -" > manifest.txt - -# Update the jar with the manifest -jar ufm out.jar manifest.txt diff --git a/packages/scala/3.0.0/environment b/packages/scala/3.0.0/environment deleted file mode 100644 index a1fcafe..0000000 --- a/packages/scala/3.0.0/environment +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env bash - -# Scala requires JAVA_HOME to be set -export JAVA_HOME=$PWD -export PATH=$PWD/bin:$PATH diff --git a/packages/scala/3.0.0/metadata.json b/packages/scala/3.0.0/metadata.json deleted file mode 100644 index 37bccf8..0000000 --- a/packages/scala/3.0.0/metadata.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "language": "scala", - "version": "3.0.0", - "aliases": ["sc"] -} diff --git a/packages/scala/3.0.0/run b/packages/scala/3.0.0/run deleted file mode 100644 index afcc045..0000000 --- a/packages/scala/3.0.0/run +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env bash - -# Run jar file -shift -java -jar out.jar "$@" diff --git a/packages/scala/3.0.0/test.scala b/packages/scala/3.0.0/test.scala deleted file mode 100644 index bf4cabc..0000000 --- a/packages/scala/3.0.0/test.scala +++ /dev/null @@ -1,3 +0,0 @@ -@main def run(): Unit = { - println("OK") -} \ No newline at end of file diff --git a/runtimes/default.nix b/runtimes/default.nix index 372ec79..29d1457 100644 --- a/runtimes/default.nix +++ b/runtimes/default.nix @@ -60,4 +60,5 @@ args: { "fpc-pascal" = import ./fpc-pascal.nix args; "brainfuck" = import ./brainfuck.nix args; "node-coffeescript" = import ./node-coffeescript.nix args; + "jvm-scala" = import ./jvm-scala.nix args; } diff --git a/runtimes/jvm-scala.nix b/runtimes/jvm-scala.nix new file mode 100644 index 0000000..ab72b36 --- /dev/null +++ b/runtimes/jvm-scala.nix @@ -0,0 +1,54 @@ +{pkgs, piston, ...}: +let + pkg = pkgs.scala; + java = pkgs.jdk8; + sed = pkgs.gnused; +in piston.mkRuntime { + language = "scala"; + version = pkg.version; + runtime = "jvm"; + + aliases = [ + "sc" + ]; + + compile = '' + # Compile scala classes into a jar file + ${pkg}/bin/scalac "$@" -d out.jar + + # Capture extra class-path libraries + java_libs="$(echo ${java}/lib/openjdk/lib/*.jar | ${sed}/bin/sed 's/\s/\\n /g')" + scala_libs="$(echo ${pkg}/lib/*.jar | ${sed}/bin/sed 's/\s/\\n /g')" + + echo -e "Class-Path: $java_libs + $scala_libs + " > classPath + + # Update the jar manifest with scala libs + ${java}/bin/jar umf classPath out.jar + ''; + + run = '' + # Run jar from compile + shift + ${java}/bin/java -jar out.jar "$@" + ''; + + tests = [ + (piston.mkTest { + files = { + "test.sc" = '' + object Main { + def main(args: Array[String]) = { + println("OK") + } + } + ''; + }; + args = []; + stdin = ""; + packages = []; + main = "test.sc"; + }) + ]; +} \ No newline at end of file From daeed0ce5e5c2031366e002556c4bd6cf38f032e Mon Sep 17 00:00:00 2001 From: Dan Vargas Date: Mon, 21 Mar 2022 08:59:03 -0600 Subject: [PATCH 4/5] add piston nix pkg for llvm_ir --- packages/llvm_ir/12.0.1/build.sh | 6 ---- packages/llvm_ir/12.0.1/compile | 4 --- packages/llvm_ir/12.0.1/environment | 2 -- packages/llvm_ir/12.0.1/metadata.json | 5 --- packages/llvm_ir/12.0.1/run | 4 --- packages/llvm_ir/12.0.1/test.ll | 10 ------ runtimes/default.nix | 1 + runtimes/llvm_ir.nix | 47 +++++++++++++++++++++++++++ 8 files changed, 48 insertions(+), 31 deletions(-) delete mode 100755 packages/llvm_ir/12.0.1/build.sh delete mode 100755 packages/llvm_ir/12.0.1/compile delete mode 100644 packages/llvm_ir/12.0.1/environment delete mode 100644 packages/llvm_ir/12.0.1/metadata.json delete mode 100644 packages/llvm_ir/12.0.1/run delete mode 100644 packages/llvm_ir/12.0.1/test.ll create mode 100644 runtimes/llvm_ir.nix diff --git a/packages/llvm_ir/12.0.1/build.sh b/packages/llvm_ir/12.0.1/build.sh deleted file mode 100755 index 7afd41a..0000000 --- a/packages/llvm_ir/12.0.1/build.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env bash -curl -L "https://github.com/llvm/llvm-project/releases/download/llvmorg-12.0.1/clang+llvm-12.0.1-x86_64-linux-gnu-ubuntu-16.04.tar.xz" -o llvm-ir.tar.xz - -tar xf llvm-ir.tar.xz clang+llvm-12.0.1-x86_64-linux-gnu-ubuntu-/bin --strip-components=1 - -rm llvm-ir.tar.xz diff --git a/packages/llvm_ir/12.0.1/compile b/packages/llvm_ir/12.0.1/compile deleted file mode 100755 index 082fb5c..0000000 --- a/packages/llvm_ir/12.0.1/compile +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env bash - -llc "$@" -o binary.s -clang binary.s -o binary diff --git a/packages/llvm_ir/12.0.1/environment b/packages/llvm_ir/12.0.1/environment deleted file mode 100644 index 85a25b6..0000000 --- a/packages/llvm_ir/12.0.1/environment +++ /dev/null @@ -1,2 +0,0 @@ -#!/usr/bin/env bash -export PATH=$PWD/bin:$PATH diff --git a/packages/llvm_ir/12.0.1/metadata.json b/packages/llvm_ir/12.0.1/metadata.json deleted file mode 100644 index 50dfbbc..0000000 --- a/packages/llvm_ir/12.0.1/metadata.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "language": "llvm_ir", - "version": "12.0.1", - "aliases": ["llvm", "llvm-ir", "ll"] -} diff --git a/packages/llvm_ir/12.0.1/run b/packages/llvm_ir/12.0.1/run deleted file mode 100644 index 94b3b0b..0000000 --- a/packages/llvm_ir/12.0.1/run +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env bash - -shift -binary "$@" diff --git a/packages/llvm_ir/12.0.1/test.ll b/packages/llvm_ir/12.0.1/test.ll deleted file mode 100644 index be7d5d3..0000000 --- a/packages/llvm_ir/12.0.1/test.ll +++ /dev/null @@ -1,10 +0,0 @@ -@.str = private unnamed_addr constant [2 x i8] c"OK" - -declare i32 @puts(i8* nocapture) nounwind - -define i32 @main() { - %cast210 = getelementptr [2 x i8],[2 x i8]* @.str, i64 0, i64 0 - - call i32 @puts(i8* %cast210) - ret i32 0 -} diff --git a/runtimes/default.nix b/runtimes/default.nix index 29d1457..1669be2 100644 --- a/runtimes/default.nix +++ b/runtimes/default.nix @@ -61,4 +61,5 @@ args: { "brainfuck" = import ./brainfuck.nix args; "node-coffeescript" = import ./node-coffeescript.nix args; "jvm-scala" = import ./jvm-scala.nix args; + "llvm_ir" = import ./llvm_ir.nix args; } diff --git a/runtimes/llvm_ir.nix b/runtimes/llvm_ir.nix new file mode 100644 index 0000000..2f736aa --- /dev/null +++ b/runtimes/llvm_ir.nix @@ -0,0 +1,47 @@ +{pkgs, piston, ...}: +let + pkg = pkgs.llvm; + clang = pkgs.llvmPackages_13.libcxxClang; +in piston.mkRuntime { + language = "llvm_ir"; + version = clang.version; + + aliases = [ + "llvm" + "llvm-ir" + "ll" + ]; + + compile = '' + ${pkg}/bin/llc "$@" -o binary.s + ${clang}/bin/clang binary.s -o binary + ''; + + run = '' + shift + ./binary "$@" + ''; + + tests = [ + (piston.mkTest { + files = { + "test.ll" = '' + @.str = private unnamed_addr constant [2 x i8] c"OK" + + declare i32 @puts(i8* nocapture) nounwind + + define i32 @main() { + %cast210 = getelementptr [2 x i8],[2 x i8]* @.str, i64 0, i64 0 + + call i32 @puts(i8* %cast210) + ret i32 0 + } + ''; + }; + args = []; + stdin = ""; + packages = []; + main = "test.ll"; + }) + ]; +} \ No newline at end of file From 9fe9b4db48f507d9bb2377bc4afbfaf08729e27a Mon Sep 17 00:00:00 2001 From: Dan Vargas Date: Mon, 21 Mar 2022 09:44:08 -0600 Subject: [PATCH 5/5] add piston nix pkg for mono-basic --- packages/mono/6.12.0/build.sh | 32 -------------------- packages/mono/6.12.0/compile | 16 ---------- packages/mono/6.12.0/environment | 1 - packages/mono/6.12.0/metadata.json | 20 ------------- packages/mono/6.12.0/run | 4 --- packages/mono/6.12.0/test.cs | 9 ------ packages/mono/6.12.0/test.vb | 9 ------ runtimes/default.nix | 1 + runtimes/mono-basic.nix | 47 ++++++++++++++++++++++++++++++ 9 files changed, 48 insertions(+), 91 deletions(-) delete mode 100755 packages/mono/6.12.0/build.sh delete mode 100644 packages/mono/6.12.0/compile delete mode 100644 packages/mono/6.12.0/environment delete mode 100644 packages/mono/6.12.0/metadata.json delete mode 100644 packages/mono/6.12.0/run delete mode 100644 packages/mono/6.12.0/test.cs delete mode 100644 packages/mono/6.12.0/test.vb create mode 100644 runtimes/mono-basic.nix diff --git a/packages/mono/6.12.0/build.sh b/packages/mono/6.12.0/build.sh deleted file mode 100755 index 7bb4b63..0000000 --- a/packages/mono/6.12.0/build.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/bash - -PREFIX=$(realpath $(dirname $0)) - -mkdir -p build/mono build/mono-basic -cd build - -curl "https://download.mono-project.com/sources/mono/mono-6.12.0.122.tar.xz" -o mono.tar.xz -curl -L "https://github.com/mono/mono-basic/archive/refs/tags/4.7.tar.gz" -o mono-basic.tar.gz -tar xf mono.tar.xz --strip-components=1 -C mono -tar xf mono-basic.tar.gz --strip-components=1 -C mono-basic - -# Compiling Mono -cd mono - -./configure --prefix "$PREFIX" - -make -j$(nproc) -make install -j$(nproc) - -export PATH="$PREFIX/bin:$PATH" # To be able to use mono commands - -# Compiling mono-basic -cd ../mono-basic -./configure --prefix="$PREFIX" - -make -j$(nproc) PLATFORM="linux" # Avoids conflict with the $PLATFORM variable we have -make install -j$(nproc) PLATFORM="linux" - -# Remove redundant files -cd ../../ -rm -rf build diff --git a/packages/mono/6.12.0/compile b/packages/mono/6.12.0/compile deleted file mode 100644 index 5246bc2..0000000 --- a/packages/mono/6.12.0/compile +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash - -case "${PISTON_LANGUAGE}" in - csharp) - rename 's/$/\.cs/' "$@" # Add .cs extension - csc -out:out *.cs - ;; - basic) - rename 's/$/\.vb/' "$@" # Add .vb extension - vbnc -out:out *.vb - ;; - *) - echo "How did you get here? (${PISTON_LANGUAGE})" - exit 1 - ;; -esac diff --git a/packages/mono/6.12.0/environment b/packages/mono/6.12.0/environment deleted file mode 100644 index 977a5e8..0000000 --- a/packages/mono/6.12.0/environment +++ /dev/null @@ -1 +0,0 @@ -export PATH=$PWD/bin:$PATH diff --git a/packages/mono/6.12.0/metadata.json b/packages/mono/6.12.0/metadata.json deleted file mode 100644 index 3f483a4..0000000 --- a/packages/mono/6.12.0/metadata.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "language": "mono", - "version": "6.12.0", - "provides": [ - { - "language": "csharp", - "aliases": ["mono", "mono-csharp", "mono-c#", "mono-cs", "c#", "cs"] - }, - { - "language": "basic", - "aliases": [ - "vb", - "mono-vb", - "mono-basic", - "visual-basic", - "visual basic" - ] - } - ] -} diff --git a/packages/mono/6.12.0/run b/packages/mono/6.12.0/run deleted file mode 100644 index 5a2e015..0000000 --- a/packages/mono/6.12.0/run +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -shift -mono out "$@" \ No newline at end of file diff --git a/packages/mono/6.12.0/test.cs b/packages/mono/6.12.0/test.cs deleted file mode 100644 index e91a2a2..0000000 --- a/packages/mono/6.12.0/test.cs +++ /dev/null @@ -1,9 +0,0 @@ -using System; - -public class Test -{ - public static void Main(string[] args) - { - Console.WriteLine("OK"); - } -} \ No newline at end of file diff --git a/packages/mono/6.12.0/test.vb b/packages/mono/6.12.0/test.vb deleted file mode 100644 index 291042e..0000000 --- a/packages/mono/6.12.0/test.vb +++ /dev/null @@ -1,9 +0,0 @@ -Imports System - -Module Module1 - - Sub Main() - Console.WriteLine("OK") - End Sub - -End Module diff --git a/runtimes/default.nix b/runtimes/default.nix index 1669be2..4624670 100644 --- a/runtimes/default.nix +++ b/runtimes/default.nix @@ -62,4 +62,5 @@ args: { "node-coffeescript" = import ./node-coffeescript.nix args; "jvm-scala" = import ./jvm-scala.nix args; "llvm_ir" = import ./llvm_ir.nix args; + "mono-basic" = import ./mono-basic.nix args; } diff --git a/runtimes/mono-basic.nix b/runtimes/mono-basic.nix new file mode 100644 index 0000000..ecafd3c --- /dev/null +++ b/runtimes/mono-basic.nix @@ -0,0 +1,47 @@ +{pkgs, piston, ...}: +let + pkg = pkgs.mono; +in piston.mkRuntime { + language = "basic"; + version = pkg.version; + runtime = "mono"; + + aliases = [ + "vb" + "mono-vb" + "mono-basic" + "visual-basic" + ]; + + compile = '' + rename 's/$/\.vb/' "$@" # Add .vb extension + ${pkg}/bin/vbc -out:out -sdkpath:${pkg}/lib/mono/4.8-api *.vb + ''; + + run = '' + shift + ${pkg}/bin/mono out.exe "$@" + ''; + + tests = [ + (piston.mkTest { + files = { + "test.vb" = '' + Imports System + + Module Module1 + + Sub Main() + Console.WriteLine("OK") + End Sub + + End Module + ''; + }; + args = []; + stdin = ""; + packages = []; + main = "test.vb"; + }) + ]; +} \ No newline at end of file