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

PortSystem 1.0
PortGroup  python 1.0
PortGroup  github 1.0

github.setup        glyph Automat 0.7.0 v
name                py-automat
categories-append   devel
license             MIT
platforms           darwin
maintainers         {mcalhoun @MarcusCalhoun-Lopez} openmaintainer
description         A library for concise, idiomatic Python expression of finite-state automata
long_description    Automat is a library for concise, idiomatic Python expression of finite-state automata (particularly deterministic finite-state transducers).

checksums           rmd160  6d506f71e86c5d8b8de396c975347233d57377bd \
                    sha256  cbd78b83fa2d81fe2a4d23d258e1661dd7493c9a50ee2f1a5b2cac61c1793b0e \
                    size    61461

master_sites        pypi:A/${github.project}

python.versions 27 34 35 36 37

if {${name} ne ${subport}} {

    supported_archs noarch

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

    # uses from "pkg_resources import load_entry_point"
    depends_run-append \
        port:py${python.version}-setuptools

    depends_run-append \
        port:py${python.version}-attrs     \
        port:py${python.version}-six

    # see https://pypi.python.org/pypi/Automat/
    # see https://trac.macports.org/ticket/54627
    # see https://trac.macports.org/ticket/56955
    #depends_run-append \
        #port:py${python.version}-twisted   \
        #port:py${python.version}-graphviz
    if {
        [catch {set installed [lindex [registry_active py${python.version}-twisted] 0]}] ||
        [catch {set installed [lindex [registry_active py${python.version}-graphviz] 0]}]
    } {
        notes "
${subport} requires py${python.version}-twisted and py${python.version}-graphviz to enable the visualize feature.
However, py${python.version}-twisted depends on ${subport} to run correctly.
Please install py${python.version}-twisted and py${python.version}-graphviz manually for full functionality.
"
    }

    test.run yes

    livecheck.type  none
}