nixpkgs/pkgs/development/ocaml-modules/bolt/default.nix

65 lines
1.8 KiB
Nix
Raw Normal View History

{ lib, stdenv, fetchurl, fetchpatch, ocaml, findlib, ocamlbuild, which, camlp4 }:
2014-10-28 13:03:14 +00:00
let inherit (lib) getVersion versionAtLeast; in
2014-10-28 13:03:14 +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
2014-10-28 13:03:14 +00:00
stdenv.mkDerivation rec {
name = "bolt-1.4";
src = fetchurl {
url = "https://forge.ocamlcore.org/frs/download.php/1043/${name}.tar.gz";
sha256 = "1c807wrpxra9sbb34lajhimwra28ldxv04m570567lh2b04n38zy";
};
buildInputs = [ ocaml findlib ocamlbuild which camlp4 ];
2015-06-24 23:15:05 +01:00
2017-07-08 07:23:59 +01:00
patches = [ (fetchpatch {
url = "https://raw.githubusercontent.com/ocaml/opam-repository/master/packages/bolt/bolt.1.4/files/opam.patch";
2017-07-08 07:23:59 +01:00
sha256 = "08cl39r98w312sw23cskd5wian6zg20isn9ki41hnbcgkazhi7pb";
})
];
postPatch = ''
2015-06-24 23:15:05 +01:00
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
'';
2014-10-28 13:03:14 +00:00
# The custom `configure` script does not expect the --prefix
# option. Installation is handled by ocamlfind.
dontAddPrefix = true;
createFindlibDestdir = true;
buildFlags = [ "all" ];
2014-10-28 13:03:14 +00:00
doCheck = true;
checkTarget = "tests";
meta = with lib; {
homepage = "http://bolt.x9c.fr";
2014-10-28 13:03:14 +00:00
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;
platforms = ocaml.meta.platforms or [];
2014-10-28 13:03:14 +00:00
maintainers = [ maintainers.jirkamarsik ];
};
}