# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=Portfile:et:sw=4:ts=4:sts=4

PortSystem          1.0
PortGroup           python 1.0
PortGroup           select 1.0

name                py-tmuxp
version             1.7.2
revision            0
categories-append   devel
license             MIT
platforms           darwin
supported_archs     noarch

maintainers         {@egorenar posteo.net:egorenar-dev} \
                    {@judaew outlook.de:judaew} openmaintainer

description         tmux session manager.
long_description    ${description}

homepage            https://github.com/tmux-python/tmuxp/
master_sites        pypi:t/${python.rootname}/
distname            ${python.rootname}-${version}
python.versions     27 36 37 38 39

if {${name} ne ${subport}} {
    depends_build-append    port:py${python.version}-setuptools
    depends_lib-append      port:py${python.version}-click \
                            port:py${python.version}-colorama \
                            port:py${python.version}-kaptan \
                            port:py${python.version}-libtmux
    depends_run             port:tmuxp_select

    checksums           rmd160  6835ae507e62a909481b024aa7846922f30c64f7 \
                        sha256  14296b62db260420d4600dcd805408ea908b3a78d4ea0a6a403d092fdbf6d075 \
                        size    91621

    select.group        tmuxp
    select.file         ${worksrcpath}/py${python.version}-tmuxp

    post-extract {
        copy -force ${filespath}/tmuxp ${worksrcpath}/py${python.version}-tmuxp
    }

    post-patch {
        reinplace \
            "s,@PYTHON_BRANCH@,${python.branch},g" \
             ${worksrcpath}/${subport}
    }

    notes "
To make the Python ${python.branch} version of tmuxp the one that is run when\
you execute the commands without a version suffix, e.g. 'tmuxp', run:

port select --set ${select.group} [file tail ${select.file}]
"

    livecheck.type      none
} else {
    livecheck.type  pypi
}
