2017-04-08 13:34:41 +02:00
|
|
|
{ stdenv, makeWrapper, buildOcaml, fetchFromGitHub,
|
|
|
|
ocaml, opam, topkg, menhir, merlin_extend, ppx_tools_versioned, utop }:
|
|
|
|
|
2017-10-27 13:14:29 +02:00
|
|
|
buildOcaml rec {
|
|
|
|
name = "reason";
|
|
|
|
version = "3.0.0";
|
|
|
|
|
2017-04-08 13:34:41 +02:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "facebook";
|
|
|
|
repo = "reason";
|
|
|
|
rev = version;
|
2017-10-27 13:14:29 +02:00
|
|
|
sha256 = "0vj3y9vlm9gqvj9grmb9n487avbrj4q5611m7wv1bsdpndvv96jr";
|
2017-04-08 13:34:41 +02:00
|
|
|
};
|
|
|
|
|
2017-10-27 13:14:29 +02:00
|
|
|
propagatedBuildInputs = [ menhir merlin_extend ppx_tools_versioned ];
|
2017-04-08 13:34:41 +02:00
|
|
|
|
2017-10-27 13:14:29 +02:00
|
|
|
buildInputs = [ makeWrapper opam topkg utop menhir opam topkg ];
|
2017-04-08 13:34:41 +02:00
|
|
|
|
|
|
|
buildFlags = [ "build" ]; # do not "make tests" before reason lib is installed
|
|
|
|
|
|
|
|
createFindlibDestdir = true;
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace src/reasonbuild.ml --replace "refmt --print binary" "$out/bin/refmt --print binary"
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
${topkg.installPhase}
|
|
|
|
|
|
|
|
wrapProgram $out/bin/rtop \
|
|
|
|
--prefix PATH : "${utop}/bin" \
|
|
|
|
--set OCAMLPATH $out/lib/ocaml/${ocaml.version}/site-lib:$OCAMLPATH
|
|
|
|
'';
|
2017-10-27 13:14:29 +02:00
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
homepage = https://facebook.github.io/reason/;
|
|
|
|
description = "Facebook's friendly syntax to OCaml";
|
|
|
|
license = licenses.bsd3;
|
|
|
|
maintainers = [ maintainers.volth ];
|
|
|
|
};
|
2017-04-08 13:34:41 +02:00
|
|
|
}
|