about summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorVincent Laporte <Vincent.Laporte@gmail.com>2017-11-20 06:49:49 +0000
committerVincent Laporte <Vincent.Laporte@gmail.com>2017-11-20 07:39:34 +0000
commitc890abba5773e25ab10a7824b2f9c3c5436e62f5 (patch)
tree94cd461a003bc9526d7ff415082eb07ea0795ded /pkgs
parent7c749ba7059efcafe7b596dabbf1a9160c728a82 (diff)
downloadnixlib-c890abba5773e25ab10a7824b2f9c3c5436e62f5.tar
nixlib-c890abba5773e25ab10a7824b2f9c3c5436e62f5.tar.gz
nixlib-c890abba5773e25ab10a7824b2f9c3c5436e62f5.tar.bz2
nixlib-c890abba5773e25ab10a7824b2f9c3c5436e62f5.tar.lz
nixlib-c890abba5773e25ab10a7824b2f9c3c5436e62f5.tar.xz
nixlib-c890abba5773e25ab10a7824b2f9c3c5436e62f5.tar.zst
nixlib-c890abba5773e25ab10a7824b2f9c3c5436e62f5.zip
ocamlPackages.rope: 0.5 -> 0.6
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/development/ocaml-modules/rope/default.nix38
1 files changed, 27 insertions, 11 deletions
diff --git a/pkgs/development/ocaml-modules/rope/default.nix b/pkgs/development/ocaml-modules/rope/default.nix
index a62c321a4e83..dfb8c56c23e8 100644
--- a/pkgs/development/ocaml-modules/rope/default.nix
+++ b/pkgs/development/ocaml-modules/rope/default.nix
@@ -1,18 +1,34 @@
-{ stdenv, fetchzip, ocaml, findlib, ocamlbuild, benchmark }:
+{ stdenv, fetchurl, ocaml, findlib, ocamlbuild, jbuilder, benchmark }:
 
-let version = "0.5"; in
+let param =
+  if stdenv.lib.versionAtLeast ocaml.version "4.03"
+  then {
+    version = "0.6";
+    url = " https://github.com/Chris00/ocaml-rope/releases/download/0.6/rope-0.6.tbz";
+    sha256 = "06pkbnkad2ck50jn59ggwv154yd9vb01abblihvam6p27m4za1pc";
+    buildInputs = [ jbuilder ];
+    extra = {
+      unpackCmd = "tar -xjf $curSrc";
+      buildPhase = "jbuilder build -p rope";
+      inherit (jbuilder) installPhase;
+    };
+  } 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
 
-stdenv.mkDerivation {
-  name = "ocaml${ocaml.version}-rope-${version}";
+stdenv.mkDerivation ({
+  name = "ocaml${ocaml.version}-rope-${param.version}";
 
-  src = fetchzip {
-    url = "https://forge.ocamlcore.org/frs/download.php/1156/rope-${version}.tar.gz";
-    sha256 = "1i8kzg19jrapl30mq8m91vy09z0r0dl4bnpw24ga96w8pxqf9qhd";
+  src = fetchurl {
+    inherit (param) url sha256;
   };
 
-  buildInputs = [ ocaml findlib ocamlbuild benchmark ];
-
-  createFindlibDestdir = true;
+  buildInputs = [ ocaml findlib benchmark ] ++ param.buildInputs;
 
   meta = {
     homepage = http://rope.forge.ocamlcore.org/;
@@ -21,4 +37,4 @@ stdenv.mkDerivation {
     license = stdenv.lib.licenses.lgpl21;
     maintainers = with stdenv.lib.maintainers; [ volth ];
   };
-}
+} // param.extra)