1{stdenv, fetchurl, ocaml, findlib, ocaml_react, opam}:
2
3let
4 ocamlVersion = stdenv.lib.getVersion ocaml;
5in
6
7assert stdenv.lib.versionAtLeast ocamlVersion "3.11";
8
9stdenv.mkDerivation {
10 name = "ocaml-reactiveData-0.1";
11 src = fetchurl {
12 url = https://github.com/hhugo/reactiveData/archive/0.1.tar.gz;
13 sha256 = "056y9in6j6rpggdf8apailvs1m30wxizpyyrj08xyfxgv91mhxgw";
14 };
15
16 buildInputs = [ocaml findlib opam];
17 propagatedBuildInputs = [ocaml_react];
18
19 buildPhase = "ocaml pkg/build.ml native=true native-dynlink=true";
20
21 installPhase = ''
22 opam-installer --script --prefix=$out reactiveData.install > install.sh
23 sed -i s!lib/reactiveData!lib/ocaml/${ocamlVersion}/site-lib/reactiveData! install.sh
24 sh install.sh
25 '';
26
27 meta = with stdenv.lib; {
28 description = "An OCaml module for functional reactive programming (FRP) based on React";
29 homepage = https://github.com/hhugo/reactiveData;
30 license = licenses.lgpl21;
31 platforms = ocaml.meta.platforms;
32 maintainers = with maintainers; [ vbgl ];
33 };
34}