From d2a4a84f00019596006cf218df9f8b143c7d624d Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Sun, 19 Feb 2017 11:57:24 +0100 Subject: [PATCH] ocamlPackages.uri: 1.9.1 -> 1.9.2 The old version is also kept, under the attribute `uri_p4`. It is built against `sexplib` version prior to 113.33 and needed by `trv`. --- .../ocaml-modules/cohttp/default.nix | 4 +-- .../ocaml-modules/conduit/default.nix | 4 +-- .../development/ocaml-modules/uri/default.nix | 27 ++++++++++++++----- pkgs/top-level/ocaml-packages.nix | 3 +++ 4 files changed, 27 insertions(+), 11 deletions(-) diff --git a/pkgs/development/ocaml-modules/cohttp/default.nix b/pkgs/development/ocaml-modules/cohttp/default.nix index 5a22e37d8213..99f101010f3e 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 afe44ea0a7f6..22c74d7f92e5 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 a6335274f737..c7d991504ec9 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 }: +{ stdenv, fetchzip, ocaml, findlib, re, stringext, ounit +, sexplib, ppx_sexp_conv +, legacyVersion ? false +, sexplib_p4 +}: -assert stdenv.lib.versionAtLeast (stdenv.lib.getVersion ocaml) "4"; +assert stdenv.lib.versionAtLeast ocaml.version "4"; -let version = "1.9.1"; in +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 615268e3778e..41cf8306992b 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 { };