about summary refs log tree commit diff
path: root/pkgs/development/ocaml-modules/conduit
diff options
context:
space:
mode:
authorVincent Laporte <Vincent.Laporte@gmail.com>2016-11-12 09:39:16 +0100
committerVincent Laporte <Vincent.Laporte@gmail.com>2016-11-12 12:41:26 +0100
commit24df641deba37fb6f9bed238f028052178721ac6 (patch)
treee07caae298efea2473bad698ded09034977719c5 /pkgs/development/ocaml-modules/conduit
parent1c3b496f0d095790b678471aeb3a67708c6cc0a7 (diff)
downloadnixlib-24df641deba37fb6f9bed238f028052178721ac6.tar
nixlib-24df641deba37fb6f9bed238f028052178721ac6.tar.gz
nixlib-24df641deba37fb6f9bed238f028052178721ac6.tar.bz2
nixlib-24df641deba37fb6f9bed238f028052178721ac6.tar.lz
nixlib-24df641deba37fb6f9bed238f028052178721ac6.tar.xz
nixlib-24df641deba37fb6f9bed238f028052178721ac6.tar.zst
nixlib-24df641deba37fb6f9bed238f028052178721ac6.zip
ocamlPackages.conduit: refactor
Diffstat (limited to 'pkgs/development/ocaml-modules/conduit')
-rw-r--r--pkgs/development/ocaml-modules/conduit/default.nix14
1 files changed, 8 insertions, 6 deletions
diff --git a/pkgs/development/ocaml-modules/conduit/default.nix b/pkgs/development/ocaml-modules/conduit/default.nix
index 26accd99db67..afe44ea0a7f6 100644
--- a/pkgs/development/ocaml-modules/conduit/default.nix
+++ b/pkgs/development/ocaml-modules/conduit/default.nix
@@ -1,5 +1,7 @@
-{stdenv, buildOcaml, fetchurl, sexplib_p4, stringext, uri, cstruct, ipaddr,
- async ? null, async_ssl ? null, lwt ? null}:
+{ stdenv, buildOcaml, fetchurl, ocaml, sexplib_p4, stringext, uri, cstruct, ipaddr
+, asyncSupport ? stdenv.lib.versionAtLeast ocaml.version "4.02"
+, async_p4 ? null, async_ssl_p4 ? null, lwt ? null
+}:
 
 buildOcaml rec {
   name = "conduit";
@@ -10,10 +12,10 @@ buildOcaml rec {
     sha256 = "5cf1a46aa0254345e5143feebe6b54bdef96314e9987f44e69f24618d620faa1";
   };
 
-  propagatedBuildInputs = ([ sexplib_p4 stringext uri cstruct ipaddr ]
-                            ++ stdenv.lib.optional (lwt != null) lwt
-                            ++ stdenv.lib.optional (async != null) async
-                            ++ stdenv.lib.optional (async_ssl != null) async_ssl);
+  propagatedBuildInputs = [ sexplib_p4 stringext uri 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;
 
   meta = with stdenv.lib; {
     homepage = https://github.com/mirage/ocaml-conduit;