From 2f2bb862e3acff6a1b426c8074a4907ed6eb1630 Mon Sep 17 00:00:00 2001 From: Dan Vargas Date: Wed, 16 Feb 2022 11:08:48 -0700 Subject: [PATCH] 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