math/py-numpy: Update to 1.25.0

PR:		272058
Reported by:	wen@
Exp-run by:	antoine@
This commit is contained in:
Wen Heping 2023-07-07 20:56:11 +08:00
parent 0347e95069
commit 65c21fd7c9
5 changed files with 26 additions and 51 deletions

View file

@ -774,7 +774,7 @@ CMAKE_ARGS+= -DPython_ADDITIONAL_VERSIONS=${PYTHON_VER}
# Python 3rd-party modules
PYGAME= ${PYTHON_PKGNAMEPREFIX}game>0:devel/py-game@${PY_FLAVOR}
PYNUMPY= ${PYTHON_PKGNAMEPREFIX}numpy>=1.16,1<1.25,1:math/py-numpy@${PY_FLAVOR}
PYNUMPY= ${PYTHON_PKGNAMEPREFIX}numpy>=1.16,1<1.26,1:math/py-numpy@${PY_FLAVOR}
. if defined(_PYTHON_FEATURE_DISTUTILS)
. if ${PYTHON_MAJOR_VER} < 3

View file

@ -1,6 +1,5 @@
PORTNAME= numpy
PORTVERSION= 1.24.1
PORTREVISION= 5
PORTVERSION= 1.25.0
PORTEPOCH= 1
CATEGORIES= math python
MASTER_SITES= PYPI \
@ -12,9 +11,6 @@ DISTFILES= ${DISTNAME}${EXTRACT_SUFX} \
DIST_SUBDIR= ${PORTNAME}-${PORTVERSION:R}
EXTRACT_ONLY= ${DISTNAME}${EXTRACT_SUFX}
PATCH_SITES= https://github.com/numpy/numpy/commit/
PATCHFILES= 8692e2478cc74cc7c08e9b2a0f731a10a1ca7118.patch:-p1
MAINTAINER= python@FreeBSD.org
COMMENT= The New Numeric Extension to Python
WWW= https://www.numpy.org/
@ -25,7 +21,7 @@ LICENSE_FILE= ${WRKSRC}/LICENSE.txt
TEST_DEPENDS= ${PYTHON_PKGNAMEPREFIX}pytest>=6.2.5:devel/py-pytest@${PY_FLAVOR} \
${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 python
USES= compiler:c11 cpe fortran python:3.9-3.11
USE_PYTHON= allflavors autoplist concurrent cython distutils
GCCLIBDIR_CMDS= ${FC} -print-file-name=libgfortran.so | ${SED} -e s/libgfortran.so//

View file

@ -1,9 +1,7 @@
TIMESTAMP = 1686775677
SHA256 (numpy-1.24/numpy-1.24.1.tar.gz) = 2386da9a471cc00a1f47845e27d916d5ec5346ae9696e01a8a34760858fe9dd2
SIZE (numpy-1.24/numpy-1.24.1.tar.gz) = 10903184
SHA256 (numpy-1.24/numpy-ref.pdf) = f493c1cae879a4e0038bec400d349fc34aafa164e1462118bdf18b25a3a07daf
SIZE (numpy-1.24/numpy-ref.pdf) = 7715485
SHA256 (numpy-1.24/numpy-user.pdf) = 3978da15c6a1b00f2737c75458db0cc0fe636ae90b72723a8ff609d40e9b7599
SIZE (numpy-1.24/numpy-user.pdf) = 4123384
SHA256 (numpy-1.24/8692e2478cc74cc7c08e9b2a0f731a10a1ca7118.patch) = 59d96ad7ef708f3b63ff7c4d7daa2a12dbaf510691f84dfd7be126de39eda49e
SIZE (numpy-1.24/8692e2478cc74cc7c08e9b2a0f731a10a1ca7118.patch) = 2861
TIMESTAMP = 1688388955
SHA256 (numpy-1.25/numpy-1.25.0.tar.gz) = f1accae9a28dc3cda46a91de86acf69de0d1b5f4edd44a9b0c3ceb8036dfff19
SIZE (numpy-1.25/numpy-1.25.0.tar.gz) = 10426700
SHA256 (numpy-1.25/numpy-ref.pdf) = f493c1cae879a4e0038bec400d349fc34aafa164e1462118bdf18b25a3a07daf
SIZE (numpy-1.25/numpy-ref.pdf) = 7715485
SHA256 (numpy-1.25/numpy-user.pdf) = 3978da15c6a1b00f2737c75458db0cc0fe636ae90b72723a8ff609d40e9b7599
SIZE (numpy-1.25/numpy-user.pdf) = 4123384

View file

@ -1,6 +1,6 @@
--- numpy/core/src/common/npy_cpu_features.c.orig 2022-11-19 22:40:58 UTC
--- numpy/core/src/common/npy_cpu_features.c.orig 2023-06-18 00:19:04 UTC
+++ numpy/core/src/common/npy_cpu_features.c
@@ -527,6 +527,18 @@ npy__cpu_init_features(void)
@@ -570,6 +570,18 @@ npy__cpu_init_features(void)
#ifndef PPC_FEATURE2_ARCH_3_1
#define PPC_FEATURE2_ARCH_3_1 0x00040000
#endif
@ -19,18 +19,10 @@
#endif
static void
@@ -551,7 +563,26 @@ npy__cpu_init_features(void)
npy__cpu_have[NPY_CPU_FEATURE_VSX2] = (hwcap & PPC_FEATURE2_ARCH_2_07) != 0;
npy__cpu_have[NPY_CPU_FEATURE_VSX3] = (hwcap & PPC_FEATURE2_ARCH_3_00) != 0;
npy__cpu_have[NPY_CPU_FEATURE_VSX4] = (hwcap & PPC_FEATURE2_ARCH_3_1) != 0;
-// TODO: AIX, FreeBSD
+#elif defined(__FreeBSD__)
+ unsigned long hwcap;
+ elf_aux_info(AT_HWCAP, &hwcap, sizeof(hwcap));
+ if ((hwcap & PPC_FEATURE_HAS_VSX) == 0)
+ return;
+
+ elf_aux_info(AT_HWCAP2, &hwcap, sizeof(hwcap));
@@ -591,6 +603,25 @@ npy__cpu_init_features(void)
elf_aux_info(AT_HWCAP2, &hwcap, sizeof(hwcap));
#endif // __linux__
+ if (hwcap & PPC_FEATURE2_ARCH_3_1)
+ {
+ npy__cpu_have[NPY_CPU_FEATURE_VSX] =
@ -43,7 +35,13 @@
+ npy__cpu_have[NPY_CPU_FEATURE_VSX2] = (hwcap & PPC_FEATURE2_ARCH_2_07) != 0;
+ npy__cpu_have[NPY_CPU_FEATURE_VSX3] = (hwcap & PPC_FEATURE2_ARCH_3_00) != 0;
+ npy__cpu_have[NPY_CPU_FEATURE_VSX4] = (hwcap & PPC_FEATURE2_ARCH_3_1) != 0;
+// TODO: AIX, OpenBSD
#else
npy__cpu_have[NPY_CPU_FEATURE_VSX] = 1;
#if defined(NPY_CPU_PPC64LE) || defined(NPY_HAVE_VSX2)
+#elif defined(__FreeBSD__)
+ unsigned long hwcap;
+ elf_aux_info(AT_HWCAP, &hwcap, sizeof(hwcap));
+ if ((hwcap & PPC_FEATURE_HAS_VSX) == 0)
+ return;
+
+ elf_aux_info(AT_HWCAP2, &hwcap, sizeof(hwcap));
if (hwcap & PPC_FEATURE2_ARCH_3_1)
{
npy__cpu_have[NPY_CPU_FEATURE_VSX] =

View file

@ -1,17 +0,0 @@
--- numpy/distutils/ccompiler_opt.py.orig 2022-11-19 22:40:58 UTC
+++ numpy/distutils/ccompiler_opt.py
@@ -959,8 +959,12 @@ class _CCompiler:
detect_arch = (
("cc_on_x64", ".*(x|x86_|amd)64.*", ""),
("cc_on_x86", ".*(win32|x86|i386|i686).*", ""),
- ("cc_on_ppc64le", ".*(powerpc|ppc)64(el|le).*", ""),
- ("cc_on_ppc64", ".*(powerpc|ppc)64.*", ""),
+ ("cc_on_ppc64le", ".*(powerpc|ppc)64(el|le).*|.*powerpc.*", ""
+ "defined(__LP64__) && "
+ "defined(__LITTLE_ENDIAN__)"),
+ ("cc_on_ppc64", ".*(powerpc|ppc).*|.*powerpc.*", ""
+ "defined(__LP64__) && "
+ "defined(__BIG_ENDIAN__)"),
("cc_on_aarch64", ".*(aarch64|arm64).*", ""),
("cc_on_armhf", ".*arm.*", "defined(__ARM_ARCH_7__) || "
"defined(__ARM_ARCH_7A__)"),