about summary refs log tree commit diff
path: root/pkgs/development/ocaml-modules/rope/default.nix
blob: c6260d713bc164df25e7dd341a5d3194764b5bb1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
{ lib, fetchurl, fetchpatch, ocaml, buildDunePackage
, version ? if lib.versionAtLeast ocaml.version "5.0" then "0.6.3" else "0.6.2"
, benchmark
}:


buildDunePackage {
  pname = "rope";
  inherit version;
  minimalOCamlVersion = "4.03";

  src = fetchurl {
    url = "https://github.com/Chris00/ocaml-rope/releases/download/${version}/rope-${version}.tbz";
    hash = {
      "0.6.2" = "sha256:15cvfa0s1vjx7gjd07d3fkznilishqf4z4h2q5f20wm9ysjh2h2i";
      "0.6.3" = "sha256-M14fiP9BDiz3WEoMqAJqZaXk4PoZ8Z1YjOk+F97z05Y=";
    }."${version}";
  };

  buildInputs = [ benchmark ] ;

  patches = lib.optional (version == "0.6.3") (fetchpatch {
    url = "https://github.com/Chris00/ocaml-rope/commit/be53daa18dd3d1450a92881b33c997eafb1dc958.patch";
    hash = "sha256-fHJNfD1ph3+QLmVJ8C4hhJ8hvrWIh7D0EL0XhOW2yqQ=";
  });

  meta = {
    homepage = "https://github.com/Chris00/ocaml-rope";
    description = "Ropes (“heavyweight strings”) in OCaml";
    license = lib.licenses.lgpl21;
    maintainers = with lib.maintainers; [ ];
  };
}