2021-02-26 16:35:36 +00:00
|
|
|
{ stdenv, lib, fetchurl, ocaml, findlib, ocamlbuild, dune_2, benchmark }:
|
2017-07-04 22:39:37 +01:00
|
|
|
|
2017-11-20 06:49:49 +00:00
|
|
|
let param =
|
2021-01-11 12:49:15 +00:00
|
|
|
if lib.versionAtLeast ocaml.version "4.03"
|
2019-12-18 09:21:00 +00:00
|
|
|
then rec {
|
|
|
|
version = "0.6.2";
|
|
|
|
url = "https://github.com/Chris00/ocaml-rope/releases/download/${version}/rope-${version}.tbz";
|
|
|
|
sha256 = "15cvfa0s1vjx7gjd07d3fkznilishqf4z4h2q5f20wm9ysjh2h2i";
|
2021-02-26 16:35:36 +00:00
|
|
|
buildInputs = [ dune_2 ];
|
2017-11-20 06:49:49 +00:00
|
|
|
extra = {
|
2018-09-05 17:11:47 +01:00
|
|
|
buildPhase = "dune build -p rope";
|
2021-01-12 19:48:57 +00:00
|
|
|
installPhase = ''
|
|
|
|
dune install --prefix $out --libdir $OCAMLFIND_DESTDIR rope
|
|
|
|
'';
|
2017-11-20 06:49:49 +00:00
|
|
|
};
|
|
|
|
} else {
|
|
|
|
version = "0.5";
|
|
|
|
url = "https://forge.ocamlcore.org/frs/download.php/1156/rope-0.5.tar.gz";
|
|
|
|
sha256 = "05fr2f5ch2rqhyaj06rv5218sbg99p1m9pq5sklk04hpslxig21f";
|
|
|
|
buildInputs = [ ocamlbuild ];
|
|
|
|
extra = { createFindlibDestdir = true; };
|
|
|
|
};
|
|
|
|
in
|
2017-07-04 22:39:37 +01:00
|
|
|
|
2017-11-20 06:49:49 +00:00
|
|
|
stdenv.mkDerivation ({
|
|
|
|
name = "ocaml${ocaml.version}-rope-${param.version}";
|
2017-07-04 22:39:37 +01:00
|
|
|
|
2017-11-20 06:49:49 +00:00
|
|
|
src = fetchurl {
|
|
|
|
inherit (param) url sha256;
|
2017-07-04 22:39:37 +01:00
|
|
|
};
|
|
|
|
|
2017-11-20 06:49:49 +00:00
|
|
|
buildInputs = [ ocaml findlib benchmark ] ++ param.buildInputs;
|
2017-07-04 22:39:37 +01:00
|
|
|
|
|
|
|
meta = {
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "http://rope.forge.ocamlcore.org/";
|
2017-07-04 22:39:37 +01:00
|
|
|
platforms = ocaml.meta.platforms or [];
|
|
|
|
description = ''Ropes ("heavyweight strings") in OCaml'';
|
2021-01-11 12:49:15 +00:00
|
|
|
license = lib.licenses.lgpl21;
|
|
|
|
maintainers = with lib.maintainers; [ volth ];
|
2017-07-04 22:39:37 +01:00
|
|
|
};
|
2017-11-20 06:49:49 +00:00
|
|
|
} // param.extra)
|