2017-04-08 12:34:41 +01:00
|
|
|
{ stdenv, makeWrapper, buildOcaml, fetchFromGitHub,
|
2017-11-22 23:43:08 +00:00
|
|
|
ocaml, opam, jbuilder, menhir, merlin_extend, ppx_tools_versioned, utop }:
|
2017-04-08 12:34:41 +01:00
|
|
|
|
2017-10-27 12:14:29 +01:00
|
|
|
buildOcaml rec {
|
|
|
|
name = "reason";
|
2017-11-28 18:28:43 +00:00
|
|
|
version = "3.0.3";
|
2017-10-27 12:14:29 +01:00
|
|
|
|
2017-04-08 12:34:41 +01:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "facebook";
|
|
|
|
repo = "reason";
|
2017-11-28 18:28:43 +00:00
|
|
|
rev = version;
|
|
|
|
sha256 = "19kp1cnxi6dq89xh07c14q7kzkawbxdkwrvn1rl48l78d04agnxx";
|
2017-04-08 12:34:41 +01:00
|
|
|
};
|
|
|
|
|
2017-10-27 12:14:29 +01:00
|
|
|
propagatedBuildInputs = [ menhir merlin_extend ppx_tools_versioned ];
|
2017-04-08 12:34:41 +01:00
|
|
|
|
2017-11-22 23:43:08 +00:00
|
|
|
buildInputs = [ makeWrapper opam jbuilder utop menhir ];
|
2017-04-08 12:34:41 +01:00
|
|
|
|
|
|
|
buildFlags = [ "build" ]; # do not "make tests" before reason lib is installed
|
|
|
|
|
|
|
|
createFindlibDestdir = true;
|
|
|
|
|
|
|
|
postPatch = ''
|
2017-11-22 23:43:08 +00:00
|
|
|
substituteInPlace src/reasonbuild/myocamlbuild.ml \
|
|
|
|
--replace "refmt --print binary" "$out/bin/refmt --print binary"
|
2017-04-08 12:34:41 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
2017-11-22 23:43:08 +00:00
|
|
|
${jbuilder.installPhase}
|
2017-04-08 12:34:41 +01:00
|
|
|
|
|
|
|
wrapProgram $out/bin/rtop \
|
|
|
|
--prefix PATH : "${utop}/bin" \
|
|
|
|
--set OCAMLPATH $out/lib/ocaml/${ocaml.version}/site-lib:$OCAMLPATH
|
|
|
|
'';
|
2017-10-27 12:14:29 +01: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 12:34:41 +01:00
|
|
|
}
|