1{stdenv, fetchurl, ocaml, findlib, opam}:
2
3stdenv.mkDerivation {
4 name = "ocaml-react-1.2.0";
5
6 src = fetchurl {
7 url = http://erratique.ch/software/react/releases/react-1.2.0.tbz;
8 sha256 = "1gymn8hy7ga0l9qymmb1jcnnkqvy7l2zr87xavzqz0dfi9ci8dm7";
9 };
10
11 unpackCmd = "tar xjf $src";
12 buildInputs = [ocaml findlib opam];
13
14 createFindlibDestdir = true;
15
16 configurePhase = "ocaml pkg/git.ml";
17 buildPhase = "ocaml pkg/build.ml native=true native-dynlink=true";
18
19 installPhase =
20 let ocamlVersion = (builtins.parseDrvName (ocaml.name)).version;
21 in
22 ''
23 opam-installer --script --prefix=$out react.install > install.sh
24 sed -i s!lib/react!lib/ocaml/${ocamlVersion}/site-lib/react! install.sh
25 sh install.sh
26 '';
27
28 meta = with stdenv.lib; {
29 homepage = http://erratique.ch/software/react;
30 description = "Applicative events and signals for OCaml";
31 license = licenses.bsd3;
32 platforms = ocaml.meta.platforms or [];
33 maintainers = with maintainers; [ z77z vbmithr gal_bolle];
34 };
35}