# -*- 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-atd
github.setup        ahrefs atd 4.0.0
revision            1
categories          ocaml devel
maintainers         {@barracuda156 macos-powerpc.org:barracuda} openmaintainer
license             ISC
description         Parser for the ATD data format description language
long_description    {*}${description}
use_bzip2           yes
extract.suffix      .tbz
distname            atd-${version}
checksums           rmd160  007f4f7ccb681ff3eb3877ce54473754dea2de4e \
                    sha256  3514fe4dc4e788640b3e9a9fec3b5b106e6f609b59d28522701de1bd2ea909f1 \
                    size    3352408
github.tarball_from releases

depends_lib-append  port:ocaml-yojson

if {${subport} eq ${name}} {
    depends_lib-append \
                    port:ocaml-cmdliner \
                    port:ocaml-easy-format \
                    port:ocaml-menhir \
                    port:ocaml-re
}

ocaml.build_type    dune

subport ocaml-atdgen {
    description     Generates efficient JSON serializers, deserializers and validators

    depends_lib-append \
                    port:ocaml-atd \
                    port:ocaml-atdgen-runtime \
                    port:ocaml-re
}

subport ocaml-atdgen-runtime {
    description     Runtime library for code generated by atdgen
}

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