# -*- 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           cmake 1.1
PortGroup           github 1.0

name                tree-sitter-cli
github.setup        barracuda156 ${name}-cpp baf938ed93b1164451b26eab43d8430edc14cce4
version             0.1.1
revision            0
categories          devel textproc
license             BSD
maintainers         {@barracuda156 macos-powerpc.org:barracuda} openmaintainer
description         re-implementation of tree-sitter CLI tool in C++
long_description    Portable, non-rusty {*}${description}. Experimental at the moment.
checksums           rmd160  d6f24785fdd4a00c8092c726f0c700c698b97329 \
                    sha256  890164a8ad86ba1b4dabc3e2c1fed99f127f6ec349436bd3ada3bfc42c1033a7 \
                    size    21189
github.tarball_from archive

depends_build-append \
                    port:CLI11 \
                    port:nlohmann-json

depends_lib-append  port:libiconv \
                    port:tree-sitter

compiler.cxx_standard   2020

configure.args-append \
                    -DBUILD_PLAYGROUND=OFF \
                    -DBUILD_TESTS=ON \
                    -DICONV_PREFIX=${prefix} \
                    -DTREE_SITTER_LIBDIR=${prefix}/lib \
                    -DUSE_SYSTEM_CLI11=ON \
                    -DUSE_SYSTEM_JSON=ON \
                    -DUSE_SYSTEM_TREE_SITTER=ON

test.run            yes

variant playground description "Enable playground" {
    depends_lib-append \
                    port:cpp-httplib
    configure.args-replace \
                    -DBUILD_PLAYGROUND=OFF -DBUILD_PLAYGROUND=ON \
                    -DUSE_SYSTEM_HTTPLIB=OFF -DUSE_SYSTEM_HTTPLIB=ON
    configure.args-append \
                    -DUSE_SYSTEM_HTTPLIB=ON
}
