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

name                py-grako
version             3.99.9
revision            0
categories-append   devel textproc
platforms           darwin
license             BSD

python.versions     27 35 36

maintainers         {stromnov @stromnov} openmaintainer

description         Tool that takes grammars in a variation of EBNF as input, and outputs memoizing PEG parsers in Python.
long_description    ${description}

homepage            http://bitbucket.org/apalala/grako
master_sites        pypi:[string index ${python.rootname} 0]/${python.rootname}

use_zip             yes

distname            ${python.rootname}-${version}

checksums           rmd160  151edb61fd019d98734cf959b1ea28178fce3ba8 \
                    sha256  fcc37309eab7cd0cbbb26cfd6a54303fbb80a00a58ab295d1e665bc69189c364

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

    # Fix permissions
    post-extract {
        fs-traverse item ${worksrcpath} {
            if {[file isdirectory ${item}]} {
                file attributes ${item} -permissions a+rx
            } elseif {[file isfile ${item}]} {
                file attributes ${item} -permissions a+r
            }
        }
    }

    livecheck.type      none
}