# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4

PortSystem          1.0
PortGroup           github 1.0
PortGroup           ocaml 1.1

github.setup        anmonteiro ocaml-h2 0.13.0
revision            2
categories          ocaml devel net
maintainers         {@barracuda156 macos-powerpc.org:barracuda} openmaintainer
license             BSD
description         High-performance, memory-efficient and scalable HTTP/2 library
long_description    {*}${description} for OCaml.
use_bzip2           yes
extract.suffix      .tbz
distname            h2-${version}
checksums           rmd160  e533f3966585d5af5100794259f63d16b0366b0b \
                    sha256  0d89b6f178175294e7a207223be81d5b83fc31b97549bec34f0432a3b2a8070f \
                    size    321382
github.tarball_from releases

if {${subport} eq ${name}} {
    depends_lib-append \
                    port:ocaml-angstrom \
                    port:ocaml-base64 \
                    port:ocaml-bigstringaf \
                    port:ocaml-faraday \
                    port:ocaml-hpack \
                    port:ocaml-httpun-types \
                    port:ocaml-psq
}

ocaml.build_type    dune

subport ${name}-async {
    description     Async support for h2

    depends_lib     port:ocaml-async_ssl \
                    port:ocaml-faraday-async \
                    port:ocaml-gluten-async \
                    port:ocaml-h2 \
                    port:ocaml-tls-async
}

# subport ${name}-eio {
#     description     EIO support for h2
# 
#     depends_lib     port:ocaml-eio \
#                     port:ocaml-gluten-eio \
#                     port:ocaml-h2
# }

subport ${name}-lwt {
    description     Lwt support for h2

    depends_lib     port:ocaml-gluten \
                    port:ocaml-h2 \
                    port:ocaml-lwt
}

subport ocaml-hpack {
    description     HPACK (Header Compression for HTTP/2) implementation in OCaml

    depends_lib     port:ocaml-angstrom \
                    port:ocaml-faraday
}
