2022-10-21 18:38:19 +00:00
|
|
|
{ lib, callPackage, stdenv, makeWrapper, fetchurl, ocaml, findlib, dune_3
|
2022-08-12 12:06:08 +00:00
|
|
|
, ncurses
|
2021-06-28 23:13:55 +00:00
|
|
|
, fix, menhir, menhirLib, menhirSdk, merlin-extend, ppxlib, utop, cppo, ppx_derivers
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2021-04-08 16:26:57 +00:00
|
|
|
pname = "ocaml${ocaml.version}-reason";
|
2022-10-21 18:38:19 +00:00
|
|
|
version = "3.8.2";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-03-30 09:31:56 +00:00
|
|
|
src = fetchurl {
|
|
|
|
url = "https://github.com/reasonml/reason/releases/download/${version}/reason-${version}.tbz";
|
2022-10-21 18:38:19 +00:00
|
|
|
sha256 = "sha256-etzEXbILje+CrfJxIhH7jthEMoSJdS6O33QoG8HrLvI=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-02-09 11:40:11 +00:00
|
|
|
strictDeps = true;
|
2021-06-28 23:13:55 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
makeWrapper
|
|
|
|
menhir
|
2023-02-09 11:40:11 +00:00
|
|
|
ocaml
|
|
|
|
menhir
|
2021-06-28 23:13:55 +00:00
|
|
|
cppo
|
2022-10-21 18:38:19 +00:00
|
|
|
dune_3
|
2021-06-28 23:13:55 +00:00
|
|
|
findlib
|
2023-02-09 11:40:11 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
2021-06-28 23:13:55 +00:00
|
|
|
fix
|
|
|
|
menhirSdk
|
|
|
|
ppxlib
|
|
|
|
utop
|
2022-08-12 12:06:08 +00:00
|
|
|
] ++ lib.optional (lib.versionOlder ocaml.version "4.07") ncurses;
|
2021-06-28 23:13:55 +00:00
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
menhirLib
|
|
|
|
merlin-extend
|
|
|
|
ppx_derivers
|
|
|
|
];
|
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 = ''
|
2022-03-30 09:31:56 +00:00
|
|
|
runHook preInstall
|
2021-01-09 10:05:03 +00:00
|
|
|
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"
|
2022-03-30 09:31:56 +00:00
|
|
|
runHook postInstall
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2021-06-28 23:13:55 +00:00
|
|
|
passthru.tests = {
|
|
|
|
hello = callPackage ./tests/hello { };
|
|
|
|
};
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://reasonml.github.io/";
|
2021-06-28 23:13:55 +00:00
|
|
|
downloadPage = "https://github.com/reasonml/reason";
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Facebook's friendly syntax to OCaml";
|
|
|
|
license = licenses.mit;
|
|
|
|
inherit (ocaml.meta) platforms;
|
2021-12-06 16:07:01 +00:00
|
|
|
maintainers = with maintainers; [ ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|