mirror of
https://github.com/engineer-man/piston.git
synced 2025-04-20 20:16:26 +02:00
ocaml for nix
This commit is contained in:
parent
e7c5b557f9
commit
f94ba284df
8 changed files with 36 additions and 35 deletions
|
@ -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;
|
||||
}
|
||||
|
|
35
runtimes/ocaml.nix
Normal file
35
runtimes/ocaml.nix
Normal file
|
@ -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";
|
||||
})
|
||||
];
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue