# -*- 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
PortGroup           select 1.0
PortGroup           github 1.0

github.setup        rocky python2-trepan 0.8.8 release-
name                py-trepan
revision            0

categories-append   devel
platforms           darwin
supported_archs     noarch
license             GPL-3+
maintainers         nomaintainer

description         GDB-like Python Debugger in the Trepan family
long_description    This is a gdb-like debugger for Python. It is a rewrite of pdb \
                    from the ground up. A command-line interface (CLI) is provided \
                    as well as an remote access interface over TCP/IP.

checksums           rmd160  3226cd794ae6cf07ea46c535ffe0042228b04c0c \
                    sha256  dd83340ab2d41c9175a6657739ec7d626677ad87345d32fd556fa6280bb58fc3 \
                    size    279724

python.versions     27

if {${subport} ne ${name}} {
    depends_lib-append \
                    port:py${python.version}-setuptools

    depends_run-append \
                    port:py${python.version}-columnize \
                    port:py${python.version}-import_relative \
                    port:py${python.version}-nose \
                    port:py${python.version}-pyficache \
                    port:py${python.version}-pygments \
                    port:py${python.version}-spark_parser \
                    port:py${python.version}-tracer \
                    port:py${python.version}-uncompyle6 \
                    port:py${python.version}-unittest2 \
                    port:py${python.version}-xdis \
                    port:trepan2_select

    post-patch {
        # relax pygments versioning cap
        reinplace {s|pygments == 2\.0\.0|pygments|g} ${worksrcpath}/__pkginfo__.py
        # relax nose versioning cap
        reinplace {s|1\.3\.4|1.4|g} ${worksrcpath}/__pkginfo__.py
        # pick valid colors for pygments
        reinplace "s|darkgray|gray|g" ${worksrcpath}/trepan/lib/format.py
        reinplace "s|turquoise|cyan|g" ${worksrcpath}/trepan/lib/format.py
        reinplace "s|darkblue|blue|g" ${worksrcpath}/trepan/lib/format.py
    }

    select.group    trepan2
    select.file     ${filespath}/trepan${python.version}

    test.run        yes
    test.env        PYTHONPATH=${worksrcpath}/build/lib

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

sudo port select --set ${select.group} [file tail ${select.file}]
"
    livecheck.type  none
}
