# -*- 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-gmpy2
epoch               1
version             2.3.1
maintainers         {@mndavidoff alluvialsw.com:md14-macports} openmaintainer
license             LGPL-2.1+
description         General multiple precision arithmetic module for Python
long_description \
    GMPY2 is a C-coded Python extension module that supports fast \
    multiple-precision arithmetic.  GMPY2 supports integer and \
    rational arithmetic (using the GMP library), correctly rounded \
    multiple-precision real arithmetic (using the MPFR library), \
    and complex arithmetic (using the MPC library).

homepage            https://github.com/gmpy2/gmpy2
checksums           rmd160  91fcbdb99e54c901ef00176e5f62d8e558bd5af2 \
                    sha256  313f35e9fe6b9ddf72759b14dac25166fe5757c970403e4bbf87a70ab2be07df \
                    size    301480

python.versions     310 311 312 313 314

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

    depends_lib-append  port:gmp port:libmpc port:mpfr

    # gmpy2_convert_gmp.c: error: ‘for’ loop initial declaration used outside C99 mode
    patchfiles-append   patch-c99.diff
    patchfiles-append   patch-pyproject.toml.diff

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