Skip to content

Commit

Permalink
ocamlPackages.cohttp*: 2.5.3 → 3.0.0
Browse files Browse the repository at this point in the history
cohttp-lwt-unix-{ssl,nossl}: new packages
  • Loading branch information
sternenseemann committed Nov 16, 2020
1 parent 3f90932 commit 619d49e
Show file tree
Hide file tree
Showing 7 changed files with 90 additions and 18 deletions.
15 changes: 12 additions & 3 deletions pkgs/development/ocaml-modules/cohttp/async.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
{ stdenv, buildDunePackage, async, cohttp, conduit-async, uri, ppx_sexp_conv
, logs, magic-mime }:
{ stdenv, buildDunePackage
, async, cohttp, conduit-async, conduit-async-ssl
, uri, logs, magic-mime, mirage-crypto, ipaddr
, ounit, ppx_sexp_conv
}:

if !stdenv.lib.versionAtLeast cohttp.version "0.99" then
cohttp
Expand All @@ -14,7 +17,13 @@ else

buildInputs = [ ppx_sexp_conv ];

propagatedBuildInputs = [ async cohttp conduit-async logs magic-mime uri ];
propagatedBuildInputs = [
async cohttp conduit-async conduit-async-ssl logs magic-mime
uri mirage-crypto ipaddr
];

doCheck = true;
checkInputs = [ ounit ];

meta = cohttp.meta // {
description = "CoHTTP implementation for the Async concurrency library";
Expand Down
8 changes: 4 additions & 4 deletions pkgs/development/ocaml-modules/cohttp/default.nix
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
{ lib, fetchurl, buildDunePackage
, ppx_fields_conv, ppx_sexp_conv, stdlib-shims
, ppx_fields_conv, ppx_sexp_conv, ppx_compare, stdlib-shims
, base64, fieldslib, jsonm, re, stringext, uri-sexp
}:

