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

# Custom name due to: https://github.com/sociomantic-tsunami/git-hub/issues/317
name                git-hub-py
github.setup        sociomantic-tsunami git-hub 2.1.3 v
revision            0
categories          devel
platforms           any
maintainers         {@barracuda156 macos-powerpc.org:barracuda} openmaintainer
license             GPL-3

conflicts           git-hub

description         Git command line interface to GitHub
long_description    {*}${description}

checksums           rmd160  445c882dd8e55c439e03c448292a79da58fbe7b9 \
                    sha256  870a79ebeea96122e2fdd3a6fdbf9066b956ed998b35b033b0ca57284f7c52a6 \
                    size    50578
github.tarball_from archive
supported_archs     noarch

# https://github.com/sociomantic-tsunami/git-hub/issues/318
# https://github.com/sociomantic-tsunami/git-hub/issues/319
patchfiles          patch-Makefile.diff

use_configure       no

set py_ver          3.13
set py_ver_nodot    [string map {. {}} ${py_ver}]

configure.python    ${prefix}/bin/python${py_ver}

depends_build-append \
                    port:gsed \
                    port:py${py_ver_nodot}-docutils
depends_lib-append  port:python${py_ver_nodot}
depends_run-append  port:bash-completion \
                    path:bin/git:git

build.args          prefix=${prefix} \
                    PYTHON=${configure.python} \
                    RST2MAN=${prefix}/bin/rst2man-${py_ver} \
                    SED=${prefix}/bin/gsed \
                    sysconfdir=${prefix}/etc

destroot.args       DESTDIR=${destroot} \
                    prefix=${prefix} \
                    PYTHON=${configure.python} \
                    SED=${prefix}/bin/gsed \
                    sysconfdir=${prefix}/etc

pre-destroot {
    xinstall -d ${destroot}${prefix}/etc/bash_completion.d
    xinstall -d ${destroot}${prefix}/share/doc/git-hub
    xinstall -d ${destroot}${prefix}/share/vim/addons/ftdetect
}
