# -*- 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        indygreg python-zstandard 0.23.0
github.tarball_from archive
name                py-zstd

license             BSD
maintainers         nomaintainer

description         Zstandard compression
long_description    This extension allows Zstandard compression from Python

homepage            https://github.com/indygreg/python-zstandard

checksums           rmd160  0786feb7ed354610226b4679248b194005353639 \
                    sha256  f29233338bcef11f233737eb58aba85074f0fd3163bec1a20303de1270e6fb16 \
                    size    732448

python.versions     38 39 310 311 312 313
python.pep517_backend \
                    poetry

patchfiles-append   patch-pyproject.toml.diff

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

    depends_lib-append \
                    port:zstd

    configure.args-append \
                    --install-option="--system-zstd"

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