git: af92280d8c35 - main - science/py-dwave-optimization: New port: DWave: Nonlinear models for industrial optimization problems

From: Yuri Victorovich <yuri_at_FreeBSD.org>
Date: Mon, 15 Jul 2024 07:19:38 UTC
The branch main has been updated by yuri:

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

commit af92280d8c35f491e3dfaa6878dbeefce4cacf0f
Author:     Yuri Victorovich <yuri@FreeBSD.org>
AuthorDate: 2024-07-15 06:49:07 +0000
Commit:     Yuri Victorovich <yuri@FreeBSD.org>
CommitDate: 2024-07-15 07:19:26 +0000

    science/py-dwave-optimization: New port: DWave: Nonlinear models for industrial optimization problems
---
 science/Makefile                        |  1 +
 science/py-dwave-optimization/Makefile  | 42 +++++++++++++++++++++++++++++++++
 science/py-dwave-optimization/distinfo  |  3 +++
 science/py-dwave-optimization/pkg-descr |  6 +++++
 science/py-dwave-optimization/pkg-plist |  1 +
 5 files changed, 53 insertions(+)

diff --git a/science/Makefile b/science/Makefile
index 758be1b5a148..a5063b6d6154 100644
--- a/science/Makefile
+++ b/science/Makefile
@@ -328,6 +328,7 @@
     SUBDIR += py-dwave-neal
     SUBDIR += py-dwave-networkx
     SUBDIR += py-dwave-ocean-sdk
+    SUBDIR += py-dwave-optimization
     SUBDIR += py-dwave-preprocessing
     SUBDIR += py-dwave-samplers
     SUBDIR += py-dwave-system
diff --git a/science/py-dwave-optimization/Makefile b/science/py-dwave-optimization/Makefile
new file mode 100644
index 000000000000..e083627cbd61
--- /dev/null
+++ b/science/py-dwave-optimization/Makefile
@@ -0,0 +1,42 @@
+PORTNAME=	dwave-optimization
+DISTVERSION=	0.1.0
+CATEGORIES=	science python # quantum-computing
+MASTER_SITES=	PYPI
+PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
+
+MAINTAINER=	yuri@FreeBSD.org
+COMMENT=	DWave: Nonlinear models for industrial optimization problems
+WWW=		https://github.com/dwavesystems/dwave-optimization
+
+LICENSE=	APACHE20
+LICENSE_FILE=	${WRKSRC}/LICENSE
+
+BUILD_DEPENDS=	${PYTHON_PKGNAMEPREFIX}cython3>0:lang/cython3@${PY_FLAVOR} \
+		${PYNUMPY} \
+		${PYTHON_PKGNAMEPREFIX}setuptools-dso>=2.10:devel/py-setuptools-dso@${PY_FLAVOR}
+RUN_DEPENDS=	${PYNUMPY} \
+		${PYTHON_PKGNAMEPREFIX}reno>=4.1.0:textproc/py-reno@${PY_FLAVOR}
+
+USES=		python
+USE_PYTHON=	distutils cython autoplist
+
+POST_PLIST=	fix-plist
+
+post-install:
+	# strip binaries
+	@${STRIP_CMD} \
+		${STAGEDIR}${PYTHON_SITELIBDIR}/dwave/optimization/libdwave-optimization.so \
+		${STAGEDIR}${PYTHON_SITELIBDIR}/dwave/optimization/model${PYTHON_EXT_SUFFIX}.so \
+		${STAGEDIR}${PYTHON_SITELIBDIR}/dwave/optimization/symbols${PYTHON_EXT_SUFFIX}.so
+	# remove conflicting __init__.py, see https://github.com/dwavesystems/dwave-system/issues/462
+	@${RM} -r \
+		${STAGEDIR}${PYTHON_SITELIBDIR}/dwave/__init__.py \
+		${STAGEDIR}${PYTHON_SITELIBDIR}/dwave/__pycache__
+
+fix-plist:
+	@${REINPLACE_CMD} -e " \
+		s|.*dwave/__init__\.py||; \
+		s|.*dwave/__pycache__/.*|| \
+		" ${TMPPLIST}
+
+.include <bsd.port.mk>
diff --git a/science/py-dwave-optimization/distinfo b/science/py-dwave-optimization/distinfo
new file mode 100644
index 000000000000..f0f7d3875377
--- /dev/null
+++ b/science/py-dwave-optimization/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1721017559
+SHA256 (dwave-optimization-0.1.0.tar.gz) = 585b69026d26e9f99b9c8552a68dae794960cd94582ccdf973d2eb30a6303b9e
+SIZE (dwave-optimization-0.1.0.tar.gz) = 725660
diff --git a/science/py-dwave-optimization/pkg-descr b/science/py-dwave-optimization/pkg-descr
new file mode 100644
index 000000000000..29e0783c9e64
--- /dev/null
+++ b/science/py-dwave-optimization/pkg-descr
@@ -0,0 +1,6 @@
+dwave-optimization enables the formulation of nonlinear models for industrial
+optimization problems. The package includes:
+
+* a class for nonlinear models used by the Leap service's quantum-classical
+  hybrid nonlinear-program solver
+* model generators for common optimization problems
diff --git a/science/py-dwave-optimization/pkg-plist b/science/py-dwave-optimization/pkg-plist
new file mode 100644
index 000000000000..c9c2eb9a150b
--- /dev/null
+++ b/science/py-dwave-optimization/pkg-plist
@@ -0,0 +1 @@
+%%PYTHON_SITELIBDIR%%/dwave/optimization/libdwave-optimization.so