# -*- 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

name                ocaml-httpun
github.setup        anmonteiro httpun 0.2.0
revision            2
categories          ocaml devel
maintainers         {@barracuda156 macos-powerpc.org:barracuda} openmaintainer
license             BSD
description         Lock-free thread-safe integer keyed hash table
long_description    {*}${description}
use_bzip2           yes
extract.suffix      .tbz
distname            httpun-${version}
checksums           rmd160  5cf7d05abf5baf516e7ce112b264aa3b1149c0a7 \
                    sha256  a2ce27ef4c85ae8e1c1008d1e3d5e893d6b211b934586a1dd2942f7db687bd2c \
                    size    206368
github.tarball_from releases

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

ocaml.build_type    dune

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

subport ${name}-types {
    description     Common HTTP/1.x types

    depends_lib     port:ocaml-faraday
}

subport ${name}-ws {
    github.setup    anmonteiro httpun-ws 0.2.0
    revision        2
    checksums       rmd160  6ddca56eab4c2eec1b5443ed897a229934648051 \
                    sha256  eae0cd2e0eb5b4fc9cb6d862b7116a6f0fc8503b2e439046bf0e6f4cb2c297fd \
                    size    25410
    description     Websocket implementation for httpun

    depends_lib     port:ocaml-angstrom \
                    port:ocaml-base64 \
                    port:ocaml-bigstringaf \
                    port:ocaml-faraday \
                    port:ocaml-gluten \
                    port:ocaml-httpun
}
