summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--pkgs/development/ocaml-modules/cohttp/default.nix4
-rw-r--r--pkgs/development/ocaml-modules/conduit/default.nix4
-rw-r--r--pkgs/development/ocaml-modules/uri/default.nix31
-rw-r--r--pkgs/top-level/ocaml-packages.nix3
4 files changed, 29 insertions, 13 deletions
diff --git a/pkgs/development/ocaml-modules/cohttp/default.nix b/pkgs/development/ocaml-modules/cohttp/default.nix
index 5a22e37d821..99f101010f3 100644
--- a/pkgs/development/ocaml-modules/cohttp/default.nix
+++ b/pkgs/development/ocaml-modules/cohttp/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, buildOcaml, fetchurl, ocaml, cmdliner, re, uri, fieldslib_p4
+{ stdenv, buildOcaml, fetchurl, ocaml, cmdliner, re, uri_p4, fieldslib_p4
 , sexplib_p4, conduit , stringext, base64, magic-mime, ounit, alcotest
 , asyncSupport ? stdenv.lib.versionAtLeast ocaml.version "4.02"
 , lwt ? null, async_p4 ? null, async_ssl_p4 ? null
@@ -17,7 +17,7 @@ buildOcaml rec {
 
   buildInputs = [ alcotest cmdliner conduit magic-mime ounit lwt ]
   ++ stdenv.lib.optionals asyncSupport [ async_p4 async_ssl_p4 ];
-  propagatedBuildInputs = [ re stringext uri fieldslib_p4 sexplib_p4 base64 ];
+  propagatedBuildInputs = [ re stringext uri_p4 fieldslib_p4 sexplib_p4 base64 ];
 
   buildFlags = "PREFIX=$(out)";
 
diff --git a/pkgs/development/ocaml-modules/conduit/default.nix b/pkgs/development/ocaml-modules/conduit/default.nix
index afe44ea0a7f..22c74d7f92e 100644
--- a/pkgs/development/ocaml-modules/conduit/default.nix
+++ b/pkgs/development/ocaml-modules/conduit/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, buildOcaml, fetchurl, ocaml, sexplib_p4, stringext, uri, cstruct, ipaddr
+{ stdenv, buildOcaml, fetchurl, ocaml, sexplib_p4, stringext, uri_p4, cstruct, ipaddr
 , asyncSupport ? stdenv.lib.versionAtLeast ocaml.version "4.02"
 , async_p4 ? null, async_ssl_p4 ? null, lwt ? null
 }:
@@ -12,7 +12,7 @@ buildOcaml rec {
     sha256 = "5cf1a46aa0254345e5143feebe6b54bdef96314e9987f44e69f24618d620faa1";
   };
 
-  propagatedBuildInputs = [ sexplib_p4 stringext uri cstruct ipaddr ];
+  propagatedBuildInputs = [ sexplib_p4 stringext uri_p4 cstruct ipaddr ];
   buildInputs = stdenv.lib.optional (lwt != null) lwt
              ++ stdenv.lib.optional (asyncSupport && async_p4 != null) async_p4
              ++ stdenv.lib.optional (asyncSupport && async_ssl_p4 != null) async_ssl_p4;
diff --git a/pkgs/development/ocaml-modules/uri/default.nix b/pkgs/development/ocaml-modules/uri/default.nix
index a6335274f73..c7d991504ec 100644
--- a/pkgs/development/ocaml-modules/uri/default.nix
+++ b/pkgs/development/ocaml-modules/uri/default.nix
@@ -1,19 +1,32 @@
-{ stdenv, fetchzip, ocaml, findlib, re, sexplib_p4, stringext, ounit }:
-
-assert stdenv.lib.versionAtLeast (stdenv.lib.getVersion ocaml) "4";
-
-let version = "1.9.1"; in
+{ stdenv, fetchzip, ocaml, findlib, re, stringext, ounit
+, sexplib, ppx_sexp_conv
+, legacyVersion ? false
+, sexplib_p4
+}:
+
+assert stdenv.lib.versionAtLeast ocaml.version "4";
+
+with
+  if legacyVersion
+  then {
+    version = "1.9.1";
+    sha256 = "0v3jxqgyi4kj92r3x83rszfpnvvzy9lyb913basch4q64yka3w85";
+  } else {
+    version = "1.9.2";
+    sha256 = "137pg8j654x7r0d1664iy2zp3l82nki1kkh921lwdrwc5qqdl6jx";
+  };
 
 stdenv.mkDerivation {
-  name = "ocaml-uri-${version}";
+  name = "ocaml${ocaml.version}-uri-${version}";
 
   src = fetchzip {
     url = "https://github.com/mirage/ocaml-uri/archive/v${version}.tar.gz";
-    sha256 = "0v3jxqgyi4kj92r3x83rszfpnvvzy9lyb913basch4q64yka3w85";
+    inherit sha256;
   };
 
-  buildInputs = [ ocaml findlib ounit ];
-  propagatedBuildInputs = [ re sexplib_p4 stringext ];
+  buildInputs = [ ocaml findlib ounit ]
+  ++ stdenv.lib.optional (!legacyVersion) ppx_sexp_conv;
+  propagatedBuildInputs = [ re (if legacyVersion then sexplib_p4 else sexplib) stringext ];
 
   configurePhase = "ocaml setup.ml -configure --prefix $out --enable-tests";
   buildPhase = ''
diff --git a/pkgs/top-level/ocaml-packages.nix b/pkgs/top-level/ocaml-packages.nix
index 615268e3778..41cf8306992 100644
--- a/pkgs/top-level/ocaml-packages.nix
+++ b/pkgs/top-level/ocaml-packages.nix
@@ -510,6 +510,9 @@ let
     uunf = callPackage ../development/ocaml-modules/uunf { };
 
     uri = callPackage ../development/ocaml-modules/uri { };
+    uri_p4 = callPackage ../development/ocaml-modules/uri {
+      legacyVersion = true;
+    };
 
     uuseg = callPackage ../development/ocaml-modules/uuseg { };
     uutf = callPackage ../development/ocaml-modules/uutf { };