add piston nix pkg for yabasic (replaces freebasic)

This commit is contained in:
Dan Vargas 2022-02-16 11:08:48 -07:00
parent 3fac94b683
commit 2f2bb862e3
8 changed files with 30 additions and 24 deletions

View File

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

View File

@ -1,4 +0,0 @@
#!/usr/bin/env bash
# Compile bas files
fbc -lang qb -b "$@" -x out

View File

@ -1,4 +0,0 @@
#!/usr/bin/env bash
# Path to fbc compiler
export PATH=$PWD/bin:$PATH

View File

@ -1,5 +0,0 @@
{
"language": "freebasic",
"version": "1.8.0",
"aliases": ["bas", "fbc", "basic", "qbasic", "quickbasic"]
}

View File

@ -1,5 +0,0 @@
#!/usr/bin/env bash
# Run output file from compile with arguments
shift
./out "$@"

View File

@ -1 +0,0 @@
PRINT "OK"

View File

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

29
runtimes/yabasic.nix Normal file
View File

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