git: 2d8caada99d8 - main - math/py-numpy: Fix build of dependent ports with swig 4.4.0+
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 02 Dec 2025 12:21:06 UTC
The branch main has been updated by sunpoet:
URL: https://cgit.FreeBSD.org/ports/commit/?id=2d8caada99d84ae2f801e198afbeadbcf901ca14
commit 2d8caada99d84ae2f801e198afbeadbcf901ca14
Author: Po-Chuan Hsieh <sunpoet@FreeBSD.org>
AuthorDate: 2025-12-02 12:10:42 +0000
Commit: Po-Chuan Hsieh <sunpoet@FreeBSD.org>
CommitDate: 2025-12-02 12:17:55 +0000
math/py-numpy: Fix build of dependent ports with swig 4.4.0+
- Bump PORTREVISION for package change
It fixes the build for at least the following dependent ports:
- math/py-faiss
- math/py-nlopt
- math/py-scikit-umfpack
Reference: https://github.com/numpy/numpy/commit/1e424dae42a2d560520b6e053e8e60ac4205bfc7
---
math/py-numpy/Makefile | 2 +-
math/py-numpy/files/patch-swig44 | 19 +++++++++++++++++++
2 files changed, 20 insertions(+), 1 deletion(-)
diff --git a/math/py-numpy/Makefile b/math/py-numpy/Makefile
index fce6242f50ce..41f8534259b0 100644
--- a/math/py-numpy/Makefile
+++ b/math/py-numpy/Makefile
@@ -1,6 +1,6 @@
PORTNAME= numpy
PORTVERSION= 1.26.4
-PORTREVISION= 10
+PORTREVISION= 11
PORTEPOCH= 1
CATEGORIES= math python
MASTER_SITES= PYPI \
diff --git a/math/py-numpy/files/patch-swig44 b/math/py-numpy/files/patch-swig44
new file mode 100644
index 000000000000..4b0cd4694c85
--- /dev/null
+++ b/math/py-numpy/files/patch-swig44
@@ -0,0 +1,19 @@
+Reference: https://github.com/numpy/numpy/commit/1e424dae42a2d560520b6e053e8e60ac4205bfc7
+
+--- numpy/core/code_generators/generate_numpy_api.py.orig 2024-02-05 21:17:48 UTC
++++ numpy/core/code_generators/generate_numpy_api.py
+@@ -118,7 +118,13 @@ _import_array(void)
+ return 0;
+ }
+
+-#define import_array() {if (_import_array() < 0) {PyErr_Print(); PyErr_SetString(PyExc_ImportError, "numpy.core.multiarray failed to import"); return NULL; } }
++#if (SWIG_VERSION < 0x040400)
++#define _RETURN_VALUE NULL
++#else
++#define _RETURN_VALUE 0
++#endif
++
++#define import_array() {if (_import_array() < 0) {PyErr_Print(); PyErr_SetString(PyExc_ImportError, "numpy.core.multiarray failed to import"); return _RETURN_VALUE; } }
+
+ #define import_array1(ret) {if (_import_array() < 0) {PyErr_Print(); PyErr_SetString(PyExc_ImportError, "numpy.core.multiarray failed to import"); return ret; } }
+