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

set _name           logcat-color

github.setup        marshall ${_name} 0.6.0 v
revision            1

name                py-${_name}
categories-append   devel
license             Apache-2
maintainers         nomaintainer
description         A colorful logcat
long_description    \
    A colorful and highly configurable alternative to the standard "adb logcat" \
    command from the Android SDK
platforms           darwin

python.versions     27

checksums           rmd160  0870039c7c99bf2d9d08a660862a8941229a80fb \
                    sha256  ff4eb54063a063e6112f291c86b8e14ab6bcbfd458cca2116405d554557f202f \
                    size    20913

if {${name} ne ${subport}} {
    post-extract {
        reinplace "s|/usr/bin/env python|${python.bin}|" ${worksrcpath}/logcat-color ${worksrcpath}/test/mock-adb
    }

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

    depends_lib-append \
                    port:py${python.version}-colorama

    depends_run-append \
                    port:${_name}_select \
                    bin:adb:android-platform-tools

    select.group    ${_name}
    select.file     ${filespath}/${_name}-${python.version}

    # Tests do not pass when stdin is not a tty, which is the case of MacPorts
    # workaround: add -nodup to command_exec in portutil.tcl
    test.run        no
    test.cmd        ${python.bin}
    test.target     test/test.py
    test.dir        ${worksrcpath}

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

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

    livecheck.type  none
} else {
    github.livecheck.regex  {([0-9.]+)}
}
