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