# -*- 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-pywavelets
version             1.5.0
revision            0
categories-append   science math
license             MIT

python.versions     38 39 310 311 312
python.pep517_backend   meson

maintainers         {stromnov @stromnov} openmaintainer

description         PyWavelets is a Python wavelet transforms module
long_description    {*}${description}.

homepage            https://github.com/PyWavelets/pywt

checksums           md5 6af08b6f004d04d9ee3464a1ee7b7f39 \
                    rmd160 c45feb627bf1ffec3118f77f7ca3a7232b23b1ed \
                    sha256 d9e25c7cabef7ccd53f5fead26ab22152fe4cb937bad7411b5d506e2b5de38f6 \
                    size   3937269

if {${name} ne ${subport}} {
    if {${python.version} == 38} {
        version     1.4.1
        revision    1
        checksums   md5 6e487b2c3418fc0a1acf3be53bfbb0c3 \
                    rmd160 955989b2760cf43fdec3895c4046c256c0c04996 \
                    sha256 6437af3ddf083118c26d8f97ab43b0724b956c9f958e9ea788659f6a2834ba93
        python.rootname         PyWavelets
        python.pep517_backend   setuptools
        depends_build-append \
                        port:py${python.version}-cython-compat
        set compat_path [string replace ${python.pkgd} 0 [string length ${python.prefix}]-1 ${prefix}/lib/py${python.version}-cython-compat]
        build.env-append    PYTHONPATH=${compat_path}
        patchfiles      pyproject.toml-1.4.1.diff
    } else {
        patchfiles      patch-pyproject.toml.diff

        depends_build-append \
                        port:py${python.version}-cython
        # Wants to run just 'cython'
        build.env-append    PATH=${python.prefix}/bin:$::env(PATH)
    }

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

    livecheck.type      none
}
