1 { lib, stdenv, fetchurl, fetchpatch, ocaml, findlib, ocamlbuild, which, camlp4 }:
3 let inherit (lib) getVersion versionAtLeast; in
5 assert versionAtLeast (getVersion ocaml) "4.00.0";
6 assert versionAtLeast (getVersion findlib) "1.3.3";
8 if versionAtLeast ocaml.version "4.06"
9 then throw "bolt is not available for OCaml ${ocaml.version}"
12 stdenv.mkDerivation rec {
17 url = "https://forge.ocamlcore.org/frs/download.php/1043/${name}.tar.gz";
18 sha256 = "1c807wrpxra9sbb34lajhimwra28ldxv04m570567lh2b04n38zy";
21 buildInputs = [ ocaml findlib ocamlbuild which camlp4 ];
23 patches = [ (fetchpatch {
24 url = "https://raw.githubusercontent.com/ocaml/opam-repository/master/packages/bolt/bolt.1.4/files/opam.patch";
25 sha256 = "08cl39r98w312sw23cskd5wian6zg20isn9ki41hnbcgkazhi7pb";
30 patch myocamlbuild.ml <<EOF
34 < let path_bin = Filename.concat (Sys.getenv "PATH_OCAML_PREFIX") "bin" in
35 < Filename.concat path_bin "camlp4of"
36 < with _ -> "camlp4of" in
38 > let camlp4of = "camlp4of" in
42 # The custom `configure` script does not expect the --prefix
43 # option. Installation is handled by ocamlfind.
46 createFindlibDestdir = true;
48 buildFlags = [ "all" ];
51 checkTarget = "tests";
54 homepage = "http://bolt.x9c.fr";
55 description = "A logging tool for the OCaml language";
57 Bolt is a logging tool for the OCaml language. It is inspired by and
58 modeled after the famous log4j logging framework for Java.
60 license = licenses.lgpl3;
61 platforms = ocaml.meta.platforms or [];
62 maintainers = [ maintainers.jirkamarsik ];