# -*- 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        mirleft ocaml-tls 2.1.0 v
revision            1
categories          ocaml devel net
maintainers         {@barracuda156 macos-powerpc.org:barracuda} openmaintainer
license             BSD
description         Transport Layer Security
long_description    {*}${description} purely in OCaml.
distname            tls-${version}
use_bzip2           yes
extract.suffix      .tbz
checksums           rmd160  9469277e526fa2fa9902393911191f9427bf5eff \
                    sha256  da79960789fa418b62bf89cd524e99815c5010413bc189f0f33966b8d0b886d2 \
                    size    398966
github.tarball_from releases

depends_lib-append  port:ocaml-mirage-crypto-rng

if {${subport} eq ${name}} {
    depends_lib-append \
                    port:ocaml-digestif \
                    port:ocaml-domain-name \
                    port:ocaml-fmt \
                    port:ocaml-ipaddr \
                    port:ocaml-kdf \
                    port:ocaml-logs \
                    port:ocaml-mirage-crypto \
                    port:ocaml-mirage-crypto-ec \
                    port:ocaml-mirage-crypto-pk \
                    port:ocaml-ohex \
                    port:ocaml-ptime \
                    port:ocaml-x509
}

ocaml.build_type    dune

subport ${name}-async {
    description     {*}${description}, Async layer

    depends_lib-append \
                    port:ocaml-async \
                    port:ocaml-async_unix \
                    port:ocaml-core \
                    port:ocaml-core_unix \
                    port:ocaml-cstruct-async \
                    port:ocaml-ppx_jane \
                    port:ocaml-ptime \
                    port:ocaml-tls
}

subport ${name}-lwt {
    description     {*}${description}, Lwt layer

    depends_lib-append \
                    port:ocaml-lwt \
                    port:ocaml-tls
}
