# -*- 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-imagecodecs
version             2026.6.26
revision            1
epoch               1

categories-append   graphics
license             BSD
maintainers         {mps @Schamschula} openmaintainer

description         Image transformation, compression, and decompression codecs
long_description    {*}${description}

homepage            https://github.com/cgohlke/imagecodecs/

checksums           rmd160  6e1faef61deeb05fd4e3b96fb8a910f1d9233e4d \
                    sha256  da95b145f6b4f746acc9e0b8707b164eefc6a36ade3b6e70f74d102e9affad8c \
                    size    9669990

python.versions     310 311 312 313 314

if {${name} ne ${subport}} {
    platforms {darwin >= 17}

    depends_build-append \
                    path:bin/cython-${python.branch}:py${python.version}-cython

    depends_lib-append \
                    port:blosc \
                    port:brotli \
                    port:brunsli \
                    port:bzip2 \
                    port:cfitsio \
                    port:charls \
                    port:giflib5 \
                    port:libaec \
                    port:libjpeg-turbo \
                    port:libjxl \
                    port:openjpeg \
                    port:py${python.version}-numpy \
                    port:py${python.version}-pyobjc \
                    port:snappy \
                    port:tiff \
                    port:webp \
                    port:zopfli \
                    port:zstd

    patchfiles      patch-setup.py.diff

    post-patch {
        reinplace "s|%PREFIX%|${prefix}|g" ${worksrcpath}/setup.py
    }
}
