From ccf39a89f952f6db9044bcbdff3cc3b91101887d Mon Sep 17 00:00:00 2001 From: Alessandro Barbieri Date: Wed, 6 Apr 2022 22:47:48 +0200 Subject: [PATCH] dev-ml/cohttp: initial import Signed-off-by: Alessandro Barbieri --- dev-ml/cohttp/Manifest | 1 + dev-ml/cohttp/cohttp-5.0.0.ebuild | 151 ++++++++++++++++++++++++++++++ dev-ml/cohttp/metadata.xml | 25 +++++ 3 files changed, 177 insertions(+) create mode 100644 dev-ml/cohttp/Manifest create mode 100644 dev-ml/cohttp/cohttp-5.0.0.ebuild create mode 100644 dev-ml/cohttp/metadata.xml diff --git a/dev-ml/cohttp/Manifest b/dev-ml/cohttp/Manifest new file mode 100644 index 0000000000..7547e650c8 --- /dev/null +++ b/dev-ml/cohttp/Manifest @@ -0,0 +1 @@ +DIST ocaml-cohttp-5.0.0.tar.gz 134016 BLAKE2B 0377bf6e9e355eb8bd27156ba95b3174aee2e9e0e2f66622bfcb9fbf15c7c2ae3fa2ac279134307260b07419887f30935e5d28c4750463eb7720ad022acbc5f2 SHA512 32f9c4cd3e3eda65a74ef01cfd1336f6a7fac30d8dde6b97b6452b887002b26ed54cb92e8abefb236486447742857f9eb712388fbd1ffd69d06d0a7698049458 diff --git a/dev-ml/cohttp/cohttp-5.0.0.ebuild b/dev-ml/cohttp/cohttp-5.0.0.ebuild new file mode 100644 index 0000000000..b880f3745b --- /dev/null +++ b/dev-ml/cohttp/cohttp-5.0.0.ebuild @@ -0,0 +1,151 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit dune multiprocessing + +DESCRIPTION="Very lightweight HTTP server using Lwt or Async" +HOMEPAGE="https://github.com/mirage/ocaml-cohttp" +SRC_URI="https://github.com/mirage/ocaml-cohttp/archive/v${PV}.tar.gz -> ocaml-cohttp-${PV}.tar.gz" +S="${WORKDIR}/ocaml-cohttp-${PV}" + +LICENSE="ISC" +SLOT="0/${PV}" +KEYWORDS="~amd64" +IUSE="async bench curl curl-async curl-lwt lwt lwt-jsoo lwt-unix mirage ocamlopt server-lwt-unix test top" + +RDEPEND=" + async? ( + dev-ml/async + dev-ml/async_kernel + dev-ml/async_unix + dev-ml/base + dev-ml/core_unix + dev-ml/conduit[async] + dev-ml/fmt + dev-ml/ipaddr + dev-ml/logs + dev-ml/magic-mime + dev-ml/mirage-crypto + ) + bench? ( + dev-ml/core + dev-ml/core_bench + ) + curl-async? ( + dev-ml/async_kernel + dev-ml/async_unix + dev-ml/core_kernel + dev-ml/ocurl + ) + curl? ( dev-ml/ocurl ) + curl-lwt? ( + dev-ml/lwt + dev-ml/ocurl + ) + lwt? ( + dev-ml/logs + dev-ml/lwt + dev-ml/ppx_sexp_conv + ) + lwt-jsoo? ( + dev-ml/js_of_ocaml[lwt,ppx] + dev-ml/logs + dev-ml/lwt + ) + lwt-unix? ( + dev-ml/base-unix + dev-ml/cmdliner + dev-ml/conduit[lwt,lwt-unix] + dev-ml/fmt + dev-ml/logs + dev-ml/lwt + dev-ml/magic-mime + dev-ml/ppx_sexp_conv + ) + mirage? ( + dev-ml/astring + dev-ml/conduit[mirage] + dev-ml/fmt + dev-ml/lwt + dev-ml/magic-mime + dev-ml/mirage-channel + dev-ml/mirage-flow + dev-ml/mirage-kv + dev-ml/ppx_sexp_conv + ) + server-lwt-unix? ( + dev-ml/lwt + ) + + dev-ml/ocaml-base64 + dev-ml/re + dev-ml/sexplib0 + dev-ml/stringext + dev-ml/uri[sexp] +" +DEPEND=" + ${RDEPEND} + test? ( + dev-ml/alcotest + dev-ml/base_quickcheck + dev-ml/ppx_assert + dev-ml/ppx_sexp_conv + dev-ml/ppx_compare + dev-ml/ppx_here + dev-ml/core + dev-ml/core_bench + dev-ml/crowbar + dev-ml/fmt + dev-ml/conduit[lwt,lwt-unix] + dev-ml/ounit + dev-ml/lwt + net-libs/nodejs[npm] + dev-ml/mirage-crypto + ) +" + +RESTRICT="!test? ( test )" +REQUIRED_USE=" + bench? ( async lwt-unix server-lwt-unix ) + curl-lwt? ( curl ) + lwt-jsoo? ( lwt ) + lwt-unix? ( lwt ) + mirage? ( lwt ) + server-lwt-unix? ( lwt ) + test? ( async curl-async curl-lwt lwt-jsoo lwt-unix lwt ) +" + +src_compile() { +# local pkgs="http,cohttp" + local pkgs="cohttp" + use async && pkgs="${pkgs},cohttp-async" + use bench && pkgs="${pkgs},cohttp-bench" + use curl-async && pkgs="${pkgs},cohttp-curl-async" + use curl-lwt && pkgs="${pkgs},cohttp-curl-lwt" + use curl && pkgs="${pkgs},cohttp-curl" + use lwt-jsoo && pkgs="${pkgs},cohttp-lwt-jsoo" + use lwt-unix && pkgs="${pkgs},cohttp-lwt-unix" + use lwt && pkgs="${pkgs},cohttp-lwt" + use mirage && pkgs="${pkgs},cohttp-mirage" + use server-lwt-unix && pkgs="${pkgs},cohttp-server-lwt-unix" + use top && pkgs="${pkgs},cohttp-top" + dune build --only-packages "${pkgs}" -j $(makeopts_jobs) --profile release || die +} + +src_install() { +# dune_src_install http + dune_src_install cohttp + use async && dune_src_install cohttp-async + use bench && dune_src_install cohttp-bench + use curl-async && dune_src_install cohttp-curl-async + use curl-lwt && dune_src_install cohttp-curl-lwt + use curl && dune_src_install cohttp-curl + use lwt-jsoo && dune_src_install cohttp-lwt-jsoo + use lwt-unix && dune_src_install cohttp-lwt-unix + use lwt && dune_src_install cohttp-lwt + use mirage && dune_src_install cohttp-mirage + use server-lwt-unix && dune_src_install cohttp-server-lwt-unix + use top && dune_src_install cohttp-top +} diff --git a/dev-ml/cohttp/metadata.xml b/dev-ml/cohttp/metadata.xml new file mode 100644 index 0000000000..49177d5b3c --- /dev/null +++ b/dev-ml/cohttp/metadata.xml @@ -0,0 +1,25 @@ + + + + + co-maintainers welcome + lssndrbarbieri@gmail.com + Alessandro Barbieri + + + mirage/ocaml-cohttp + + + CoHTTP implementation for the Async concurrency library + Benchmarks binaries for Cohttp + Cohttp client using Curl and Async as the backend + Cohttp client using Curl and Lwt as the backend + Shared code between the individual cohttp-curl clients + CoHTTP implementation for the Js_of_ocaml JavaScript compiler + CoHTTP implementation for Unix and Windows using Lwt + CoHTTP implementation using the Lwt concurrency library + CoHTTP implementation for the MirageOS unikernel + Lightweight Cohttp plus Lwt based HTTP server + CoHTTP toplevel pretty printers for HTTP types + +