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

name                commitizen
version             2.42.1
revision            0
categories-prepend  devel
license             MIT
supported_archs     noarch
platforms           {darwin any}

python.default_version \
                    310

maintainers         {@harens harens} openmaintainer

description         Create committing rules for projects, auto bump versions, \
                    and auto changelog generation
long_description    Commitizen is a tool designed for teams. Its main purpose is to \
                    define a standard way of committing rules and communicating it. \
                    The reasoning behind it is that it is easier to read, and enforces \
                    writing descriptive commits.

homepage            https://${name}-tools.github.io/${name}/

checksums           rmd160  b692f64dfe1387a2bbe802398c53ffd5c3f0fa94 \
                    sha256  eac18c7c65587061aac6829534907aeb208405b8230bfd35ec08503c228a7f17 \
                    size    37650

depends_build-append \
    port:py${python.version}-setuptools

depends_run-append \
    port:py${python.version}-chardet \
    port:py${python.version}-colorama \
    port:py${python.version}-decli \
    port:py${python.version}-jinja2 \
    port:py${python.version}-packaging \
    port:py${python.version}-questionary \
    port:py${python.version}-termcolor \
    port:py${python.version}-tomlkit \
    port:py${python.version}-typing_extensions \
    port:py${python.version}-yaml

default_variants    +bash_completion

variant bash_completion {
    depends_lib-append      port:py${python.version}-argcomplete
    depends_run-append      path:etc/bash_completion:bash-completion

    post-destroot {
        set bash-completions ${prefix}/share/bash-completion/completions
        xinstall -d -m 0755 ${destroot}${bash-completions}
        foreach cmd [list cz git-cz] {
            system "register-python-argcomplete-${python.branch} ${cmd} > ${destroot}${bash-completions}/${cmd}"
        }
    }
}
