summary refs log tree commit diff
path: root/pkgs/development/compilers/reason/default.nix
blob: 81c935fc421f8be1bd7352252e3999022f4d499f (plain) (blame)
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
37
38
39
40
{ stdenv, makeWrapper, fetchFromGitHub, ocaml, findlib, dune
, menhir, merlin_extend, ppx_tools_versioned, utop
}:

stdenv.mkDerivation rec {
  name = "ocaml${ocaml.version}-reason-${version}";
  version = "3.3.3";

  src = fetchFromGitHub {
    owner = "facebook";
    repo = "reason";
    rev = "fefe5e4db3a54a7946c2220ee037dd2f407011c9";
    sha256 = "1x0dbacgq9pa36zgzwrc0gm14wbb6v27y9bf7wcwk55a1ck0am18";
  };

  propagatedBuildInputs = [ menhir merlin_extend ppx_tools_versioned ];

  buildInputs = [ makeWrapper ocaml findlib dune utop menhir ];

  buildFlags = [ "build" ]; # do not "make tests" before reason lib is installed

  installPhase = ''
    for p in reason rtop
    do
      ${dune.installPhase} $p.install
    done

    wrapProgram $out/bin/rtop \
      --prefix PATH : "${utop}/bin" \
      --set OCAMLPATH $out/lib/ocaml/${ocaml.version}/site-lib:$OCAMLPATH
  '';

  meta = with stdenv.lib; {
    homepage = https://reasonml.github.io/;
    description = "Facebook's friendly syntax to OCaml";
    license = licenses.mit;
    inherit (ocaml.meta) platforms;
    maintainers = [ maintainers.volth ];
  };
}