1{ stdenv, fetchurl, buildOcaml, ocaml, findlib, ocamlbuild, topkg, result, opam, js_of_ocaml }:
2
3buildOcaml rec {
4 version = "0.8.3";
5 name = "ptime";
6
7 src = fetchurl {
8 url = "http://erratique.ch/software/ptime/releases/ptime-${version}.tbz";
9 sha256 = "18jimskgnd9izg7kn6zk6sk35adgjm605dkv13plwslbb90kqr44";
10 };
11
12 unpackCmd = "tar -xf $curSrc";
13
14 buildInputs = [ ocaml findlib ocamlbuild topkg opam js_of_ocaml ];
15
16 propagatedBuildInputs = [ result ];
17
18 buildPhase = ''
19 ocaml -I ${findlib}/lib/ocaml/${ocaml.version}/site-lib/ pkg/pkg.ml build --with-js_of_ocaml true
20 '';
21
22 inherit (topkg) installPhase;
23
24 meta = {
25 homepage = http://erratique.ch/software/ptime;
26 description = "POSIX time for OCaml";
27 longDescription = ''
28 Ptime has platform independent POSIX time support in pure OCaml.
29 It provides a type to represent a well-defined range of POSIX timestamps
30 with picosecond precision, conversion with date-time values, conversion
31 with RFC 3339 timestamps and pretty printing to a human-readable,
32 locale-independent representation.
33
34 The additional Ptime_clock library provides access to a system POSIX clock
35 and to the system's current time zone offset.
36
37 Ptime is not a calendar library.
38 '';
39 license = stdenv.lib.licenses.isc;
40 maintainers = with stdenv.lib.maintainers; [ sternenseemann ];
41 };
42}