diff --git a/python/py-gmpy2/Portfile b/python/py-gmpy2/Portfile index b5a9ed845180..8a1a7213bdee 100644 --- a/python/py-gmpy2/Portfile +++ b/python/py-gmpy2/Portfile @@ -26,6 +26,9 @@ python.versions 38 39 310 311 312 if {${name} ne ${subport}} { 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 + post-destroot { xinstall -m 0644 -W ${worksrcpath} README.rst \ ${destroot}${prefix}/share/doc/${subport} diff --git a/python/py-gmpy2/files/patch-c99.diff b/python/py-gmpy2/files/patch-c99.diff new file mode 100644 index 000000000000..ef13b9e00b0b --- /dev/null +++ b/python/py-gmpy2/files/patch-c99.diff @@ -0,0 +1,10 @@ +--- setup.py 2024-03-24 02:01:15.000000000 +0800 ++++ setup.py 2024-07-16 19:44:11.000000000 +0800 +@@ -6,6 +6,7 @@ + + ON_WINDOWS = platform.system() == 'Windows' + _comp_args = ["DSHARED=1"] ++_comp_args.append('std=c99') + sources = ['src/gmpy2.c'] + if os.getenv('CIBUILDWHEEL'): + include_dirs = [os.path.join(os.path.dirname(__file__), '.local', 'include')]