# -*- 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        python-hyper brotlipy 0.7.0 v
revision            1
name                py-brotlipy
platforms           darwin
license             MIT
maintainers         nomaintainer

description         Python binding to the Brotli library
long_description    ${description}

fetch.type          git

python.versions     27 36 37 38 39

if {${name} ne ${subport}} {
    post-fetch {
        system -W ${worksrcpath} "git submodule update --init"
    }

    patchfiles      patch-test_simple_compression.py.diff

    depends_build-append \
                        port:py${python.version}-setuptools

    depends_lib-append  port:py${python.version}-cffi

    if {${python.version} < 34} {
        depends_lib-append  port:py${python.version}-enum34
    }

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

    pre-test {
        test.env        PYTHONPATH=[glob -nocomplain ${worksrcpath}/build/lib*]
    }
    test.run            yes
    test.cmd            py.test-${python.branch}
    test.target         test

    livecheck.type      none
} else {
    livecheck.type      pypi
}
