# -*- 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-blosc2
version             4.0.0
revision            0

categories-append   archivers devel
maintainers         nomaintainer
license             BSD

description         Python wrapper for Blosc2
long_description    A Python wrapper for the extremely fast Blosc2 \
                    compression library

homepage            https://pypi.python.org/pypi/blosc2/

checksums           md5 437877d72187cf67239fedb2968097a5 \
                    rmd160 6393a9a853c99b0c717b8ebff37c15a2e81fbfe7 \
                    sha256 aa28272fab4ba23b82396759bd05b6f99ac51a37388abef290e901cb071caf1c

python.versions     310 311 312 313 314

# uses cmake via scikit-build-core
python.pep517_backend

if {$subport ne $name} {
    depends_build-append \
                        port:py${python.version}-scikit-build-core \
                        port:py${python.version}-cython \
                        port:py${python.version}-oldest-supported-numpy \
                        path:bin/pkg-config:pkgconfig

    depends_lib-append  port:blosc2 \
                        port:py${python.version}-msgpack \
                        port:py${python.version}-ndindex \
                        port:py${python.version}-numexpr \
                        port:py${python.version}-numpy \
                        port:py${python.version}-requests

    build.args-append   -Cbuild.verbose=true
    build.env-append    USE_SYSTEM_BLOSC2=1

    pre-build {
        build.env-append    ARCHFLAGS=[get_canonical_archflags cc]
    }

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