From 48e06000c2b29277edf6c840e613c337990e77f0 Mon Sep 17 00:00:00 2001 From: "Aaron L. Zeng" Date: Thu, 9 Jul 2020 20:51:58 -0400 Subject: [PATCH] ocamlPackages.cohttp-async: init at 2.5.1 --- .../ocaml-modules/cohttp/async.nix | 21 +++++++++++++++++++ pkgs/top-level/ocaml-packages.nix | 2 ++ 2 files changed, 23 insertions(+) create mode 100644 pkgs/development/ocaml-modules/cohttp/async.nix diff --git a/pkgs/development/ocaml-modules/cohttp/async.nix b/pkgs/development/ocaml-modules/cohttp/async.nix new file mode 100644 index 000000000000..23e6f4f10a14 --- /dev/null +++ b/pkgs/development/ocaml-modules/cohttp/async.nix @@ -0,0 +1,21 @@ +{ stdenv, buildDunePackage, async, cohttp, conduit-async, uri, ppx_sexp_conv +, logs, magic-mime }: + +if !stdenv.lib.versionAtLeast cohttp.version "0.99" then + cohttp +else if !stdenv.lib.versionAtLeast async.version "0.13" then + throw "cohttp-async needs async-0.13 (hence OCaml >= 4.08)" +else + + buildDunePackage { + pname = "cohttp-async"; + inherit (cohttp) version src; + + buildInputs = [ ppx_sexp_conv ]; + + propagatedBuildInputs = [ async cohttp conduit-async logs magic-mime uri ]; + + meta = cohttp.meta // { + description = "CoHTTP implementation for the Async concurrency library"; + }; + } diff --git a/pkgs/top-level/ocaml-packages.nix b/pkgs/top-level/ocaml-packages.nix index d9937829b93e..ba02c3bb5246 100644 --- a/pkgs/top-level/ocaml-packages.nix +++ b/pkgs/top-level/ocaml-packages.nix @@ -137,6 +137,8 @@ let cohttp = callPackage ../development/ocaml-modules/cohttp { }; + cohttp-async = callPackage ../development/ocaml-modules/cohttp/async.nix { }; + cohttp-lwt = callPackage ../development/ocaml-modules/cohttp/lwt.nix { }; cohttp-lwt-unix = callPackage ../development/ocaml-modules/cohttp/lwt-unix.nix { };