# -*- 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           golang 1.0

go.setup            gitea.com/gitea/tea 0.15.1 v
go.package          code.gitea.io/tea
go.offline_build    no
go.toolchain_min    1.26
name                gitea-tea
revision            0

homepage            https://code.gitea.io/tea

description         A command line tool to interact with Gitea servers

long_description    {*}${description}. tea is the official CLI for Gitea. \
                    It can be used to manage most entities on one or multiple \
                    Gitea instances and provides local helpers like \'tea \
                    pull checkout\'. tea makes use of context provided by \
                    the repository in \$PWD if available, but is still usable \
                    independently of \$PWD.

categories          devel
installs_libs       no
license             MIT
maintainers         {gmail.com:herby.gillot @herbygillot} \
                    openmaintainer

checksums           rmd160  d5887447765734c450ec5042042b059e6b102a8f \
                    sha256  e242dd3589c31a36320d75e0de9eefa3fa429bd9b0af89d35af8585c7f514b9c \
                    size    843088

build.cmd           make
build.pre_args      TEA_VERSION=${version} \
                    SDK=v1.2.0
build.target        build

use_parallel_build  no

destroot {
    xinstall -m 0755 ${worksrcpath}/tea ${destroot}${prefix}/bin/

    set zsh_comp_dir ${prefix}/share/zsh/site-functions
    xinstall -d ${destroot}/${zsh_comp_dir}
    xinstall -m 0644 ${worksrcpath}/contrib/autocomplete.zsh \
        ${destroot}${zsh_comp_dir}/_tea

    set bash_comp_dir ${prefix}/share/bash-completion/completions
    xinstall -d ${destroot}${bash_comp_dir}
    xinstall -m 0644 ${worksrcpath}/contrib/autocomplete.sh \
        ${destroot}${bash_comp_dir}/tea
}
