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

github.setup        google yapf 0.31.0 v
github.tarball_from archive
revision            0
name                py-yapf

categories-append   devel
platforms           darwin
supported_archs     noarch
license             Apache-2
maintainers         {reneeotten @reneeotten} openmaintainer

description         A formatter for Python files
long_description    YAPF is based off of 'clang-format', developed by Daniel Jasper.

checksums           rmd160  df6cf26337dc45cd8cab1895c4df5b93b02382ab \
                    sha256  e6330f89f024615b102f3140e50a1b864196c4d9d8e29ace4eaa234feec4c924 \
                    size    176856

python.versions     27 35 36 37 38 39

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

    depends_run-append \
                    port:yapf_select

    test.run        yes

    post-destroot {
        set docdir ${prefix}/share/doc/${subport}
        xinstall -d ${destroot}${docdir}
        xinstall -m 0644 -W ${worksrcpath} AUTHORS CHANGELOG \
            CONTRIBUTING.rst CONTRIBUTORS HACKING.rst \
            LICENSE README.rst ${destroot}${docdir}
    }

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

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

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

    livecheck.type  none
}
