From 0a857847304727f8b3e1ffd79ab7980efac6955d Mon Sep 17 00:00:00 2001 From: Sergey Fedorov Date: Tue, 16 Jul 2024 19:48:20 +0800 Subject: [PATCH] py-gmpy2: use c99 --- python/py-gmpy2/Portfile | 3 +++ python/py-gmpy2/files/patch-c99.diff | 10 ++++++++++ 2 files changed, 13 insertions(+) create mode 100644 python/py-gmpy2/files/patch-c99.diff diff --git a/python/py-gmpy2/Portfile b/python/py-gmpy2/Portfile index b5a9ed8451801..8a1a7213bdeee 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 0000000000000..ef13b9e00b0bf --- /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')]