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

github.setup        pygraphviz pygraphviz 1.7 pygraphviz-
github.tarball_from archive
revision            0
name                py-pygraphviz

categories-append   science
platforms           darwin
license             BSD
maintainers         nomaintainer

description         A Python wrapper for the Graphviz Agraph data structure.
long_description    PyGraphviz is a Python interface to the Graphviz graph layout \
                    and visualization package. With PyGraphviz you can create, edit, \
                    read, write, and draw graphs using Python to access the Graphviz \
                    graph data structure and layout algorithms. PyGraphviz is \
                    independent from NetworkX but provides a similar programming \
                    interface.

checksums           rmd160  fa1b0994db093de94b049f88cb0b2c70984c0893 \
                    sha256  9dba480cf9b13cf90e7ef43070b1c8445fb52cd7f27a305ab2b6fe0c100fd768 \
                    size    105725

python.versions     27 35 36 37 38 39

if {${name} ne ${subport}} {
    depends_build-append \
                    port:pkgconfig

    depends_lib-append \
                    port:py${python.version}-setuptools \
                    path:bin/dot:graphviz

    depends_test-append \
                    port:py${python.version}-doctest-ignore-unicode \
                    port:py${python.version}-mock \
                    port:py${python.version}-nose

    if {${python.version} == 36} {
        github.setup    pygraphviz pygraphviz 1.6 pygraphviz-
        github.tarball_from archive
        revision        0
        checksums       rmd160  22cf7a2a8aeef0bdb34a56a0570b38ae4b7f561b \
                        sha256  9b0a7d9df881c9bb1d597ac72e96227d38b432e948d753dd9df021883668fb0e \
                        size    101131
    } elseif {${python.version} in "27 35"} {
        github.setup    pygraphviz pygraphviz 1.5 pygraphviz-
        github.tarball_from archive
        revision        0
        checksums       rmd160  865d61939646f1a813fbda71e4bcf812af515aee \
                        sha256  58c3122c7efb9a62275a915953818acd5b3e113b943075501d316ab2291dc21d \
                        size    102796
    } else {
        depends_test    port:py${python.version}-pytest

        test.cmd        py.test-${python.branch}
        test.target
        test.args       --pyargs pygraphviz
    }

    pre-test {
        test.env    PYTHONPATH=[glob -nocomplain ${worksrcpath}/build/lib*]
    }

    test.run        yes

    post-destroot {
        set docdir ${prefix}/share/doc/${subport}
        xinstall -d ${destroot}${docdir}
        xinstall -m 0644 -W ${worksrcpath} INSTALL.txt LICENSE \
            README.rst ${destroot}${docdir}
    }

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