2021-01-15 22:18:51 +00:00
|
|
|
{ lib, stdenv, fetchurl, fetchpatch, ocaml, findlib, ocamlbuild, which, camlp4 }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
let inherit (lib) getVersion versionAtLeast; in
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
assert versionAtLeast (getVersion ocaml) "4.00.0";
|
|
|
|
assert versionAtLeast (getVersion findlib) "1.3.3";
|
|
|
|
|
|
|
|
if versionAtLeast ocaml.version "4.06"
|
|
|
|
then throw "bolt is not available for OCaml ${ocaml.version}"
|
|
|
|
else
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2021-12-06 16:07:01 +00:00
|
|
|
pname = "bolt";
|
|
|
|
version = "1.4";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2021-12-06 16:07:01 +00:00
|
|
|
url = "https://forge.ocamlcore.org/frs/download.php/1043/bolt-${version}.tar.gz";
|
2020-04-24 23:36:52 +00:00
|
|
|
sha256 = "1c807wrpxra9sbb34lajhimwra28ldxv04m570567lh2b04n38zy";
|
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [ ocaml findlib ocamlbuild which camlp4 ];
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
patches = [
|
|
|
|
(fetchpatch {
|
2020-04-24 23:36:52 +00:00
|
|
|
url = "https://raw.githubusercontent.com/ocaml/opam-repository/master/packages/bolt/bolt.1.4/files/opam.patch";
|
|
|
|
sha256 = "08cl39r98w312sw23cskd5wian6zg20isn9ki41hnbcgkazhi7pb";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
patch myocamlbuild.ml <<EOF
|
|
|
|
70,74c70
|
|
|
|
< let camlp4of =
|
|
|
|
< try
|
|
|
|
< let path_bin = Filename.concat (Sys.getenv "PATH_OCAML_PREFIX") "bin" in
|
|
|
|
< Filename.concat path_bin "camlp4of"
|
|
|
|
< with _ -> "camlp4of" in
|
|
|
|
---
|
|
|
|
> let camlp4of = "camlp4of" in
|
|
|
|
EOF
|
|
|
|
'';
|
|
|
|
|
|
|
|
# The custom `configure` script does not expect the --prefix
|
|
|
|
# option. Installation is handled by ocamlfind.
|
|
|
|
dontAddPrefix = true;
|
2021-09-18 10:52:07 +00:00
|
|
|
dontAddStaticConfigureFlags = true;
|
2021-12-06 16:07:01 +00:00
|
|
|
configurePlatforms = [ ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
createFindlibDestdir = true;
|
|
|
|
|
|
|
|
buildFlags = [ "all" ];
|
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
checkTarget = "tests";
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "http://bolt.x9c.fr";
|
|
|
|
description = "A logging tool for the OCaml language";
|
|
|
|
longDescription = ''
|
|
|
|
Bolt is a logging tool for the OCaml language. It is inspired by and
|
|
|
|
modeled after the famous log4j logging framework for Java.
|
|
|
|
'';
|
|
|
|
license = licenses.lgpl3;
|
2021-12-06 16:07:01 +00:00
|
|
|
platforms = ocaml.meta.platforms or [ ];
|
2020-04-24 23:36:52 +00:00
|
|
|
maintainers = [ maintainers.jirkamarsik ];
|
|
|
|
};
|
|
|
|
}
|