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

name                git-cola
# https://github.com/git-cola/git-cola/issues/1477
github.setup        ${name} ${name} 3.12.0 v
revision            1
categories-prepend  devel
platforms           {darwin any}
maintainers         nomaintainer
license             GPL-2+
description         The highly caffeinated Git GUI
long_description    ${name} is a powerful Git GUI with a slick \
                    and intuitive user interface.
homepage            https://git-cola.github.io
checksums           rmd160  0db530a4f66ce4f6188703f45e7111f65375a156 \
                    sha256  ec1167ea9a472214bf18f5537d96e137c724f3d28a85b3642f07dba35f04b24a \
                    size    1004892
github.tarball_from archive
supported_archs     noarch

# Do not move this up from python310.
python.default_version 312

depends_build-append \
                    port:py${python.version}-setuptools_scm \
                    port:py${python.version}-toml \
                    port:py${python.version}-wheel
depends_lib-append  path:bin/git:git \
                    port:py${python.version}-pyqt4 \
                    port:py${python.version}-qt4py
depends_run-append  port:desktop-file-utils

patchfiles-append   patch-pyqt-version.diff

build.env-append    GIT_COLA_NO_VENDOR_LIBS=1

post-destroot {
    xinstall -d ${destroot}${prefix}/share/bash-completion/completions
    xinstall -m 644 ${worksrcpath}/contrib/git-cola-completion.bash ${destroot}${prefix}/share/bash-completion/completions/${name}
}

post-activate {
    system "${prefix}/bin/update-desktop-database ${prefix}/share/applications"
}

notes "\
    If you want to use bash-completion for git-cola, you have to source\
    the completion files from your ~/.bashrc as it extends the git command\
    completion and cannot be loaded automatically:

      source ${prefix}/share/bash-completion/completions/git
      source ${prefix}/share/bash-completion/completions/git-cola
"
