1{ stdenv
2, lib
3, fetchurl
4, ocaml
5, findlib
6, ocamlbuild
7, topkg
8}:
9
10lib.throwIfNot (lib.versionAtLeast ocaml.version "4.08")
11 "ptime is not available for OCaml ${ocaml.version}"
12
13stdenv.mkDerivation (finalAttrs: {
14 version = "1.1.0";
15 pname = "ocaml${ocaml.version}-ptime";
16
17 src = fetchurl {
18 url = "https://erratique.ch/software/ptime/releases/ptime-${finalAttrs.version}.tbz";
19 hash = "sha256-y/WxVFT7JxBeLDNAI+HhHY+TnXF4hw9cvo7SbfcBPrE=";
20 };
21
22 nativeBuildInputs = [
23 findlib
24 ocaml
25 ocamlbuild
26 topkg
27 ];
28
29 buildInputs = [
30 topkg
31 ];
32
33 strictDeps = true;
34
35 inherit (topkg) buildPhase installPhase;
36
37 meta = {
38 description = "POSIX time for OCaml";
39 homepage = "https://erratique.ch/software/ptime";
40 license = lib.licenses.isc;
41 longDescription = ''
42 Ptime has platform independent POSIX time support in pure OCaml.
43 It provides a type to represent a well-defined range of POSIX timestamps
44 with picosecond precision, conversion with date-time values, conversion
45 with RFC 3339 timestamps and pretty printing to a human-readable,
46 locale-independent representation.
47
48 The additional Ptime_clock library provides access to a system POSIX clock
49 and to the system's current time zone offset.
50
51 Ptime is not a calendar library.
52 '';
53 maintainers = with lib.maintainers; [ sternenseemann ];
54 };
55})