git: ed8403f487c8 - main - math/py-SQNomad: Unbreak

From: Yuri Victorovich <yuri_at_FreeBSD.org>
Date: Wed, 16 Sep 2026 03:16:31 UTC
The branch main has been updated by yuri:

URL: https://cgit.FreeBSD.org/ports/commit/?id=ed8403f487c89db137152b73ba1c81145a0f6e4c

commit ed8403f487c89db137152b73ba1c81145a0f6e4c
Author:     Yuri Victorovich <yuri@FreeBSD.org>
AuthorDate: 2026-09-16 03:15:29 +0000
Commit:     Yuri Victorovich <yuri@FreeBSD.org>
CommitDate: 2026-09-16 03:16:27 +0000

    math/py-SQNomad: Unbreak
---
 math/py-SQNomad/Makefile             |  4 +---
 math/py-SQNomad/files/patch-setup.py | 17 ++++++++++++++---
 2 files changed, 15 insertions(+), 6 deletions(-)

diff --git a/math/py-SQNomad/Makefile b/math/py-SQNomad/Makefile
index 1df0b4d20534..060aec217f4b 100644
--- a/math/py-SQNomad/Makefile
+++ b/math/py-SQNomad/Makefile
@@ -1,6 +1,6 @@
 PORTNAME=	SQNomad
 DISTVERSION=	0.2.3
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	math python
 MASTER_SITES=	PYPI
 PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
@@ -9,8 +9,6 @@ MAINTAINER=	yuri@FreeBSD.org
 COMMENT=	Blackbox optimization software
 WWW=		https://www.gerad.ca/nomad/
 
-BROKEN=		fails to build with NumPy 2.x
-
 LICENSE=	LGPL3
 LICENSE_FILE=	${WRKSRC}/LICENSE
 
diff --git a/math/py-SQNomad/files/patch-setup.py b/math/py-SQNomad/files/patch-setup.py
index b053c7d06f67..9da5b0df0256 100644
--- a/math/py-SQNomad/files/patch-setup.py
+++ b/math/py-SQNomad/files/patch-setup.py
@@ -1,7 +1,18 @@
---- setup.py.orig	2023-11-12 00:10:52 UTC
+-- Use numpy.get_include() to find NumPy's C headers instead of building
+-- the path manually, because NumPy >= 2.0 moved its C API headers from
+-- numpy/core/include to numpy/_core/include, breaking the previous
+-- hardcoded path.
+-- Also enable the FreeBSD platform check that was missing so the C++14
+-- flag is applied on FreeBSD as well as Linux/macOS.
+
+--- setup.py.orig	2021-03-29 23:39:12 UTC
 +++ setup.py
-@@ -55,7 +55,7 @@ class my_build_extension(_build_ext):
-         ext.extra_compile_args += ['-I'+os.path.join(numpy.__path__[0], 'core/include/numpy')]
+@@ -52,10 +52,10 @@ class my_build_extension(_build_ext):
+ 
+         # adding numpy late to allow setup to install it in the build env
+         import numpy
+-        ext.extra_compile_args += ['-I'+os.path.join(numpy.__path__[0], 'core/include/numpy')]
++        ext.extra_compile_args += ['-I'+numpy.get_include(), '-I'+os.path.join(numpy.get_include(), 'numpy')]
  
          # force C++14
 -        if 'linux' in sys.platform or 'darwin' in sys.platform: