2016-11-27 17:54:44 +01:00
|
|
|
{ stdenv, fetchFromGitHub, fetchpatch, ocaml, findlib, ocpBuild, ocpIndent, opam, cmdliner, ncurses, re, lambdaTerm, libev }:
|
2015-01-25 11:31:06 +01:00
|
|
|
|
|
|
|
let inherit (stdenv.lib) getVersion versionAtLeast optional; in
|
|
|
|
|
2015-10-14 19:27:33 +02:00
|
|
|
assert versionAtLeast (getVersion ocaml) "4";
|
2016-11-27 17:54:44 +01:00
|
|
|
assert versionAtLeast (getVersion ocpBuild) "1.99.13-beta";
|
2015-01-25 11:31:06 +01:00
|
|
|
assert versionAtLeast (getVersion ocpIndent) "1.4.2";
|
|
|
|
|
2015-07-01 20:22:55 +02:00
|
|
|
let
|
2016-11-27 17:54:44 +01:00
|
|
|
version = "1.1.5";
|
2015-07-01 20:22:55 +02:00
|
|
|
in
|
2015-01-25 11:31:06 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
|
|
|
|
name = "ocp-index-${version}";
|
|
|
|
|
2016-11-27 17:54:44 +01:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "OCamlPro";
|
|
|
|
repo = "ocp-index";
|
|
|
|
rev = version;
|
|
|
|
sha256 = "0gir0fm8mq609371kmwpsqfvpfx2b26ax3f9rg5fjf5r0bjk9pqd";
|
|
|
|
};
|
|
|
|
|
|
|
|
patches = [ (fetchpatch {
|
|
|
|
url = https://github.com/OCamlPro/ocp-index/commit/618872a0980d077857a63d502eadbbf0d1b05c0f.diff;
|
|
|
|
sha256 = "07snnydczkzapradh1c22ggv9vaff67nc36pi3218azb87mb1p7z";
|
|
|
|
}) ];
|
2015-07-01 20:22:55 +02:00
|
|
|
|
2015-01-25 11:31:06 +01:00
|
|
|
buildInputs = [ ocaml findlib ocpBuild opam cmdliner ncurses re libev ]
|
|
|
|
++ optional (versionAtLeast (getVersion lambdaTerm) "1.7") lambdaTerm;
|
|
|
|
propagatedBuildInputs = [ ocpIndent ];
|
|
|
|
|
|
|
|
createFindlibDestdir = true;
|
|
|
|
|
|
|
|
preBuild = "export TERM=xterm";
|
|
|
|
postInstall = "mv $out/lib/{ocp-index,ocaml/${getVersion ocaml}/site-lib/}";
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
homepage = http://typerex.ocamlpro.com/ocp-index.html;
|
|
|
|
description = "A simple and light-weight documentation extractor for OCaml";
|
|
|
|
license = stdenv.lib.licenses.lgpl3;
|
2015-12-24 18:49:07 +01:00
|
|
|
platforms = ocaml.meta.platforms or [];
|
2015-01-25 11:31:06 +01:00
|
|
|
maintainers = with stdenv.lib.maintainers; [ vbgl ];
|
|
|
|
};
|
|
|
|
}
|