2017-12-14 07:36:29 +00:00
|
|
|
{ stdenv, lib, fetchurl, ocaml, findlib, ocamlbuild, topkg, js_of_ocaml
|
2019-09-06 16:01:51 +00:00
|
|
|
, jsooSupport ? lib.versionAtLeast ocaml.version "4.03"
|
2017-01-24 21:09:20 +00:00
|
|
|
}:
|
|
|
|
|
2017-04-11 16:08:51 +00:00
|
|
|
with lib;
|
|
|
|
|
2017-06-28 17:19:17 +00:00
|
|
|
let param =
|
|
|
|
if versionAtLeast ocaml.version "4.03"
|
|
|
|
then {
|
2019-08-19 15:43:08 +00:00
|
|
|
version = "1.2.0";
|
|
|
|
sha256 = "0zm1jvqkz3ghznfsm3bbv9q2zinp9grggdf7k9phjazjvny68xb8";
|
2017-06-28 17:19:17 +00:00
|
|
|
} else {
|
|
|
|
version = "0.8.4";
|
|
|
|
sha256 = "1adm8sc3lkjly99hyi5gqnxas748k7h62ljgn8x423nkn8gyp8dh";
|
|
|
|
};
|
|
|
|
in
|
|
|
|
|
2017-01-24 21:09:20 +00:00
|
|
|
stdenv.mkDerivation {
|
2017-06-28 17:19:17 +00:00
|
|
|
name = "ocaml${ocaml.version}-mtime-${param.version}";
|
2017-01-24 21:09:20 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2019-04-22 08:14:28 +00:00
|
|
|
url = "https://erratique.ch/software/mtime/releases/mtime-${param.version}.tbz";
|
2017-06-28 17:19:17 +00:00
|
|
|
inherit (param) sha256;
|
2017-01-24 21:09:20 +00:00
|
|
|
};
|
|
|
|
|
2019-10-31 10:16:15 +00:00
|
|
|
nativeBuildInputs = [ ocaml findlib ocamlbuild ];
|
|
|
|
buildInputs = [ findlib topkg ]
|
2021-01-11 12:49:15 +00:00
|
|
|
++ optional jsooSupport js_of_ocaml;
|
2017-01-24 21:09:20 +00:00
|
|
|
|
2017-06-28 17:19:17 +00:00
|
|
|
buildPhase = "${topkg.buildPhase} --with-js_of_ocaml ${boolToString jsooSupport}";
|
2017-01-24 21:09:20 +00:00
|
|
|
|
2017-06-28 17:19:17 +00:00
|
|
|
inherit (topkg) installPhase;
|
2017-01-24 21:09:20 +00:00
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Monotonic wall-clock time for OCaml";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://erratique.ch/software/mtime";
|
2017-01-24 21:09:20 +00:00
|
|
|
inherit (ocaml.meta) platforms;
|
2017-04-11 16:08:51 +00:00
|
|
|
maintainers = [ maintainers.vbgl ];
|
|
|
|
license = licenses.bsd3;
|
2017-01-24 21:09:20 +00:00
|
|
|
};
|
|
|
|
}
|