From fe9147a042f83b7700da92f0680cfb7438997ac3 Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Sat, 1 Jul 2017 10:18:34 +0000 Subject: [PATCH] ocamlPackages.conduit: 0.10.0 -> 0.15.4 Keeping the old version under attribute conduit_p4. --- .../ocaml-modules/conduit/0.10.0.nix | 26 ++++++++++ .../ocaml-modules/conduit/default.nix | 47 +++++++++++-------- pkgs/top-level/ocaml-packages.nix | 13 +++-- 3 files changed, 62 insertions(+), 24 deletions(-) create mode 100644 pkgs/development/ocaml-modules/conduit/0.10.0.nix diff --git a/pkgs/development/ocaml-modules/conduit/0.10.0.nix b/pkgs/development/ocaml-modules/conduit/0.10.0.nix new file mode 100644 index 00000000000..4d1c43e0ae1 --- /dev/null +++ b/pkgs/development/ocaml-modules/conduit/0.10.0.nix @@ -0,0 +1,26 @@ +{ stdenv, buildOcaml, fetchurl, ocaml, sexplib_p4, stringext, uri_p4, cstruct, ipaddr_p4 +, asyncSupport ? stdenv.lib.versionAtLeast ocaml.version "4.02" +, async_p4 ? null, async_ssl_p4 ? null, lwt ? null +}: + +buildOcaml rec { + name = "conduit"; + version = "0.10.0"; + + src = fetchurl { + url = "https://github.com/mirage/ocaml-conduit/archive/v${version}.tar.gz"; + sha256 = "1jz2skzsyg0axlkk9s6ahfblfrjx599wisyfs0cvn5dik9jqjadh"; + }; + + propagatedBuildInputs = [ sexplib_p4 stringext uri_p4 cstruct ipaddr_p4 ]; + 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; + + meta = with stdenv.lib; { + homepage = https://github.com/mirage/ocaml-conduit; + description = "Resolve URIs into communication channels for Async or Lwt "; + license = licenses.mit; + maintainers = [ maintainers.ericbmerritt ]; + }; +} diff --git a/pkgs/development/ocaml-modules/conduit/default.nix b/pkgs/development/ocaml-modules/conduit/default.nix index 4d1c43e0ae1..750bded2893 100644 --- a/pkgs/development/ocaml-modules/conduit/default.nix +++ b/pkgs/development/ocaml-modules/conduit/default.nix @@ -1,26 +1,33 @@ -{ stdenv, buildOcaml, fetchurl, ocaml, sexplib_p4, stringext, uri_p4, cstruct, ipaddr_p4 -, asyncSupport ? stdenv.lib.versionAtLeast ocaml.version "4.02" -, async_p4 ? null, async_ssl_p4 ? null, lwt ? null +{ stdenv, fetchFromGitHub, ocaml, findlib, ocamlbuild +, ppx_driver, ppx_sexp_conv +, ipaddr, uri, logs +, ocaml_lwt ? null +, async ? null, async_ssl ? null +, tls ? null }: -buildOcaml rec { - name = "conduit"; - version = "0.10.0"; +stdenv.mkDerivation rec { + version = "0.15.4"; + name = "ocaml${ocaml.version}-conduit-${version}"; - src = fetchurl { - url = "https://github.com/mirage/ocaml-conduit/archive/v${version}.tar.gz"; - sha256 = "1jz2skzsyg0axlkk9s6ahfblfrjx599wisyfs0cvn5dik9jqjadh"; - }; + src = fetchFromGitHub { + owner = "mirage"; + repo = "ocaml-conduit"; + rev = "v${version}"; + sha256 = "1ya7jqvhl8hc22cid5myf31w5c473imdxjnl9785lavsqj3djjxq"; + }; - propagatedBuildInputs = [ sexplib_p4 stringext uri_p4 cstruct ipaddr_p4 ]; - 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; + buildInputs = [ ocaml findlib ocamlbuild ppx_driver ppx_sexp_conv + ocaml_lwt async async_ssl tls ]; + propagatedBuildInputs = [ ipaddr uri logs ]; - meta = with stdenv.lib; { - homepage = https://github.com/mirage/ocaml-conduit; - description = "Resolve URIs into communication channels for Async or Lwt "; - license = licenses.mit; - maintainers = [ maintainers.ericbmerritt ]; - }; + createFindlibDestdir = true; + + meta = { + description = "Network connection library for TCP and SSL"; + license = stdenv.lib.licenses.isc; + maintainers = [ stdenv.lib.maintainers.vbgl ]; + inherit (src.meta) homepage; + inherit (ocaml.meta) platforms; + }; } diff --git a/pkgs/top-level/ocaml-packages.nix b/pkgs/top-level/ocaml-packages.nix index 49d02f61f91..c38c4c53a82 100644 --- a/pkgs/top-level/ocaml-packages.nix +++ b/pkgs/top-level/ocaml-packages.nix @@ -114,10 +114,6 @@ let }; camlimages = camlimages_4_1; - conduit = callPackage ../development/ocaml-modules/conduit { - lwt = ocaml_lwt; - }; - biniou = callPackage ../development/ocaml-modules/biniou { }; bin_prot_p4 = callPackage ../development/ocaml-modules/bin_prot { }; @@ -136,6 +132,15 @@ let lwt = ocaml_lwt; }; + conduit_p4 = callPackage ../development/ocaml-modules/conduit/0.10.0.nix { + lwt = ocaml_lwt; + }; + + conduit = + if lib.versionOlder "4.03" ocaml.version + then callPackage ../development/ocaml-modules/conduit { } + else conduit_p4; + config-file = callPackage ../development/ocaml-modules/config-file { }; containers = callPackage ../development/ocaml-modules/containers { };