From 5ee28d918a8945224563bdfed293a0ff4b6e5757 Mon Sep 17 00:00:00 2001 From: Dan Vargas Date: Mon, 31 Jan 2022 19:35:06 -0700 Subject: [PATCH 01/46] add ruby 3.1.0 --- runtimes/default.nix | 1 + runtimes/ruby.nix | 57 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+) create mode 100644 runtimes/ruby.nix diff --git a/runtimes/default.nix b/runtimes/default.nix index bfc0e2a..dbf454c 100644 --- a/runtimes/default.nix +++ b/runtimes/default.nix @@ -14,4 +14,5 @@ args: { "erlang" = import ./erlang.nix args; "gawk-awk" = import ./gawk-awk.nix args; "openjdk11_headless-java" = import ./openjdk11_headless-java.nix args; + "ruby" = import ./ruby.nix args; } diff --git a/runtimes/ruby.nix b/runtimes/ruby.nix new file mode 100644 index 0000000..6673222 --- /dev/null +++ b/runtimes/ruby.nix @@ -0,0 +1,57 @@ +{pkgs, piston, ...}: +let + pkg = pkgs.ruby_3_1; # ruby 3.1 stable from unstable channel +in piston.mkRuntime { + language = "ruby"; + version = pkg.version; + + aliases = [ + "ruby3" + "rb" + ]; + + run = '' + ${pkg}/bin/ruby "$@" + ''; + + # Run the following command to test the package: + # $ ./piston test ruby + tests = [ + # standard output test + (piston.mkTest { + files = { + "test.rb" = '' + puts("OK"); + ''; + }; + args = []; + stdin = ""; + packages = []; + main = "test.rb"; + }) + # args test + (piston.mkTest { + files = { + "test.rb" = '' + puts $*; + ''; + }; + args = ["OK"]; + stdin = ""; + packages = []; + main = "test.rb"; + }) + # stdin test + (piston.mkTest { + files = { + "test.rb" = '' + print Kernel.gets; + ''; + }; + args = []; + stdin = "OK"; + packages = []; + main = "test.rb"; + }) + ]; +} \ No newline at end of file From 6da12dd2b408d72be04c6c8c5fe39c05811490e4 Mon Sep 17 00:00:00 2001 From: Dan Vargas Date: Tue, 1 Feb 2022 13:18:40 -0700 Subject: [PATCH 02/46] add zig 0.9.0 --- runtimes/default.nix | 1 + runtimes/zig.nix | 43 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 runtimes/zig.nix diff --git a/runtimes/default.nix b/runtimes/default.nix index bfc0e2a..0272a43 100644 --- a/runtimes/default.nix +++ b/runtimes/default.nix @@ -14,4 +14,5 @@ args: { "erlang" = import ./erlang.nix args; "gawk-awk" = import ./gawk-awk.nix args; "openjdk11_headless-java" = import ./openjdk11_headless-java.nix args; + "zig" = import ./zig.nix args; } diff --git a/runtimes/zig.nix b/runtimes/zig.nix new file mode 100644 index 0000000..97c90d9 --- /dev/null +++ b/runtimes/zig.nix @@ -0,0 +1,43 @@ +{pkgs, piston, ...}: +let + pkg = pkgs.zig; +in piston.mkRuntime { + language = "zig"; + version = pkg.version; + aliases = []; + + # Add .zig extension for compile script and optimize compiler for small programs + compile = '' + rename 's/$/\.zig/' "$@" + ${pkg}/bin/zig build-exe -O ReleaseSafe --color off --cache-dir . --global-cache-dir . --name out *.zig + ''; + + # Remove first arg filename and run binary with remaining args + run = '' + shift + ./out "$@" + ''; + + # These should output "OK" to STDOUT if everything looks good + # Run the following command to test the package: + # $ ./piston test zig + tests = [ + # Standard output test + (piston.mkTest { + files = { + "test.zig" = '' + const std = @import("std"); + + pub fn main() !void { + const stdout = std.io.getStdOut().writer(); + try stdout.print("OK\n", .{}); + } + ''; + }; + args = []; + stdin = ""; + packages = []; + main = "test.zig"; + }) + ]; +} From 1df354c503813320f2eac3a04d7a107da45464d0 Mon Sep 17 00:00:00 2001 From: Dan Vargas Date: Wed, 2 Feb 2022 11:13:33 -0700 Subject: [PATCH 03/46] add vlang --- runtimes/default.nix | 3 ++- runtimes/vlang.nix | 40 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 runtimes/vlang.nix diff --git a/runtimes/default.nix b/runtimes/default.nix index ffdfe8f..e1a1f9a 100644 --- a/runtimes/default.nix +++ b/runtimes/default.nix @@ -14,6 +14,7 @@ args: { "erlang" = import ./erlang.nix args; "gawk-awk" = import ./gawk-awk.nix args; "openjdk11_headless-java" = import ./openjdk11_headless-java.nix args; - "zig" = import ./zig.nix args; "ruby" = import ./ruby.nix args; + "zig" = import ./zig.nix args; + "vlang" = import ./vlang.nix args; } diff --git a/runtimes/vlang.nix b/runtimes/vlang.nix new file mode 100644 index 0000000..c203c1b --- /dev/null +++ b/runtimes/vlang.nix @@ -0,0 +1,40 @@ +{pkgs, piston, ...}: +let + pkg = pkgs.vlang; +in piston.mkRuntime { + language = "vlang"; + version = pkg.version; + + aliases = [ + "v" + ]; + + run = '' + # vlang env + export VMODULES="$PWD" + export TMPDIR="$PWD" + + # modify file extension + mv "$1" "$1.v" + filename="$1.v" + shift + + ${pkg}/bin/v run "$filename" "$@" + ''; + + tests = [ + (piston.mkTest { + files = { + "file0.code" = '' + fn main() { + println('OK') + } + ''; + }; + args = []; + stdin = ""; + packages = []; + main = "file0.code"; + }) + ]; +} \ No newline at end of file From e0c41e3ddaa779ae1389be21f6359124eec0054d Mon Sep 17 00:00:00 2001 From: Dan Vargas Date: Thu, 3 Feb 2022 19:33:40 -0700 Subject: [PATCH 04/46] add swift 5.4.2 --- runtimes/default.nix | 1 + runtimes/ruby.nix | 2 +- runtimes/swift.nix | 27 +++++++++++++++++++++++++++ 3 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 runtimes/swift.nix diff --git a/runtimes/default.nix b/runtimes/default.nix index e1a1f9a..8730bff 100644 --- a/runtimes/default.nix +++ b/runtimes/default.nix @@ -17,4 +17,5 @@ args: { "ruby" = import ./ruby.nix args; "zig" = import ./zig.nix args; "vlang" = import ./vlang.nix args; + "swift" = import ./swift.nix args; } diff --git a/runtimes/ruby.nix b/runtimes/ruby.nix index 6673222..c2399e9 100644 --- a/runtimes/ruby.nix +++ b/runtimes/ruby.nix @@ -1,6 +1,6 @@ {pkgs, piston, ...}: let - pkg = pkgs.ruby_3_1; # ruby 3.1 stable from unstable channel + pkg = pkgs.ruby_3_1; in piston.mkRuntime { language = "ruby"; version = pkg.version; diff --git a/runtimes/swift.nix b/runtimes/swift.nix new file mode 100644 index 0000000..65c6a45 --- /dev/null +++ b/runtimes/swift.nix @@ -0,0 +1,27 @@ +{pkgs, piston, ...}: +let + pkg = pkgs.swift; +in piston.mkRuntime { + language = "swift"; + version = "5.4.2"; + aliases = []; + + run = '' + ls ${pkg} + ${pkg}/bin/swift -module-cache-path . "$@" + ''; + + tests = [ + (piston.mkTest { + files = { + "test.swift" = '' + print("OK"); + ''; + }; + args = []; + stdin = ""; + packages = []; + main = "test.swift"; + }) + ]; +} \ No newline at end of file From a857780f34a15c15fa838821462bd740d09cc333 Mon Sep 17 00:00:00 2001 From: Dan Vargas Date: Thu, 3 Feb 2022 19:55:08 -0700 Subject: [PATCH 05/46] fix zig extension rename --- runtimes/zig.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/runtimes/zig.nix b/runtimes/zig.nix index 97c90d9..b098306 100644 --- a/runtimes/zig.nix +++ b/runtimes/zig.nix @@ -8,7 +8,7 @@ in piston.mkRuntime { # Add .zig extension for compile script and optimize compiler for small programs compile = '' - rename 's/$/\.zig/' "$@" + for f; do mv "$f" "$f.zig"; done ${pkg}/bin/zig build-exe -O ReleaseSafe --color off --cache-dir . --global-cache-dir . --name out *.zig ''; @@ -22,10 +22,10 @@ in piston.mkRuntime { # Run the following command to test the package: # $ ./piston test zig tests = [ - # Standard output test + # Standard output test with generic file extension (piston.mkTest { files = { - "test.zig" = '' + "file0.code" = '' const std = @import("std"); pub fn main() !void { @@ -37,7 +37,7 @@ in piston.mkRuntime { args = []; stdin = ""; packages = []; - main = "test.zig"; + main = "file0.code"; }) ]; } From f79a168805f4684b5a92d5abc0ec9cedeb28d595 Mon Sep 17 00:00:00 2001 From: Dan Vargas Date: Thu, 3 Feb 2022 20:00:14 -0700 Subject: [PATCH 06/46] add extra check on ruby and swift tests --- runtimes/ruby.nix | 4 ++-- runtimes/swift.nix | 7 +++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/runtimes/ruby.nix b/runtimes/ruby.nix index c2399e9..e00fb37 100644 --- a/runtimes/ruby.nix +++ b/runtimes/ruby.nix @@ -20,14 +20,14 @@ in piston.mkRuntime { # standard output test (piston.mkTest { files = { - "test.rb" = '' + "file0.code" = '' puts("OK"); ''; }; args = []; stdin = ""; packages = []; - main = "test.rb"; + main = "file0.code"; }) # args test (piston.mkTest { diff --git a/runtimes/swift.nix b/runtimes/swift.nix index 65c6a45..9d9d728 100644 --- a/runtimes/swift.nix +++ b/runtimes/swift.nix @@ -3,25 +3,24 @@ let pkg = pkgs.swift; in piston.mkRuntime { language = "swift"; - version = "5.4.2"; + version = "5.4.2"; # pkg.version attribute is missing, so pinning it to 5.4.2 aliases = []; run = '' - ls ${pkg} ${pkg}/bin/swift -module-cache-path . "$@" ''; tests = [ (piston.mkTest { files = { - "test.swift" = '' + "file0.code" = '' print("OK"); ''; }; args = []; stdin = ""; packages = []; - main = "test.swift"; + main = "file0.code"; }) ]; } \ No newline at end of file From 35cd527c6911743ad9968e9f6d96c425736fe93e Mon Sep 17 00:00:00 2001 From: Dan Vargas Date: Fri, 4 Feb 2022 09:18:19 -0700 Subject: [PATCH 07/46] remove old packages --- packages/ruby/2.5.1/build.sh | 20 -------------------- packages/ruby/2.5.1/environment | 1 - packages/ruby/2.5.1/metadata.json | 5 ----- packages/ruby/2.5.1/run | 3 --- packages/ruby/2.5.1/test.rb | 1 - packages/ruby/3.0.1/build.sh | 21 --------------------- packages/ruby/3.0.1/environment | 4 ---- packages/ruby/3.0.1/metadata.json | 5 ----- packages/ruby/3.0.1/run | 4 ---- packages/ruby/3.0.1/test.rb | 1 - packages/swift/5.3.3/build.sh | 6 ------ packages/swift/5.3.3/environment | 4 ---- packages/swift/5.3.3/metadata.json | 5 ----- packages/swift/5.3.3/run | 4 ---- packages/swift/5.3.3/test.swift | 1 - packages/vlang/0.1.13/build.sh | 8 -------- packages/vlang/0.1.13/environment | 4 ---- packages/vlang/0.1.13/metadata.json | 5 ----- packages/vlang/0.1.13/run | 14 -------------- packages/vlang/0.1.13/test.v | 3 --- packages/zig/0.7.1/build.sh | 10 ---------- packages/zig/0.7.1/compile | 6 ------ packages/zig/0.7.1/environment | 4 ---- packages/zig/0.7.1/metadata.json | 5 ----- packages/zig/0.7.1/run | 4 ---- packages/zig/0.7.1/test.zig | 6 ------ packages/zig/0.8.0/build.sh | 10 ---------- packages/zig/0.8.0/compile | 6 ------ packages/zig/0.8.0/environment | 4 ---- packages/zig/0.8.0/metadata.json | 8 -------- packages/zig/0.8.0/run | 4 ---- packages/zig/0.8.0/test.zig | 6 ------ 32 files changed, 192 deletions(-) delete mode 100755 packages/ruby/2.5.1/build.sh delete mode 100644 packages/ruby/2.5.1/environment delete mode 100644 packages/ruby/2.5.1/metadata.json delete mode 100644 packages/ruby/2.5.1/run delete mode 100644 packages/ruby/2.5.1/test.rb delete mode 100755 packages/ruby/3.0.1/build.sh delete mode 100644 packages/ruby/3.0.1/environment delete mode 100644 packages/ruby/3.0.1/metadata.json delete mode 100644 packages/ruby/3.0.1/run delete mode 100644 packages/ruby/3.0.1/test.rb delete mode 100755 packages/swift/5.3.3/build.sh delete mode 100644 packages/swift/5.3.3/environment delete mode 100644 packages/swift/5.3.3/metadata.json delete mode 100644 packages/swift/5.3.3/run delete mode 100644 packages/swift/5.3.3/test.swift delete mode 100755 packages/vlang/0.1.13/build.sh delete mode 100644 packages/vlang/0.1.13/environment delete mode 100644 packages/vlang/0.1.13/metadata.json delete mode 100644 packages/vlang/0.1.13/run delete mode 100644 packages/vlang/0.1.13/test.v delete mode 100755 packages/zig/0.7.1/build.sh delete mode 100644 packages/zig/0.7.1/compile delete mode 100644 packages/zig/0.7.1/environment delete mode 100644 packages/zig/0.7.1/metadata.json delete mode 100644 packages/zig/0.7.1/run delete mode 100644 packages/zig/0.7.1/test.zig delete mode 100755 packages/zig/0.8.0/build.sh delete mode 100644 packages/zig/0.8.0/compile delete mode 100644 packages/zig/0.8.0/environment delete mode 100644 packages/zig/0.8.0/metadata.json delete mode 100644 packages/zig/0.8.0/run delete mode 100644 packages/zig/0.8.0/test.zig diff --git a/packages/ruby/2.5.1/build.sh b/packages/ruby/2.5.1/build.sh deleted file mode 100755 index 7403e87..0000000 --- a/packages/ruby/2.5.1/build.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash - -PREFIX=$(realpath $(dirname $0)) - -mkdir -p build - -cd build - -curl "https://cache.ruby-lang.org/pub/ruby/2.5/ruby-2.5.1.tar.gz" -o ruby.tar.gz -tar xzf ruby.tar.gz --strip-components=1 -rm ruby.tar.gz - -./configure --prefix "$PREFIX" -make -j$(nproc) -make install -j$(nproc) - -cd .. - -rm -rf build - diff --git a/packages/ruby/2.5.1/environment b/packages/ruby/2.5.1/environment deleted file mode 100644 index bd0ff98..0000000 --- a/packages/ruby/2.5.1/environment +++ /dev/null @@ -1 +0,0 @@ -export PATH=$PWD/bin:$PATH \ No newline at end of file diff --git a/packages/ruby/2.5.1/metadata.json b/packages/ruby/2.5.1/metadata.json deleted file mode 100644 index a483428..0000000 --- a/packages/ruby/2.5.1/metadata.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "language": "ruby", - "version": "2.5.1", - "aliases": ["ruby", "rb"] -} diff --git a/packages/ruby/2.5.1/run b/packages/ruby/2.5.1/run deleted file mode 100644 index ae76e5f..0000000 --- a/packages/ruby/2.5.1/run +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -ruby "$@" \ No newline at end of file diff --git a/packages/ruby/2.5.1/test.rb b/packages/ruby/2.5.1/test.rb deleted file mode 100644 index 3fca0dd..0000000 --- a/packages/ruby/2.5.1/test.rb +++ /dev/null @@ -1 +0,0 @@ -puts("OK") \ No newline at end of file diff --git a/packages/ruby/3.0.1/build.sh b/packages/ruby/3.0.1/build.sh deleted file mode 100755 index ab6b8a0..0000000 --- a/packages/ruby/3.0.1/build.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash - -PREFIX=$(realpath $(dirname $0)) - -mkdir -p build -cd build - -# Download and extract ruby -curl "https://cache.ruby-lang.org/pub/ruby/3.0/ruby-3.0.1.tar.gz" -o ruby.tar.gz -tar xzf ruby.tar.gz --strip-components=1 -rm ruby.tar.gz - -# Autoconf based -./configure --prefix "$PREFIX" -make -j$(nproc) -make install -j$(nproc) - -# Cleanup -cd .. -rm -rf build - diff --git a/packages/ruby/3.0.1/environment b/packages/ruby/3.0.1/environment deleted file mode 100644 index 118cf33..0000000 --- a/packages/ruby/3.0.1/environment +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -# Path to ruby binary -export PATH=$PWD/bin:$PATH diff --git a/packages/ruby/3.0.1/metadata.json b/packages/ruby/3.0.1/metadata.json deleted file mode 100644 index 283cf71..0000000 --- a/packages/ruby/3.0.1/metadata.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "language": "ruby", - "version": "3.0.1", - "aliases": ["ruby3", "rb"] -} diff --git a/packages/ruby/3.0.1/run b/packages/ruby/3.0.1/run deleted file mode 100644 index 55cca9c..0000000 --- a/packages/ruby/3.0.1/run +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -# Run ruby script with args -ruby "$@" diff --git a/packages/ruby/3.0.1/test.rb b/packages/ruby/3.0.1/test.rb deleted file mode 100644 index eb08579..0000000 --- a/packages/ruby/3.0.1/test.rb +++ /dev/null @@ -1 +0,0 @@ -puts("OK") diff --git a/packages/swift/5.3.3/build.sh b/packages/swift/5.3.3/build.sh deleted file mode 100755 index 5070b12..0000000 --- a/packages/swift/5.3.3/build.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env bash - -# Binary install -curl -L "https://swift.org/builds/swift-5.3.3-release/ubuntu1804/swift-5.3.3-RELEASE/swift-5.3.3-RELEASE-ubuntu18.04.tar.gz" -o swift.tar.gz -tar xzf swift.tar.gz --strip-components=2 -rm swift.tar.gz diff --git a/packages/swift/5.3.3/environment b/packages/swift/5.3.3/environment deleted file mode 100644 index 780b668..0000000 --- a/packages/swift/5.3.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/swift/5.3.3/metadata.json b/packages/swift/5.3.3/metadata.json deleted file mode 100644 index ecc52ae..0000000 --- a/packages/swift/5.3.3/metadata.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "language": "swift", - "version": "5.3.3", - "aliases": ["swift"] -} diff --git a/packages/swift/5.3.3/run b/packages/swift/5.3.3/run deleted file mode 100644 index 5d29e87..0000000 --- a/packages/swift/5.3.3/run +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env bash - -# Setting clang cache to current dir to avoid permission error on /tmp -swift -module-cache-path . "$@" diff --git a/packages/swift/5.3.3/test.swift b/packages/swift/5.3.3/test.swift deleted file mode 100644 index 3f2688f..0000000 --- a/packages/swift/5.3.3/test.swift +++ /dev/null @@ -1 +0,0 @@ -print("OK") \ No newline at end of file diff --git a/packages/vlang/0.1.13/build.sh b/packages/vlang/0.1.13/build.sh deleted file mode 100755 index 127bac9..0000000 --- a/packages/vlang/0.1.13/build.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env bash - -# Cloning vlang source -git clone https://github.com/vlang/v -cd v - -# Building and installing vlang -make \ No newline at end of file diff --git a/packages/vlang/0.1.13/environment b/packages/vlang/0.1.13/environment deleted file mode 100644 index 638b0c2..0000000 --- a/packages/vlang/0.1.13/environment +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env bash - -# Put 'export' statements here for environment variables -export PATH="$PWD/v:$PATH" \ No newline at end of file diff --git a/packages/vlang/0.1.13/metadata.json b/packages/vlang/0.1.13/metadata.json deleted file mode 100644 index d136076..0000000 --- a/packages/vlang/0.1.13/metadata.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "language": "vlang", - "version": "0.1.13", - "aliases": ["v"] -} diff --git a/packages/vlang/0.1.13/run b/packages/vlang/0.1.13/run deleted file mode 100644 index c999cca..0000000 --- a/packages/vlang/0.1.13/run +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/env bash - -# Export environment variables -export VMODULES="$PWD" -export TMPDIR="$PWD" - -# Put instructions to run the runtime - -filename=$1 - -rename 's/$/\.v/' $filename # Add .v extension - -shift -v run $filename.v "$@" diff --git a/packages/vlang/0.1.13/test.v b/packages/vlang/0.1.13/test.v deleted file mode 100644 index fb5de5e..0000000 --- a/packages/vlang/0.1.13/test.v +++ /dev/null @@ -1,3 +0,0 @@ -fn main() { - println('OK') -} \ No newline at end of file diff --git a/packages/zig/0.7.1/build.sh b/packages/zig/0.7.1/build.sh deleted file mode 100755 index 284214f..0000000 --- a/packages/zig/0.7.1/build.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env bash - -mkdir -p bin -cd bin/ - -curl -L "https://ziglang.org/download/0.7.1/zig-linux-x86_64-0.7.1.tar.xz" -o zig.tar.xz -tar xf zig.tar.xz --strip-components=1 -rm zig.tar.xz - -cd ../ diff --git a/packages/zig/0.7.1/compile b/packages/zig/0.7.1/compile deleted file mode 100644 index 75ee6ba..0000000 --- a/packages/zig/0.7.1/compile +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env bash - -# optimizing for small programs -rename 's/$/\.zig/' "$@" # Add .zig extension - -zig build-exe -O ReleaseSafe --color off --cache-dir . --global-cache-dir . --name out *.zig diff --git a/packages/zig/0.7.1/environment b/packages/zig/0.7.1/environment deleted file mode 100644 index a85000c..0000000 --- a/packages/zig/0.7.1/environment +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env bash - -# compiler path -export PATH=$PWD/bin:$PATH diff --git a/packages/zig/0.7.1/metadata.json b/packages/zig/0.7.1/metadata.json deleted file mode 100644 index 2712dc0..0000000 --- a/packages/zig/0.7.1/metadata.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "language": "zig", - "version": "0.7.1", - "aliases": ["zig"] -} diff --git a/packages/zig/0.7.1/run b/packages/zig/0.7.1/run deleted file mode 100644 index d96e06f..0000000 --- a/packages/zig/0.7.1/run +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env bash - -shift # Filename is only used in compile step, so we can take it out here -./out "$@" diff --git a/packages/zig/0.7.1/test.zig b/packages/zig/0.7.1/test.zig deleted file mode 100644 index 548c703..0000000 --- a/packages/zig/0.7.1/test.zig +++ /dev/null @@ -1,6 +0,0 @@ -const std = @import("std"); - -pub fn main() !void { - const stdout = std.io.getStdOut().writer(); - try stdout.print("OK\n", .{}); -} \ No newline at end of file diff --git a/packages/zig/0.8.0/build.sh b/packages/zig/0.8.0/build.sh deleted file mode 100755 index b3bbaf5..0000000 --- a/packages/zig/0.8.0/build.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env bash - -mkdir -p bin -cd bin/ - -curl -L "https://ziglang.org/download/0.8.0/zig-linux-x86_64-0.8.0.tar.xz" -o zig.tar.xz -tar xf zig.tar.xz --strip-components=1 -rm zig.tar.xz - -cd ../ diff --git a/packages/zig/0.8.0/compile b/packages/zig/0.8.0/compile deleted file mode 100644 index 75ee6ba..0000000 --- a/packages/zig/0.8.0/compile +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env bash - -# optimizing for small programs -rename 's/$/\.zig/' "$@" # Add .zig extension - -zig build-exe -O ReleaseSafe --color off --cache-dir . --global-cache-dir . --name out *.zig diff --git a/packages/zig/0.8.0/environment b/packages/zig/0.8.0/environment deleted file mode 100644 index a85000c..0000000 --- a/packages/zig/0.8.0/environment +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env bash - -# compiler path -export PATH=$PWD/bin:$PATH diff --git a/packages/zig/0.8.0/metadata.json b/packages/zig/0.8.0/metadata.json deleted file mode 100644 index 8c02d33..0000000 --- a/packages/zig/0.8.0/metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "language": "zig", - "version": "0.8.0", - "aliases": ["zig"], - "limit_overrides": { - "compile_timeout": 15000 - } -} diff --git a/packages/zig/0.8.0/run b/packages/zig/0.8.0/run deleted file mode 100644 index d96e06f..0000000 --- a/packages/zig/0.8.0/run +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env bash - -shift # Filename is only used in compile step, so we can take it out here -./out "$@" diff --git a/packages/zig/0.8.0/test.zig b/packages/zig/0.8.0/test.zig deleted file mode 100644 index 548c703..0000000 --- a/packages/zig/0.8.0/test.zig +++ /dev/null @@ -1,6 +0,0 @@ -const std = @import("std"); - -pub fn main() !void { - const stdout = std.io.getStdOut().writer(); - try stdout.print("OK\n", .{}); -} \ No newline at end of file From 9cbec535803e710100a3f65fc14ac9dbcba0e27e Mon Sep 17 00:00:00 2001 From: Dan Vargas Date: Fri, 4 Feb 2022 09:34:01 -0700 Subject: [PATCH 08/46] add perl-rename to container and update related runtime scripts --- api/default.nix | 1 + runtimes/vlang.nix | 6 +++--- runtimes/zig.nix | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/api/default.nix b/api/default.nix index a4d4868..544db0e 100644 --- a/api/default.nix +++ b/api/default.nix @@ -40,6 +40,7 @@ with pkgs; rec { gnutar gzip gnugrep + rename util-linux ]; diff --git a/runtimes/vlang.nix b/runtimes/vlang.nix index c203c1b..6ed8b33 100644 --- a/runtimes/vlang.nix +++ b/runtimes/vlang.nix @@ -15,11 +15,11 @@ in piston.mkRuntime { export TMPDIR="$PWD" # modify file extension - mv "$1" "$1.v" - filename="$1.v" + filename="$1" + rename 's/$/.v/' "$filename" shift - ${pkg}/bin/v run "$filename" "$@" + ${pkg}/bin/v run "$filename.v" "$@" ''; tests = [ diff --git a/runtimes/zig.nix b/runtimes/zig.nix index b098306..b2b56cb 100644 --- a/runtimes/zig.nix +++ b/runtimes/zig.nix @@ -8,7 +8,7 @@ in piston.mkRuntime { # Add .zig extension for compile script and optimize compiler for small programs compile = '' - for f; do mv "$f" "$f.zig"; done + rename 's/$/.zig/' "$@" ${pkg}/bin/zig build-exe -O ReleaseSafe --color off --cache-dir . --global-cache-dir . --name out *.zig ''; From 60296ccd26e31e0a65f2e6d490d411ca29f33eeb Mon Sep 17 00:00:00 2001 From: Dan Vargas Date: Fri, 4 Feb 2022 10:19:05 -0700 Subject: [PATCH 09/46] disable checks for nix-package branch --- .github/workflows/api-push.yaml | 1 + .github/workflows/package-pr.yaml | 2 ++ .github/workflows/package-push.yaml | 1 + 3 files changed, 4 insertions(+) diff --git a/.github/workflows/api-push.yaml b/.github/workflows/api-push.yaml index dec3bce..8461e41 100644 --- a/.github/workflows/api-push.yaml +++ b/.github/workflows/api-push.yaml @@ -4,6 +4,7 @@ on: branches: - master - v3 + - '!nix-packages' paths: - api/** diff --git a/.github/workflows/package-pr.yaml b/.github/workflows/package-pr.yaml index d5bfe78..d0856a3 100644 --- a/.github/workflows/package-pr.yaml +++ b/.github/workflows/package-pr.yaml @@ -2,6 +2,8 @@ name: 'Package Pull Requests' on: pull_request: + branches: + - '!nix-packages' types: - opened - reopened diff --git a/.github/workflows/package-push.yaml b/.github/workflows/package-push.yaml index 9de6051..c740191 100644 --- a/.github/workflows/package-push.yaml +++ b/.github/workflows/package-push.yaml @@ -5,6 +5,7 @@ on: branches: - master - v3 + - '!nix-packages' paths: - packages/** From 59f164c48c294de29b1c0124c430c96c1d36a3c2 Mon Sep 17 00:00:00 2001 From: Dan Vargas Date: Sun, 6 Feb 2022 13:58:02 -0700 Subject: [PATCH 10/46] add typescript node --- runtimes/default.nix | 1 + runtimes/node-typescript.nix | 40 ++++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 runtimes/node-typescript.nix diff --git a/runtimes/default.nix b/runtimes/default.nix index 8730bff..6aa3355 100644 --- a/runtimes/default.nix +++ b/runtimes/default.nix @@ -18,4 +18,5 @@ args: { "zig" = import ./zig.nix args; "vlang" = import ./vlang.nix args; "swift" = import ./swift.nix args; + "node-typescript" = import ./node-typescript.nix args; } diff --git a/runtimes/node-typescript.nix b/runtimes/node-typescript.nix new file mode 100644 index 0000000..5d75f88 --- /dev/null +++ b/runtimes/node-typescript.nix @@ -0,0 +1,40 @@ +{pkgs, piston, ...}: +let + node = pkgs.nodejs; + pkg = pkgs.nodePackages.typescript; +in piston.mkRuntime { + language = "typescript"; + version = pkg.version; + runtime = "node"; + + aliases = [ + "ts" + "node-ts" + "tsc" + ]; + + compile = '' + rename 's/$/.ts/' "$@" # Add .ts extension + ${pkg}/bin/tsc *.ts + ''; + + run = '' + code="$1.js" + shift + ${node}/bin/node "$code" "$@" + ''; + + tests = [ + (piston.mkTest { + files = { + "test.js" = '' + console.log("OK"); + ''; + }; + args = []; + stdin = ""; + packages = []; + main = "test.js"; + }) + ]; +} \ No newline at end of file From f113b0c00afc24f3bcc593372717443c9b4a314e Mon Sep 17 00:00:00 2001 From: Dan Vargas Date: Sun, 6 Feb 2022 13:58:53 -0700 Subject: [PATCH 11/46] remove old ts node package --- packages/typescript/4.2.3/build.sh | 7 ------- packages/typescript/4.2.3/compile | 7 ------- packages/typescript/4.2.3/environment | 4 ---- packages/typescript/4.2.3/metadata.json | 5 ----- packages/typescript/4.2.3/run | 8 -------- packages/typescript/4.2.3/test.ts | 1 - 6 files changed, 32 deletions(-) delete mode 100755 packages/typescript/4.2.3/build.sh delete mode 100644 packages/typescript/4.2.3/compile delete mode 100644 packages/typescript/4.2.3/environment delete mode 100644 packages/typescript/4.2.3/metadata.json delete mode 100644 packages/typescript/4.2.3/run delete mode 100644 packages/typescript/4.2.3/test.ts diff --git a/packages/typescript/4.2.3/build.sh b/packages/typescript/4.2.3/build.sh deleted file mode 100755 index 9182055..0000000 --- a/packages/typescript/4.2.3/build.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env bash - -source ../../node/15.10.0/build.sh - -source ./environment - -bin/npm install -g typescript@4.2.3 diff --git a/packages/typescript/4.2.3/compile b/packages/typescript/4.2.3/compile deleted file mode 100644 index d674bb0..0000000 --- a/packages/typescript/4.2.3/compile +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env bash - -# Put instructions to compile source code, remove this file if the language does not require this stage - -rename 's/$/\.ts/' "$@" # Add .ts extension - -tsc *.ts \ No newline at end of file diff --git a/packages/typescript/4.2.3/environment b/packages/typescript/4.2.3/environment deleted file mode 100644 index 780b668..0000000 --- a/packages/typescript/4.2.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/typescript/4.2.3/metadata.json b/packages/typescript/4.2.3/metadata.json deleted file mode 100644 index cc7669b..0000000 --- a/packages/typescript/4.2.3/metadata.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "language": "typescript", - "version": "4.2.3", - "aliases": ["ts", "node-ts", "tsc"] -} diff --git a/packages/typescript/4.2.3/run b/packages/typescript/4.2.3/run deleted file mode 100644 index 5a8c60e..0000000 --- a/packages/typescript/4.2.3/run +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env bash - -# Put instructions to run the runtime - -CODE=$1.js -shift - -node $CODE "$@" diff --git a/packages/typescript/4.2.3/test.ts b/packages/typescript/4.2.3/test.ts deleted file mode 100644 index e106678..0000000 --- a/packages/typescript/4.2.3/test.ts +++ /dev/null @@ -1 +0,0 @@ -console.log('OK'); From 2758f95228040cef6254ede212454193020c5f7c Mon Sep 17 00:00:00 2001 From: Dan Vargas Date: Sun, 6 Feb 2022 14:07:13 -0700 Subject: [PATCH 12/46] migrate sqlite3 to nix --- packages/sqlite3/3.36.0/build.sh | 10 --------- packages/sqlite3/3.36.0/environment | 2 -- packages/sqlite3/3.36.0/metadata.json | 5 ----- packages/sqlite3/3.36.0/run | 3 --- packages/sqlite3/3.36.0/test.sql | 1 - runtimes/default.nix | 1 + runtimes/sqlite3.nix | 30 +++++++++++++++++++++++++++ 7 files changed, 31 insertions(+), 21 deletions(-) delete mode 100755 packages/sqlite3/3.36.0/build.sh delete mode 100644 packages/sqlite3/3.36.0/environment delete mode 100644 packages/sqlite3/3.36.0/metadata.json delete mode 100644 packages/sqlite3/3.36.0/run delete mode 100644 packages/sqlite3/3.36.0/test.sql create mode 100644 runtimes/sqlite3.nix diff --git a/packages/sqlite3/3.36.0/build.sh b/packages/sqlite3/3.36.0/build.sh deleted file mode 100755 index 18d5b8f..0000000 --- a/packages/sqlite3/3.36.0/build.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash -PREFIX=$(realpath $(dirname $0)) - -curl https://www.sqlite.org/2021/sqlite-amalgamation-3360000.zip -o sqlite.zip -unzip -q sqlite.zip -rm -rf sqlite.zip - -gcc -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION sqlite-amalgamation-3360000/shell.c sqlite-amalgamation-3360000/sqlite3.c -o sqlite3 - -rm -rf sqlite-amalgamation-3360000 diff --git a/packages/sqlite3/3.36.0/environment b/packages/sqlite3/3.36.0/environment deleted file mode 100644 index 50242cc..0000000 --- a/packages/sqlite3/3.36.0/environment +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -export PATH=$PWD:$PATH diff --git a/packages/sqlite3/3.36.0/metadata.json b/packages/sqlite3/3.36.0/metadata.json deleted file mode 100644 index d531aaf..0000000 --- a/packages/sqlite3/3.36.0/metadata.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "language": "sqlite3", - "version": "3.36.0", - "aliases": ["sqlite", "sql"] -} diff --git a/packages/sqlite3/3.36.0/run b/packages/sqlite3/3.36.0/run deleted file mode 100644 index 8484f3d..0000000 --- a/packages/sqlite3/3.36.0/run +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -sqlite3 < "$1" diff --git a/packages/sqlite3/3.36.0/test.sql b/packages/sqlite3/3.36.0/test.sql deleted file mode 100644 index 3a3c57b..0000000 --- a/packages/sqlite3/3.36.0/test.sql +++ /dev/null @@ -1 +0,0 @@ -SELECT 'OK'; diff --git a/runtimes/default.nix b/runtimes/default.nix index 6aa3355..9e817a6 100644 --- a/runtimes/default.nix +++ b/runtimes/default.nix @@ -19,4 +19,5 @@ args: { "vlang" = import ./vlang.nix args; "swift" = import ./swift.nix args; "node-typescript" = import ./node-typescript.nix args; + "sqlite3" = import ./sqlite3.nix args; } diff --git a/runtimes/sqlite3.nix b/runtimes/sqlite3.nix new file mode 100644 index 0000000..5fc105a --- /dev/null +++ b/runtimes/sqlite3.nix @@ -0,0 +1,30 @@ +{pkgs, piston, ...}: +let + pkg = pkgs.sqlite; +in piston.mkRuntime { + language = "sqlite3"; + version = pkg.version; + + aliases = [ + "sqlite" + "sql" + ]; + + run = '' + ${pkg}/bin/sqlite3 < "$1" + ''; + + tests = [ + (piston.mkTest { + files = { + "test.sql" = '' + SELECT 'OK'; + ''; + }; + args = []; + stdin = ""; + packages = []; + main = "test.sql"; + }) + ]; +} \ No newline at end of file From a8c23ecd99800e0b185cb0346cee543ab906bff2 Mon Sep 17 00:00:00 2001 From: Dan Vargas Date: Sun, 6 Feb 2022 18:38:30 -0700 Subject: [PATCH 13/46] migrate rscript to nix --- packages/rscript/4.1.1/build.sh | 16 -------- packages/rscript/4.1.1/environment | 1 - packages/rscript/4.1.1/metadata.json | 5 --- packages/rscript/4.1.1/run | 2 - packages/rscript/4.1.1/test.r | 1 - runtimes/default.nix | 1 + runtimes/rscript.nix | 59 ++++++++++++++++++++++++++++ 7 files changed, 60 insertions(+), 25 deletions(-) delete mode 100755 packages/rscript/4.1.1/build.sh delete mode 100644 packages/rscript/4.1.1/environment delete mode 100644 packages/rscript/4.1.1/metadata.json delete mode 100644 packages/rscript/4.1.1/run delete mode 100644 packages/rscript/4.1.1/test.r create mode 100644 runtimes/rscript.nix diff --git a/packages/rscript/4.1.1/build.sh b/packages/rscript/4.1.1/build.sh deleted file mode 100755 index 9837c22..0000000 --- a/packages/rscript/4.1.1/build.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash - -PREFIX=$(realpath $(dirname $0)) - -mkdir build -cd build - -curl https://cloud.r-project.org/src/base/R-4/R-4.1.1.tar.gz -o R.tar.gz -tar xzf R.tar.gz --strip-components 1 - -./configure --prefix="$PREFIX" --with-x=no -make -j$(nproc) -make install -j$(nproc) - -cd ../ -rm -rf build diff --git a/packages/rscript/4.1.1/environment b/packages/rscript/4.1.1/environment deleted file mode 100644 index 977a5e8..0000000 --- a/packages/rscript/4.1.1/environment +++ /dev/null @@ -1 +0,0 @@ -export PATH=$PWD/bin:$PATH diff --git a/packages/rscript/4.1.1/metadata.json b/packages/rscript/4.1.1/metadata.json deleted file mode 100644 index db16a76..0000000 --- a/packages/rscript/4.1.1/metadata.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "language": "rscript", - "version": "4.1.1", - "aliases": ["r"] -} diff --git a/packages/rscript/4.1.1/run b/packages/rscript/4.1.1/run deleted file mode 100644 index d122eb8..0000000 --- a/packages/rscript/4.1.1/run +++ /dev/null @@ -1,2 +0,0 @@ -#/bin/bash -Rscript "$@" diff --git a/packages/rscript/4.1.1/test.r b/packages/rscript/4.1.1/test.r deleted file mode 100644 index 9273f27..0000000 --- a/packages/rscript/4.1.1/test.r +++ /dev/null @@ -1 +0,0 @@ -cat('OK') diff --git a/runtimes/default.nix b/runtimes/default.nix index 9e817a6..9aad700 100644 --- a/runtimes/default.nix +++ b/runtimes/default.nix @@ -20,4 +20,5 @@ args: { "swift" = import ./swift.nix args; "node-typescript" = import ./node-typescript.nix args; "sqlite3" = import ./sqlite3.nix args; + "rscript" = import ./rscript.nix args; } diff --git a/runtimes/rscript.nix b/runtimes/rscript.nix new file mode 100644 index 0000000..b1ae034 --- /dev/null +++ b/runtimes/rscript.nix @@ -0,0 +1,59 @@ +{pkgs, piston, ...}: +let + pkg = pkgs.rWrapper; +in piston.mkRuntime { + language = "rscript"; + version = "4.1.2-wrapper"; + + aliases = [ + "r" + ]; + + run = '' + ${pkg}/bin/Rscript "$@" + ''; + + tests = [ + # test different extension + (piston.mkTest { + files = { + "file.code" = '' + cat('OK') + ''; + }; + args = []; + stdin = ""; + packages = []; + main = "file.code"; + }) + # test argv + (piston.mkTest { + files = { + "test.r" = '' + cat(commandArgs(trailingOnly=TRUE)) + ''; + }; + args = ["OK"]; + stdin = ""; + packages = []; + main = "test.r"; + }) + # test stdin + (piston.mkTest { + files = { + "test.r" = '' + f <- file("stdin") + open(f) + while(length(line <- readLines(f,n=1)) > 0) { + write(line, stderr()) + cat(line) + } + ''; + }; + args = []; + stdin = "OK"; + packages = []; + main = "test.r"; + }) + ]; +} \ No newline at end of file From 54510b713ebdb10acc7bd1f3e8e9eae2797901b5 Mon Sep 17 00:00:00 2001 From: Dan Vargas Date: Sun, 6 Feb 2022 19:10:04 -0700 Subject: [PATCH 14/46] migrate raku to nix --- packages/raku/6.100.0/build.sh | 5 --- packages/raku/6.100.0/environment | 4 -- packages/raku/6.100.0/metadata.json | 5 --- packages/raku/6.100.0/run | 3 -- packages/raku/6.100.0/test.raku | 1 - runtimes/default.nix | 1 + runtimes/raku.nix | 58 +++++++++++++++++++++++++++++ 7 files changed, 59 insertions(+), 18 deletions(-) delete mode 100644 packages/raku/6.100.0/build.sh delete mode 100644 packages/raku/6.100.0/environment delete mode 100644 packages/raku/6.100.0/metadata.json delete mode 100644 packages/raku/6.100.0/run delete mode 100644 packages/raku/6.100.0/test.raku create mode 100644 runtimes/raku.nix diff --git a/packages/raku/6.100.0/build.sh b/packages/raku/6.100.0/build.sh deleted file mode 100644 index 20be2fc..0000000 --- a/packages/raku/6.100.0/build.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env bash - -curl -L "https://rakudo.org/dl/rakudo/rakudo-moar-2021.05-01-linux-x86_64-gcc.tar.gz" -o raku.tar.xz -tar xf raku.tar.xz --strip-components=1 -rm raku.tar.xz \ No newline at end of file diff --git a/packages/raku/6.100.0/environment b/packages/raku/6.100.0/environment deleted file mode 100644 index 12ab624..0000000 --- a/packages/raku/6.100.0/environment +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -# Path to raku binary -export PATH=$PWD/bin:$PATH \ No newline at end of file diff --git a/packages/raku/6.100.0/metadata.json b/packages/raku/6.100.0/metadata.json deleted file mode 100644 index e1fbad8..0000000 --- a/packages/raku/6.100.0/metadata.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "language": "raku", - "version": "6.100.0", - "aliases": ["raku", "rakudo", "perl6", "p6", "pl6"] -} diff --git a/packages/raku/6.100.0/run b/packages/raku/6.100.0/run deleted file mode 100644 index 6c2c077..0000000 --- a/packages/raku/6.100.0/run +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -raku "$@" \ No newline at end of file diff --git a/packages/raku/6.100.0/test.raku b/packages/raku/6.100.0/test.raku deleted file mode 100644 index f863fac..0000000 --- a/packages/raku/6.100.0/test.raku +++ /dev/null @@ -1 +0,0 @@ -say "OK" \ No newline at end of file diff --git a/runtimes/default.nix b/runtimes/default.nix index 9aad700..5131bb6 100644 --- a/runtimes/default.nix +++ b/runtimes/default.nix @@ -21,4 +21,5 @@ args: { "node-typescript" = import ./node-typescript.nix args; "sqlite3" = import ./sqlite3.nix args; "rscript" = import ./rscript.nix args; + "raku" = import ./raku.nix args; } diff --git a/runtimes/raku.nix b/runtimes/raku.nix new file mode 100644 index 0000000..2f92b54 --- /dev/null +++ b/runtimes/raku.nix @@ -0,0 +1,58 @@ +{pkgs, piston, ...}: +let + pkg = pkgs.rakudo; +in piston.mkRuntime { + language = "raku"; + version = pkg.version; + + aliases = [ + "raku" + "rakudo" + "perl6" + "p6" + "pl6" + ]; + + run = '' + ${pkg}/bin/raku "$@" + ''; + + tests = [ + # test different extension + (piston.mkTest { + files = { + "file.code" = '' + say "OK" + ''; + }; + args = []; + stdin = ""; + packages = []; + main = "file.code"; + }) + # test argv + (piston.mkTest { + files = { + "test.raku" = '' + print @*ARGS + ''; + }; + args = ["OK"]; + stdin = ""; + packages = []; + main = "test.raku"; + }) + # test stdin + (piston.mkTest { + files = { + "test.raku" = '' + say prompt + ''; + }; + args = []; + stdin = "OK"; + packages = []; + main = "test.raku"; + }) + ]; +} \ No newline at end of file From f16eb5fa42a237223490feaf94dda3bed35d7c7b Mon Sep 17 00:00:00 2001 From: Dan Vargas Date: Sun, 6 Feb 2022 19:25:23 -0700 Subject: [PATCH 15/46] migrate racket to nix --- packages/racket/8.3.0/build.sh | 10 ----- packages/racket/8.3.0/environment | 5 --- packages/racket/8.3.0/metadata.json | 5 --- packages/racket/8.3.0/run | 3 -- packages/racket/8.3.0/test.rkt | 3 -- runtimes/default.nix | 1 + runtimes/racket.nix | 61 +++++++++++++++++++++++++++++ 7 files changed, 62 insertions(+), 26 deletions(-) delete mode 100644 packages/racket/8.3.0/build.sh delete mode 100644 packages/racket/8.3.0/environment delete mode 100644 packages/racket/8.3.0/metadata.json delete mode 100644 packages/racket/8.3.0/run delete mode 100644 packages/racket/8.3.0/test.rkt create mode 100644 runtimes/racket.nix diff --git a/packages/racket/8.3.0/build.sh b/packages/racket/8.3.0/build.sh deleted file mode 100644 index 187aef4..0000000 --- a/packages/racket/8.3.0/build.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env bash - -# curl racket 8.3 linux installation shell file -curl -L 'https://download.racket-lang.org/installers/8.3/racket-8.3-x86_64-linux-cs.sh' -o racket.sh - -# provide settings "no" "4" and "" to racket.sh -echo "no -4 -" | sh racket.sh - diff --git a/packages/racket/8.3.0/environment b/packages/racket/8.3.0/environment deleted file mode 100644 index 1a30eef..0000000 --- a/packages/racket/8.3.0/environment +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash - -# Path to racket binary -export PATH=$PWD/bin:$PATH -export RACKET_PATH=$PWD/racket \ No newline at end of file diff --git a/packages/racket/8.3.0/metadata.json b/packages/racket/8.3.0/metadata.json deleted file mode 100644 index 14b902c..0000000 --- a/packages/racket/8.3.0/metadata.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "language": "racket", - "version": "8.3.0", - "aliases": ["rkt"] -} diff --git a/packages/racket/8.3.0/run b/packages/racket/8.3.0/run deleted file mode 100644 index 227bfaa..0000000 --- a/packages/racket/8.3.0/run +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -"$RACKET_PATH"/bin/racket "$@" \ No newline at end of file diff --git a/packages/racket/8.3.0/test.rkt b/packages/racket/8.3.0/test.rkt deleted file mode 100644 index 7e0825c..0000000 --- a/packages/racket/8.3.0/test.rkt +++ /dev/null @@ -1,3 +0,0 @@ -#lang racket - -(display "OK") \ No newline at end of file diff --git a/runtimes/default.nix b/runtimes/default.nix index 5131bb6..cbefe12 100644 --- a/runtimes/default.nix +++ b/runtimes/default.nix @@ -22,4 +22,5 @@ args: { "sqlite3" = import ./sqlite3.nix args; "rscript" = import ./rscript.nix args; "raku" = import ./raku.nix args; + "racket" = import ./racket.nix args; } diff --git a/runtimes/racket.nix b/runtimes/racket.nix new file mode 100644 index 0000000..e20172f --- /dev/null +++ b/runtimes/racket.nix @@ -0,0 +1,61 @@ +{pkgs, piston, ...}: +let + pkg = pkgs.racket-minimal; +in piston.mkRuntime { + language = "racket"; + version = pkg.version; + + aliases = [ + "rkt" + ]; + + run = '' + ${pkg}/bin/racket "$@" + ''; + + tests = [ + # test different file extension + (piston.mkTest { + files = { + "file.code" = '' + #lang racket + (display "OK") + ''; + }; + args = []; + stdin = ""; + packages = []; + main = "file.code"; + }) + #test argv + (piston.mkTest { + files = { + "test.rkt" = '' + #lang racket + (for ([arg (current-command-line-arguments)]) (displayln arg)) + ''; + }; + args = ["OK"]; + stdin = ""; + packages = []; + main = "test.rkt"; + }) + # test stdin + (piston.mkTest { + files = { + "test.rkt" = '' + #lang racket + (let loop () + (match (read-char) + [(? eof-object?) (void)] + [c (display c) + (loop)])) + ''; + }; + args = []; + stdin = "OK"; + packages = []; + main = "test.rkt"; + }) + ]; +} \ No newline at end of file From f35d3f910f262d9526fedc8abaa05b98185e70ec Mon Sep 17 00:00:00 2001 From: Dan Vargas Date: Sun, 6 Feb 2022 19:39:36 -0700 Subject: [PATCH 16/46] migrate powershell to nix --- packages/pwsh/7.1.4/build.sh | 6 ---- packages/pwsh/7.1.4/environment | 1 - packages/pwsh/7.1.4/metadata.json | 10 ------ packages/pwsh/7.1.4/run | 3 -- packages/pwsh/7.1.4/test.ps1 | 1 - runtimes/default.nix | 1 + runtimes/powershell.nix | 58 +++++++++++++++++++++++++++++++ 7 files changed, 59 insertions(+), 21 deletions(-) delete mode 100755 packages/pwsh/7.1.4/build.sh delete mode 100644 packages/pwsh/7.1.4/environment delete mode 100644 packages/pwsh/7.1.4/metadata.json delete mode 100644 packages/pwsh/7.1.4/run delete mode 100644 packages/pwsh/7.1.4/test.ps1 create mode 100644 runtimes/powershell.nix diff --git a/packages/pwsh/7.1.4/build.sh b/packages/pwsh/7.1.4/build.sh deleted file mode 100755 index 3f4b070..0000000 --- a/packages/pwsh/7.1.4/build.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash -curl -L https://github.com/PowerShell/PowerShell/releases/download/v7.1.4/powershell-7.1.4-linux-x64.tar.gz -o powershell.tar.gz -tar zxf powershell.tar.gz -rm powershell.tar.gz - -chmod +x pwsh diff --git a/packages/pwsh/7.1.4/environment b/packages/pwsh/7.1.4/environment deleted file mode 100644 index 42644cd..0000000 --- a/packages/pwsh/7.1.4/environment +++ /dev/null @@ -1 +0,0 @@ -export PATH=$PWD:$PATH diff --git a/packages/pwsh/7.1.4/metadata.json b/packages/pwsh/7.1.4/metadata.json deleted file mode 100644 index da90f76..0000000 --- a/packages/pwsh/7.1.4/metadata.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "language": "pwsh", - "version": "7.1.4", - "provides": [ - { - "language": "powershell", - "aliases": ["ps", "pwsh", "ps1"] - } - ] -} diff --git a/packages/pwsh/7.1.4/run b/packages/pwsh/7.1.4/run deleted file mode 100644 index 02a0be7..0000000 --- a/packages/pwsh/7.1.4/run +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -pwsh "$@" diff --git a/packages/pwsh/7.1.4/test.ps1 b/packages/pwsh/7.1.4/test.ps1 deleted file mode 100644 index f0a4be3..0000000 --- a/packages/pwsh/7.1.4/test.ps1 +++ /dev/null @@ -1 +0,0 @@ -echo "OK" diff --git a/runtimes/default.nix b/runtimes/default.nix index cbefe12..a36c3fc 100644 --- a/runtimes/default.nix +++ b/runtimes/default.nix @@ -23,4 +23,5 @@ args: { "rscript" = import ./rscript.nix args; "raku" = import ./raku.nix args; "racket" = import ./racket.nix args; + "powershell" = import ./powershell.nix args; } diff --git a/runtimes/powershell.nix b/runtimes/powershell.nix new file mode 100644 index 0000000..4e72687 --- /dev/null +++ b/runtimes/powershell.nix @@ -0,0 +1,58 @@ +{pkgs, piston, ...}: +let + pkg = pkgs.powershell; +in piston.mkRuntime { + language = "powershell"; + version = pkg.version; + + aliases = [ + "pwsh" + "ps" + "ps1" + ]; + + run = '' + ${pkg}/bin/pwsh "$@" + ''; + + tests = [ + # test different file extension + (piston.mkTest { + files = { + "test.code" = '' + echo "OK" + ''; + }; + args = []; + stdin = ""; + packages = []; + main = "test.code"; + }) + # test argv + (piston.mkTest { + files = { + "test.pwsh" = '' + foreach ($s in $args) { + Write-Host $s + } + ''; + }; + args = ["OK"]; + stdin = ""; + packages = []; + main = "test.pwsh"; + }) + # test stdin + (piston.mkTest { + files = { + "test.pwsh" = '' + $s = Read-Host + ''; + }; + args = []; + stdin = "OK"; + packages = []; + main = "test.pwsh"; + }) + ]; +} \ No newline at end of file From b94e99ac099904465421f5eb92acf9029e0312e2 Mon Sep 17 00:00:00 2001 From: Dan Vargas Date: Sun, 6 Feb 2022 19:57:04 -0700 Subject: [PATCH 17/46] review fixes --- runtimes/default.nix | 2 +- runtimes/raku.nix | 1 - runtimes/{sqlite3.nix => sqlite.nix} | 3 +-- 3 files changed, 2 insertions(+), 4 deletions(-) rename runtimes/{sqlite3.nix => sqlite.nix} (91%) diff --git a/runtimes/default.nix b/runtimes/default.nix index a36c3fc..3dc95a5 100644 --- a/runtimes/default.nix +++ b/runtimes/default.nix @@ -19,7 +19,7 @@ args: { "vlang" = import ./vlang.nix args; "swift" = import ./swift.nix args; "node-typescript" = import ./node-typescript.nix args; - "sqlite3" = import ./sqlite3.nix args; + "sqlite" = import ./sqlite.nix args; "rscript" = import ./rscript.nix args; "raku" = import ./raku.nix args; "racket" = import ./racket.nix args; diff --git a/runtimes/raku.nix b/runtimes/raku.nix index 2f92b54..e2aba3f 100644 --- a/runtimes/raku.nix +++ b/runtimes/raku.nix @@ -6,7 +6,6 @@ in piston.mkRuntime { version = pkg.version; aliases = [ - "raku" "rakudo" "perl6" "p6" diff --git a/runtimes/sqlite3.nix b/runtimes/sqlite.nix similarity index 91% rename from runtimes/sqlite3.nix rename to runtimes/sqlite.nix index 5fc105a..97d9dfb 100644 --- a/runtimes/sqlite3.nix +++ b/runtimes/sqlite.nix @@ -2,11 +2,10 @@ let pkg = pkgs.sqlite; in piston.mkRuntime { - language = "sqlite3"; + language = "sqlite"; version = pkg.version; aliases = [ - "sqlite" "sql" ]; From a8adca3e18af0dbe8c35f5b8208e16a42373c4a3 Mon Sep 17 00:00:00 2001 From: Dan Vargas Date: Sun, 6 Feb 2022 20:55:36 -0700 Subject: [PATCH 18/46] move prolog to nix --- packages/prolog/8.2.4/build.sh | 22 ---------------------- packages/prolog/8.2.4/environment | 1 - packages/prolog/8.2.4/metadata.json | 5 ----- packages/prolog/8.2.4/run | 4 ---- packages/prolog/8.2.4/test.prolog | 1 - runtimes/default.nix | 1 + runtimes/prolog.nix | 29 +++++++++++++++++++++++++++++ 7 files changed, 30 insertions(+), 33 deletions(-) delete mode 100755 packages/prolog/8.2.4/build.sh delete mode 100644 packages/prolog/8.2.4/environment delete mode 100644 packages/prolog/8.2.4/metadata.json delete mode 100644 packages/prolog/8.2.4/run delete mode 100644 packages/prolog/8.2.4/test.prolog create mode 100644 runtimes/prolog.nix diff --git a/packages/prolog/8.2.4/build.sh b/packages/prolog/8.2.4/build.sh deleted file mode 100755 index 3473d69..0000000 --- a/packages/prolog/8.2.4/build.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash - -PREFIX=$(realpath $(dirname $0)) - -mkdir -p build - -cd build - -# Source compile -curl -L "https://www.swi-prolog.org/download/stable/src/swipl-8.2.4.tar.gz" -o swipl.tar.gz -tar xzf swipl.tar.gz --strip-components=1 -rm swipl.tar.gz - -mkdir build -cd build -cmake -DCMAKE_INSTALL_PREFIX="$PREFIX" -DSWIPL_PACKAGES_JAVA=OFF -DSWIPL_PACKAGES_X=OFF -DMULTI_THREADED=OFF -DINSTALL_DOCUMENTATION=OFF .. -make -j$(nproc) -make install -j$(nproc) - -cd ../../ - -rm -rf build diff --git a/packages/prolog/8.2.4/environment b/packages/prolog/8.2.4/environment deleted file mode 100644 index bd0ff98..0000000 --- a/packages/prolog/8.2.4/environment +++ /dev/null @@ -1 +0,0 @@ -export PATH=$PWD/bin:$PATH \ No newline at end of file diff --git a/packages/prolog/8.2.4/metadata.json b/packages/prolog/8.2.4/metadata.json deleted file mode 100644 index d799d87..0000000 --- a/packages/prolog/8.2.4/metadata.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "language": "prolog", - "version": "8.2.4", - "aliases": ["prolog", "plg"] -} diff --git a/packages/prolog/8.2.4/run b/packages/prolog/8.2.4/run deleted file mode 100644 index 7609191..0000000 --- a/packages/prolog/8.2.4/run +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env bash - -# Put instructions to run the runtime -swipl -g true -t halt "$@" diff --git a/packages/prolog/8.2.4/test.prolog b/packages/prolog/8.2.4/test.prolog deleted file mode 100644 index 290ef7c..0000000 --- a/packages/prolog/8.2.4/test.prolog +++ /dev/null @@ -1 +0,0 @@ -:- write('OK'), nl. \ No newline at end of file diff --git a/runtimes/default.nix b/runtimes/default.nix index 3dc95a5..3e2c7d0 100644 --- a/runtimes/default.nix +++ b/runtimes/default.nix @@ -24,4 +24,5 @@ args: { "raku" = import ./raku.nix args; "racket" = import ./racket.nix args; "powershell" = import ./powershell.nix args; + "prolog" = import ./prolog.nix args; } diff --git a/runtimes/prolog.nix b/runtimes/prolog.nix new file mode 100644 index 0000000..a4058e1 --- /dev/null +++ b/runtimes/prolog.nix @@ -0,0 +1,29 @@ +{pkgs, piston, ...}: +let + pkg = pkgs.swiProlog; +in piston.mkRuntime { + language = "prolog"; + version = pkg.version; + + aliases = [ + "plg" + ]; + + run = '' + ${pkg}/bin/swipl -g true -t halt "$@" + ''; + + tests = [ + (piston.mkTest { + files = { + "test.pl" = '' + :- write('OK'), nl. + ''; + }; + args = []; + stdin = ""; + packages = []; + main = "test.pl"; + }) + ]; +} \ No newline at end of file From dc2c5f3380923bd9f72e615dcef577155dc596ec Mon Sep 17 00:00:00 2001 From: Dan Vargas Date: Sun, 6 Feb 2022 21:06:32 -0700 Subject: [PATCH 19/46] migrate ponylang to nix --- packages/ponylang/0.39.0/build.sh | 27 ------------------- packages/ponylang/0.39.0/compile | 5 ---- packages/ponylang/0.39.0/environment | 4 --- packages/ponylang/0.39.0/metadata.json | 5 ---- packages/ponylang/0.39.0/run | 6 ----- packages/ponylang/0.39.0/test.pony | 3 --- runtimes/default.nix | 1 + runtimes/ponylang.nix | 37 ++++++++++++++++++++++++++ 8 files changed, 38 insertions(+), 50 deletions(-) delete mode 100755 packages/ponylang/0.39.0/build.sh delete mode 100644 packages/ponylang/0.39.0/compile delete mode 100644 packages/ponylang/0.39.0/environment delete mode 100644 packages/ponylang/0.39.0/metadata.json delete mode 100644 packages/ponylang/0.39.0/run delete mode 100644 packages/ponylang/0.39.0/test.pony create mode 100644 runtimes/ponylang.nix diff --git a/packages/ponylang/0.39.0/build.sh b/packages/ponylang/0.39.0/build.sh deleted file mode 100755 index ec93a10..0000000 --- a/packages/ponylang/0.39.0/build.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/env bash - -PREFIX=$(realpath $(dirname $0)) - -# get sources - only get the latest copy of the relevant files -git clone -q https://github.com/ponylang/ponyc.git ponyc - -cd ponyc - -# release commit for 0.39.0 -git reset --hard 85d897b978c5082a1f3264a3a9ad479446d73984 - -# updates all submodules recursively along their tracking branches -# i.e. https://github.com/ponylang/ponyc/blob/main/.gitmodules -git submodule update --recursive --init - -# Build the vendored LLVM libraries that are included in the `lib/llvm/src`. -make libs build_flags="-j$(nproc)" -# Configure the CMake build directory. -make configure -# Will build pony and put it in `build/release`. -make build -# Install pony into `$PREFIX`. -make prefix="$PREFIX" install - -cd .. -rm -rf ponyc diff --git a/packages/ponylang/0.39.0/compile b/packages/ponylang/0.39.0/compile deleted file mode 100644 index f00b22c..0000000 --- a/packages/ponylang/0.39.0/compile +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env bash - -# Compile pony file(s) -rename 's/$/\.pony/' "$@" # Add .pony extension -ponyc -b out \ No newline at end of file diff --git a/packages/ponylang/0.39.0/environment b/packages/ponylang/0.39.0/environment deleted file mode 100644 index c6ab089..0000000 --- a/packages/ponylang/0.39.0/environment +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env bash - -# Put 'export' statements here for environment variables -export PATH=$PWD/bin:$PATH \ No newline at end of file diff --git a/packages/ponylang/0.39.0/metadata.json b/packages/ponylang/0.39.0/metadata.json deleted file mode 100644 index 5856c39..0000000 --- a/packages/ponylang/0.39.0/metadata.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "language": "ponylang", - "version": "0.39.0", - "aliases": ["pony", "ponyc"] -} diff --git a/packages/ponylang/0.39.0/run b/packages/ponylang/0.39.0/run deleted file mode 100644 index 8ac647b..0000000 --- a/packages/ponylang/0.39.0/run +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash - -# removes the first arg from $@, which is always the filename -shift -# runs the executable with whatever args are left in $@ -./out "$@" \ No newline at end of file diff --git a/packages/ponylang/0.39.0/test.pony b/packages/ponylang/0.39.0/test.pony deleted file mode 100644 index 556516a..0000000 --- a/packages/ponylang/0.39.0/test.pony +++ /dev/null @@ -1,3 +0,0 @@ -actor Main - new create(env: Env) => - env.out.print("OK") diff --git a/runtimes/default.nix b/runtimes/default.nix index 3e2c7d0..869295a 100644 --- a/runtimes/default.nix +++ b/runtimes/default.nix @@ -25,4 +25,5 @@ args: { "racket" = import ./racket.nix args; "powershell" = import ./powershell.nix args; "prolog" = import ./prolog.nix args; + "ponylang" = import ./ponylang.nix args; } diff --git a/runtimes/ponylang.nix b/runtimes/ponylang.nix new file mode 100644 index 0000000..73fc423 --- /dev/null +++ b/runtimes/ponylang.nix @@ -0,0 +1,37 @@ +{pkgs, piston, ...}: +let + pkg = pkgs.ponyc; +in piston.mkRuntime { + language = "ponylang"; + version = pkg.version; + aliases = [ + "pony" + "ponyc" + ]; + + compile = '' + rename 's/$/.pony/' "$@" # Add .pony extension + ${pkg}/bin/ponyc -b out + ''; + + run = '' + shift + ./out "$@" + ''; + + tests = [ + (piston.mkTest { + files = { + "test.pony" = '' + actor Main + new create(env: Env) => + env.out.print("OK") + ''; + }; + args = []; + stdin = ""; + packages = []; + main = "test.pony"; + }) + ]; +} \ No newline at end of file From 3530a79a571f81851e87a6af23e9e00f01b038c6 Mon Sep 17 00:00:00 2001 From: Dan Vargas Date: Sun, 6 Feb 2022 21:13:11 -0700 Subject: [PATCH 20/46] migrate php to nix --- packages/php/8.0.2/build.sh | 20 -------------------- packages/php/8.0.2/environment | 1 - packages/php/8.0.2/metadata.json | 5 ----- packages/php/8.0.2/run | 3 --- packages/php/8.0.2/test.php | 1 - runtimes/default.nix | 1 + runtimes/php.nix | 26 ++++++++++++++++++++++++++ 7 files changed, 27 insertions(+), 30 deletions(-) delete mode 100755 packages/php/8.0.2/build.sh delete mode 100644 packages/php/8.0.2/environment delete mode 100644 packages/php/8.0.2/metadata.json delete mode 100644 packages/php/8.0.2/run delete mode 100644 packages/php/8.0.2/test.php create mode 100644 runtimes/php.nix diff --git a/packages/php/8.0.2/build.sh b/packages/php/8.0.2/build.sh deleted file mode 100755 index b84a80d..0000000 --- a/packages/php/8.0.2/build.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash - -PREFIX=$(realpath $(dirname $0)) - -mkdir -p build/php -cd build - -curl "https://www.php.net/distributions/php-8.0.2.tar.gz" -o php.tar.gz -tar xzf php.tar.gz --strip-components=1 -C php - -cd php - - -./configure --prefix "$PREFIX" - -make -j$(nproc) -make install -j$(nproc) - -cd ../../ -rm -rf build diff --git a/packages/php/8.0.2/environment b/packages/php/8.0.2/environment deleted file mode 100644 index bd0ff98..0000000 --- a/packages/php/8.0.2/environment +++ /dev/null @@ -1 +0,0 @@ -export PATH=$PWD/bin:$PATH \ No newline at end of file diff --git a/packages/php/8.0.2/metadata.json b/packages/php/8.0.2/metadata.json deleted file mode 100644 index 14d3e11..0000000 --- a/packages/php/8.0.2/metadata.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "language": "php", - "version": "8.0.2", - "aliases": ["php8", "html"] -} diff --git a/packages/php/8.0.2/run b/packages/php/8.0.2/run deleted file mode 100644 index 1261d95..0000000 --- a/packages/php/8.0.2/run +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -php "$@" \ No newline at end of file diff --git a/packages/php/8.0.2/test.php b/packages/php/8.0.2/test.php deleted file mode 100644 index a0aba93..0000000 --- a/packages/php/8.0.2/test.php +++ /dev/null @@ -1 +0,0 @@ -OK \ No newline at end of file diff --git a/runtimes/default.nix b/runtimes/default.nix index 869295a..910bc8d 100644 --- a/runtimes/default.nix +++ b/runtimes/default.nix @@ -26,4 +26,5 @@ args: { "powershell" = import ./powershell.nix args; "prolog" = import ./prolog.nix args; "ponylang" = import ./ponylang.nix args; + "php" = import ./php.nix args; } diff --git a/runtimes/php.nix b/runtimes/php.nix new file mode 100644 index 0000000..8871f9c --- /dev/null +++ b/runtimes/php.nix @@ -0,0 +1,26 @@ +{pkgs, piston, ...}: +let + pkg = pkgs.php; +in piston.mkRuntime { + language = "php"; + version = pkg.version; + aliases = []; + + run = '' + ${pkg}/bin/php "$@" + ''; + + tests = [ + (piston.mkTest { + files = { + "test.php" = '' + OK + ''; + }; + args = []; + stdin = ""; + packages = []; + main = "test.php"; + }) + ]; +} \ No newline at end of file From 66af61c2cb73a7084535a66ce70074bd96eb5cd7 Mon Sep 17 00:00:00 2001 From: Dan Vargas Date: Sun, 6 Feb 2022 21:17:38 -0700 Subject: [PATCH 21/46] convert perl to nix --- packages/perl/5.26.1/build.sh | 19 ------------------- packages/perl/5.26.1/environment | 1 - packages/perl/5.26.1/metadata.json | 5 ----- packages/perl/5.26.1/run | 3 --- packages/perl/5.26.1/test.pl | 1 - runtimes/default.nix | 1 + runtimes/perl.nix | 29 +++++++++++++++++++++++++++++ 7 files changed, 30 insertions(+), 29 deletions(-) delete mode 100755 packages/perl/5.26.1/build.sh delete mode 100644 packages/perl/5.26.1/environment delete mode 100644 packages/perl/5.26.1/metadata.json delete mode 100644 packages/perl/5.26.1/run delete mode 100644 packages/perl/5.26.1/test.pl create mode 100644 runtimes/perl.nix diff --git a/packages/perl/5.26.1/build.sh b/packages/perl/5.26.1/build.sh deleted file mode 100755 index 1aed9eb..0000000 --- a/packages/perl/5.26.1/build.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash - -PREFIX=$(realpath $(dirname $0)) - -mkdir -p build - -cd build - -curl "https://www.cpan.org/src/5.0/perl-5.26.1.tar.gz" -o perl.tar.gz -tar xzf perl.tar.gz --strip-components=1 -./Configure -des -Dprefix="$PREFIX" - -make -j$(nproc) -make install -j$(nproc) - -cd .. - -rm -rf build - diff --git a/packages/perl/5.26.1/environment b/packages/perl/5.26.1/environment deleted file mode 100644 index bd0ff98..0000000 --- a/packages/perl/5.26.1/environment +++ /dev/null @@ -1 +0,0 @@ -export PATH=$PWD/bin:$PATH \ No newline at end of file diff --git a/packages/perl/5.26.1/metadata.json b/packages/perl/5.26.1/metadata.json deleted file mode 100644 index 67a6624..0000000 --- a/packages/perl/5.26.1/metadata.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "language": "perl", - "version": "5.26.1", - "aliases": ["perl", "pl"] -} diff --git a/packages/perl/5.26.1/run b/packages/perl/5.26.1/run deleted file mode 100644 index 3b8d77c..0000000 --- a/packages/perl/5.26.1/run +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -perl "$@" \ No newline at end of file diff --git a/packages/perl/5.26.1/test.pl b/packages/perl/5.26.1/test.pl deleted file mode 100644 index 3f2688f..0000000 --- a/packages/perl/5.26.1/test.pl +++ /dev/null @@ -1 +0,0 @@ -print("OK") \ No newline at end of file diff --git a/runtimes/default.nix b/runtimes/default.nix index 910bc8d..c9050d2 100644 --- a/runtimes/default.nix +++ b/runtimes/default.nix @@ -27,4 +27,5 @@ args: { "prolog" = import ./prolog.nix args; "ponylang" = import ./ponylang.nix args; "php" = import ./php.nix args; + "perl" = import ./perl.nix args; } diff --git a/runtimes/perl.nix b/runtimes/perl.nix new file mode 100644 index 0000000..0f463bb --- /dev/null +++ b/runtimes/perl.nix @@ -0,0 +1,29 @@ +{pkgs, piston, ...}: +let + pkg = pkgs.perl; +in piston.mkRuntime { + language = "perl"; + version = pkg.version; + + aliases = [ + "pl" + ]; + + run = '' + ${pkg}/bin/perl "$@" + ''; + + tests = [ + (piston.mkTest { + files = { + "test.pl" = '' + print("OK") + ''; + }; + args = []; + stdin = ""; + packages = []; + main = "test.pl"; + }) + ]; +} \ No newline at end of file From e7c5b557f97f6a651ab025cc7c1a8ec221fe32f2 Mon Sep 17 00:00:00 2001 From: Dan Vargas Date: Sun, 6 Feb 2022 21:36:32 -0700 Subject: [PATCH 22/46] octave --> nix --- packages/octave/6.2.0/build.sh | 22 --------------------- packages/octave/6.2.0/environment | 4 ---- packages/octave/6.2.0/metadata.json | 5 ----- packages/octave/6.2.0/run | 4 ---- packages/octave/6.2.0/test.octave | 1 - runtimes/default.nix | 1 + runtimes/octave.nix | 30 +++++++++++++++++++++++++++++ 7 files changed, 31 insertions(+), 36 deletions(-) delete mode 100755 packages/octave/6.2.0/build.sh delete mode 100644 packages/octave/6.2.0/environment delete mode 100644 packages/octave/6.2.0/metadata.json delete mode 100644 packages/octave/6.2.0/run delete mode 100644 packages/octave/6.2.0/test.octave create mode 100644 runtimes/octave.nix diff --git a/packages/octave/6.2.0/build.sh b/packages/octave/6.2.0/build.sh deleted file mode 100755 index 48a9853..0000000 --- a/packages/octave/6.2.0/build.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env bash - -# Build octave from source -PREFIX=$(realpath $(dirname $0)) - -mkdir -p build - -cd build - -curl -L "https://ftpmirror.gnu.org/octave/octave-6.2.0.tar.gz" -o octave.tar.gz - -tar xzf octave.tar.gz --strip-components=1 - -# === autoconf based === -# Disable support for GUI, HDF5 and Java -./configure --prefix "$PREFIX" --without-opengl --without-qt --without-x --without-hdf5 --disable-java - -make -j$(nproc) -make install -j$(nproc) - -cd ../ -rm -rf build diff --git a/packages/octave/6.2.0/environment b/packages/octave/6.2.0/environment deleted file mode 100644 index fcbc1e3..0000000 --- a/packages/octave/6.2.0/environment +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env bash - -# Path to octave binary -export PATH=$PWD/bin:$PATH diff --git a/packages/octave/6.2.0/metadata.json b/packages/octave/6.2.0/metadata.json deleted file mode 100644 index 0b209ce..0000000 --- a/packages/octave/6.2.0/metadata.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "language": "octave", - "version": "6.2.0", - "aliases": ["matlab", "m"] -} diff --git a/packages/octave/6.2.0/run b/packages/octave/6.2.0/run deleted file mode 100644 index b3e4e73..0000000 --- a/packages/octave/6.2.0/run +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env bash - -# Run octave scripts without gui, history, init scripts and initial message -octave --no-gui --no-window-system --no-history --no-init-file --no-site-file --norc --quiet "$@" diff --git a/packages/octave/6.2.0/test.octave b/packages/octave/6.2.0/test.octave deleted file mode 100644 index a94310b..0000000 --- a/packages/octave/6.2.0/test.octave +++ /dev/null @@ -1 +0,0 @@ -disp('OK') \ No newline at end of file diff --git a/runtimes/default.nix b/runtimes/default.nix index c9050d2..3a80376 100644 --- a/runtimes/default.nix +++ b/runtimes/default.nix @@ -28,4 +28,5 @@ args: { "ponylang" = import ./ponylang.nix args; "php" = import ./php.nix args; "perl" = import ./perl.nix args; + "octave" = import ./octave.nix args; } diff --git a/runtimes/octave.nix b/runtimes/octave.nix new file mode 100644 index 0000000..1975a48 --- /dev/null +++ b/runtimes/octave.nix @@ -0,0 +1,30 @@ +{pkgs, piston, ...}: +let + pkg = pkgs.octave; +in piston.mkRuntime { + language = "octave"; + version = pkg.version; + + aliases = [ + "matlab" + "m" + ]; + + run = '' + ${pkg}/bin/octave --no-gui --no-window-system --no-history --no-init-file --no-site-file --norc --quiet "$@" + ''; + + tests = [ + (piston.mkTest { + files = { + "test.m" = '' + disp("OK"); + ''; + }; + args = []; + stdin = ""; + packages = []; + main = "test.m"; + }) + ]; +} \ No newline at end of file From f94ba284df1da6d802a57db75e00b621a486bdb2 Mon Sep 17 00:00:00 2001 From: Dan Vargas Date: Sun, 6 Feb 2022 21:41:18 -0700 Subject: [PATCH 23/46] ocaml for nix --- packages/ocaml/4.12.0/build.sh | 17 -------------- packages/ocaml/4.12.0/compile | 5 ----- packages/ocaml/4.12.0/environment | 3 --- packages/ocaml/4.12.0/metadata.json | 5 ----- packages/ocaml/4.12.0/run | 4 ---- packages/ocaml/4.12.0/test.ml | 1 - runtimes/default.nix | 1 + runtimes/ocaml.nix | 35 +++++++++++++++++++++++++++++ 8 files changed, 36 insertions(+), 35 deletions(-) delete mode 100755 packages/ocaml/4.12.0/build.sh delete mode 100644 packages/ocaml/4.12.0/compile delete mode 100644 packages/ocaml/4.12.0/environment delete mode 100644 packages/ocaml/4.12.0/metadata.json delete mode 100644 packages/ocaml/4.12.0/run delete mode 100644 packages/ocaml/4.12.0/test.ml create mode 100644 runtimes/ocaml.nix diff --git a/packages/ocaml/4.12.0/build.sh b/packages/ocaml/4.12.0/build.sh deleted file mode 100755 index fd91cdd..0000000 --- a/packages/ocaml/4.12.0/build.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash - -PREFIX=$(realpath $(dirname $0)) - -mkdir -p build -cd build - -curl -L "https://github.com/ocaml/ocaml/archive/4.12.0.tar.gz" -o ocaml.tar.gz -tar xzf ocaml.tar.gz --strip-components=1 -rm ocaml.tar.gz - -./configure --prefix="$PREFIX" -make -j$(nproc) -make install -j$(nproc) - -cd .. -rm -rf build diff --git a/packages/ocaml/4.12.0/compile b/packages/ocaml/4.12.0/compile deleted file mode 100644 index 39ddd0b..0000000 --- a/packages/ocaml/4.12.0/compile +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash - -rename 's/$/\.ml/' "$@" # Add .ml extension - -ocamlc -o out *.ml diff --git a/packages/ocaml/4.12.0/environment b/packages/ocaml/4.12.0/environment deleted file mode 100644 index 116e7aa..0000000 --- a/packages/ocaml/4.12.0/environment +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -export PATH=$PWD/bin:$PATH diff --git a/packages/ocaml/4.12.0/metadata.json b/packages/ocaml/4.12.0/metadata.json deleted file mode 100644 index 6c2f733..0000000 --- a/packages/ocaml/4.12.0/metadata.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "language": "ocaml", - "version": "4.12.0", - "aliases": ["ocaml", "ml"] -} diff --git a/packages/ocaml/4.12.0/run b/packages/ocaml/4.12.0/run deleted file mode 100644 index e2663b1..0000000 --- a/packages/ocaml/4.12.0/run +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -shift -./out "$@" diff --git a/packages/ocaml/4.12.0/test.ml b/packages/ocaml/4.12.0/test.ml deleted file mode 100644 index ef98f8c..0000000 --- a/packages/ocaml/4.12.0/test.ml +++ /dev/null @@ -1 +0,0 @@ -print_string "OK\n"; diff --git a/runtimes/default.nix b/runtimes/default.nix index 3a80376..8da8f44 100644 --- a/runtimes/default.nix +++ b/runtimes/default.nix @@ -29,4 +29,5 @@ args: { "php" = import ./php.nix args; "perl" = import ./perl.nix args; "octave" = import ./octave.nix args; + "ocaml" = import ./ocaml.nix args; } diff --git a/runtimes/ocaml.nix b/runtimes/ocaml.nix new file mode 100644 index 0000000..18fa1bb --- /dev/null +++ b/runtimes/ocaml.nix @@ -0,0 +1,35 @@ +{pkgs, piston, ...}: +let + pkg = pkgs.ocaml; +in piston.mkRuntime { + language = "ocaml"; + version = pkg.version; + + aliases = [ + "ml" + ]; + + compile = '' + rename 's/$/\.ml/' "$@" # Add .ml extension + ${pkg}/bin/ocamlc -o out *.ml + ''; + + run = '' + shift + ./out "$@" + ''; + + tests = [ + (piston.mkTest { + files = { + "test.ml" = '' + print_string "OK\n"; + ''; + }; + args = []; + stdin = ""; + packages = []; + main = "test.ml"; + }) + ]; +} \ No newline at end of file From ab536f35ffef3027a5a32e6c89c67af81800c5ae Mon Sep 17 00:00:00 2001 From: Dan Vargas Date: Sun, 6 Feb 2022 21:45:52 -0700 Subject: [PATCH 24/46] migrate nim pkg to nix --- packages/nim/1.4.4/build.sh | 18 ------------------ packages/nim/1.4.4/compile | 5 ----- packages/nim/1.4.4/environment | 1 - packages/nim/1.4.4/metadata.json | 5 ----- packages/nim/1.4.4/run | 4 ---- packages/nim/1.4.4/test.nim | 1 - runtimes/default.nix | 1 + runtimes/nim.nix | 32 ++++++++++++++++++++++++++++++++ 8 files changed, 33 insertions(+), 34 deletions(-) delete mode 100755 packages/nim/1.4.4/build.sh delete mode 100644 packages/nim/1.4.4/compile delete mode 100644 packages/nim/1.4.4/environment delete mode 100644 packages/nim/1.4.4/metadata.json delete mode 100644 packages/nim/1.4.4/run delete mode 100644 packages/nim/1.4.4/test.nim create mode 100644 runtimes/nim.nix diff --git a/packages/nim/1.4.4/build.sh b/packages/nim/1.4.4/build.sh deleted file mode 100755 index 1bb0bee..0000000 --- a/packages/nim/1.4.4/build.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash - -PREFIX=$(realpath $(dirname $0)) - -mkdir -p build - -cd build - -# Prebuilt binary - source *can* be built, but it requires gcc -curl -L "https://nim-lang.org/download/nim-1.4.4-linux_x64.tar.xz" -o nim.tar.xz -tar xf nim.tar.xz --strip-components=1 -rm nim.tar.xz - -./install.sh "$PREFIX" - -cd ../ - -rm -rf build diff --git a/packages/nim/1.4.4/compile b/packages/nim/1.4.4/compile deleted file mode 100644 index 91dc0ba..0000000 --- a/packages/nim/1.4.4/compile +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env bash - -# Compile nim file(s) -nim --hints:off --out:out --nimcache:./ c "$@" -chmod +x out diff --git a/packages/nim/1.4.4/environment b/packages/nim/1.4.4/environment deleted file mode 100644 index 872a1f3..0000000 --- a/packages/nim/1.4.4/environment +++ /dev/null @@ -1 +0,0 @@ -export PATH=$PWD/nim/bin:$PATH \ No newline at end of file diff --git a/packages/nim/1.4.4/metadata.json b/packages/nim/1.4.4/metadata.json deleted file mode 100644 index f23eb0e..0000000 --- a/packages/nim/1.4.4/metadata.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "language": "nim", - "version": "1.4.4", - "aliases": ["nim"] -} diff --git a/packages/nim/1.4.4/run b/packages/nim/1.4.4/run deleted file mode 100644 index 6955ba9..0000000 --- a/packages/nim/1.4.4/run +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -shift # Filename is only used to compile -./out "$@" diff --git a/packages/nim/1.4.4/test.nim b/packages/nim/1.4.4/test.nim deleted file mode 100644 index 6c57628..0000000 --- a/packages/nim/1.4.4/test.nim +++ /dev/null @@ -1 +0,0 @@ -echo("OK") \ No newline at end of file diff --git a/runtimes/default.nix b/runtimes/default.nix index 8da8f44..478b0fd 100644 --- a/runtimes/default.nix +++ b/runtimes/default.nix @@ -30,4 +30,5 @@ args: { "perl" = import ./perl.nix args; "octave" = import ./octave.nix args; "ocaml" = import ./ocaml.nix args; + "nim" = import ./nim.nix args; } diff --git a/runtimes/nim.nix b/runtimes/nim.nix new file mode 100644 index 0000000..f76cc02 --- /dev/null +++ b/runtimes/nim.nix @@ -0,0 +1,32 @@ +{pkgs, piston, ...}: +let + pkg = pkgs.nim; +in piston.mkRuntime { + language = "nim"; + version = pkg.version; + aliases = []; + + compile = '' + ${pkg}/bin/nim --hints:off --out:out --nimcache:./ c "$@" + chmod +x out + ''; + + run = '' + shift + ./out "$@" + ''; + + tests = [ + (piston.mkTest { + files = { + "test.nim" = '' + echo("OK") + ''; + }; + args = []; + stdin = ""; + packages = []; + main = "test.nim"; + }) + ]; +} \ No newline at end of file From 7d9009b71493f2956bbbee1e3a219a324822489f Mon Sep 17 00:00:00 2001 From: Dan Vargas Date: Sun, 6 Feb 2022 22:08:05 -0700 Subject: [PATCH 25/46] fix rscript version by using pname pkg --- runtimes/rscript.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/runtimes/rscript.nix b/runtimes/rscript.nix index b1ae034..6f7b559 100644 --- a/runtimes/rscript.nix +++ b/runtimes/rscript.nix @@ -1,9 +1,9 @@ {pkgs, piston, ...}: let - pkg = pkgs.rWrapper; + pkg = pkgs.R; in piston.mkRuntime { language = "rscript"; - version = "4.1.2-wrapper"; + version = pkg.version; aliases = [ "r" @@ -56,4 +56,4 @@ in piston.mkRuntime { main = "test.r"; }) ]; -} \ No newline at end of file +} From bc80269ce2268282062d51dff590d8c3a8a793f7 Mon Sep 17 00:00:00 2001 From: Dan Vargas Date: Sun, 6 Feb 2022 22:26:23 -0700 Subject: [PATCH 26/46] fix swift version --- runtimes/swift.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/runtimes/swift.nix b/runtimes/swift.nix index 9d9d728..f1a39d4 100644 --- a/runtimes/swift.nix +++ b/runtimes/swift.nix @@ -3,7 +3,7 @@ let pkg = pkgs.swift; in piston.mkRuntime { language = "swift"; - version = "5.4.2"; # pkg.version attribute is missing, so pinning it to 5.4.2 + version = (builtins.parseDrvName pkg.name).version; aliases = []; run = '' @@ -23,4 +23,4 @@ in piston.mkRuntime { main = "file0.code"; }) ]; -} \ No newline at end of file +} From d258bed574d4f6fce54d021cc909681ac197d51c Mon Sep 17 00:00:00 2001 From: Dan Vargas Date: Mon, 7 Feb 2022 10:56:17 -0700 Subject: [PATCH 27/46] add nasm and nasm64 --- packages/nasm/2.15.5/build.sh | 21 ----------- packages/nasm/2.15.5/compile | 21 ----------- packages/nasm/2.15.5/environment | 4 --- packages/nasm/2.15.5/metadata.json | 14 -------- packages/nasm/2.15.5/run | 5 --- packages/nasm/2.15.5/test.nasm.asm | 16 --------- packages/nasm/2.15.5/test.nasm64.asm | 18 ---------- runtimes/default.nix | 2 ++ runtimes/nasm-nasm64.nix | 54 ++++++++++++++++++++++++++++ runtimes/nasm.nix | 52 +++++++++++++++++++++++++++ 10 files changed, 108 insertions(+), 99 deletions(-) delete mode 100755 packages/nasm/2.15.5/build.sh delete mode 100644 packages/nasm/2.15.5/compile delete mode 100644 packages/nasm/2.15.5/environment delete mode 100644 packages/nasm/2.15.5/metadata.json delete mode 100644 packages/nasm/2.15.5/run delete mode 100644 packages/nasm/2.15.5/test.nasm.asm delete mode 100644 packages/nasm/2.15.5/test.nasm64.asm create mode 100644 runtimes/nasm-nasm64.nix create mode 100644 runtimes/nasm.nix diff --git a/packages/nasm/2.15.5/build.sh b/packages/nasm/2.15.5/build.sh deleted file mode 100755 index 0f39f6f..0000000 --- a/packages/nasm/2.15.5/build.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env bash - -# Put instructions to build your package in here -PREFIX=$(realpath $(dirname $0)) - -mkdir -p build - -cd build - -curl -L "https://www.nasm.us/pub/nasm/releasebuilds/2.15.05/nasm-2.15.05.tar.gz" -o nasm.tar.gz - -tar xzf nasm.tar.gz --strip-components=1 - -# === autoconf based === -./configure --prefix "$PREFIX" - -make -j$(nproc) -make install -j$(nproc) -cd ../ -rm -rf build - diff --git a/packages/nasm/2.15.5/compile b/packages/nasm/2.15.5/compile deleted file mode 100644 index f133a67..0000000 --- a/packages/nasm/2.15.5/compile +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env bash - -# Put instructions to compile source code, remove this file if the language does not require this stage - - -case "${PISTON_LANGUAGE}" in - nasm) - nasm -f elf32 -o binary.o "$@" - ld -m elf_i386 binary.o -o binary - ;; - nasm64) - nasm -f elf64 -o binary.o "$@" - ld -m elf_x86_64 binary.o -o binary - ;; - *) - echo "How did you get here? (${PISTON_LANGUAGE})" - exit 1 - ;; -esac - -chmod +x ./binary \ No newline at end of file diff --git a/packages/nasm/2.15.5/environment b/packages/nasm/2.15.5/environment deleted file mode 100644 index 780b668..0000000 --- a/packages/nasm/2.15.5/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/nasm/2.15.5/metadata.json b/packages/nasm/2.15.5/metadata.json deleted file mode 100644 index 80a5150..0000000 --- a/packages/nasm/2.15.5/metadata.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "language": "nasm", - "version": "2.15.5", - "provides": [ - { - "language": "nasm", - "aliases": ["asm", "nasm32"] - }, - { - "language": "nasm64", - "aliases": ["asm64"] - } - ] -} diff --git a/packages/nasm/2.15.5/run b/packages/nasm/2.15.5/run deleted file mode 100644 index f910a1c..0000000 --- a/packages/nasm/2.15.5/run +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env bash - -# Put instructions to run the runtime -shift -./binary "$@" diff --git a/packages/nasm/2.15.5/test.nasm.asm b/packages/nasm/2.15.5/test.nasm.asm deleted file mode 100644 index d1e5a57..0000000 --- a/packages/nasm/2.15.5/test.nasm.asm +++ /dev/null @@ -1,16 +0,0 @@ -SECTION .DATA -good: db 'OK',10 -txtlen: equ $-good - -SECTION .TEXT -GLOBAL _start - -_start: -mov eax,4 -mov ebx,1 -mov ecx,good -mov edx,txtlen -int 80h -mov eax,1 -mov ebx,0 -int 80h \ No newline at end of file diff --git a/packages/nasm/2.15.5/test.nasm64.asm b/packages/nasm/2.15.5/test.nasm64.asm deleted file mode 100644 index 20ea316..0000000 --- a/packages/nasm/2.15.5/test.nasm64.asm +++ /dev/null @@ -1,18 +0,0 @@ -SECTION .data - good: db "OK", 0x0 - txtlen: equ $ - good - -SECTION .text -GLOBAL _start - -_start: - ;sys_write - mov rax, 1 - mov rdi, 1 - mov rsi, good - mov rdx, txtlen - syscall - ;sys_exit - mov rax, 60 - mov rdi, 0 - syscall \ No newline at end of file diff --git a/runtimes/default.nix b/runtimes/default.nix index 478b0fd..f7b30c3 100644 --- a/runtimes/default.nix +++ b/runtimes/default.nix @@ -31,4 +31,6 @@ args: { "octave" = import ./octave.nix args; "ocaml" = import ./ocaml.nix args; "nim" = import ./nim.nix args; + "nasm" = import ./nasm.nix args; + "nasm-nasm64" = import ./nasm-nasm64.nix args; } diff --git a/runtimes/nasm-nasm64.nix b/runtimes/nasm-nasm64.nix new file mode 100644 index 0000000..5a10d2b --- /dev/null +++ b/runtimes/nasm-nasm64.nix @@ -0,0 +1,54 @@ +{pkgs, piston, ...}: +let + pkg = pkgs.nasm; + binutils = pkgs.binutils; +in piston.mkRuntime { + language = "nasm64"; + version = pkg.version; + runtime = "nasm"; + + aliases = [ + "asm64" + ]; + + compile = '' + ${pkg}/bin/nasm -f elf64 -o binary.o "$@" + ${binutils}/bin/ld -m elf_x86_64 binary.o -o binary + ''; + + run = '' + shift + ./binary "$@" + ''; + + tests = [ + (piston.mkTest { + files = { + "test.asm64" = '' + SECTION .data + good: db "OK", 10 + txtlen: equ $ - good + + SECTION .text + GLOBAL _start + + _start: + ;sys_write + mov rax, 1 + mov rdi, 1 + mov rsi, good + mov rdx, txtlen + syscall + ;sys_exit + mov rax, 60 + mov rdi, 0 + syscall + ''; + }; + args = []; + stdin = ""; + packages = []; + main = "test.asm64"; + }) + ]; +} \ No newline at end of file diff --git a/runtimes/nasm.nix b/runtimes/nasm.nix new file mode 100644 index 0000000..486d1f4 --- /dev/null +++ b/runtimes/nasm.nix @@ -0,0 +1,52 @@ +{pkgs, piston, ...}: +let + pkg = pkgs.nasm; + binutils = pkgs.binutils; +in piston.mkRuntime { + language = "nasm"; + version = pkg.version; + + aliases = [ + "nasm32" + "asm" + ]; + + compile = '' + ${pkg}/bin/nasm -f elf32 -o binary.o "$@" + ${binutils}/bin/ld -m elf_i386 binary.o -o binary + ''; + + run = '' + shift + ./binary "$@" + ''; + + tests = [ + (piston.mkTest { + files = { + "test.asm" = '' + SECTION .DATA + good: db 'OK',10 + txtlen: equ $-good + + SECTION .TEXT + GLOBAL _start + + _start: + mov eax,4 + mov ebx,1 + mov ecx,good + mov edx,txtlen + int 80h + mov eax,1 + mov ebx,0 + int 80h + ''; + }; + args = []; + stdin = ""; + packages = []; + main = "test.asm"; + }) + ]; +} \ No newline at end of file From d688ec3fe3177e8ae7da91173d1a90223cc68b41 Mon Sep 17 00:00:00 2001 From: Dan Vargas Date: Mon, 7 Feb 2022 11:04:40 -0700 Subject: [PATCH 28/46] add mono csharp --- runtimes/default.nix | 1 + runtimes/mono-csharp.nix | 49 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 runtimes/mono-csharp.nix diff --git a/runtimes/default.nix b/runtimes/default.nix index f7b30c3..d25201b 100644 --- a/runtimes/default.nix +++ b/runtimes/default.nix @@ -33,4 +33,5 @@ args: { "nim" = import ./nim.nix args; "nasm" = import ./nasm.nix args; "nasm-nasm64" = import ./nasm-nasm64.nix args; + "mono-csharp" = import ./mono-csharp.nix args; } diff --git a/runtimes/mono-csharp.nix b/runtimes/mono-csharp.nix new file mode 100644 index 0000000..7be9078 --- /dev/null +++ b/runtimes/mono-csharp.nix @@ -0,0 +1,49 @@ +{pkgs, piston, ...}: +let + pkg = pkgs.mono; +in piston.mkRuntime { + language = "csharp"; + version = pkg.version; + runtime = "mono"; + + aliases = [ + "mono" + "mono-csharp" + "mono-c#" + "mono-cs" + "c#" + "cs" + ]; + + compile = '' + rename 's/$/\.cs/' "$@" # Add .cs extension + ${pkg}/bin/csc -out:out *.cs + ''; + + run = '' + shift + ${pkg}/bin/mono out "$@" + ''; + + tests = [ + (piston.mkTest { + files = { + "test.cs" = '' + using System; + + public class Test + { + public static void Main(string[] args) + { + Console.WriteLine("OK"); + } + } + ''; + }; + args = []; + stdin = ""; + packages = []; + main = "test.cs"; + }) + ]; +} \ No newline at end of file From 27e59923f28347ed3cd04a693ae367f8ccac27aa Mon Sep 17 00:00:00 2001 From: Dan Vargas Date: Mon, 7 Feb 2022 15:52:18 -0700 Subject: [PATCH 29/46] 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 From c604863c724ca5a4e5695fd3790b5ee4c7e50966 Mon Sep 17 00:00:00 2001 From: Dan Vargas Date: Mon, 7 Feb 2022 16:06:37 -0700 Subject: [PATCH 30/46] 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 From 2d7609f5a2e1990b4f0ed6e409c6286e2ee5432c Mon Sep 17 00:00:00 2001 From: Dan Vargas Date: Tue, 8 Feb 2022 13:32:54 -0700 Subject: [PATCH 31/46] add piston nix pkg for sbcl-lisp --- packages/lisp/2.1.2/build.sh | 19 ------------------ packages/lisp/2.1.2/environment | 4 ---- packages/lisp/2.1.2/metadata.json | 5 ----- packages/lisp/2.1.2/run | 4 ---- packages/lisp/2.1.2/test.cl | 1 - runtimes/default.nix | 1 + runtimes/sbcl-lisp.nix | 32 +++++++++++++++++++++++++++++++ 7 files changed, 33 insertions(+), 33 deletions(-) delete mode 100755 packages/lisp/2.1.2/build.sh delete mode 100644 packages/lisp/2.1.2/environment delete mode 100644 packages/lisp/2.1.2/metadata.json delete mode 100644 packages/lisp/2.1.2/run delete mode 100644 packages/lisp/2.1.2/test.cl create mode 100644 runtimes/sbcl-lisp.nix diff --git a/packages/lisp/2.1.2/build.sh b/packages/lisp/2.1.2/build.sh deleted file mode 100755 index 37f1f8a..0000000 --- a/packages/lisp/2.1.2/build.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/usr/bin/env bash - -# Put instructions to build your package in here -PREFIX=$(realpath $(dirname $0)) - -mkdir -p build - -cd build - -# Prebuilt binary install since source compile requires lisp to be installed already -curl -L "http://prdownloads.sourceforge.net/sbcl/sbcl-2.1.2-x86-64-linux-binary.tar.bz2" -o sbcl.tar.bz2 -tar xf sbcl.tar.bz2 --strip-components=1 -rm sbcl.tar.bz2 - -INSTALL_ROOT=$PREFIX sh install.sh - -cd ../ - -rm -rf build diff --git a/packages/lisp/2.1.2/environment b/packages/lisp/2.1.2/environment deleted file mode 100644 index 780b668..0000000 --- a/packages/lisp/2.1.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/lisp/2.1.2/metadata.json b/packages/lisp/2.1.2/metadata.json deleted file mode 100644 index 185cf9e..0000000 --- a/packages/lisp/2.1.2/metadata.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "language": "lisp", - "version": "2.1.2", - "aliases": ["lisp", "cl", "sbcl", "commonlisp"] -} diff --git a/packages/lisp/2.1.2/run b/packages/lisp/2.1.2/run deleted file mode 100644 index 74a5cf3..0000000 --- a/packages/lisp/2.1.2/run +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env bash - -# Put instructions to run the runtime -sbcl --script "$@" diff --git a/packages/lisp/2.1.2/test.cl b/packages/lisp/2.1.2/test.cl deleted file mode 100644 index 1de92b7..0000000 --- a/packages/lisp/2.1.2/test.cl +++ /dev/null @@ -1 +0,0 @@ -(write-line "OK") \ No newline at end of file diff --git a/runtimes/default.nix b/runtimes/default.nix index f97aae1..3b25c62 100644 --- a/runtimes/default.nix +++ b/runtimes/default.nix @@ -36,4 +36,5 @@ args: { "mono-csharp" = import ./mono-csharp.nix args; "lua" = import ./lua.nix args; "lolcode" = import ./lolcode.nix args; + "sbcl-lisp" = import ./sbcl-lisp.nix args; } diff --git a/runtimes/sbcl-lisp.nix b/runtimes/sbcl-lisp.nix new file mode 100644 index 0000000..c331f66 --- /dev/null +++ b/runtimes/sbcl-lisp.nix @@ -0,0 +1,32 @@ +{pkgs, piston, ...}: +let + pkg = pkgs.sbcl; +in piston.mkRuntime { + language = "lisp"; + version = pkg.version; + runtime = "sbcl"; + + aliases = [ + "lisp" + "cl" + "commonlisp" + ]; + + run = '' + ${pkg}/bin/sbcl --script "$@" + ''; + + tests = [ + (piston.mkTest { + files = { + "test.cl" = '' + (write-line "OK") + ''; + }; + args = []; + stdin = ""; + packages = []; + main = "test.cl"; + }) + ]; +} \ No newline at end of file From 58a46e3b0a031f4d1ed4754158149a59173b61fa Mon Sep 17 00:00:00 2001 From: Dan Vargas Date: Fri, 11 Feb 2022 09:28:03 -0700 Subject: [PATCH 32/46] add piston nix pkg for jvm-kotlin --- packages/kotlin/1.4.31/build.sh | 13 ---------- packages/kotlin/1.4.31/compile | 6 ----- packages/kotlin/1.4.31/environment | 4 --- packages/kotlin/1.4.31/metadata.json | 5 ---- packages/kotlin/1.4.31/run | 5 ---- packages/kotlin/1.4.31/test.kt | 3 --- runtimes/default.nix | 1 + runtimes/jvm-kotlin.nix | 39 ++++++++++++++++++++++++++++ 8 files changed, 40 insertions(+), 36 deletions(-) delete mode 100755 packages/kotlin/1.4.31/build.sh delete mode 100644 packages/kotlin/1.4.31/compile delete mode 100644 packages/kotlin/1.4.31/environment delete mode 100644 packages/kotlin/1.4.31/metadata.json delete mode 100644 packages/kotlin/1.4.31/run delete mode 100644 packages/kotlin/1.4.31/test.kt create mode 100644 runtimes/jvm-kotlin.nix diff --git a/packages/kotlin/1.4.31/build.sh b/packages/kotlin/1.4.31/build.sh deleted file mode 100755 index c00cb27..0000000 --- a/packages/kotlin/1.4.31/build.sh +++ /dev/null @@ -1,13 +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 Kotlin -curl -L "https://github.com/JetBrains/kotlin/releases/download/v1.4.31/kotlin-compiler-1.4.31.zip" -o kotlin.zip -unzip kotlin.zip -rm kotlin.zip -cp -r kotlinc/* . -rm -rf kotlinc diff --git a/packages/kotlin/1.4.31/compile b/packages/kotlin/1.4.31/compile deleted file mode 100644 index 9b49562..0000000 --- a/packages/kotlin/1.4.31/compile +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env bash - -rename 's/$/\.kt/' "$@" # Add .kt extension - -# Compile Kotlin code to a jar file -kotlinc *.kt -include-runtime -d code.jar diff --git a/packages/kotlin/1.4.31/environment b/packages/kotlin/1.4.31/environment deleted file mode 100644 index aadd2e5..0000000 --- a/packages/kotlin/1.4.31/environment +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env bash - -# Add java and kotlinc to path -export PATH=$PWD/bin:$PATH diff --git a/packages/kotlin/1.4.31/metadata.json b/packages/kotlin/1.4.31/metadata.json deleted file mode 100644 index 304c5cd..0000000 --- a/packages/kotlin/1.4.31/metadata.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "language": "kotlin", - "version": "1.4.31", - "aliases": ["kt"] -} diff --git a/packages/kotlin/1.4.31/run b/packages/kotlin/1.4.31/run deleted file mode 100644 index 8ecc073..0000000 --- a/packages/kotlin/1.4.31/run +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env bash - -# Run jar file -shift -java -jar code.jar "$@" diff --git a/packages/kotlin/1.4.31/test.kt b/packages/kotlin/1.4.31/test.kt deleted file mode 100644 index 0c9540f..0000000 --- a/packages/kotlin/1.4.31/test.kt +++ /dev/null @@ -1,3 +0,0 @@ -fun main() { - println("OK") -} diff --git a/runtimes/default.nix b/runtimes/default.nix index 3b25c62..4e41dde 100644 --- a/runtimes/default.nix +++ b/runtimes/default.nix @@ -37,4 +37,5 @@ args: { "lua" = import ./lua.nix args; "lolcode" = import ./lolcode.nix args; "sbcl-lisp" = import ./sbcl-lisp.nix args; + "jvm-kotlin" = import ./jvm-kotlin.nix args; } diff --git a/runtimes/jvm-kotlin.nix b/runtimes/jvm-kotlin.nix new file mode 100644 index 0000000..62e402b --- /dev/null +++ b/runtimes/jvm-kotlin.nix @@ -0,0 +1,39 @@ +{pkgs, piston, ...}: +let + pkg = pkgs.kotlin; + jre = pkgs.jre; +in piston.mkRuntime { + language = "kotlin"; + version = pkg.version; + runtime = "jvm"; + + aliases = [ + "kt" + ]; + + compile = '' + rename 's/$/\.kt/' "$@" # Add .kt extension + ${pkg}/bin/kotlinc *.kt -include-runtime -d code.jar + ''; + + run = '' + shift + ${jre}/bin/java -jar code.jar "$@" + ''; + + tests = [ + (piston.mkTest { + files = { + "test.kt" = '' + fun main() { + println("OK") + } + ''; + }; + args = []; + stdin = ""; + packages = []; + main = "test.kt"; + }) + ]; +} \ No newline at end of file From 93fa1a975502f660f782ba09996b29df265e837f Mon Sep 17 00:00:00 2001 From: Dan Vargas Date: Fri, 11 Feb 2022 09:30:54 -0700 Subject: [PATCH 33/46] fix lisp alias --- runtimes/sbcl-lisp.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtimes/sbcl-lisp.nix b/runtimes/sbcl-lisp.nix index c331f66..dbe81b3 100644 --- a/runtimes/sbcl-lisp.nix +++ b/runtimes/sbcl-lisp.nix @@ -7,7 +7,7 @@ in piston.mkRuntime { runtime = "sbcl"; aliases = [ - "lisp" + "sbcl" "cl" "commonlisp" ]; From 25ae43df699499a04f3658d8dc8ddc79357043f2 Mon Sep 17 00:00:00 2001 From: Dan Vargas Date: Fri, 11 Feb 2022 09:57:53 -0700 Subject: [PATCH 34/46] add piston nix pkg for julia --- packages/julia/1.5.4/build.sh | 21 --------------------- packages/julia/1.5.4/environment | 4 ---- packages/julia/1.5.4/metadata.json | 5 ----- packages/julia/1.5.4/run | 4 ---- packages/julia/1.5.4/test.jl | 1 - packages/julia/1.6.1/build.sh | 21 --------------------- packages/julia/1.6.1/environment | 4 ---- packages/julia/1.6.1/metadata.json | 5 ----- packages/julia/1.6.1/run | 4 ---- packages/julia/1.6.1/test.jl | 1 - runtimes/default.nix | 1 + runtimes/julia.nix | 29 +++++++++++++++++++++++++++++ 12 files changed, 30 insertions(+), 70 deletions(-) delete mode 100755 packages/julia/1.5.4/build.sh delete mode 100644 packages/julia/1.5.4/environment delete mode 100644 packages/julia/1.5.4/metadata.json delete mode 100755 packages/julia/1.5.4/run delete mode 100644 packages/julia/1.5.4/test.jl delete mode 100755 packages/julia/1.6.1/build.sh delete mode 100644 packages/julia/1.6.1/environment delete mode 100644 packages/julia/1.6.1/metadata.json delete mode 100755 packages/julia/1.6.1/run delete mode 100644 packages/julia/1.6.1/test.jl create mode 100644 runtimes/julia.nix diff --git a/packages/julia/1.5.4/build.sh b/packages/julia/1.5.4/build.sh deleted file mode 100755 index 678764c..0000000 --- a/packages/julia/1.5.4/build.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env bash - -# Install location -PREFIX=$(realpath $(dirname $0)) - -mkdir -p build -cd build - -# Download and extract Julia source -curl -L "https://github.com/JuliaLang/julia/releases/download/v1.5.4/julia-1.5.4.tar.gz" -o julia.tar.gz -tar xzf julia.tar.gz --strip-components=1 - -# Build -echo "JULIA_CPU_TARGET=generic;sandybridge,-xsaveopt,clone_all;haswell,-rdrnd,base(1) -prefix=$PREFIX" > Make.user -make -j$(nproc) -make install -j$(nproc) - -# Cleanup -cd .. -rm -rf build diff --git a/packages/julia/1.5.4/environment b/packages/julia/1.5.4/environment deleted file mode 100644 index e7d0c97..0000000 --- a/packages/julia/1.5.4/environment +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env bash - -# Add Julia binary to path -export PATH=$PWD/bin:$PATH diff --git a/packages/julia/1.5.4/metadata.json b/packages/julia/1.5.4/metadata.json deleted file mode 100644 index f177ea8..0000000 --- a/packages/julia/1.5.4/metadata.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "language": "julia", - "version": "1.5.4", - "aliases": ["jl"] -} diff --git a/packages/julia/1.5.4/run b/packages/julia/1.5.4/run deleted file mode 100755 index 6badf1c..0000000 --- a/packages/julia/1.5.4/run +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env bash - -# Run without startup or history file -julia --startup-file=no --history-file=no "$@" diff --git a/packages/julia/1.5.4/test.jl b/packages/julia/1.5.4/test.jl deleted file mode 100644 index dc98a27..0000000 --- a/packages/julia/1.5.4/test.jl +++ /dev/null @@ -1 +0,0 @@ -println("OK") diff --git a/packages/julia/1.6.1/build.sh b/packages/julia/1.6.1/build.sh deleted file mode 100755 index b2772ae..0000000 --- a/packages/julia/1.6.1/build.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env bash - -# Install location -PREFIX=$(realpath $(dirname $0)) - -mkdir -p build -cd build - -# Download and extract Julia source -curl -L "https://github.com/JuliaLang/julia/releases/download/v1.6.1/julia-1.6.1.tar.gz" -o julia.tar.gz -tar xzf julia.tar.gz --strip-components=1 - -# Build -echo "JULIA_CPU_TARGET=generic;sandybridge,-xsaveopt,clone_all;haswell,-rdrnd,base(1) -prefix=$PREFIX" > Make.user -make -j$(nproc) -make install -j$(nproc) - -# Cleanup -cd .. -rm -rf build diff --git a/packages/julia/1.6.1/environment b/packages/julia/1.6.1/environment deleted file mode 100644 index e7d0c97..0000000 --- a/packages/julia/1.6.1/environment +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env bash - -# Add Julia binary to path -export PATH=$PWD/bin:$PATH diff --git a/packages/julia/1.6.1/metadata.json b/packages/julia/1.6.1/metadata.json deleted file mode 100644 index be2fdea..0000000 --- a/packages/julia/1.6.1/metadata.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "language": "julia", - "version": "1.6.1", - "aliases": ["jl"] -} diff --git a/packages/julia/1.6.1/run b/packages/julia/1.6.1/run deleted file mode 100755 index 6badf1c..0000000 --- a/packages/julia/1.6.1/run +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env bash - -# Run without startup or history file -julia --startup-file=no --history-file=no "$@" diff --git a/packages/julia/1.6.1/test.jl b/packages/julia/1.6.1/test.jl deleted file mode 100644 index dc98a27..0000000 --- a/packages/julia/1.6.1/test.jl +++ /dev/null @@ -1 +0,0 @@ -println("OK") diff --git a/runtimes/default.nix b/runtimes/default.nix index 4e41dde..993506c 100644 --- a/runtimes/default.nix +++ b/runtimes/default.nix @@ -38,4 +38,5 @@ args: { "lolcode" = import ./lolcode.nix args; "sbcl-lisp" = import ./sbcl-lisp.nix args; "jvm-kotlin" = import ./jvm-kotlin.nix args; + "julia" = import ./julia.nix args; } diff --git a/runtimes/julia.nix b/runtimes/julia.nix new file mode 100644 index 0000000..fd80ccc --- /dev/null +++ b/runtimes/julia.nix @@ -0,0 +1,29 @@ +{pkgs, piston, ...}: +let + pkg = pkgs.julia-bin; +in piston.mkRuntime { + language = "julia"; + version = pkg.version; + + aliases = [ + "jl" + ]; + + run = '' + ${pkg}/bin/julia --startup-file=no --history-file=no "$@" + ''; + + tests = [ + (piston.mkTest { + files = { + "test.jl" = '' + println("OK") + ''; + }; + args = []; + stdin = ""; + packages = []; + main = "test.jl"; + }) + ]; +} \ No newline at end of file From c3d1ece81e367dc6b02371f9c0729c7c1ed7e43e Mon Sep 17 00:00:00 2001 From: Dan Vargas Date: Fri, 11 Feb 2022 10:18:22 -0700 Subject: [PATCH 35/46] add piston nix pkg for jelly --- packages/jelly/0.1.31/build.sh | 12 ------------ packages/jelly/0.1.31/environment | 1 - packages/jelly/0.1.31/metadata.json | 5 ----- packages/jelly/0.1.31/run | 1 - packages/jelly/0.1.31/test.jelly | 1 - runtimes/default.nix | 1 + runtimes/jelly.nix | 26 ++++++++++++++++++++++++++ 7 files changed, 27 insertions(+), 20 deletions(-) delete mode 100755 packages/jelly/0.1.31/build.sh delete mode 100644 packages/jelly/0.1.31/environment delete mode 100644 packages/jelly/0.1.31/metadata.json delete mode 100644 packages/jelly/0.1.31/run delete mode 100644 packages/jelly/0.1.31/test.jelly create mode 100644 runtimes/jelly.nix diff --git a/packages/jelly/0.1.31/build.sh b/packages/jelly/0.1.31/build.sh deleted file mode 100755 index db57122..0000000 --- a/packages/jelly/0.1.31/build.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -source ../../python/3.9.1/build.sh - -mkdir -p build - -git clone -q https://github.com/DennisMitchell/jellylanguage.git build/jelly -cd build/jelly -../../bin/python3.9 setup.py install --optimize=1 - -cd ../../ -rm -rf build diff --git a/packages/jelly/0.1.31/environment b/packages/jelly/0.1.31/environment deleted file mode 100644 index bd0ff98..0000000 --- a/packages/jelly/0.1.31/environment +++ /dev/null @@ -1 +0,0 @@ -export PATH=$PWD/bin:$PATH \ No newline at end of file diff --git a/packages/jelly/0.1.31/metadata.json b/packages/jelly/0.1.31/metadata.json deleted file mode 100644 index 905242e..0000000 --- a/packages/jelly/0.1.31/metadata.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "language": "jelly", - "version": "0.1.31", - "aliases": [] -} diff --git a/packages/jelly/0.1.31/run b/packages/jelly/0.1.31/run deleted file mode 100644 index e07c1af..0000000 --- a/packages/jelly/0.1.31/run +++ /dev/null @@ -1 +0,0 @@ -jelly fu "$@" \ No newline at end of file diff --git a/packages/jelly/0.1.31/test.jelly b/packages/jelly/0.1.31/test.jelly deleted file mode 100644 index b32bbcd..0000000 --- a/packages/jelly/0.1.31/test.jelly +++ /dev/null @@ -1 +0,0 @@ -“OK” \ No newline at end of file diff --git a/runtimes/default.nix b/runtimes/default.nix index 993506c..48e2e52 100644 --- a/runtimes/default.nix +++ b/runtimes/default.nix @@ -39,4 +39,5 @@ args: { "sbcl-lisp" = import ./sbcl-lisp.nix args; "jvm-kotlin" = import ./jvm-kotlin.nix args; "julia" = import ./julia.nix args; + "jelly" = import ./jelly.nix args; } diff --git a/runtimes/jelly.nix b/runtimes/jelly.nix new file mode 100644 index 0000000..37b5108 --- /dev/null +++ b/runtimes/jelly.nix @@ -0,0 +1,26 @@ +{pkgs, piston, ...}: +let + pkg = pkgs.jelly; +in piston.mkRuntime { + language = "jelly"; + version = pkg.version; + aliases = []; + + run = '' + ${pkg}/bin/jelly fu "$@" + ''; + + tests = [ + (piston.mkTest { + files = { + "test.jelly" = '' + “OK” + ''; + }; + args = []; + stdin = ""; + packages = []; + main = "test.jelly"; + }) + ]; +} \ No newline at end of file From 93cf2319f3be2662a0fe0cf04d7c66b123eb3516 Mon Sep 17 00:00:00 2001 From: Dan Vargas Date: Fri, 11 Feb 2022 10:45:31 -0700 Subject: [PATCH 36/46] add piston nix pkg for openjdk-java --- packages/java/15.0.2/build.sh | 9 -------- packages/java/15.0.2/environment | 4 ---- packages/java/15.0.2/metadata.json | 5 ----- packages/java/15.0.2/run | 7 ------ packages/java/15.0.2/test.java | 5 ----- runtimes/default.nix | 1 + runtimes/openjdk-java.nix | 34 ++++++++++++++++++++++++++++++ 7 files changed, 35 insertions(+), 30 deletions(-) delete mode 100755 packages/java/15.0.2/build.sh delete mode 100644 packages/java/15.0.2/environment delete mode 100644 packages/java/15.0.2/metadata.json delete mode 100644 packages/java/15.0.2/run delete mode 100644 packages/java/15.0.2/test.java create mode 100644 runtimes/openjdk-java.nix diff --git a/packages/java/15.0.2/build.sh b/packages/java/15.0.2/build.sh deleted file mode 100755 index aef09a6..0000000 --- a/packages/java/15.0.2/build.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env bash - -# Put instructions to build your package in here - -curl "https://download.java.net/java/GA/jdk15.0.2/0d1cfde4252546c6931946de8db48ee2/7/GPL/openjdk-15.0.2_linux-x64_bin.tar.gz" -o java.tar.gz - -tar xzf java.tar.gz --strip-components=1 -rm java.tar.gz - diff --git a/packages/java/15.0.2/environment b/packages/java/15.0.2/environment deleted file mode 100644 index 780b668..0000000 --- a/packages/java/15.0.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/java/15.0.2/metadata.json b/packages/java/15.0.2/metadata.json deleted file mode 100644 index 9c3a298..0000000 --- a/packages/java/15.0.2/metadata.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "language": "java", - "version": "15.0.2", - "aliases": [] -} diff --git a/packages/java/15.0.2/run b/packages/java/15.0.2/run deleted file mode 100644 index 505e4e4..0000000 --- a/packages/java/15.0.2/run +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env bash - -# Put instructions to run the runtime -mv $1 $1.java -filename=$1.java -shift -java $filename "$@" diff --git a/packages/java/15.0.2/test.java b/packages/java/15.0.2/test.java deleted file mode 100644 index 2dc0eaa..0000000 --- a/packages/java/15.0.2/test.java +++ /dev/null @@ -1,5 +0,0 @@ -public class HelloWorld { - public static void main(String[] args) { - System.out.println("OK"); - } -} \ No newline at end of file diff --git a/runtimes/default.nix b/runtimes/default.nix index 48e2e52..ec6e596 100644 --- a/runtimes/default.nix +++ b/runtimes/default.nix @@ -40,4 +40,5 @@ args: { "jvm-kotlin" = import ./jvm-kotlin.nix args; "julia" = import ./julia.nix args; "jelly" = import ./jelly.nix args; + "openjdk-java" = import ./openjdk-java.nix args; } diff --git a/runtimes/openjdk-java.nix b/runtimes/openjdk-java.nix new file mode 100644 index 0000000..98e8f97 --- /dev/null +++ b/runtimes/openjdk-java.nix @@ -0,0 +1,34 @@ +{pkgs, piston, ...}: +let + pkg = pkgs.openjdk; +in piston.mkRuntime { + language = "java"; + version = pkg.version; + runtime = "openjdk"; + aliases = []; + + run = '' + mv $1 $1.java + filename=$1.java + shift + ${pkg}/bin/java $filename "$@" + ''; + + tests = [ + (piston.mkTest { + files = { + "test.java" = '' + public class PrinOK { + public static void main(String[] args) { + System.out.println("OK"); + } + } + ''; + }; + args = []; + stdin = ""; + packages = []; + main = "test.java"; + }) + ]; +} \ No newline at end of file From 61bac60830cd03d657e7bfdfe04302dd525a09da Mon Sep 17 00:00:00 2001 From: Dan Vargas Date: Fri, 11 Feb 2022 10:56:19 -0700 Subject: [PATCH 37/46] add piston nix pkg for iverilog --- packages/iverilog/11.0.0/build.sh | 17 ---------- packages/iverilog/11.0.0/compile | 4 --- packages/iverilog/11.0.0/environment | 2 -- packages/iverilog/11.0.0/metadata.json | 5 --- packages/iverilog/11.0.0/run | 4 --- packages/iverilog/11.0.0/test.verilog | 7 ----- runtimes/default.nix | 1 + runtimes/iverilog.nix | 43 ++++++++++++++++++++++++++ 8 files changed, 44 insertions(+), 39 deletions(-) delete mode 100755 packages/iverilog/11.0.0/build.sh delete mode 100644 packages/iverilog/11.0.0/compile delete mode 100644 packages/iverilog/11.0.0/environment delete mode 100644 packages/iverilog/11.0.0/metadata.json delete mode 100644 packages/iverilog/11.0.0/run delete mode 100644 packages/iverilog/11.0.0/test.verilog create mode 100644 runtimes/iverilog.nix diff --git a/packages/iverilog/11.0.0/build.sh b/packages/iverilog/11.0.0/build.sh deleted file mode 100755 index befb2fa..0000000 --- a/packages/iverilog/11.0.0/build.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash - -PREFIX=$(realpath $(dirname $0)) - -mkdir -p build/iverilog -cd build/iverilog -curl -L https://github.com/steveicarus/iverilog/archive/refs/tags/v11_0.tar.gz -o iverilog.tar.gz -tar xzf iverilog.tar.gz --strip-components=1 - -chmod +x ./autoconf.sh -./autoconf.sh -./configure --prefix="$PREFIX" -make -j$(nproc) -make install -j$(nproc) - -cd ../../ -rm -rf build diff --git a/packages/iverilog/11.0.0/compile b/packages/iverilog/11.0.0/compile deleted file mode 100644 index 56f4b4e..0000000 --- a/packages/iverilog/11.0.0/compile +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -rename 's/$/\.v/' "$@" # Add .v extension -iverilog *.v diff --git a/packages/iverilog/11.0.0/environment b/packages/iverilog/11.0.0/environment deleted file mode 100644 index b482830..0000000 --- a/packages/iverilog/11.0.0/environment +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -export PATH=$PWD/bin:$PATH diff --git a/packages/iverilog/11.0.0/metadata.json b/packages/iverilog/11.0.0/metadata.json deleted file mode 100644 index 5a35bde..0000000 --- a/packages/iverilog/11.0.0/metadata.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "language": "iverilog", - "version": "11.0.0", - "aliases": ["verilog", "vvp"] -} diff --git a/packages/iverilog/11.0.0/run b/packages/iverilog/11.0.0/run deleted file mode 100644 index 39e898c..0000000 --- a/packages/iverilog/11.0.0/run +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -shift -vvp a.out "$@" diff --git a/packages/iverilog/11.0.0/test.verilog b/packages/iverilog/11.0.0/test.verilog deleted file mode 100644 index 88fcd7a..0000000 --- a/packages/iverilog/11.0.0/test.verilog +++ /dev/null @@ -1,7 +0,0 @@ -module hello; - initial - begin - $display("OK"); - $finish ; - end -endmodule diff --git a/runtimes/default.nix b/runtimes/default.nix index ec6e596..c09b8f5 100644 --- a/runtimes/default.nix +++ b/runtimes/default.nix @@ -41,4 +41,5 @@ args: { "julia" = import ./julia.nix args; "jelly" = import ./jelly.nix args; "openjdk-java" = import ./openjdk-java.nix args; + "iverilog" = import ./iverilog.nix args; } diff --git a/runtimes/iverilog.nix b/runtimes/iverilog.nix new file mode 100644 index 0000000..9e62d7a --- /dev/null +++ b/runtimes/iverilog.nix @@ -0,0 +1,43 @@ +{pkgs, piston, ...}: +let + pkg = pkgs.verilog; +in piston.mkRuntime { + language = "iverilog"; + version = pkg.version; + + aliases = [ + "verilog" + "vvp" + ]; + + compile = '' + rename 's/$/\.v/' "$@" # Add .v extension + ${pkg}/bin/iverilog *.v + ''; + + run = '' + shift + ${pkg}/bin/vvp a.out "$@" + ''; + + tests = [ + (piston.mkTest { + files = { + "test.verilog" = '' + module ok; + initial + begin + $display("OK"); + $finish ; + end + endmodule + + ''; + }; + args = []; + stdin = ""; + packages = []; + main = "test.verilog"; + }) + ]; +} \ No newline at end of file From 2bc715589512de0852f9ba9f609ffc40f5bb3182 Mon Sep 17 00:00:00 2001 From: Dan Vargas Date: Fri, 11 Feb 2022 11:14:14 -0700 Subject: [PATCH 38/46] add piston nix pkg for ghc-haskell --- packages/haskell/9.0.1/build.sh | 19 -------------- packages/haskell/9.0.1/compile | 6 ----- packages/haskell/9.0.1/environment | 1 - packages/haskell/9.0.1/metadata.json | 5 ---- packages/haskell/9.0.1/run | 4 --- packages/haskell/9.0.1/test.hs | 1 - runtimes/default.nix | 1 + runtimes/ghc-haskell.nix | 37 ++++++++++++++++++++++++++++ 8 files changed, 38 insertions(+), 36 deletions(-) delete mode 100755 packages/haskell/9.0.1/build.sh delete mode 100644 packages/haskell/9.0.1/compile delete mode 100644 packages/haskell/9.0.1/environment delete mode 100644 packages/haskell/9.0.1/metadata.json delete mode 100644 packages/haskell/9.0.1/run delete mode 100644 packages/haskell/9.0.1/test.hs create mode 100644 runtimes/ghc-haskell.nix diff --git a/packages/haskell/9.0.1/build.sh b/packages/haskell/9.0.1/build.sh deleted file mode 100755 index 50d63c2..0000000 --- a/packages/haskell/9.0.1/build.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash - -PREFIX=$(realpath $(dirname $0)) - -mkdir -p build - -cd build - -# Platform specific because a true source compile would require GHC to be installed already on the latest -curl -L "https://downloads.haskell.org/~ghc/9.0.1/ghc-9.0.1-x86_64-deb10-linux.tar.xz" -o ghc.tar.xz -tar xf ghc.tar.xz --strip-components=1 -rm ghc.tar.xz - -./configure --prefix="$PREFIX" -make install -j$(nproc) - -cd ../ - -rm -rf build diff --git a/packages/haskell/9.0.1/compile b/packages/haskell/9.0.1/compile deleted file mode 100644 index 18e268b..0000000 --- a/packages/haskell/9.0.1/compile +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env bash - -# Compile haskell file(s) -rename 's/$/\.hs/' "$@" # Add .hs extension -ghc -dynamic -v0 -o out *.hs -chmod +x out diff --git a/packages/haskell/9.0.1/environment b/packages/haskell/9.0.1/environment deleted file mode 100644 index bd0ff98..0000000 --- a/packages/haskell/9.0.1/environment +++ /dev/null @@ -1 +0,0 @@ -export PATH=$PWD/bin:$PATH \ No newline at end of file diff --git a/packages/haskell/9.0.1/metadata.json b/packages/haskell/9.0.1/metadata.json deleted file mode 100644 index d58d528..0000000 --- a/packages/haskell/9.0.1/metadata.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "language": "haskell", - "version": "9.0.1", - "aliases": ["haskell", "hs"] -} diff --git a/packages/haskell/9.0.1/run b/packages/haskell/9.0.1/run deleted file mode 100644 index 6955ba9..0000000 --- a/packages/haskell/9.0.1/run +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -shift # Filename is only used to compile -./out "$@" diff --git a/packages/haskell/9.0.1/test.hs b/packages/haskell/9.0.1/test.hs deleted file mode 100644 index a8dd75a..0000000 --- a/packages/haskell/9.0.1/test.hs +++ /dev/null @@ -1 +0,0 @@ -main = putStrLn "OK" \ No newline at end of file diff --git a/runtimes/default.nix b/runtimes/default.nix index c09b8f5..b6f99ae 100644 --- a/runtimes/default.nix +++ b/runtimes/default.nix @@ -42,4 +42,5 @@ args: { "jelly" = import ./jelly.nix args; "openjdk-java" = import ./openjdk-java.nix args; "iverilog" = import ./iverilog.nix args; + "ghc-haskell" = import ./ghc-haskell.nix args; } diff --git a/runtimes/ghc-haskell.nix b/runtimes/ghc-haskell.nix new file mode 100644 index 0000000..81180f6 --- /dev/null +++ b/runtimes/ghc-haskell.nix @@ -0,0 +1,37 @@ +{pkgs, piston, ...}: +let + pkg = pkgs.haskell.compiler.ghcHEAD; +in piston.mkRuntime { + language = "haskell"; + version = pkg.version; + runtime = "ghc"; + + aliases = [ + "hs" + ]; + + compile = '' + rename 's/$/\.hs/' "$@" # Add .hs extension + ${pkg}/bin/ghc -dynamic -v0 -o out *.hs + chmod +x out + ''; + + run = '' + shift # Filename is only used to compile + ./out "$@" + ''; + + tests = [ + (piston.mkTest { + files = { + "test.hs" = '' + main = putStrLn "OK" + ''; + }; + args = []; + stdin = ""; + packages = []; + main = "test.hs"; + }) + ]; +} \ No newline at end of file From 226eca1fb92626f6503badc05dd883f39ec1360a Mon Sep 17 00:00:00 2001 From: Dan Vargas Date: Fri, 11 Feb 2022 15:22:57 -0700 Subject: [PATCH 39/46] add piston nix pkg for groovy --- packages/groovy/3.0.7/build.sh | 14 -------- packages/groovy/3.0.7/compile | 17 --------- packages/groovy/3.0.7/environment | 10 ------ packages/groovy/3.0.7/metadata.json | 5 --- packages/groovy/3.0.7/run | 5 --- packages/groovy/3.0.7/test.groovy | 1 - runtimes/default.nix | 1 + runtimes/groovy.nix | 55 +++++++++++++++++++++++++++++ 8 files changed, 56 insertions(+), 52 deletions(-) delete mode 100755 packages/groovy/3.0.7/build.sh delete mode 100644 packages/groovy/3.0.7/compile delete mode 100644 packages/groovy/3.0.7/environment delete mode 100644 packages/groovy/3.0.7/metadata.json delete mode 100644 packages/groovy/3.0.7/run delete mode 100644 packages/groovy/3.0.7/test.groovy create mode 100644 runtimes/groovy.nix diff --git a/packages/groovy/3.0.7/build.sh b/packages/groovy/3.0.7/build.sh deleted file mode 100755 index fb6321d..0000000 --- a/packages/groovy/3.0.7/build.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash - -# Groovy depends on JDK8+ -mkdir -p java -cd java -curl "https://download.java.net/java/GA/jdk15.0.2/0d1cfde4252546c6931946de8db48ee2/7/GPL/openjdk-15.0.2_linux-x64_bin.tar.gz" -o java.tar.gz -tar xzf java.tar.gz --strip-components=1 -rm java.tar.gz -cd .. - -# Download Groovy binaries -curl -L "https://groovy.jfrog.io/artifactory/dist-release-local/groovy-zips/apache-groovy-binary-3.0.7.zip" -o groovy.zip -unzip -q groovy.zip -rm groovy.zip diff --git a/packages/groovy/3.0.7/compile b/packages/groovy/3.0.7/compile deleted file mode 100644 index c501c9e..0000000 --- a/packages/groovy/3.0.7/compile +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash - -# Compile groovy scripts into a separate "classes" directory -# NOTE: - Main file MUST be a groovy script -# - not supporting object class entry points as of now -groovyc -d classes "$@" - -# Create the Manifest and include groovy jars: -# NOTE: - main class will be the first file ('.' becomes '_' and without the extension) -# - groovy lib jars MUST be in the class path in order to work properly -echo "Main-Class: $(sed 's/\./\_/g'<<<${1%.*}) -Class-Path: $(echo $GROOVY_HOME/lib/*.jar | sed 's/\s/\n /g') - -" > manifest.txt - -# Create the jar from the manifest and classes -jar cfm out.jar manifest.txt -C classes . diff --git a/packages/groovy/3.0.7/environment b/packages/groovy/3.0.7/environment deleted file mode 100644 index 1817781..0000000 --- a/packages/groovy/3.0.7/environment +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash - -# Groovy requires JAVA_HOME to be set -export JAVA_HOME=$PWD/java - -# GROOVY_HOME needed to get the groovy libs -export GROOVY_HOME=$PWD/groovy-3.0.7 - -# Add java and groovy binaries to the path -export PATH=$PWD/java/bin:$PWD/groovy-3.0.7/bin:$PATH diff --git a/packages/groovy/3.0.7/metadata.json b/packages/groovy/3.0.7/metadata.json deleted file mode 100644 index 34ab93d..0000000 --- a/packages/groovy/3.0.7/metadata.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "language": "groovy", - "version": "3.0.7", - "aliases": ["groovy", "gvy"] -} diff --git a/packages/groovy/3.0.7/run b/packages/groovy/3.0.7/run deleted file mode 100644 index 813d3bc..0000000 --- a/packages/groovy/3.0.7/run +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash - -# Run the jar created during compile -shift -java -jar out.jar "$@" diff --git a/packages/groovy/3.0.7/test.groovy b/packages/groovy/3.0.7/test.groovy deleted file mode 100644 index e4eb9d8..0000000 --- a/packages/groovy/3.0.7/test.groovy +++ /dev/null @@ -1 +0,0 @@ -println 'OK' diff --git a/runtimes/default.nix b/runtimes/default.nix index b6f99ae..cad9dd2 100644 --- a/runtimes/default.nix +++ b/runtimes/default.nix @@ -43,4 +43,5 @@ args: { "openjdk-java" = import ./openjdk-java.nix args; "iverilog" = import ./iverilog.nix args; "ghc-haskell" = import ./ghc-haskell.nix args; + "groovy" = import ./groovy.nix args; } diff --git a/runtimes/groovy.nix b/runtimes/groovy.nix new file mode 100644 index 0000000..b1d6fc6 --- /dev/null +++ b/runtimes/groovy.nix @@ -0,0 +1,55 @@ +{pkgs, piston, ...}: +let + pkg = pkgs.groovy; + jre = pkgs.jre; + awk = pkgs.gawk; + sed = pkgs.gnused; + grep = pkgs.gnugrep; +in piston.mkRuntime { + language = "groovy"; + version = pkg.version; + + aliases = [ + "gvy" + ]; + + compile = '' + # Groovyc has some dependencies on GNU grep, sed, and awk in their startup script + export PATH="$PATH:${awk}/bin:${sed}/bin:${grep}/bin" + + # Compile groovy scripts into a separate "classes" directory + # NOTE: - Main file MUST be a groovy script + # - not supporting object class entry points as of now + ${pkg}/bin/groovyc -d classes "$@" + + # Create the Manifest and include groovy jars: + # NOTE: - main class will be the first file ('.' becomes '_' and without the extension) + # - groovy lib jars MUST be in the class path in order to work properly + echo "Main-Class: $(sed 's/\./\_/g'<<<''${1%.*}) + Class-Path: $(echo ${pkg}/lib/*.jar | sed 's/\s/\n /g') + + " > manifest.txt + + # Create the jar from the manifest and classes + ${jre}/bin/jar cfm out.jar manifest.txt -C classes . + ''; + + run = '' + shift + ${jre}/bin/java -jar out.jar "$@" + ''; + + tests = [ + (piston.mkTest { + files = { + "test.groovy" = '' + println 'OK' + ''; + }; + args = []; + stdin = ""; + packages = []; + main = "test.groovy"; + }) + ]; +} \ No newline at end of file From bc2036486c3dab726234a38a722b1b719c41e925 Mon Sep 17 00:00:00 2001 From: Dan Vargas Date: Wed, 16 Feb 2022 09:10:46 -0700 Subject: [PATCH 40/46] add piston nix pkg for go --- packages/go/1.16.2/build.sh | 5 ----- packages/go/1.16.2/environment | 2 -- packages/go/1.16.2/metadata.json | 5 ----- packages/go/1.16.2/run | 7 ------ packages/go/1.16.2/test.go | 7 ------ runtimes/default.nix | 1 + runtimes/go.nix | 38 ++++++++++++++++++++++++++++++++ 7 files changed, 39 insertions(+), 26 deletions(-) delete mode 100755 packages/go/1.16.2/build.sh delete mode 100644 packages/go/1.16.2/environment delete mode 100644 packages/go/1.16.2/metadata.json delete mode 100644 packages/go/1.16.2/run delete mode 100644 packages/go/1.16.2/test.go create mode 100644 runtimes/go.nix diff --git a/packages/go/1.16.2/build.sh b/packages/go/1.16.2/build.sh deleted file mode 100755 index 5cf70f9..0000000 --- a/packages/go/1.16.2/build.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env bash -curl -LO https://golang.org/dl/go1.16.2.linux-amd64.tar.gz -tar -xzf go1.16.2.linux-amd64.tar.gz -rm go1.16.2.linux-amd64.tar.gz - diff --git a/packages/go/1.16.2/environment b/packages/go/1.16.2/environment deleted file mode 100644 index 88299c1..0000000 --- a/packages/go/1.16.2/environment +++ /dev/null @@ -1,2 +0,0 @@ -export PATH=$PWD/go/bin:$PATH -export GOPATH=$PWD/gopath diff --git a/packages/go/1.16.2/metadata.json b/packages/go/1.16.2/metadata.json deleted file mode 100644 index 0144808..0000000 --- a/packages/go/1.16.2/metadata.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "language": "go", - "version": "1.16.2", - "aliases": ["go", "golang"] -} diff --git a/packages/go/1.16.2/run b/packages/go/1.16.2/run deleted file mode 100644 index 65c9a4f..0000000 --- a/packages/go/1.16.2/run +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env bash - -mv $1 $1.go -#filename=$1.go -filename=*.go -shift -GOCACHE=$PWD go run $filename "$@" diff --git a/packages/go/1.16.2/test.go b/packages/go/1.16.2/test.go deleted file mode 100644 index c06f485..0000000 --- a/packages/go/1.16.2/test.go +++ /dev/null @@ -1,7 +0,0 @@ -package main - -import "fmt" - -func main() { - fmt.Println("OK") -} diff --git a/runtimes/default.nix b/runtimes/default.nix index cad9dd2..807d46d 100644 --- a/runtimes/default.nix +++ b/runtimes/default.nix @@ -44,4 +44,5 @@ args: { "iverilog" = import ./iverilog.nix args; "ghc-haskell" = import ./ghc-haskell.nix args; "groovy" = import ./groovy.nix args; + "go" = import ./go.nix args; } diff --git a/runtimes/go.nix b/runtimes/go.nix new file mode 100644 index 0000000..d4b12e3 --- /dev/null +++ b/runtimes/go.nix @@ -0,0 +1,38 @@ +{pkgs, piston, ...}: +let + pkg = pkgs.go; +in piston.mkRuntime { + language = "go"; + version = pkg.version; + + aliases = [ + "golang" + ]; + + run = '' + mv $1 $1.go + filename=*.go + shift + GOCACHE=$PWD ${pkg}/bin/go run $filename "$@" + ''; + + tests = [ + (piston.mkTest { + files = { + "test.go" = '' + package main + + import "fmt" + + func main() { + fmt.Println("OK") + } + ''; + }; + args = []; + stdin = ""; + packages = []; + main = "test.go"; + }) + ]; +} \ No newline at end of file From 6297b0bcad25f1689d886cea1df6109bae77701c Mon Sep 17 00:00:00 2001 From: Dan Vargas Date: Wed, 16 Feb 2022 10:23:32 -0700 Subject: [PATCH 41/46] add piston nix pkg for gcc-c --- runtimes/default.nix | 1 + runtimes/gcc-c.nix | 41 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 runtimes/gcc-c.nix diff --git a/runtimes/default.nix b/runtimes/default.nix index 807d46d..c230450 100644 --- a/runtimes/default.nix +++ b/runtimes/default.nix @@ -45,4 +45,5 @@ args: { "ghc-haskell" = import ./ghc-haskell.nix args; "groovy" = import ./groovy.nix args; "go" = import ./go.nix args; + "gcc-c" = import ./gcc-c.nix args; } diff --git a/runtimes/gcc-c.nix b/runtimes/gcc-c.nix new file mode 100644 index 0000000..d85e677 --- /dev/null +++ b/runtimes/gcc-c.nix @@ -0,0 +1,41 @@ +{pkgs, piston, ...}: +let + pkg = pkgs.gcc; +in piston.mkRuntime { + language = "c"; + version = pkg.version; + runtime = "gcc"; + + aliases = [ + "gcc" + ]; + + compile = '' + rename 's/$/\.c/' "$@" # Add .c extension + ${pkg}/bin/gcc -std=c11 *.c -lm + ''; + + run = '' + shift + ./a.out "$@" + ''; + + tests = [ + (piston.mkTest { + files = { + "test.c" = '' + #include + + int main(void) { + printf("OK"); + return 0; + } + ''; + }; + args = []; + stdin = ""; + packages = []; + main = "test.c"; + }) + ]; +} \ No newline at end of file From 28dca3ec443e0aeceda7ec2dbb9b5f23849755f8 Mon Sep 17 00:00:00 2001 From: Dan Vargas Date: Wed, 16 Feb 2022 10:27:11 -0700 Subject: [PATCH 42/46] add piston nix pkg for gcc-c++ --- runtimes/default.nix | 1 + runtimes/gcc-c++.nix | 42 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 runtimes/gcc-c++.nix diff --git a/runtimes/default.nix b/runtimes/default.nix index c230450..9b01411 100644 --- a/runtimes/default.nix +++ b/runtimes/default.nix @@ -46,4 +46,5 @@ args: { "groovy" = import ./groovy.nix args; "go" = import ./go.nix args; "gcc-c" = import ./gcc-c.nix args; + "gcc-c++" = import ./gcc-c++.nix args; } diff --git a/runtimes/gcc-c++.nix b/runtimes/gcc-c++.nix new file mode 100644 index 0000000..da575b1 --- /dev/null +++ b/runtimes/gcc-c++.nix @@ -0,0 +1,42 @@ +{pkgs, piston, ...}: +let + pkg = pkgs.gcc; +in piston.mkRuntime { + language = "c++"; + version = pkg.version; + runtime = "gcc"; + + aliases = [ + "cpp" + "g++" + ]; + + compile = '' + rename 's/$/\.cpp/' "$@" # Add .cpp extension + ${pkg}/bin/g++ -std=c++17 *.cpp + ''; + + run = '' + shift + ./a.out "$@" + ''; + + tests = [ + (piston.mkTest { + files = { + "test.cpp" = '' + #include + + int main(void) { + printf("OK"); + return 0; + } + ''; + }; + args = []; + stdin = ""; + packages = []; + main = "test.cpp"; + }) + ]; +} \ No newline at end of file From 11882b2085e275fe434e56478bc9dcb0432dbf7f Mon Sep 17 00:00:00 2001 From: Dan Vargas Date: Wed, 16 Feb 2022 10:46:31 -0700 Subject: [PATCH 43/46] add piston nix pkg for gcc-d --- runtimes/default.nix | 1 + runtimes/gcc-d.nix | 40 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 runtimes/gcc-d.nix diff --git a/runtimes/default.nix b/runtimes/default.nix index 9b01411..23b997e 100644 --- a/runtimes/default.nix +++ b/runtimes/default.nix @@ -47,4 +47,5 @@ args: { "go" = import ./go.nix args; "gcc-c" = import ./gcc-c.nix args; "gcc-c++" = import ./gcc-c++.nix args; + "gcc-d" = import ./gcc-d.nix args; } diff --git a/runtimes/gcc-d.nix b/runtimes/gcc-d.nix new file mode 100644 index 0000000..ccec61f --- /dev/null +++ b/runtimes/gcc-d.nix @@ -0,0 +1,40 @@ +{pkgs, piston, ...}: +let + pkg = pkgs.gdc; +in piston.mkRuntime { + language = "d"; + version = pkg.version; + runtime = "gcc"; + + aliases = [ + "gdc" + ]; + + compile = '' + rename 's/.code$/\.d/' "$@" # Add .d + ${pkg}/bin/gdc *.d + ''; + + run = '' + shift + ./a.out "$@" + ''; + + tests = [ + (piston.mkTest { + files = { + "test.d" = '' + import std.stdio; + + void main() { + writeln("OK"); + } + ''; + }; + args = []; + stdin = ""; + packages = []; + main = "test.d"; + }) + ]; +} \ No newline at end of file From 3fac94b6836c0cdb3be2fdf90f9bb2facbc3bb75 Mon Sep 17 00:00:00 2001 From: Dan Vargas Date: Wed, 16 Feb 2022 10:59:05 -0700 Subject: [PATCH 44/46] add piston nix pkg for gcc-fortran --- packages/gcc/10.2.0/build.sh | 26 --------------------- packages/gcc/10.2.0/compile | 29 ----------------------- packages/gcc/10.2.0/environment | 5 ---- packages/gcc/10.2.0/metadata.json | 22 ----------------- packages/gcc/10.2.0/run | 6 ----- packages/gcc/10.2.0/test.c | 6 ----- packages/gcc/10.2.0/test.cpp | 6 ----- packages/gcc/10.2.0/test.d | 5 ---- packages/gcc/10.2.0/test.f90 | 3 --- runtimes/default.nix | 1 + runtimes/gcc-fortran.nix | 39 +++++++++++++++++++++++++++++++ 11 files changed, 40 insertions(+), 108 deletions(-) delete mode 100755 packages/gcc/10.2.0/build.sh delete mode 100644 packages/gcc/10.2.0/compile delete mode 100644 packages/gcc/10.2.0/environment delete mode 100644 packages/gcc/10.2.0/metadata.json delete mode 100644 packages/gcc/10.2.0/run delete mode 100644 packages/gcc/10.2.0/test.c delete mode 100644 packages/gcc/10.2.0/test.cpp delete mode 100644 packages/gcc/10.2.0/test.d delete mode 100644 packages/gcc/10.2.0/test.f90 create mode 100644 runtimes/gcc-fortran.nix diff --git a/packages/gcc/10.2.0/build.sh b/packages/gcc/10.2.0/build.sh deleted file mode 100755 index 0ed183a..0000000 --- a/packages/gcc/10.2.0/build.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/usr/bin/env bash - -# Put instructions to build your package in here -[[ -d "bin" ]] && exit 0 -PREFIX=$(realpath $(dirname $0)) - -mkdir -p build obj - -cd build - -curl "https://ftp.gnu.org/gnu/gcc/gcc-10.2.0/gcc-10.2.0.tar.gz" -o gcc.tar.gz - -tar xzf gcc.tar.gz --strip-components=1 - -./contrib/download_prerequisites - -cd ../obj - -# === autoconf based === -../build/configure --prefix "$PREFIX" --enable-languages=c,c++,d,fortran --disable-multilib --disable-bootstrap - -make -j$(nproc) -make install -j$(nproc) -cd ../ -rm -rf build obj - diff --git a/packages/gcc/10.2.0/compile b/packages/gcc/10.2.0/compile deleted file mode 100644 index a77ba35..0000000 --- a/packages/gcc/10.2.0/compile +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/env bash - -# Put instructions to compile source code, remove this file if the language does not require this stage - - -case "${PISTON_LANGUAGE}" in - c) - rename 's/$/\.c/' "$@" # Add .c extension - gcc -std=c11 *.c -lm - ;; - c++) - rename 's/$/\.cpp/' "$@" # Add .cpp extension - g++ -std=c++17 *.cpp - ;; - d) - rename 's/.code$/\.d/' "$@" # Add .d extension - gdc *.d - ;; - fortran) - rename 's/.code$/\.f90/' "$@" # Add .f90 extension - gfortran *.f90 - ;; - *) - echo "How did you get here? (${PISTON_LANGUAGE})" - exit 1 - ;; -esac - -chmod +x a.out \ No newline at end of file diff --git a/packages/gcc/10.2.0/environment b/packages/gcc/10.2.0/environment deleted file mode 100644 index a0b5a11..0000000 --- a/packages/gcc/10.2.0/environment +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env bash - -# Put 'export' statements here for environment variables -export PATH=$PWD/bin:$PATH -export LD_LIBRARY_PATH="$PWD/lib:$PWD/lib64" # Need this to properly link Fortran diff --git a/packages/gcc/10.2.0/metadata.json b/packages/gcc/10.2.0/metadata.json deleted file mode 100644 index 367de7c..0000000 --- a/packages/gcc/10.2.0/metadata.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "language": "gcc", - "version": "10.2.0", - "provides": [ - { - "language": "c", - "aliases": ["gcc"] - }, - { - "language": "c++", - "aliases": ["cpp", "g++"] - }, - { - "language": "d", - "aliases": ["gdc"] - }, - { - "language": "fortran", - "aliases": ["fortran", "f90"] - } - ] -} diff --git a/packages/gcc/10.2.0/run b/packages/gcc/10.2.0/run deleted file mode 100644 index 60ad16b..0000000 --- a/packages/gcc/10.2.0/run +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env bash - -# Put instructions to run the runtime - -shift # Discard main filename -./a.out "$@" diff --git a/packages/gcc/10.2.0/test.c b/packages/gcc/10.2.0/test.c deleted file mode 100644 index fafae75..0000000 --- a/packages/gcc/10.2.0/test.c +++ /dev/null @@ -1,6 +0,0 @@ -#include - -int main(void) { - printf("OK"); - return 0; -} \ No newline at end of file diff --git a/packages/gcc/10.2.0/test.cpp b/packages/gcc/10.2.0/test.cpp deleted file mode 100644 index 9d0499e..0000000 --- a/packages/gcc/10.2.0/test.cpp +++ /dev/null @@ -1,6 +0,0 @@ -#include - -int main(void) { - printf("OK"); - return 0; -} \ No newline at end of file diff --git a/packages/gcc/10.2.0/test.d b/packages/gcc/10.2.0/test.d deleted file mode 100644 index e74851d..0000000 --- a/packages/gcc/10.2.0/test.d +++ /dev/null @@ -1,5 +0,0 @@ -import std.stdio; - -void main() { - writeln("OK"); -} \ No newline at end of file diff --git a/packages/gcc/10.2.0/test.f90 b/packages/gcc/10.2.0/test.f90 deleted file mode 100644 index 99fc062..0000000 --- a/packages/gcc/10.2.0/test.f90 +++ /dev/null @@ -1,3 +0,0 @@ -program test - print "(a)", 'OK' -end program test diff --git a/runtimes/default.nix b/runtimes/default.nix index 23b997e..bd8dbf3 100644 --- a/runtimes/default.nix +++ b/runtimes/default.nix @@ -48,4 +48,5 @@ args: { "gcc-c" = import ./gcc-c.nix args; "gcc-c++" = import ./gcc-c++.nix args; "gcc-d" = import ./gcc-d.nix args; + "gcc-fortran" = import ./gcc-fortran.nix args; } diff --git a/runtimes/gcc-fortran.nix b/runtimes/gcc-fortran.nix new file mode 100644 index 0000000..7173753 --- /dev/null +++ b/runtimes/gcc-fortran.nix @@ -0,0 +1,39 @@ +{pkgs, piston, ...}: +let + pkg = pkgs.gfortran; +in piston.mkRuntime { + language = "fortran"; + version = pkg.version; + runtime = "gcc"; + + aliases = [ + "gfortran" + "f90" + ]; + + compile = '' + rename 's/.code$/\.f90/' "$@" # Add .f90 extension + ${pkg}/bin/gfortran *.f90 + ''; + + run = '' + shift + ./a.out "$@" + ''; + + tests = [ + (piston.mkTest { + files = { + "test.f90" = '' + program test + print "(a)", 'OK' + end program test + ''; + }; + args = []; + stdin = ""; + packages = []; + main = "test.f90"; + }) + ]; +} \ No newline at end of file From 2f2bb862e3acff6a1b426c8074a4907ed6eb1630 Mon Sep 17 00:00:00 2001 From: Dan Vargas Date: Wed, 16 Feb 2022 11:08:48 -0700 Subject: [PATCH 45/46] add piston nix pkg for yabasic (replaces freebasic) --- packages/freebasic/1.8.0/build.sh | 5 ----- packages/freebasic/1.8.0/compile | 4 ---- packages/freebasic/1.8.0/environment | 4 ---- packages/freebasic/1.8.0/metadata.json | 5 ----- packages/freebasic/1.8.0/run | 5 ----- packages/freebasic/1.8.0/test.bas | 1 - runtimes/default.nix | 1 + runtimes/yabasic.nix | 29 ++++++++++++++++++++++++++ 8 files changed, 30 insertions(+), 24 deletions(-) delete mode 100755 packages/freebasic/1.8.0/build.sh delete mode 100644 packages/freebasic/1.8.0/compile delete mode 100644 packages/freebasic/1.8.0/environment delete mode 100644 packages/freebasic/1.8.0/metadata.json delete mode 100644 packages/freebasic/1.8.0/run delete mode 100644 packages/freebasic/1.8.0/test.bas create mode 100644 runtimes/yabasic.nix diff --git a/packages/freebasic/1.8.0/build.sh b/packages/freebasic/1.8.0/build.sh deleted file mode 100755 index bd58488..0000000 --- a/packages/freebasic/1.8.0/build.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env bash - -curl -L "https://sourceforge.net/projects/fbc/files/FreeBASIC-1.08.0/Binaries-Linux/FreeBASIC-1.08.0-linux-x86_64.tar.gz/download" -o freebasic.tar.gz -tar xf freebasic.tar.gz --strip-components=1 -rm freebasic.tar.gz diff --git a/packages/freebasic/1.8.0/compile b/packages/freebasic/1.8.0/compile deleted file mode 100644 index b836b3d..0000000 --- a/packages/freebasic/1.8.0/compile +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env bash - -# Compile bas files -fbc -lang qb -b "$@" -x out diff --git a/packages/freebasic/1.8.0/environment b/packages/freebasic/1.8.0/environment deleted file mode 100644 index 144c737..0000000 --- a/packages/freebasic/1.8.0/environment +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env bash - -# Path to fbc compiler -export PATH=$PWD/bin:$PATH diff --git a/packages/freebasic/1.8.0/metadata.json b/packages/freebasic/1.8.0/metadata.json deleted file mode 100644 index 1dcf1ff..0000000 --- a/packages/freebasic/1.8.0/metadata.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "language": "freebasic", - "version": "1.8.0", - "aliases": ["bas", "fbc", "basic", "qbasic", "quickbasic"] -} diff --git a/packages/freebasic/1.8.0/run b/packages/freebasic/1.8.0/run deleted file mode 100644 index 610d7e6..0000000 --- a/packages/freebasic/1.8.0/run +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env bash - -# Run output file from compile with arguments -shift -./out "$@" diff --git a/packages/freebasic/1.8.0/test.bas b/packages/freebasic/1.8.0/test.bas deleted file mode 100644 index b13a0ef..0000000 --- a/packages/freebasic/1.8.0/test.bas +++ /dev/null @@ -1 +0,0 @@ -PRINT "OK" \ No newline at end of file diff --git a/runtimes/default.nix b/runtimes/default.nix index bd8dbf3..d1a2459 100644 --- a/runtimes/default.nix +++ b/runtimes/default.nix @@ -49,4 +49,5 @@ args: { "gcc-c++" = import ./gcc-c++.nix args; "gcc-d" = import ./gcc-d.nix args; "gcc-fortran" = import ./gcc-fortran.nix args; + "yabasic" = import ./yabasic.nix args; } diff --git a/runtimes/yabasic.nix b/runtimes/yabasic.nix new file mode 100644 index 0000000..d319d02 --- /dev/null +++ b/runtimes/yabasic.nix @@ -0,0 +1,29 @@ +{pkgs, piston, ...}: +let + pkg = pkgs.yabasic; +in piston.mkRuntime { + language = "yabasic"; + version = pkg.version; + + aliases = [ + "basic" + ]; + + run = '' + ${pkg}/bin/yabasic "$@" + ''; + + tests = [ + (piston.mkTest { + files = { + "test.bas" = '' + PRINT "OK" + ''; + }; + args = []; + stdin = ""; + packages = []; + main = "test.bas"; + }) + ]; +} \ No newline at end of file From 961b67894824f005f57767977fa37da4fec3e3fc Mon Sep 17 00:00:00 2001 From: Dan Vargas Date: Wed, 16 Feb 2022 11:15:38 -0700 Subject: [PATCH 46/46] add piston nix pkg for emacs --- packages/emacs/27.1.0/build.sh | 24 ----------------------- packages/emacs/27.1.0/environment | 4 ---- packages/emacs/27.1.0/metadata.json | 5 ----- packages/emacs/27.1.0/run | 4 ---- packages/emacs/27.1.0/test.el | 1 - runtimes/default.nix | 1 + runtimes/emacs.nix | 30 +++++++++++++++++++++++++++++ 7 files changed, 31 insertions(+), 38 deletions(-) delete mode 100755 packages/emacs/27.1.0/build.sh delete mode 100644 packages/emacs/27.1.0/environment delete mode 100644 packages/emacs/27.1.0/metadata.json delete mode 100644 packages/emacs/27.1.0/run delete mode 100644 packages/emacs/27.1.0/test.el create mode 100644 runtimes/emacs.nix diff --git a/packages/emacs/27.1.0/build.sh b/packages/emacs/27.1.0/build.sh deleted file mode 100755 index a4aecc6..0000000 --- a/packages/emacs/27.1.0/build.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash - -export PATH=$PWD/bin:$PATH - -PREFIX=$(realpath $(dirname $0)) - -mkdir -p build - -cd build - -# Emacs version 27.1 supports Docker builds -# Otherwise, older versions will work too, but you will have to disable `/proc/sys/kernel/randomize_va_space` which is less secure -curl -L "http://ftpmirror.gnu.org/emacs/emacs-27.1.tar.gz" -o emacs.tar.gz -tar xzf emacs.tar.gz --strip-components=1 -rm emacs.tar.gz - -# Building without all that X11 stuff -./configure --prefix="$PREFIX" --with-x=no --with-x-toolkit=no --with-xpm=no --with-jpeg=no --with-png=no --with-gif=no --with-tiff=no --with-gnutls=no -make -j$(nproc) -make install -j$(nproc) - -cd .. - -rm -rf build diff --git a/packages/emacs/27.1.0/environment b/packages/emacs/27.1.0/environment deleted file mode 100644 index 780b668..0000000 --- a/packages/emacs/27.1.0/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/emacs/27.1.0/metadata.json b/packages/emacs/27.1.0/metadata.json deleted file mode 100644 index caa2fb4..0000000 --- a/packages/emacs/27.1.0/metadata.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "language": "emacs", - "version": "27.1.0", - "aliases": ["emacs", "el", "elisp"] -} diff --git a/packages/emacs/27.1.0/run b/packages/emacs/27.1.0/run deleted file mode 100644 index 8bf46e4..0000000 --- a/packages/emacs/27.1.0/run +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -# Put instructions to run the runtime -emacs -Q --script "$@" \ No newline at end of file diff --git a/packages/emacs/27.1.0/test.el b/packages/emacs/27.1.0/test.el deleted file mode 100644 index ebe0215..0000000 --- a/packages/emacs/27.1.0/test.el +++ /dev/null @@ -1 +0,0 @@ -(princ "OK") \ No newline at end of file diff --git a/runtimes/default.nix b/runtimes/default.nix index d1a2459..140fd83 100644 --- a/runtimes/default.nix +++ b/runtimes/default.nix @@ -50,4 +50,5 @@ args: { "gcc-d" = import ./gcc-d.nix args; "gcc-fortran" = import ./gcc-fortran.nix args; "yabasic" = import ./yabasic.nix args; + "emacs" = import ./emacs.nix args; } diff --git a/runtimes/emacs.nix b/runtimes/emacs.nix new file mode 100644 index 0000000..53c4d81 --- /dev/null +++ b/runtimes/emacs.nix @@ -0,0 +1,30 @@ +{pkgs, piston, ...}: +let + pkg = pkgs.emacs-nox; +in piston.mkRuntime { + language = "emacs"; + version = pkg.version; + + aliases = [ + "el" + "elisp" + ]; + + run = '' + ${pkg}/bin/emacs -Q --script "$@" + ''; + + tests = [ + (piston.mkTest { + files = { + "test.el" = '' + (princ "OK") + ''; + }; + args = []; + stdin = ""; + packages = []; + main = "test.el"; + }) + ]; +} \ No newline at end of file