nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 callPackage,
3 stdenv,
4 fetchFromGitHub,
5 lib,
6 writableTmpDirAsHomeHook,
7 writeTextDir,
8}:
9
10stdenv.mkDerivation (finalAttrs: {
11 pname = "microhs";
12 version = "0.14.21.0";
13
14 src = fetchFromGitHub {
15 owner = "augustss";
16 repo = "MicroHs";
17 tag = "v${finalAttrs.version}";
18 hash = "sha256-Tq8fjI3LCP4NWrmbMP0xyhY2fjRmsMCEvgfDQ/SB5Bo=";
19 };
20
21 # mcabal doesn't seem to respect the make flag and fails with /homeless-shelter
22 # This works around the issue
23 nativeBuildInputs = [ writableTmpDirAsHomeHook ];
24
25 makeFlags = [ "MCABAL=$(out)" ];
26 buildFlags = [ "bootstrap" ];
27
28 # MicroCabal is a separate repository, which should be packaged separately
29 # The MicroCabal that is installed by `make install` is pregenerated, does not respect MCABAL above, and so is not useable
30 postInstall = "rm $out/bin/mcabal";
31
32 passthru.tests = {
33 hello-world = callPackage ./test-hello-world.nix { microhs = finalAttrs.finalPackage; };
34 };
35
36 meta = {
37 description = "Haskell implemented with combinators";
38 homepage = "https://github.com/augustss/MicroHs";
39 license = lib.licenses.asl20;
40 maintainers = [ lib.maintainers.steeleduncan ];
41 platforms = lib.platforms.all;
42 };
43})