git: 9c26f66e0b0e - main - math/py-nlopt: update 2.7.1 → 2.7.1.2

From: Yuri Victorovich <yuri_at_FreeBSD.org>
Date: Thu, 04 Apr 2024 08:05:25 UTC
The branch main has been updated by yuri:

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

commit 9c26f66e0b0eeceee43e3c27cdc594036b569b2e
Author:     Yuri Victorovich <yuri@FreeBSD.org>
AuthorDate: 2024-04-04 08:04:12 +0000
Commit:     Yuri Victorovich <yuri@FreeBSD.org>
CommitDate: 2024-04-04 08:05:07 +0000

    math/py-nlopt: update 2.7.1 → 2.7.1.2
    
    Reported by:    portscout
---
 math/py-nlopt/Makefile                               | 10 ++++++----
 math/py-nlopt/distinfo                               | 10 +++++-----
 math/py-nlopt/files/patch-CMakeLists.txt             | 20 ++++++++++++++++++++
 math/py-nlopt/files/patch-extensions.py              |  4 ++--
 .../py-nlopt/files/patch-extern_nlopt_CMakeLists.txt | 14 ++++++++++++++
 math/py-nlopt/pkg-plist                              |  8 +++++++-
 6 files changed, 54 insertions(+), 12 deletions(-)

diff --git a/math/py-nlopt/Makefile b/math/py-nlopt/Makefile
index 0914749ac68f..4e7d547013a3 100644
--- a/math/py-nlopt/Makefile
+++ b/math/py-nlopt/Makefile
@@ -1,6 +1,5 @@
 PORTNAME=	nlopt
-DISTVERSION=	2.7.1
-PORTREVISION=	1
+DISTVERSION=	2.7.1.2
 CATEGORIES=	math
 #MASTER_SITES=	PYPI # https://github.com/DanielBok/nlopt-python/issues/15
 PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
@@ -24,10 +23,13 @@ USE_PYTHON=	distutils # autoplist is broken, see https://github.com/DanielBok/nl
 USE_GITHUB=	yes
 GH_ACCOUNT=	DanielBok
 GH_PROJECT=	nlopt-python
-GH_TUPLE=	stevengj:nlopt:4a0e93c:nlopt/extern/nlopt
+GH_TUPLE=	stevengj:nlopt:7a7587e:nlopt/extern/nlopt
+
+#CMAKE_ARGS=	-DFREEBSD_PYTHON_VER=${PYTHON_VER}
+MAKE_ENV=	FREEBSD_PYTHON_VER=${PYTHON_VER}
 
 post-install:
-	@${STRIP_CMD} ${STAGEDIR}${PYTHON_SITELIBDIR}/nlopt/_nlopt.so
+	@${STRIP_CMD} ${STAGEDIR}${PYTHON_SITELIBDIR}/nlopt/_nlopt${PYTHON_EXT_SUFFIX}.so
 
 do-test:
 	@${SETENV} ${TEST_ENV} PYTHONPATH=${STAGEDIR}${PYTHONPREFIX_SITELIBDIR} ${PYTHON_CMD} ${FILESDIR}/example.py
