summaryrefslogtreecommitdiff
path: root/pkgs/development/compilers/microhs/stage1.nix
blob: 625f1e05ac44875c5bde393cc3b0b624c9916b8d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
{
  lib,
  args,
  microhs-boot,
  stdenv,
}:

stdenv.mkDerivation (
  finalAttrs:
  let
    args' = args finalAttrs;
  in
  args'
  // {
    pname = "microhs-stage1";
    patches =
      (args'.patches or [ ])
      ++ lib.optionals microhs-boot.usesHugs [
        patches/simple-unicode.patch
      ];

    makeFlags = [ "PREFIX=${placeholder "out"}" ];
    installTargets = [
      "targets.conf"
      "oldinstall"
    ];

    buildPhase = ''
      runHook preBuild
      mkdir -p bin
      printf 'Building bin/mhs using ${microhs-boot}/bin/mhs\n'
      ${microhs-boot}/bin/mhs -l -imhs -isrc -ipaths MicroHs.Main -o bin/mhs
      runHook postBuild
    '';
  }
)