about summary refs log tree commit diff
path: root/pkgs/development/ocaml-modules/react/default.nix
blob: 02420204dbfa3fedf1629fd96b4b4ebc4ec391ad (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
{stdenv, fetchurl, ocaml}:

let
  ocaml_version = (builtins.parseDrvName ocaml.name).version;
  version = "0.9.2";
in

stdenv.mkDerivation {
  name = "ocaml-react-${version}";

  src = fetchurl {
    url = "http://erratique.ch/software/react/releases/react-${version}.tbz";
    sha256 = "0fiaxzfxv8pc82d31jz85zryz06k84is0l3sn5g0di5mpc5falxr";
  };

  buildInputs = [ocaml];

  buildCommand = ''
    export INSTALLDIR=$out/lib/ocaml/${ocaml_version}/site-lib/react
    tar xjf $src
    cd react-*
    substituteInPlace src/META --replace '+react' $INSTALLDIR
    chmod +x build
    ./build 
    ./build install
  '';

  meta = {
    homepage = http://erratique.ch/software/react;
    description = "Applicative events and signals for OCaml";
    license = "BSD";
    platforms = ocaml.meta.platforms;
    maintainers = [
      stdenv.lib.maintainers.z77z
    ];
  };
}