diff --git a/math/py-numpy1/Makefile b/math/py-numpy1/Makefile index e5da822501f8..ed36c1a44980 100644 --- a/math/py-numpy1/Makefile +++ b/math/py-numpy1/Makefile @@ -1,73 +1,73 @@ PORTNAME= numpy DISTVERSION= 1.26.4 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= math python MASTER_SITES= PYPI \ https://numpy.org/doc/${DISTVERSION:R}/:doc PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} PKGNAMESUFFIX= 1 DISTFILES= ${DISTNAME}${EXTRACT_SUFX} \ ${PORTNAME}-html.zip:doc DIST_SUBDIR= ${PORTNAME}-${DISTVERSION:R} EXTRACT_ONLY= ${DISTNAME}${EXTRACT_SUFX} MAINTAINER= python@FreeBSD.org COMMENT= Fundamental package for array computing in Python WWW= https://www.numpy.org/ LICENSE= BSD3CLAUSE LICENSE_FILE= ${WRKSRC}/LICENSE.txt BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}meson-python>=0.15.0:devel/meson-python@${PY_FLAVOR} TEST_DEPENDS= ${PYTHON_PKGNAMEPREFIX}hypothesis>=6.24.1:devel/py-hypothesis@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}typing-extensions>=4.2.0:devel/py-typing-extensions@${PY_FLAVOR} USES= compiler:c11 cpe fortran pkgconfig python shebangfix USE_PYTHON= autoplist concurrent cython pep517 pytest PEP517_BUILD_CONFIG_SETTING= -Csetup-args=-Dallow-noblas=false WITHOUT_FBSD10_FIX= yes SHEBANG_GLOB= *.py PORTDOCS= * CONFLICTS_INSTALL= py*-numpy TEST_WRKSRC= ${WRKDIR} TEST_ARGS= --pyargs numpy OPTIONS_DEFINE= DOCS OPTIONS_SINGLE= BLASLIB OPTIONS_SINGLE_BLASLIB= BLIS FLEXIBLAS NETLIB OPENBLAS OPTIONS_DEFAULT= OPENBLAS BLIS_DESC= BLIS BLAS-like implementation FLEXIBLAS_DESC= FlexiBLAS BLAS implementation BLIS_USES= blaslapack:blis BLIS_VARS= PEP517_BUILD_CONFIG_SETTING+="-Csetup-args=-Dblas=blis -Csetup-args=-Dlapack=flame" BLIS_BROKEN= math/libflame does not provide a pkg-config file FLEXIBLAS_USES= blaslapack:flexiblas FLEXIBLAS_VARS= PEP517_BUILD_CONFIG_SETTING+="-Csetup-args=-Dblas=flexiblas -Csetup-args=-Dlapack=flexiblas" NETLIB_LIB_DEPENDS= libcblas.so:math/cblas NETLIB_USES= blaslapack:netlib NETLIB_VARS= PEP517_BUILD_CONFIG_SETTING+="-Csetup-args=-Dblas=blas -Csetup-args=-Dlapack=lapack" OPENBLAS_USES= blaslapack:openblas OPENBLAS_VARS= PEP517_BUILD_CONFIG_SETTING+="-Csetup-args=-Dblas=openblas -Csetup-args=-Dlapack=openblas" .include .if ${PYTHON_REL} >= 31200 BUILD_DEPENDS+= ${PYTHON_PKGNAMEPREFIX}setuptools>0:devel/py-setuptools@${PY_FLAVOR} .endif post-patch: @${REINPLACE_CMD} -e 's|meson-python>=0.15.0,<0.16.0|meson-python>=0.15.0|' \ -e 's|Cython>=0.29.34,<3.1|Cython>=0.29.34|' \ ${WRKSRC}/pyproject.toml post-install-DOCS-on: @${MKDIR} ${STAGEDIR}${DOCSDIR} ${UNZIP_NATIVE_CMD} -qo ${DISTDIR}/${DIST_SUBDIR}/numpy-html.zip -d ${STAGEDIR}${DOCSDIR} @${RM} ${STAGEDIR}${DOCSDIR}/.buildinfo .include diff --git a/math/py-numpy1/files/patch-swig44 b/math/py-numpy1/files/patch-swig44 new file mode 100644 index 000000000000..4b0cd4694c85 --- /dev/null +++ b/math/py-numpy1/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; } } +