ocamlPackages.mtime: 1.2.0 → 1.4.0

This commit is contained in:
Vincent Laporte
2022-11-23 18:04:54 +01:00
committed by Vincent Laporte
parent bb7b27d1cf
commit 58930f0b7f
2 changed files with 14 additions and 21 deletions
@@ -6,6 +6,11 @@ buildDunePackage rec {
inherit (metrics) version src;
# Fixes https://github.com/mirage/metrics/issues/57
postPatch = ''
substituteInPlace src/unix/dune --replace "mtime mtime.clock" "mtime"
'';
propagatedBuildInputs = [ gnuplot lwt metrics mtime uuidm ];
checkInputs = [ metrics-lwt ];
@@ -1,37 +1,25 @@
{ stdenv, lib, fetchurl, ocaml, findlib, ocamlbuild, topkg, js_of_ocaml
, jsooSupport ? lib.versionAtLeast ocaml.version "4.03"
}:
{ stdenv, lib, fetchurl, ocaml, findlib, ocamlbuild, topkg }:
with lib;
let param =
if versionAtLeast ocaml.version "4.03"
then {
version = "1.2.0";
sha256 = "0zm1jvqkz3ghznfsm3bbv9q2zinp9grggdf7k9phjazjvny68xb8";
} else {
version = "0.8.4";
sha256 = "1adm8sc3lkjly99hyi5gqnxas748k7h62ljgn8x423nkn8gyp8dh";
};
in
throwIfNot (versionAtLeast ocaml.version "4.08")
"mtime is not available for OCaml ${ocaml.version}"
stdenv.mkDerivation {
stdenv.mkDerivation rec {
pname = "ocaml${ocaml.version}-mtime";
inherit (param) version;
version = "1.4.0";
src = fetchurl {
url = "https://erratique.ch/software/mtime/releases/mtime-${param.version}.tbz";
inherit (param) sha256;
url = "https://erratique.ch/software/mtime/releases/mtime-${version}.tbz";
sha256 = "sha256-VQyYEk8+57Yq8SUuYossaQUHZKqemHDJtf4LK8qjxvc=";
};
nativeBuildInputs = [ ocaml findlib ocamlbuild topkg ];
buildInputs = [ topkg ] ++ optional jsooSupport js_of_ocaml;
buildInputs = [ topkg ];
strictDeps = true;
buildPhase = "${topkg.buildPhase} --with-js_of_ocaml ${boolToString jsooSupport}";
inherit (topkg) installPhase;
inherit (topkg) buildPhase installPhase;
meta = {
description = "Monotonic wall-clock time for OCaml";