# -*- 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        aflc editdistance 0.5.3 v
revision            0
name                py-${github.project}

categories-append   textproc
platforms           darwin
license             MIT
maintainers         nomaintainer

description         Fast implementation of the edit distance (Levenshtein distance).
long_description    ${description} This library simply implements \
                    Levenshtein distance with C++ and Cython. The \
                    algorithm used in this library is proposed by \
                    Heikki Hyyrö, \"Explaining and extending the \
                    bit-parallel approximate string matching algorithm \
                    of Myers\", (2001).

checksums           rmd160  419f914fe6b8102e6e15367ab7928c6cf62914da \
                    sha256  559ff7b31eba37b7ae954eb59ef939cad074d155487e1f70d5459eae147d2102 \
                    size    27993

python.versions     37 38 39

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

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

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

    test.run        yes
    test.env        PYTHONPATH=${worksrcpath}/build/lib
    test.cmd        ${python.bin}
    test.target     test/test_${github.project}.py

    livecheck.type  none
}