buildDunePackage rec {
pname = "cohttp";
version = "2.5.4";
version = "3.0.0";

useDune2 = true;

minimumOCamlVersion = "4.04.1";

src = fetchurl {
url = "https://github.com/mirage/ocaml-cohttp/releases/download/v${version}/cohttp-v${version}.tbz";
sha256 = "1q04spmki5zis5p5m1vs77i3k7ijm134j62g61071vblwx25z17a";
sha256 = "191fr2pxqydnmznx7fgc2hk4lyffrf6c2al2pcvc7jdbg91jz1zv";
};

buildInputs = [ jsonm ppx_fields_conv ppx_sexp_conv ];

propagatedBuildInputs = [ base64 fieldslib re stringext uri-sexp stdlib-shims ];
propagatedBuildInputs = [ base64 fieldslib re stringext uri-sexp stdlib-shims ppx_compare ];

meta = {
description = "HTTP(S) library for Lwt, Async and Mirage";
Expand Down
23 changes: 23 additions & 0 deletions pkgs/development/ocaml-modules/cohttp/lwt-unix-nossl.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{ buildDunePackage, cohttp-lwt
, conduit-lwt, cmdliner, magic-mime, logs, fmt, ocaml_lwt, ca-certs
, ounit
}:

buildDunePackage {
pname = "cohttp-lwt-unix-nossl";

minimumOCamlVersion = "4.08";

inherit (cohttp-lwt) src version useDune2;

propagatedBuildInputs = [
cohttp-lwt conduit-lwt ca-certs cmdliner magic-mime logs fmt ocaml_lwt
];

doCheck = true;
checkInputs = [ ounit ];

meta = cohttp-lwt.meta // {
description = "CoHTTP implementation for Unix and Windows using Lwt";
};
}
25 changes: 25 additions & 0 deletions pkgs/development/ocaml-modules/cohttp/lwt-unix-ssl.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{ buildDunePackage, cohttp-lwt, cohttp-lwt-unix-nossl
, conduit-lwt, conduit-lwt-ssl, ca-certs, cmdliner
, magic-mime, logs, fmt, ocaml_lwt
, ounit
}:

buildDunePackage {
pname = "cohttp-lwt-unix-ssl";

minimumOCamlVersion = "4.08";

inherit (cohttp-lwt) src version useDune2;

propagatedBuildInputs = [
cohttp-lwt cohttp-lwt-unix-nossl conduit-lwt conduit-lwt-ssl
ca-certs cmdliner magic-mime logs fmt ocaml_lwt
];

doCheck = true;
checkInputs = [ ounit ];

meta = cohttp-lwt.meta // {
description = "CoHTTP implementation for Unix and Windows using Lwt";
};
}
24 changes: 16 additions & 8 deletions pkgs/development/ocaml-modules/cohttp/lwt-unix.nix
Original file line number Diff line number Diff line change
@@ -1,19 +1,27 @@
{ stdenv, buildDunePackage, cohttp-lwt
, conduit-lwt-unix, ppx_sexp_conv
, cmdliner, fmt, magic-mime
{ lib, buildDunePackage, cohttp-lwt, cohttp-lwt-unix-nossl
, conduit-lwt, conduit-lwt-tls, ca-certs
, cmdliner, magic-mime, logs, fmt, ocaml_lwt
}:

if !stdenv.lib.versionAtLeast cohttp-lwt.version "0.99"
if !lib.versionAtLeast cohttp-lwt.version "0.99"
then cohttp-lwt
else

buildDunePackage {
pname = "cohttp-lwt-unix";
inherit (cohttp-lwt) version src meta;
inherit (cohttp-lwt) version src useDune2;

useDune2 = true;
minimumOCamlVersion = "4.08";

buildInputs = [ cmdliner ppx_sexp_conv ];
propagatedBuildInputs = [
cohttp-lwt cohttp-lwt-unix-nossl conduit-lwt conduit-lwt-tls ca-certs
cmdliner magic-mime logs fmt ocaml_lwt
];

propagatedBuildInputs = [ cohttp-lwt conduit-lwt-unix fmt magic-mime ];
# requires system trust anchor not available in sandbox
doCheck = false;

meta = cohttp-lwt.meta // {
description = "CoHTTP implementation for Unix and Windows using Lwt";
};
}
9 changes: 6 additions & 3 deletions pkgs/development/ocaml-modules/cohttp/lwt.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{ stdenv, buildDunePackage, cohttp, ocaml_lwt, uri, ppx_sexp_conv, logs }:
{ stdenv, buildDunePackage
, cohttp, ocaml_lwt, uri, logs
, ppx_sexp_conv
}:

if !stdenv.lib.versionAtLeast cohttp.version "0.99"
then cohttp
Expand All @@ -10,7 +13,7 @@ buildDunePackage {
pname = "cohttp-lwt";
inherit (cohttp) version src useDune2 meta;

buildInputs = [ uri ppx_sexp_conv ];
buildInputs = [ ppx_sexp_conv ];

propagatedBuildInputs = [ cohttp ocaml_lwt logs ];
propagatedBuildInputs = [ cohttp ocaml_lwt logs uri ];
}
4 changes: 4 additions & 0 deletions pkgs/top-level/ocaml-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,10 @@ let

cohttp-lwt-unix = callPackage ../development/ocaml-modules/cohttp/lwt-unix.nix { };

cohttp-lwt-unix-nossl = callPackage ../development/ocaml-modules/cohttp/lwt-unix-nossl.nix { };

cohttp-lwt-unix-ssl = callPackage ../development/ocaml-modules/cohttp/lwt-unix-ssl.nix { };

conduit = callPackage ../development/ocaml-modules/conduit { };

conduit-async = callPackage ../development/ocaml-modules/conduit/async.nix { };
Expand Down

0 comments on commit 619d49e

Please sign in to comment.