# -*- 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-lz4
version             2.2.1
revision            0

platforms           darwin
supported_archs     noarch
license             BSD
maintainers         nomaintainer

description         LZ4 bindings for Python
long_description    ${description}

homepage            https://github.com/python-lz4/python-lz4
master_sites        pypi:l/lz4/
distname            lz4-${version}

checksums           rmd160  5c5e3e2087e99cbbcbf925b0e724204333893090 \
                    sha256  b666e2d04648f656b6af7d863bc7e50bd72bc00c5c569f89ead010c29c5facb4 \
                    size    141841

python.versions     27 35 36 37 38 39

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

    depends_lib-append \
                    port:lz4

    if {${python.version} eq 27} {
        depends_lib-append \
                    port:py${python.version}-future
    }

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

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

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

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

    livecheck.type  none
}
