# -*- 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-marisa-trie
version             0.7.5
revision            0
categories-append   devel
platforms           darwin
license             LGPL

python.versions     27 35 36 37 38

maintainers         {stromnov @stromnov} openmaintainer

description         Static memory-efficient & fast Trie structures for Python (based on marisa-trie C++ library)
long_description    ${description}

homepage            https://github.com/kmike/marisa-trie
master_sites        pypi:[string index ${python.rootname} 0]/${python.rootname}

distname            marisa-trie-${version}

checksums           rmd160  f0c254b37abf122c0b397d3a8954011eac2c5b51 \
                    sha256  c73bc25d868e8c4ea7aa7f1e19892db07bba2463351269b05340ccfa06eb2baf \
                    size    270581

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

    post-patch {
        reinplace "s|setup_requires=\\\[\"pytest-runner\"\\\]|setup_requires=\\\[\\\]|" ${worksrcpath}/setup.py
    }

    depends_test-append \
                    port:py${python.version}-pytest

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

    test.run        yes
    test.cmd        py.test-${python.branch}
    test.target

    livecheck.type      none
}
