add piston nix pkg for ghc-haskell
This commit is contained in:
parent
61bac60830
commit
2bc7155895
|
@ -1,19 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
PREFIX=$(realpath $(dirname $0))
|
||||
|
||||
mkdir -p build
|
||||
|
||||
cd build
|
||||
|
||||
# Platform specific because a true source compile would require GHC to be installed already on the latest
|
||||
curl -L "https://downloads.haskell.org/~ghc/9.0.1/ghc-9.0.1-x86_64-deb10-linux.tar.xz" -o ghc.tar.xz
|
||||
tar xf ghc.tar.xz --strip-components=1
|
||||
rm ghc.tar.xz
|
||||
|
||||
./configure --prefix="$PREFIX"
|
||||
make install -j$(nproc)
|
||||
|
||||
cd ../
|
||||
|
||||
rm -rf build
|
|
@ -1,6 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# Compile haskell file(s)
|
||||
rename 's/$/\.hs/' "$@" # Add .hs extension
|
||||
ghc -dynamic -v0 -o out *.hs
|
||||
chmod +x out
|
|
@ -1 +0,0 @@
|
|||
export PATH=$PWD/bin:$PATH
|
|
@ -1,5 +0,0 @@
|
|||
{
|
||||
"language": "haskell",
|
||||
"version": "9.0.1",
|
||||
"aliases": ["haskell", "hs"]
|
||||
}
|
|
@ -1,4 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
shift # Filename is only used to compile
|
||||
./out "$@"
|
|
@ -1 +0,0 @@
|
|||
main = putStrLn "OK"
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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…
Reference in New Issue