mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-07-21 16:11:22 +00:00
The package set is built entirely from source using the stdenv and Hugs. This also replaces the recently added microhs package, which was built from pre-generated compiler output. Co-authored-by: sternenseemann <sternenseemann@systemli.org>
35 lines
529 B
Nix
35 lines
529 B
Nix
{
|
|
stdenv,
|
|
microhs,
|
|
writeTextDir,
|
|
}:
|
|
|
|
stdenv.mkDerivation {
|
|
name = "microhs-hello-world";
|
|
buildInputs = [ microhs ];
|
|
|
|
src = writeTextDir "helloworld.hs" ''
|
|
main :: IO ()
|
|
main = putStrLn "Hello World"
|
|
'';
|
|
|
|
buildPhase = ''
|
|
runHook preBuild
|
|
mhs helloworld.hs -oExe
|
|
runHook postBuild
|
|
'';
|
|
|
|
checkPhase = ''
|
|
runHook preCheck
|
|
./Exe | grep "Hello World"
|
|
runHook postCheck
|
|
'';
|
|
doCheck = true;
|
|
|
|
installPhase = ''
|
|
runHook preInstall
|
|
touch $out
|
|
runHook postInstall
|
|
'';
|
|
}
|