# -*- 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-pyzstd
version             0.20.0
revision            0

platforms           {darwin any}
supported_archs     noarch
license             BSD
maintainers         nomaintainer

description         Python bindings to Zstandard (zstd) compression library, the API is similar to Python's bz2/lzma/zlib module.
long_description    ${description}

homepage            https://github.com/Rogdham/pyzstd

checksums           rmd160  dfe15da5e81dd76541cea27aeecf63d892b648fe \
                    sha256  f6647f7e7026970551f97cafa2340f88b42cb25d0fcffcc3cd93dd78e5f27504 \
                    size    71001

python.versions     311 312 313 314 315

if {${name} ne ${subport}} {
    # https://github.com/Rogdham/pyzstd/issues/22
    if {[string match *gcc-4.* ${configure.compiler}]} {
        patchfiles-append \
                    patch-no-flto.diff
    }

    python.pep517_backend hatch

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

    test.run        yes
}
