On 2025-10-14 00:10, Antoine Brodin wrote:
On Tue, Oct 14, 2025 at 8:20 AM Xin Li <[email protected]> wrote:
On 2025-10-13 22:21, Antoine Brodin wrote:
On Mon, Oct 13, 2025 at 8:37 AM Xin LI <[email protected]> wrote:
The branch main has been updated by delphij:
URL:
https://cgit.FreeBSD.org/ports/commit/?id=3f582fcf38bb0cee40f9346683490aceb3bda654
commit 3f582fcf38bb0cee40f9346683490aceb3bda654
Author: Matthew Wener <[email protected]>
AuthorDate: 2025-10-11 17:57:18 +0000
Commit: Xin LI <[email protected]>
CommitDate: 2025-10-13 06:36:40 +0000
math/py-numpy: Migrate to PEP517
PR: ports/287794
This broke the ports tree and bulk -a
Please fix asap or revert as this blocks packages builders.
[00:00:39] Error: compute_deps_pkg failed to lookup pkgname for
devel/meson-python@py312 processing package py312-numpy-1.26.4_8,1
from math/py-numpy@py312 -- Is SUBDIR+=meson-python missing in
devel/Makefile? And does the port provide the 'py312' FLAVOR?
[00:00:39] Error: compute_deps_pkg failed to lookup pkgname for
devel/meson-python@py310 processing package py310-numpy-1.26.4_8,1
from math/py-numpy@py310 -- Is SUBDIR+=meson-python missing in
devel/Makefile? And does the port provide the 'py310' FLAVOR?
[00:00:39] Error: compute_deps_pkg failed to lookup pkgname for
devel/meson-python@py39 processing package py39-numpy-1.26.4_8,1 from
math/py-numpy@py39 -- Is SUBDIR+=meson-python missing in
devel/Makefile? And does the port provide the 'py39' FLAVOR?
I don't yet understand why this would cause breakages, but I've reverted
the change (with a new PORTREVISION bump) as a precaution for now in the
hope to unbreak the tree.
This was failing because default ports tree attempts to build the
py311 py312 py310 py39 flavors for math/py-numpy , while only
building the py311 flavor for devel/meson-python
In my opinion we should only attempt to build the default python
flavor (py311 at the moment) for py-numpy.
I see. I'll need to investigate how Poudriere gathers dependency data to
confidently create a solution.
For now, the attached patch (3-allflavors.patch) appears to fix the
initial stage of the bulk -a build when the original commit is
reapplied. This patch modifies the BUILD_DEPENDS of py-numpy to build
with allflavors (maintainer CC'd). I haven't waited for the full build
to complete, as it takes a significant amount of time on my machine, but
the initial check appear to pass.
It appears very few ports use allflavors (I think the value of doing it
at all is questionable as result). For this approach to be more broadly
useful, we would likely need to have more Python library packages to
build for allflavors as well.
Cheers,
diff --git a/devel/meson-python/Makefile b/devel/meson-python/Makefile
index c05b403172b6..736c70e8390f 100644
--- a/devel/meson-python/Makefile
+++ b/devel/meson-python/Makefile
@@ -28,7 +28,7 @@ TEST_DEPENDS=
${PYTHON_PKGNAMEPREFIX}build>0:devel/py-build@${PY_FLAVOR} \
git:devel/git
USES= python
-USE_PYTHON= autoplist cython_test concurrent pep517 pytest
+USE_PYTHON= allflavors autoplist cython_test concurrent pep517 pytest
NO_ARCH= yes
diff --git a/devel/meson/Makefile b/devel/meson/Makefile
index 7fa71f4ff049..e86b27275c56 100644
--- a/devel/meson/Makefile
+++ b/devel/meson/Makefile
@@ -15,7 +15,7 @@ BUILD_DEPENDS= ${PY_SETUPTOOLS} \
TEST_DEPENDS=
${PYTHON_PKGNAMEPREFIX}pytest-xdist>0:devel/py-pytest-xdist@${PY_FLAVOR}
USES= ninja:run python shebangfix
-USE_PYTHON= autoplist pep517
+USE_PYTHON= allflavors autoplist pep517
SHEBANG_FILES= mesonbuild/rewriter.py \
mesonbuild/scripts/cmake_run_ctgt.py
NO_ARCH= yes
diff --git a/devel/py-pyproject-metadata/Makefile
b/devel/py-pyproject-metadata/Makefile
index 086c5315126e..475949bd520f 100644
--- a/devel/py-pyproject-metadata/Makefile
+++ b/devel/py-pyproject-metadata/Makefile
@@ -16,7 +16,7 @@ BUILD_DEPENDS=
${PYTHON_PKGNAMEPREFIX}setuptools>=42.0.0:devel/py-setuptools@${P
RUN_DEPENDS=
${PYTHON_PKGNAMEPREFIX}packaging>=19.0:devel/py-packaging@${PY_FLAVOR}
USES= python
-USE_PYTHON= autoplist concurrent pep517
+USE_PYTHON= allflavors autoplist concurrent pep517
NO_ARCH= yes
From 79a935203f1c1552bc6bef7c16e82b6f3c279024 Mon Sep 17 00:00:00 2001
From: Matthew Wener <[email protected]>
Date: Sat, 11 Oct 2025 13:57:18 -0400
Subject: [PATCH] math/py-numpy: Reland Migrate to PEP517
PR: ports/287794
---
math/py-numpy/Makefile | 12 +++++++---
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, 79 insertions(+), 3 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 22f8b33f9ed3..61bc8729e793 100644
--- a/math/py-numpy/Makefile
+++ b/math/py-numpy/Makefile
@@ -1,6 +1,6 @@
PORTNAME= numpy
PORTVERSION= 1.26.4
-PORTREVISION= 9
+PORTREVISION= 10
PORTEPOCH= 1
CATEGORIES= math python
MASTER_SITES= PYPI \
@@ -18,12 +18,14 @@ WWW= https://www.numpy.org/
LICENSE= BSD3CLAUSE
LICENSE_FILE= ${WRKSRC}/LICENSE.txt
+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//
@@ -61,6 +63,10 @@ OPENBLAS_VARS= BLASLIBS="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
@${TOUCH} ${WRKSRC}/numpy/random/_examples/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.51.0