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