# -*- 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-pint
version             0.24.4
revision            0

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

description         Pint: a Python units library
long_description    Pint is Python module/package to define, operate and \
                    manipulate physical quantities: the product of a numerical \
                    value and a unit of measurement.  It allows arithmetic \
                    operations between them and conversions from and to \
                    different units.

homepage            https://pint.readthedocs.org/

checksums           rmd160  2509a1e263a5181b88ed1d17fef5946e5e3366a6 \
                    sha256  35275439b574837a6cd3020a5a4a73645eb125ce4152a73a2f126bf164b91b80 \
                    size    342225

python.versions     38 39 310 311 312 313

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

    depends_lib-append \
                    port:py${python.version}-appdirs \
                    port:py${python.version}-flexcache \
                    port:py${python.version}-flexparser \
                    port:py${python.version}-packaging

    test.run        yes

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

    if {${python.version} < 39} {
        version     0.23
        revision    0
        epoch       1

        checksums   rmd160  e5f5e0b619ed5140fa6e38f302eaf3ff95b68bdf \
                    sha256  e1509b91606dbc52527c600a4ef74ffac12fff70688aff20e9072409346ec9b4 \
                    size    347420

        depends_lib-delete  \
                    port:py${python.version}-appdirs \
                    port:py${python.version}-flexcache \
                    port:py${python.version}-flexparser
    }
}
