diff --git a/packages/haskell/9.0.1/build.sh b/packages/haskell/9.0.1/build.sh deleted file mode 100755 index 50d63c2..0000000 --- a/packages/haskell/9.0.1/build.sh +++ /dev/null @@ -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 diff --git a/packages/haskell/9.0.1/compile b/packages/haskell/9.0.1/compile deleted file mode 100644 index 18e268b..0000000 --- a/packages/haskell/9.0.1/compile +++ /dev/null @@ -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 diff --git a/packages/haskell/9.0.1/environment b/packages/haskell/9.0.1/environment deleted file mode 100644 index bd0ff98..0000000 --- a/packages/haskell/9.0.1/environment +++ /dev/null @@ -1 +0,0 @@ -export PATH=$PWD/bin:$PATH \ No newline at end of file diff --git a/packages/haskell/9.0.1/metadata.json b/packages/haskell/9.0.1/metadata.json deleted file mode 100644 index d58d528..0000000 --- a/packages/haskell/9.0.1/metadata.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "language": "haskell", - "version": "9.0.1", - "aliases": ["haskell", "hs"] -} diff --git a/packages/haskell/9.0.1/run b/packages/haskell/9.0.1/run deleted file mode 100644 index 6955ba9..0000000 --- a/packages/haskell/9.0.1/run +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -shift # Filename is only used to compile -./out "$@" diff --git a/packages/haskell/9.0.1/test.hs b/packages/haskell/9.0.1/test.hs deleted file mode 100644 index a8dd75a..0000000 --- a/packages/haskell/9.0.1/test.hs +++ /dev/null @@ -1 +0,0 @@ -main = putStrLn "OK" \ No newline at end of file diff --git a/runtimes/default.nix b/runtimes/default.nix index c09b8f5..b6f99ae 100644 --- a/runtimes/default.nix +++ b/runtimes/default.nix @@ -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; } diff --git a/runtimes/ghc-haskell.nix b/runtimes/ghc-haskell.nix new file mode 100644 index 0000000..81180f6 --- /dev/null +++ b/runtimes/ghc-haskell.nix @@ -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"; + }) + ]; +} \ No newline at end of file