pkg(j-902): added j 902 nix package

This commit is contained in:
Hydrazer 2022-02-20 13:47:37 -07:00
parent 04de31b946
commit 9d5900251c
4 changed files with 138 additions and 0 deletions

View file

@ -340,6 +340,7 @@ Content-Type: application/json
`haskell`, `haskell`,
`husk`, `husk`,
`iverilog`, `iverilog`,
`j`,
`japt`, `japt`,
`java`, `java`,
`javascript`, `javascript`,

68
runtimes/902-j.nix Normal file
View file

@ -0,0 +1,68 @@
{pkgs, piston, ...}:
let
# Put your package here, preferibly from nixpkgs.
pkg = pkgs.902; # this may be incorrect - it is guessed
in piston.mkRuntime {
# Name of the language implemented by this runtime
language = "j";
# The version of the language
# Usually this is specified on the package
version = pkg.version;
# Name of the runtime
# This line should be kept if the runtime differs from the language
runtime = "902";
aliases = [
# Put extensions in here, and other common names
# Example:
# "js"
# "node-javascript"
];
# This is the lines of a shell script to compile source code.
# Arguments passed to this script are all the provided source files
# The CWD of this script is a temp directory for a job
#
# If the language only supports JIT compiling, simply remove this line
# See ./python3.nix and ./node-javascript.nix for examples
#
# No shebang needs to be added to this - that is done automatically.
compile = ''
${pkg}/bin/902 --compile "$@"
'';
# This is the lines of a shell script to evaluate a file at $1
# The remaining arguments are the arguments to launch the application with
# The CWD of this script is a temp directory for a job
#
# If the compile stage is used, $1 still contains the name of the source file.
# It is up to your script to determine the filename of the emitted binary
#
# No shebang needs to be added to this - that is done automatically.
run = ''
${pkg}/bin/902 "$@"
'';
# Specify a list of tests.
# These should output "OK" to STDOUT if everything looks good
#
# Run the following command to test the package:
# $ ./piston test 902-j
tests = [
(piston.mkTest {
files = {
"test.js" = ''
console.log("OK");
'';
};
args = [];
stdin = "";
packages = [];
main = "test.js";
})
];
}

View file

@ -51,4 +51,5 @@ args: {
"gcc-fortran" = import ./gcc-fortran.nix args; "gcc-fortran" = import ./gcc-fortran.nix args;
"yabasic" = import ./yabasic.nix args; "yabasic" = import ./yabasic.nix args;
"emacs" = import ./emacs.nix args; "emacs" = import ./emacs.nix args;
"j" = import ./j.nix args;
} }

68
runtimes/j.nix Normal file
View file

@ -0,0 +1,68 @@
{pkgs, piston, ...}:
let
# Put your package here, preferibly from nixpkgs.
pkg = pkgs.j; # this may be incorrect - it is guessed
in piston.mkRuntime {
# Name of the language implemented by this runtime
language = "j";
# The version of the language
# Usually this is specified on the package
version = pkg.version;
# Name of the runtime
# This line should be kept if the runtime differs from the language
runtime = "j";
aliases = [
# Put extensions in here, and other common names
# Example:
# "js"
# "node-javascript"
];
# This is the lines of a shell script to compile source code.
# Arguments passed to this script are all the provided source files
# The CWD of this script is a temp directory for a job
#
# If the language only supports JIT compiling, simply remove this line
# See ./python3.nix and ./node-javascript.nix for examples
#
# No shebang needs to be added to this - that is done automatically.
compile = ''
${pkg}/bin/j --compile "$@"
'';
# This is the lines of a shell script to evaluate a file at $1
# The remaining arguments are the arguments to launch the application with
# The CWD of this script is a temp directory for a job
#
# If the compile stage is used, $1 still contains the name of the source file.
# It is up to your script to determine the filename of the emitted binary
#
# No shebang needs to be added to this - that is done automatically.
run = ''
${pkg}/bin/j "$@"
'';
# Specify a list of tests.
# These should output "OK" to STDOUT if everything looks good
#
# Run the following command to test the package:
# $ ./piston test j
tests = [
(piston.mkTest {
files = {
"test.js" = ''
console.log("OK");
'';
};
args = [];
stdin = "";
packages = [];
main = "test.js";
})
];
}