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