about summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorVincent Laporte <Vincent.Laporte@gmail.com>2024-05-13 08:34:31 +0200
committerVincent Laporte <vbgl@users.noreply.github.com>2024-05-21 07:13:52 +0200
commit08e65e472e25c99e1af3e5f727b33220cadf2fda (patch)
treeb7e9dde0035b951d575c0da589dc83c4d859598f /pkgs
parentcfb4ca3234f3b854bb1e23d3a8ba71eb109e5425 (diff)
ocamlPackages.rope: 0.6.2 → 0.6.3
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/development/ocaml-modules/rope/default.nix21
1 files changed, 15 insertions, 6 deletions
diff --git a/pkgs/development/ocaml-modules/rope/default.nix b/pkgs/development/ocaml-modules/rope/default.nix
index ff4f304d68515..c6260d713bc16 100644
--- a/pkgs/development/ocaml-modules/rope/default.nix
+++ b/pkgs/development/ocaml-modules/rope/default.nix
@@ -1,20 +1,29 @@
-{ lib, fetchurl, ocaml, buildDunePackage, benchmark }:
+{ lib, fetchurl, fetchpatch, ocaml, buildDunePackage
+, version ? if lib.versionAtLeast ocaml.version "5.0" then "0.6.3" else "0.6.2"
+, benchmark
+}:
 
-lib.throwIf (lib.versionAtLeast ocaml.version "5.0")
-  "rope is not available for OCaml ${ocaml.version}"
 
-buildDunePackage rec {
+buildDunePackage {
   pname = "rope";
-  version = "0.6.2";
+  inherit version;
   minimalOCamlVersion = "4.03";
 
   src = fetchurl {
     url = "https://github.com/Chris00/ocaml-rope/releases/download/${version}/rope-${version}.tbz";
-    sha256 = "15cvfa0s1vjx7gjd07d3fkznilishqf4z4h2q5f20wm9ysjh2h2i";
+    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";