1{
2 lib,
3 fetchurl,
4 fetchpatch,
5 ocaml,
6 buildDunePackage,
7 version ? if lib.versionAtLeast ocaml.version "5.0" then "0.6.3" else "0.6.2",
8 benchmark,
9}:
10
11buildDunePackage {
12 pname = "rope";
13 inherit version;
14 minimalOCamlVersion = "4.03";
15
16 src = fetchurl {
17 url = "https://github.com/Chris00/ocaml-rope/releases/download/${version}/rope-${version}.tbz";
18 hash =
19 {
20 "0.6.2" = "sha256:15cvfa0s1vjx7gjd07d3fkznilishqf4z4h2q5f20wm9ysjh2h2i";
21 "0.6.3" = "sha256-M14fiP9BDiz3WEoMqAJqZaXk4PoZ8Z1YjOk+F97z05Y=";
22 }
23 ."${version}";
24 };
25
26 buildInputs = [ benchmark ];
27
28 patches = lib.optional (version == "0.6.3") (fetchpatch {
29 url = "https://github.com/Chris00/ocaml-rope/commit/be53daa18dd3d1450a92881b33c997eafb1dc958.patch";
30 hash = "sha256-fHJNfD1ph3+QLmVJ8C4hhJ8hvrWIh7D0EL0XhOW2yqQ=";
31 });
32
33 meta = {
34 homepage = "https://github.com/Chris00/ocaml-rope";
35 description = "Ropes (“heavyweight strings”) in OCaml";
36 license = lib.licenses.lgpl21;
37 maintainers = [ ];
38 };
39}