2021-01-15 22:18:51 +00:00
|
|
|
{ lib, stdenv, fetchurl, ocaml, findlib, ocamlbuild
|
2021-10-01 09:20:50 +00:00
|
|
|
, topkg, result, lwt, cmdliner, fmt
|
|
|
|
, js_of_ocaml
|
2021-10-04 12:37:57 +00:00
|
|
|
, jsooSupport ? true
|
2021-10-01 09:20:50 +00:00
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
let
|
|
|
|
pname = "logs";
|
|
|
|
webpage = "https://erratique.ch/software/${pname}";
|
|
|
|
in
|
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
if lib.versionOlder ocaml.version "4.03"
|
2020-04-24 23:36:52 +00:00
|
|
|
then throw "logs is not available for OCaml ${ocaml.version}"
|
|
|
|
else
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "ocaml${ocaml.version}-${pname}-${version}";
|
|
|
|
version = "0.7.0";
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "${webpage}/releases/${pname}-${version}.tbz";
|
|
|
|
sha256 = "1jnmd675wmsmdwyb5mx5b0ac66g4c6gpv5s4mrx2j6pb0wla1x46";
|
|
|
|
};
|
|
|
|
|
2022-03-05 16:20:37 +00:00
|
|
|
nativeBuildInputs = [ ocaml findlib ocamlbuild topkg ];
|
|
|
|
buildInputs = [ fmt cmdliner lwt topkg ]
|
2021-10-04 12:37:57 +00:00
|
|
|
++ lib.optional jsooSupport js_of_ocaml;
|
2020-04-24 23:36:52 +00:00
|
|
|
propagatedBuildInputs = [ result ];
|
|
|
|
|
2022-03-05 16:20:37 +00:00
|
|
|
strictDeps = true;
|
|
|
|
|
2021-10-04 12:37:57 +00:00
|
|
|
buildPhase = "${topkg.run} build --with-js_of_ocaml ${lib.boolToString jsooSupport}";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
inherit (topkg) installPhase;
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Logging infrastructure for OCaml";
|
|
|
|
homepage = webpage;
|
|
|
|
inherit (ocaml.meta) platforms;
|
|
|
|
maintainers = [ maintainers.sternenseemann ];
|
|
|
|
license = licenses.isc;
|
|
|
|
};
|
|
|
|
}
|