FreeBSD Bugzilla – Attachment 261877 Details for
Bug 287794
math/py-numpy: Migrate to PEP517
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Proposed patch v2
0001-math-py-numpy-Migrate-to-PEP517.patch (text/plain), 7.41 KB, created by
Xin LI
on 2025-07-05 01:46:10 UTC
(
hide
)
Description:
Proposed patch v2
Filename:
MIME Type:
Creator:
Xin LI
Created:
2025-07-05 01:46:10 UTC
Size:
7.41 KB
patch
obsolete
>From 104d38089e2fbd476295cd69beebeb663eef7cd2 Mon Sep 17 00:00:00 2001 >From: Matthew Wener <matthew@wener.org> >Date: Tue, 24 Jun 2025 20:07:19 -0400 >Subject: [PATCH 1/2] math/py-numpy: Migrate to PEP517 > >--- > math/py-numpy/Makefile | 46 +++++++++++++------ > math/py-numpy/files/patch-numpy_core_setup.py | 19 ++++++++ > .../patch-numpy_distutils_mingw32ccompiler.py | 17 +++++++ > .../files/patch-numpy_random_setup.py | 23 ++++++++++ > math/py-numpy/files/patch-pyproject.toml | 11 +++++ > 5 files changed, 101 insertions(+), 15 deletions(-) > create mode 100644 math/py-numpy/files/patch-numpy_core_setup.py > create mode 100644 math/py-numpy/files/patch-numpy_distutils_mingw32ccompiler.py > create mode 100644 math/py-numpy/files/patch-numpy_random_setup.py > create mode 100644 math/py-numpy/files/patch-pyproject.toml > >diff --git a/math/py-numpy/Makefile b/math/py-numpy/Makefile >index 42a13b88864f..242d4b1984ec 100644 >--- a/math/py-numpy/Makefile >+++ b/math/py-numpy/Makefile >@@ -1,6 +1,6 @@ > PORTNAME= numpy > PORTVERSION= 1.26.4 >-PORTREVISION= 6 >+PORTREVISION= 7 > PORTEPOCH= 1 > CATEGORIES= math python > MASTER_SITES= PYPI \ >@@ -18,16 +18,19 @@ WWW= https://www.numpy.org/ > LICENSE= BSD3CLAUSE > 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} \ >+BUILD_DEPENDS= ${PY_SETUPTOOLS} \ >+ ${PYTHON_PKGNAMEPREFIX}meson-python>=0:devel/meson-python@${PY_FLAVOR} >+TEST_DEPENDS= ${PYTHON_PKGNAMEPREFIX}hypothesis>=6.24.1:devel/py-hypothesis@${PY_FLAVOR} \ >+ ${PYTHON_PKGNAMEPREFIX}pytest>=6.2.5:devel/py-pytest@${PY_FLAVOR} \ > ${PYTHON_PKGNAMEPREFIX}typing-extensions>=4.2.0:devel/py-typing-extensions@${PY_FLAVOR} > >-USES= compiler:c11 cpe fortran python:3.9+ >-USE_PYTHON= allflavors autoplist concurrent cython distutils >+USES= compiler:c11 cpe fortran pkgconfig python:3.9+ shebangfix >+USE_PYTHON= allflavors autoplist concurrent cython pep517 > >-GCCLIBDIR_CMDS= ${FC} -print-file-name=libgfortran.so | ${SED} -e s/libgfortran.so// >+GCCLIBDIR_CMDS= ${FC} -print-file-name=libgfortran.so | ${SED} -e \ >+ s/libgfortran.so// > LDFLAGS+= -s >-PYDISTUTILS_BUILDARGS= --fcompiler=gnu95 >+PYDISTUTILS_BUILDARGS= --fcompiler=gnu95 > PYDISTUTILS_CONFIGUREARGS= --fcompiler=gnu95 > > PIE_UNSAFE= yes >@@ -42,14 +45,27 @@ OPTIONS_SINGLE_BLASLIB= ATLAS NETLIB OPENBLAS > OPTIONS_DEFAULT= OPENBLAS SUITESPARSE > SUITESPARSE_DESC= Use AMD and UMFPACK in SuiteSparse > >-ATLAS_USES= blaslapack:atlas >-ATLAS_VARS= BLASLIBS="ptf77blas, ptcblas" BLASNAME=atlas LAPACKLIBS=alapack LIBRARIES=atlas_libs >-NETLIB_LIB_DEPENDS= libcblas.so:math/cblas >-NETLIB_USES= blaslapack:netlib >-NETLIB_VARS= BLASLIBS="blas, cblas" BLASNAME=atlas LAPACKLIBS=lapack LIBRARIES=atlas_libs >-OPENBLAS_USES= blaslapack:openblas >-OPENBLAS_VARS= BLASLIBS="openblas, gfortran" BLASNAME=openblas LAPACKLIBS="openblas, gfortran" LIBRARIES=libraries >-SUITESPARSE_LIB_DEPENDS=libumfpack.so:math/suitesparse-umfpack >+ATLAS_USES= blaslapack:atlas >+ATLAS_VARS= BLASLIBS="ptf77blas, ptcblas" \ >+ BLASNAME=atlas \ >+ LAPACKLIBS=alapack \ >+ LIBRARIES=atlas_libs >+NETLIB_LIB_DEPENDS= libcblas.so:math/cblas >+NETLIB_USES= blaslapack:netlib >+NETLIB_VARS= BLASLIBS="blas, cblas" \ >+ BLASNAME=atlas \ >+ LAPACKLIBS=lapack \ >+ LIBRARIES=atlas_libs >+OPENBLAS_USES= blaslapack:openblas >+OPENBLAS_VARS= BLASLIBS="openblas, gfortran" \ >+ BLASNAME=openblas \ >+ LAPACKLIBS="openblas, gfortran" \ >+ LIBRARIES=libraries >+SUITESPARSE_LIB_DEPENDS= libumfpack.so:math/suitesparse-umfpack >+ >+SHEBANG_FILES= numpy/f2py/crackfortran.py numpy/f2py/f2py2e.py \ >+ numpy/f2py/rules.py numpy/testing/print_coercion_tables.py \ >+ numpy/testing/setup.py > > post-extract: > @${TOUCH} ${WRKSRC}/numpy/f2py/tests/src/temp >diff --git a/math/py-numpy/files/patch-numpy_core_setup.py b/math/py-numpy/files/patch-numpy_core_setup.py >new file mode 100644 >index 000000000000..7502a4df93fb >--- /dev/null >+++ b/math/py-numpy/files/patch-numpy_core_setup.py >@@ -0,0 +1,19 @@ >+--- numpy/core/setup.py.orig 2024-02-05 21:17:48 UTC >++++ numpy/core/setup.py >+@@ -9,7 +9,6 @@ from numpy.distutils import log >+ from os.path import join >+ >+ from numpy.distutils import log >+-from numpy.distutils.msvccompiler import lib_opts_if_msvc >+ from distutils.dep_util import newer >+ from sysconfig import get_config_var >+ from numpy.compat import npy_load_module >+@@ -688,7 +687,7 @@ def configuration(parent_package='',top_path=None): >+ install_dir='lib', >+ build_info={ >+ 'include_dirs' : [], # empty list required for creating npy_math_internal.h >+- 'extra_compiler_args': [lib_opts_if_msvc], >++ 'extra_compiler_args': [], >+ }) >+ config.add_npy_pkg_config("npymath.ini.in", "lib/npy-pkg-config", >+ subst_dict) >diff --git a/math/py-numpy/files/patch-numpy_distutils_mingw32ccompiler.py b/math/py-numpy/files/patch-numpy_distutils_mingw32ccompiler.py >new file mode 100644 >index 000000000000..a7466a818792 >--- /dev/null >+++ b/math/py-numpy/files/patch-numpy_distutils_mingw32ccompiler.py >@@ -0,0 +1,17 @@ >+--- numpy/distutils/mingw32ccompiler.py.orig 2024-02-05 21:17:48 UTC >++++ numpy/distutils/mingw32ccompiler.py >+@@ -24,7 +24,13 @@ from distutils.unixccompiler import UnixCCompiler >+ >+ import distutils.cygwinccompiler >+ from distutils.unixccompiler import UnixCCompiler >+-from distutils.msvccompiler import get_build_version as get_build_msvc_version >++ >++try: >++ from distutils.msvccompiler import get_build_version as get_build_msvc_version >++except ImportError: >++ def get_build_msvc_version(): >++ return None >++ >+ from distutils.errors import UnknownFileError >+ from numpy.distutils.misc_util import (msvc_runtime_library, >+ msvc_runtime_version, >diff --git a/math/py-numpy/files/patch-numpy_random_setup.py b/math/py-numpy/files/patch-numpy_random_setup.py >new file mode 100644 >index 000000000000..74ff5ffc8e54 >--- /dev/null >+++ b/math/py-numpy/files/patch-numpy_random_setup.py >@@ -0,0 +1,23 @@ >+--- numpy/random/setup.py.orig 2024-02-05 21:17:48 UTC >++++ numpy/random/setup.py >+@@ -3,7 +3,6 @@ from numpy.distutils.system_info import platform_bits >+ from os.path import join >+ >+ from numpy.distutils.system_info import platform_bits >+-from numpy.distutils.msvccompiler import lib_opts_if_msvc >+ >+ >+ def configuration(parent_package='', top_path=None): >+@@ -70,11 +69,7 @@ def configuration(parent_package='', top_path=None): >+ not initialized the distutils build command, so use this deferred >+ calculation to run when we are building the library. >+ """ >+- opts = lib_opts_if_msvc(build_cmd) >+- if build_cmd.compiler.compiler_type != 'msvc': >+- # Some bit generators require c99 >+- opts.append('-std=c99') >+- return opts >++ return ['-std=c99'] >+ >+ config.add_installed_library('npyrandom', >+ sources=npyrandom_sources, >diff --git a/math/py-numpy/files/patch-pyproject.toml b/math/py-numpy/files/patch-pyproject.toml >new file mode 100644 >index 000000000000..3eb3c97a8da5 >--- /dev/null >+++ b/math/py-numpy/files/patch-pyproject.toml >@@ -0,0 +1,11 @@ >+--- pyproject.toml.orig 2025-06-24 22:40:55 UTC >++++ pyproject.toml >+@@ -2,7 +2,7 @@ requires = [ >+ build-backend = "mesonpy" >+ requires = [ >+ "Cython>=0.29.34,<3.1", >+- "meson-python>=0.15.0,<0.16.0", >++ "meson-python>=0.15.0", >+ ] >+ >+ [project] >-- >2.50.0 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
delphij
:
maintainer-approval?
(
python
)
Actions:
View
|
Diff
Attachments on
bug 287794
:
261580
| 261877 |
264489