# -*- 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-nmrglue
version             0.11
revision            0

categories-append   science
platforms           {darwin any}
supported_archs     noarch
license             BSD
maintainers         {reneeotten @reneeotten} openmaintainer

description         A module for working with NMR data in Python
long_description    nmrglue is a module for working with NMR data in Python. \
                    When used with the Numpy, Scipy, and matplotlib packages \
                    nmrglue provides a robust interpreted environment for processing, \
                    analysing, and inspecting NMR data.

homepage            https://nmrglue.com

checksums           rmd160  d3d361f1ca9f62ddf497f91c0d38f635f7037aec \
                    sha256  9e740a02d34ce5df9eb0390274c6a5f37b4837d59139512a3dd169106a8e3fe1 \
                    size    205874

python.versions     39 310 311 312 313

conflicts           ${subport}-devel

foreach pver [list {*}${python.versions} ""] {
    subport py${pver}-nmrglue-devel {
        PortGroup       github 1.0

        github.setup    jjhelmus nmrglue 32df8629234b269a593
        # Change github.tarball_from to 'releases' or 'archive' next update
        github.tarball_from tarball
        version         20241029-[string range ${github.version} 0 7]
        revision        0
        checksums       rmd160  b074dc434af54dcaf2b78fbb07ce83c78b756d50 \
                        sha256  e680e7095ea2bff03244d2ec97d8c5a6be4fa01e816c17f33a9ce1a9ba5dabe4 \
                        size    14921719

        conflicts       py${pver}-nmrglue

        if {${pver} ne ""} {
            livecheck.type  none
        } else {
            PortGroup   stub 1.0
        }
    }
}

if {${subport} ni [list ${name} ${name}-devel]} {
    depends_lib-append \
                    port:py${python.version}-numpy \
                    port:py${python.version}-scipy

    test.run        yes
    test.args       --pyargs nmrglue

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