2021-02-05 17:12:51 +00:00
|
|
|
{ lib, stdenv, makeWrapper, fetchFromGitHub, ocaml, findlib, dune_2
|
2021-06-06 07:54:09 +00:00
|
|
|
, fix, menhir, menhirLib, menhirSdk, merlin-extend, ppx_tools_versioned, utop, cppo
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2021-04-08 16:26:57 +00:00
|
|
|
pname = "ocaml${ocaml.version}-reason";
|
|
|
|
version = "3.7.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "facebook";
|
|
|
|
repo = "reason";
|
2021-04-08 16:26:57 +00:00
|
|
|
rev = "daa11255cb4716ce1c370925251021bd6e3bd974";
|
|
|
|
sha256 = "0m6ldrci1a4j0qv1cbwh770zni3al8qxsphl353rv19f6rblplhs";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-06-06 07:54:09 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper menhir ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-06-06 07:54:09 +00:00
|
|
|
propagatedBuildInputs = [ menhirLib merlin-extend ppx_tools_versioned ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-06-06 07:54:09 +00:00
|
|
|
buildInputs = [ ocaml findlib dune_2 cppo fix utop menhir menhirSdk ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildFlags = [ "build" ]; # do not "make tests" before reason lib is installed
|
|
|
|
|
2021-01-09 10:05:03 +00:00
|
|
|
installPhase = ''
|
|
|
|
dune install --prefix=$out --libdir=$OCAMLFIND_DESTDIR
|
2020-04-24 23:36:52 +00:00
|
|
|
wrapProgram $out/bin/rtop \
|
|
|
|
--prefix PATH : "${utop}/bin" \
|
|
|
|
--prefix CAML_LD_LIBRARY_PATH : "$CAML_LD_LIBRARY_PATH" \
|
|
|
|
--prefix OCAMLPATH : "$OCAMLPATH:$OCAMLFIND_DESTDIR"
|
|
|
|
'';
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://reasonml.github.io/";
|
|
|
|
description = "Facebook's friendly syntax to OCaml";
|
|
|
|
license = licenses.mit;
|
|
|
|
inherit (ocaml.meta) platforms;
|
|
|
|
maintainers = [ maintainers.volth ];
|
|
|
|
};
|
|
|
|
}
|