summaryrefslogtreecommitdiff
path: root/math/py-diffcp
diff options
context:
space:
mode:
Diffstat (limited to 'math/py-diffcp')
-rw-r--r--math/py-diffcp/Makefile31
-rw-r--r--math/py-diffcp/distinfo3
-rw-r--r--math/py-diffcp/files/patch-pyproject.toml15
-rw-r--r--math/py-diffcp/pkg-descr4
4 files changed, 53 insertions, 0 deletions
diff --git a/math/py-diffcp/Makefile b/math/py-diffcp/Makefile
new file mode 100644
index 000000000000..cbcbe2e4436d
--- /dev/null
+++ b/math/py-diffcp/Makefile
@@ -0,0 +1,31 @@
+PORTNAME= diffcp
+DISTVERSION= 1.0.23
+CATEGORIES= math python
+MASTER_SITES= PYPI
+PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
+
+MAINTAINER= yuri@FreeBSD.org
+COMMENT= Differentiation through cone programs
+WWW= https://github.com/cvxgrp/diffcp/
+
+LICENSE= APACHE20
+LICENSE_FILE= ${WRKSRC}/LICENSE
+
+PY_DEPENDS= ${PYNUMPY} \
+ ${PYTHON_PKGNAMEPREFIX}pybind11>0:devel/py-pybind11@${PY_FLAVOR} \
+ ${PYTHON_PKGNAMEPREFIX}scipy>=0.13.2:science/py-scipy@${PY_FLAVOR}
+BUILD_DEPENDS= ${PY_SETUPTOOLS} \
+ ${PY_DEPENDS} \
+ ${PYTHON_PKGNAMEPREFIX}wheel>=0:devel/py-wheel@${PY_FLAVOR}
+RUN_DEPENDS= ${PY_DEPENDS}
+TEST_DEPENDS= ${PYTHON_PKGNAMEPREFIX}cvxpy>0:math/py-cvxpy@${PY_FLAVOR}
+
+USES= compiler:c++11-lang python
+USE_PYTHON= pep517 autoplist pytest
+
+TEST_ENV= ${MAKE_ENV} PYTHONPATH=${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}
+
+post-install:
+ @${STRIP_CMD} ${STAGEDIR}${PYTHON_SITELIBDIR}/_diffcp${PYTHON_EXT_SUFFIX}.so
+
+.include <bsd.port.mk>
diff --git a/math/py-diffcp/distinfo b/math/py-diffcp/distinfo
new file mode 100644
index 000000000000..e576e6e42778
--- /dev/null
+++ b/math/py-diffcp/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1718822369
+SHA256 (diffcp-1.0.23.tar.gz) = 09fdcb3bc23668ccd09fdf3e20f790518c5b9be1877770bb6c265380c34f2199
+SIZE (diffcp-1.0.23.tar.gz) = 2198434
diff --git a/math/py-diffcp/files/patch-pyproject.toml b/math/py-diffcp/files/patch-pyproject.toml
new file mode 100644
index 000000000000..dce6bde7455a
--- /dev/null
+++ b/math/py-diffcp/files/patch-pyproject.toml
@@ -0,0 +1,15 @@
+--- pyproject.toml.orig 2024-06-19 18:46:39 UTC
++++ pyproject.toml
+@@ -2,9 +2,9 @@ requires = [
+ requires = [
+ "numpy>=1.15,<1.16; python_version=='3.7'",
+ "numpy>=1.17,<1.18; python_version=='3.8'",
+- "numpy>=1.19,<1.20; python_version=='3.9'",
+- "numpy>=1.21,<1.22; python_version=='3.10'",
+- "numpy>=1.23,<1.24; python_version=='3.11'",
++ "numpy; python_version=='3.9'",
++ "numpy; python_version=='3.10'",
++ "numpy; python_version=='3.11'",
+ "scipy>=1.1.0",
+ "pybind11>=2.4",
+ "setuptools",
diff --git a/math/py-diffcp/pkg-descr b/math/py-diffcp/pkg-descr
new file mode 100644
index 000000000000..d8017cbac786
--- /dev/null
+++ b/math/py-diffcp/pkg-descr
@@ -0,0 +1,4 @@
+diffcp is a Python package for computing the derivative of a convex cone
+program, with respect to its problem data. The derivative is implemented
+as an abstract linear map, with methods for its forward application and
+its adjoint.