# -*- 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.0.3 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  f976d32aba65eec824982d530cb8e4c9c08c9f74 \
                    sha256  d7159ba745f3da2e73844353f020fdbc767393882b47565f8b61b941c351c3d7 \
                    size    395512
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
}
