# -*- 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        ocsigen lwt 6.1.0
revision            2

name                ocaml-lwt
categories          ocaml devel
maintainers         {landonf @landonf} openmaintainer
license             MIT
description         Promises and event-driven I/O for OCaml
long_description    Lwt provides typed, composable promises for OCaml, \
                    with support for parallel resolution.

homepage            https://github.com/ocsigen/lwt

depends_build-append \
                    port:ocaml-cppo
depends_lib-append  port:ocaml-dune-configurator \
                    port:ocaml-findlib \
                    port:ocaml-ocplib-endian

checksums           rmd160  99f59823f22a1eb1fb68426342c00f86a2b9f192 \
                    sha256  197ff76a70971a41b9b1d678aa4e9310db8beda4b0c9d88bb11701be5fc8c06d \
                    size    326145
github.tarball_from archive

ocaml.build_type    dune

# Only the main lwt builds the C unix stubs that conflict with OCaml 5.5's
# caml_unix_get_sockaddr macro (backport of upstream ocsigen/lwt#1100).
if {${subport} eq ${name}} {
    patchfiles-append   patch-ocaml55-get_sockaddr.diff
}

subport ${name}_ppx {
    revision        1

    depends_lib-append \
                    port:${name} \
                    port:ocaml-ppxlib
}

subport ${name}_react {
    version         1.2.0
    revision        1
    description     Helpers for using React with Lwt

    depends_lib-append \
                    port:${name} \
                    port:ocaml-react
}
