# -*- 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-aws-s3
github.setup        andersfugmann aws-s3 4.8.1
revision            2
categories          ocaml net
maintainers         {@barracuda156 macos-powerpc.org:barracuda} openmaintainer
license             BSD
description         OCaml library for accessing Amazon S3
long_description    {*}${description}
use_bzip2           yes
extract.suffix      .tbz
distname            aws-s3-${version}
checksums           rmd160  f0205de345c3b24c8ccbeafc16c976b47f4cfef1 \
                    sha256  2658ea176ba9fec42f885d9a8f0d2e652ec945945cf9dc5c40807ebafed09464 \
                    size    34052
github.tarball_from releases

depends_lib-append  port:ocaml-base64 \
                    port:ocaml-cmdliner \
                    port:ocaml-digestif \
                    port:ocaml-ezxmlm \
                    port:ocaml-inifiles2 \
                    port:ocaml-ppx_protocol_conv_json \
                    port:ocaml-ppx_protocol_conv_xmlm \
                    port:ocaml-ptime \
                    port:ocaml-uri \
                    port:ocaml-yojson

ocaml.build_type    dune

subport ${name}-async {
    long_description \
                    {*}${description}. Async version.

    depends_lib     port:ocaml-async_kernel \
                    port:ocaml-async_unix \
                    port:ocaml-aws-s3 \
                    port:ocaml-conduit-async \
                    port:ocaml-core \
                    port:ocaml-core_unix
}

subport ${name}-lwt {
    long_description \
                    {*}${description}. Lwt version.

    depends_lib     port:ocaml-aws-s3 \
                    port:ocaml-conduit-lwt-unix \
                    port:ocaml-lwt
}

# https://github.com/andersfugmann/aws-s3/issues/42
if {${subport} eq ${name}} {
    notes "
       Executable is installed by ${name}-async or ${name}-lwt subports.
    "
}
