about summary refs log tree commit diff
diff options
context:
space:
mode:
authorVincent Laporte <Vincent.Laporte@gmail.com>2016-11-12 09:55:42 +0100
committerVincent Laporte <Vincent.Laporte@gmail.com>2016-11-12 12:41:27 +0100
commit72c1a6f0f46cf4e35986b49f957f690922ba7a02 (patch)
treeafd4fadd480e9c7614319ef5eaba2e30ef88b820
parent24df641deba37fb6f9bed238f028052178721ac6 (diff)
downloadnixlib-72c1a6f0f46cf4e35986b49f957f690922ba7a02.tar
nixlib-72c1a6f0f46cf4e35986b49f957f690922ba7a02.tar.gz
nixlib-72c1a6f0f46cf4e35986b49f957f690922ba7a02.tar.bz2
nixlib-72c1a6f0f46cf4e35986b49f957f690922ba7a02.tar.lz
nixlib-72c1a6f0f46cf4e35986b49f957f690922ba7a02.tar.xz
nixlib-72c1a6f0f46cf4e35986b49f957f690922ba7a02.tar.zst
nixlib-72c1a6f0f46cf4e35986b49f957f690922ba7a02.zip
ocamlPackages.cohttp: refactor
-rw-r--r--pkgs/development/ocaml-modules/cohttp/default.nix17
-rw-r--r--pkgs/development/tools/misc/trv/default.nix5
2 files changed, 12 insertions, 10 deletions
diff --git a/pkgs/development/ocaml-modules/cohttp/default.nix b/pkgs/development/ocaml-modules/cohttp/default.nix
index dcf3c8c13d79..5a22e37d8213 100644
--- a/pkgs/development/ocaml-modules/cohttp/default.nix
+++ b/pkgs/development/ocaml-modules/cohttp/default.nix
@@ -1,22 +1,23 @@
-{stdenv, buildOcaml, fetchurl, cmdliner, re, uri, fieldslib_p4, sexplib_p4, conduit,
- stringext, base64, magic-mime, ounit, alcotest, lwt ? null,
- async ? null, async_ssl ? null}:
+{ stdenv, buildOcaml, fetchurl, ocaml, cmdliner, re, uri, 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
+}:
 
 buildOcaml rec {
   name = "cohttp";
   version = "0.19.3";
 
-  minimumSupportedOcamlVersion = "4.02";
+  minimumSupportedOcamlVersion = "4.01";
 
   src = fetchurl {
     url = "https://github.com/mirage/ocaml-cohttp/archive/v${version}.tar.gz";
     sha256 = "1nrzpd4h52c1hnzcgsz462676saj9zss708ng001h54dglk8i1iv";
   };
 
-  buildInputs = [ alcotest ];
-  propagatedBuildInputs = [ cmdliner re uri fieldslib_p4 sexplib_p4 sexplib_p4
-                            conduit stringext base64 magic-mime ounit async
-                            async_ssl lwt ];
+  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 ];
 
   buildFlags = "PREFIX=$(out)";
 
diff --git a/pkgs/development/tools/misc/trv/default.nix b/pkgs/development/tools/misc/trv/default.nix
index 4b83c12bed77..4b00e92b4c3c 100644
--- a/pkgs/development/tools/misc/trv/default.nix
+++ b/pkgs/development/tools/misc/trv/default.nix
@@ -1,6 +1,7 @@
 {stdenv, fetchFromGitHub, ocaml, findlib, camlp4, core_p4, async_p4, async_unix_p4
 , re2_p4, async_extra_p4, sexplib_p4, async_shell, core_extended_p4, async_find
-, cohttp, uri, tzdata}:
+, cohttp, conduit, magic-mime, uri, tzdata
+}:
 
 assert stdenv.lib.versionOlder "4.02" ocaml.version;
 
@@ -16,7 +17,7 @@ stdenv.mkDerivation rec {
   };
 
 
-  buildInputs = [ ocaml findlib camlp4 ];
+  buildInputs = [ ocaml findlib camlp4 conduit magic-mime ];
   propagatedBuildInputs = [ core_p4 async_p4 async_unix_p4
                             async_extra_p4 sexplib_p4 async_shell core_extended_p4
                             async_find cohttp uri re2_p4 ];