# -*- 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.2 v
revision            0
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  23ab777dc2336296f34d8c2bbb4e997de7391cd8 \
                    sha256  d51940587bce9475c977c596904c8179dcd784d9ef6dd9afe3e634cca940c9f3 \
                    size    399686
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-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
}

subport ${name}-eio {
    description     {*}${description}, Eio

    depends_lib-append \
                    port:ocaml-eio \
                    port:ocaml-eio_main
}

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

    depends_lib-append \
                    port:ocaml-lwt
}

if {${subport} ne ${name}} {
    depends_lib-append \
                    port:ocaml-tls
}

if {${subport} ne "${name}-lwt"} {
    depends_lib-append \
                    port:ocaml-ptime
}
