nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ lib, callPackage, stdenv, makeWrapper, fetchurl, ocaml, findlib, dune_2
2, fix, menhir, menhirLib, menhirSdk, merlin-extend, ppxlib, utop, cppo, ppx_derivers
3}:
4
5stdenv.mkDerivation rec {
6 pname = "ocaml${ocaml.version}-reason";
7 version = "3.8.0";
8
9 src = fetchurl {
10 url = "https://github.com/reasonml/reason/releases/download/${version}/reason-${version}.tbz";
11 sha256 = "sha256:0yc94m3ddk599crg33yxvkphxpy54kmdsl599c320wvn055p4y4l";
12 };
13
14 nativeBuildInputs = [
15 makeWrapper
16 menhir
17 ];
18
19 buildInputs = [
20 cppo
21 dune_2
22 findlib
23 fix
24 menhir
25 menhirSdk
26 ocaml
27 ppxlib
28 utop
29 ];
30
31 propagatedBuildInputs = [
32 menhirLib
33 merlin-extend
34 ppx_derivers
35 ];
36
37 buildFlags = [ "build" ]; # do not "make tests" before reason lib is installed
38
39 installPhase = ''
40 runHook preInstall
41 dune install --prefix=$out --libdir=$OCAMLFIND_DESTDIR
42 wrapProgram $out/bin/rtop \
43 --prefix PATH : "${utop}/bin" \
44 --prefix CAML_LD_LIBRARY_PATH : "$CAML_LD_LIBRARY_PATH" \
45 --prefix OCAMLPATH : "$OCAMLPATH:$OCAMLFIND_DESTDIR"
46 runHook postInstall
47 '';
48
49 passthru.tests = {
50 hello = callPackage ./tests/hello { };
51 };
52
53 meta = with lib; {
54 homepage = "https://reasonml.github.io/";
55 downloadPage = "https://github.com/reasonml/reason";
56 description = "Facebook's friendly syntax to OCaml";
57 license = licenses.mit;
58 inherit (ocaml.meta) platforms;
59 maintainers = with maintainers; [ ];
60 };
61}