1{ lib, stdenv, fetchFromGitHub, ocaml, findlib, ocamlbuild, react, opaline }:
2
3if lib.versionOlder ocaml.version "4.04"
4then throw "reactiveData is not available for OCaml ${ocaml.version}"
5else
6
7stdenv.mkDerivation rec {
8 pname = "ocaml${ocaml.version}-reactiveData";
9 version = "0.2.2";
10
11 src = fetchFromGitHub {
12 owner = "ocsigen";
13 repo = "reactiveData";
14 rev = version;
15 sha256 = "sha256-YLkacIbjxZQ/ThgSxjTqviBYih6eW2GX5H7iybQDv1A=";
16 };
17
18 nativeBuildInputs = [ ocaml findlib ocamlbuild opaline ];
19 propagatedBuildInputs = [ react ];
20
21 strictDeps = true;
22
23 buildPhase = "ocaml pkg/build.ml native=true native-dynlink=true";
24
25 installPhase = "opaline -prefix $out -libdir $OCAMLFIND_DESTDIR";
26
27 meta = with lib; {
28 description = "An OCaml module for functional reactive programming (FRP) based on React";
29 homepage = "https://github.com/ocsigen/reactiveData";
30 license = licenses.lgpl21;
31 platforms = ocaml.meta.platforms or [ ];
32 maintainers = with maintainers; [ vbgl ];
33 };
34}