# -*- 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-soxr
version             0.5.0.post1
revision            0

categories-append   audio
license             LGPL-2.1+
maintainers         nomaintainer

description         High quality, one-dimensional sample-rate conversion library for Python
long_description    {*}${description}

homepage            https://github.com/dofuuz/python-soxr

checksums           rmd160  9ce74efc3b189b7d8d5b10a69cfbf1fb87795015 \
                    sha256  7092b9f3e8a416044e1fa138c8172520757179763b85dc53aa9504f4813cff73 \
                    size    170853

python.versions     39 310 311 312 313

if {${name} ne ${subport}} {
    depends_build-append \
                    port:py${python.version}-nanobind \
                    port:py${python.version}-scikit-build-core \
                    port:py${python.version}-setuptools_scm

    if {${python.version} < 311} {
        depends_build-append \
                    port:py${python.version}-typing_extensions
    }

    depends_run-append \
                    port:py${python.version}-numpy

    test.run        yes

    post-patch {
        reinplace "s|oldest-supported-numpy|numpy|" ${worksrcpath}/pyproject.toml
    }

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