diff --git a/math/py-nlopt/distinfo b/math/py-nlopt/distinfo
index d896243b4cf7..f69b01154ae3 100644
--- a/math/py-nlopt/distinfo
+++ b/math/py-nlopt/distinfo
@@ -1,5 +1,5 @@
-TIMESTAMP = 1655669851
-SHA256 (DanielBok-nlopt-python-2.7.1_GH0.tar.gz) = 838a46f67309b1e1f63227a27726e8a7be19f9b05f0972d40b98a52ccfb799fb
-SIZE (DanielBok-nlopt-python-2.7.1_GH0.tar.gz) = 6749
-SHA256 (stevengj-nlopt-4a0e93c_GH0.tar.gz) = 3d8036633821df60f387431fde51cd11c125743a24ccbda40221518ad21663a4
-SIZE (stevengj-nlopt-4a0e93c_GH0.tar.gz) = 2044242
+TIMESTAMP = 1712206116
+SHA256 (DanielBok-nlopt-python-2.7.1.2_GH0.tar.gz) = 3fd3c49689f42adf2ff230fde768312ee55bd48c33f97cc8effd52b655aaa909
+SIZE (DanielBok-nlopt-python-2.7.1.2_GH0.tar.gz) = 9079
+SHA256 (stevengj-nlopt-7a7587e_GH0.tar.gz) = 0a5a0e349e3c59283ee9f309da2e5dea0e68d33d642e7ee6b6df3f4de5f0b013
+SIZE (stevengj-nlopt-7a7587e_GH0.tar.gz) = 2049756
diff --git a/math/py-nlopt/files/patch-CMakeLists.txt b/math/py-nlopt/files/patch-CMakeLists.txt
new file mode 100644
index 000000000000..482d889f62b6
--- /dev/null
+++ b/math/py-nlopt/files/patch-CMakeLists.txt
@@ -0,0 +1,20 @@
+--- CMakeLists.txt.orig	2024-04-03 02:23:20 UTC
++++ CMakeLists.txt
+@@ -2,6 +2,8 @@ project(nlopt-python)
+ 
+ project(nlopt-python)
+ 
++set(FREEBSD_PYTHON_VER $ENV{FREEBSD_PYTHON_VER})
++
+ set (CMAKE_INSTALL_PREFIX ${CMAKE_CURRENT_BINARY_DIR})
+ set (CMAKE_INSTALL_LIBDIR ${CMAKE_INSTALL_PREFIX}/nlopt)
+ set (INSTALL_PYTHON_DIR ${CMAKE_INSTALL_PREFIX})
+@@ -9,7 +11,7 @@ if (NOT WIN32)
+ option (BUILD_SHARED_LIBS OFF)
+ 
+ if (NOT WIN32)
+-  find_package (PythonInterp)
++  find_package (PythonInterp ${FREEBSD_PYTHON_VER} EXACT)
+ 
+   execute_process(
+     COMMAND
diff --git a/math/py-nlopt/files/patch-extensions.py b/math/py-nlopt/files/patch-extensions.py
index 1c8cfb1104cd..22c394738ec0 100644
--- a/math/py-nlopt/files/patch-extensions.py
+++ b/math/py-nlopt/files/patch-extensions.py
@@ -1,6 +1,6 @@
---- extensions.py.orig	2022-06-19 20:42:31 UTC
+--- extensions.py.orig	2024-04-03 02:23:20 UTC
 +++ extensions.py
-@@ -25,7 +25,7 @@ class NLOptBuild(build_ext):
+@@ -26,7 +26,7 @@ class NLOptBuild(build_ext):
          except OSError:
              raise RuntimeError("CMake must be installed")
  
diff --git a/math/py-nlopt/files/patch-extern_nlopt_CMakeLists.txt b/math/py-nlopt/files/patch-extern_nlopt_CMakeLists.txt
new file mode 100644
index 000000000000..f4d2675e7f87
--- /dev/null
+++ b/math/py-nlopt/files/patch-extern_nlopt_CMakeLists.txt
@@ -0,0 +1,14 @@
+--- extern/nlopt/CMakeLists.txt.orig	2024-04-04 04:49:46 UTC
++++ extern/nlopt/CMakeLists.txt
+@@ -317,9 +317,9 @@ if (NLOPT_PYTHON)
+ 
+ if (NLOPT_PYTHON)
+   if (CMAKE_VERSION VERSION_LESS 3.24)
+-    find_package (Python COMPONENTS Interpreter Development)
++    find_package (Python ${FREEBSD_PYTHON_VER} EXACT COMPONENTS Interpreter Development)
+   else ()
+-    find_package (Python COMPONENTS Interpreter Development.Module)
++    find_package (Python ${FREEBSD_PYTHON_VER} EXACT COMPONENTS Interpreter Development.Module)
+   endif ()
+ 
+   find_package (NumPy)
diff --git a/math/py-nlopt/pkg-plist b/math/py-nlopt/pkg-plist
index 325f0732f7c5..1288cc803e18 100644
--- a/math/py-nlopt/pkg-plist
+++ b/math/py-nlopt/pkg-plist
@@ -1,7 +1,13 @@
+%%PYTHON_SITELIBDIR%%/nlopt-2.7.1-py%%PYTHON_VER%%.egg-info/PKG-INFO
+%%PYTHON_SITELIBDIR%%/nlopt-2.7.1-py%%PYTHON_VER%%.egg-info/SOURCES.txt
+%%PYTHON_SITELIBDIR%%/nlopt-2.7.1-py%%PYTHON_VER%%.egg-info/dependency_links.txt
+%%PYTHON_SITELIBDIR%%/nlopt-2.7.1-py%%PYTHON_VER%%.egg-info/not-zip-safe
+%%PYTHON_SITELIBDIR%%/nlopt-2.7.1-py%%PYTHON_VER%%.egg-info/requires.txt
+%%PYTHON_SITELIBDIR%%/nlopt-2.7.1-py%%PYTHON_VER%%.egg-info/top_level.txt
 %%PYTHON_SITELIBDIR%%/nlopt/__init__.py
 %%PYTHON_SITELIBDIR%%/nlopt/__pycache__/__init__%%PYTHON_EXT_SUFFIX%%.opt-1.pyc
 %%PYTHON_SITELIBDIR%%/nlopt/__pycache__/__init__%%PYTHON_EXT_SUFFIX%%.pyc
 %%PYTHON_SITELIBDIR%%/nlopt/__pycache__/nlopt%%PYTHON_EXT_SUFFIX%%.opt-1.pyc
 %%PYTHON_SITELIBDIR%%/nlopt/__pycache__/nlopt%%PYTHON_EXT_SUFFIX%%.pyc
-%%PYTHON_SITELIBDIR%%/nlopt/_nlopt.so
+%%PYTHON_SITELIBDIR%%/nlopt/_nlopt%%PYTHON_EXT_SUFFIX%%.so
 %%PYTHON_SITELIBDIR%%/nlopt/nlopt.py