# -*- 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        tmcgilchrist ocaml-gitlab 0.1.8
revision            2
categories          ocaml devel
maintainers         {@barracuda156 macos-powerpc.org:barracuda} openmaintainer
license             BSD
description         Native OCaml bindings to Gitlab REST API v4
long_description    {*}${description}
use_bzip2           yes
extract.suffix      .tbz
distname            gitlab-${version}
checksums           rmd160  1e89b06a544451f14b58f9db50987011876712e8 \
                    sha256  06e430f4ab919c3417374d9628ce7ebfd49b6a901129a6e6fa1cdd53c2daae42 \
                    size    84116
github.tarball_from releases

# https://github.com/tmcgilchrist/ocaml-gitlab/issues/100
patchfiles          patch-find-atdgen.diff

# This must be depends_lib-append port:ocaml-yojson
# but it is broken until this gets addressed:
# https://github.com/ahrefs/atd/issues/431
# https://github.com/tmcgilchrist/ocaml-gitlab/issues/101
depends_build-append \
                    port:ocaml-yojson2

depends_lib-append  port:ocaml-atdgen \
                    port:ocaml-cohttp-lwt \
                    port:ocaml-ISO8601 \
                    port:ocaml-stringext \
                    port:ocaml-uri

ocaml.build_type    dune

# What about 32-bit archs?
# https://github.com/tmcgilchrist/ocaml-gitlab/issues/99
subport ${name}-unix {
    description     GitLab APIv4 OCaml library

    depends_lib     port:ocaml-cmdliner \
                    port:ocaml-cohttp \
                    port:ocaml-cohttp-lwt-unix \
                    port:ocaml-gitlab \
                    port:ocaml-lwt \
                    port:ocaml-tls \
                    port:ocaml-stringext
}

subport ocaml-lab {
    description     GitLab CLI

    depends_lib     port:ocaml-cmdliner \
                    port:ocaml-cohttp-lwt-unix \
                    port:ocaml-gitlab-unix \
                    port:ocaml-fmt \
                    port:ocaml-otoml
}
