2015-07-01 19:22:55 +01:00
|
|
|
{ stdenv, fetchurl, fetchzip, ocaml, findlib, ocpBuild, ocpIndent, opam, cmdliner, ncurses, re, lambdaTerm, libev }:
|
2015-01-25 10:31:06 +00:00
|
|
|
|
|
|
|
let inherit (stdenv.lib) getVersion versionAtLeast optional; in
|
|
|
|
|
2015-10-14 18:27:33 +01:00
|
|
|
assert versionAtLeast (getVersion ocaml) "4";
|
2015-01-25 10:31:06 +00:00
|
|
|
assert versionAtLeast (getVersion ocpBuild) "1.99.6-beta";
|
|
|
|
assert versionAtLeast (getVersion ocpIndent) "1.4.2";
|
|
|
|
|
2015-07-01 19:22:55 +01:00
|
|
|
let
|
|
|
|
version = "1.1.2";
|
|
|
|
patch402 = fetchurl {
|
|
|
|
url = https://raw.githubusercontent.com/ocaml/opam-repository/master/packages/ocp-index/ocp-index.1.1.2/files/ocaml.4.02.patch;
|
|
|
|
sha256 = "1wcpn2pv7h8ia3ybmzdlm8v5hfvq1rgmlj02wwj0yh3vqjvxqvsm";
|
|
|
|
};
|
|
|
|
in
|
2015-01-25 10:31:06 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
|
|
|
|
name = "ocp-index-${version}";
|
|
|
|
|
|
|
|
src = fetchzip {
|
|
|
|
url = "http://github.com/OCamlPro/ocp-index/archive/${version}.tar.gz";
|
2015-07-01 19:22:55 +01:00
|
|
|
sha256 = "0cz0bz5nisc5r23b1w07q2bl489gd09mg8rp9kyq9m6rj669b18l";
|
2015-01-25 10:31:06 +00:00
|
|
|
};
|
|
|
|
|
2015-07-01 19:22:55 +01:00
|
|
|
patches = optional (versionAtLeast (getVersion ocaml) "4.02") patch402;
|
|
|
|
|
2015-01-25 10:31:06 +00: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;
|
|
|
|
platforms = ocaml.meta.platforms;
|
|
|
|
maintainers = with stdenv.lib.maintainers; [ vbgl ];
|
|
|
|
};
|
|
|
|
}
|