about summary refs log tree commit diff
path: root/pkgs/development/ocaml-modules/mtime/default.nix
blob: 5e18d1fd6e423a05bf8f2ff193985fbd20b50537 (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
{ stdenv, lib, fetchurl, ocaml, findlib, ocamlbuild, opam, js_of_ocaml
, jsooSupport ? !(stdenv.lib.versionAtLeast ocaml.version "4.04")
}:

with lib;

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

  src = fetchurl {
    url = http://erratique.ch/software/mtime/releases/mtime-0.8.3.tbz;
    sha256 = "1hfx4ny2dkw6jf3jppz0640dafl5xgn8r2si9kpwzhmibal8qrah";
  };

  unpackCmd = "tar xjf $src";

  buildInputs = [ ocaml findlib ocamlbuild opam ]
  ++ stdenv.lib.optional jsooSupport js_of_ocaml;

  buildPhase = "ocaml pkg/build.ml native=true native-dynlink=true jsoo=${boolToString jsooSupport}";

  installPhase = "opam-installer -i --prefix=$out --libdir=$OCAMLFIND_DESTDIR";

  meta = {
    description = "Monotonic wall-clock time for OCaml";
    homepage = http://erratique.ch/software/mtime;
    inherit (ocaml.meta) platforms;
    maintainers = [ maintainers.vbgl ];
    license = licenses.bsd3;
  };
}