aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuri Victorovich <yuri@FreeBSD.org>2024-04-26 01:15:15 +0000
committerYuri Victorovich <yuri@FreeBSD.org>2024-04-26 03:26:05 +0000
commita2851b786959d5b5ad821da82d167f435ed1bf8c (patch)
treec365ea7a81a526aa2b5bee3798acfb8c211bb1f6
parent458501362db4fef46442baaa14e37ca2ab1e2984 (diff)
downloadports-a2851b786959d5b5ad821da82d167f435ed1bf8c.tar.gz
ports-a2851b786959d5b5ad821da82d167f435ed1bf8c.zip
devel/py-nanobind: New port: Tiny and efficient C++/Python bindings
-rw-r--r--devel/Makefile1
-rw-r--r--devel/py-nanobind/Makefile37
-rw-r--r--devel/py-nanobind/distinfo5
-rw-r--r--devel/py-nanobind/files/patch-pyproject.toml9
-rw-r--r--devel/py-nanobind/pkg-descr5
5 files changed, 57 insertions, 0 deletions
diff --git a/devel/Makefile b/devel/Makefile
index c398cfa454c7..5440e3313dc4 100644
--- a/devel/Makefile
+++ b/devel/Makefile
@@ -5094,6 +5094,7 @@
SUBDIR += py-mypy_extensions
SUBDIR += py-mystic
SUBDIR += py-naiveBayesClassifier
+ SUBDIR += py-nanobind
SUBDIR += py-nanotime
SUBDIR += py-natsort
SUBDIR += py-natural
diff --git a/devel/py-nanobind/Makefile b/devel/py-nanobind/Makefile
new file mode 100644
index 000000000000..d39734df7c67
--- /dev/null
+++ b/devel/py-nanobind/Makefile
@@ -0,0 +1,37 @@
+PORTNAME= nanobind
+DISTVERSIONPREFIX= v
+DISTVERSION= 1.9.2
+CATEGORIES= devel python
+MASTER_SITES= PYPI
+PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
+
+MAINTAINER= yuri@FreeBSD.org
+COMMENT= Tiny and efficient C++/Python bindings
+WWW= https://github.com/wjakob/nanobind
+
+LICENSE= BSD3CLAUSE
+LICENSE_FILE= ${WRKSRC}/LICENSE
+
+BUILD_DEPENDS= ${PY_SETUPTOOLS} \
+ ${PYTHON_PKGNAMEPREFIX}scikit-build>0:devel/py-scikit-build@${PY_FLAVOR} \
+ ${PYTHON_PKGNAMEPREFIX}typing-extensions>0:devel/py-typing-extensions@${PY_FLAVOR} \
+ ${PYTHON_PKGNAMEPREFIX}wheel>0:devel/py-wheel@${PY_FLAVOR}
+TEST_DEPENDS= ${PYTHON_PKGNAMEPREFIX}pytest>0:devel/py-pytest@${PY_FLAVOR}
+
+USES= cmake:insource,testing python
+USE_PYTHON= pep517 autoplist
+
+USE_GITHUB= yes
+GH_ACCOUNT= wjakob
+GH_TUPLE= Tessil:robin-map:188c455:robin_map/ext/robin_map
+
+CMAKE_OFF= NB_TEST
+CMAKE_TESTING_ON= NB_TEST
+CMAKE_TESTING_TARGET=
+
+NO_ARCH= yes
+
+post-test: # run-tests
+ @cd ${WRKSRC} && ${SETENV} ${TEST_ENV} pytest .
+
+.include <bsd.port.mk>
diff --git a/devel/py-nanobind/distinfo b/devel/py-nanobind/distinfo
new file mode 100644
index 000000000000..e20bbfcbaeaf
--- /dev/null
+++ b/devel/py-nanobind/distinfo
@@ -0,0 +1,5 @@
+TIMESTAMP = 1714059630
+SHA256 (wjakob-nanobind-v1.9.2_GH0.tar.gz) = 149a3da40b0a988513d8cf5e71db3037373823505a3c92f87b988c92d7e0ab34
+SIZE (wjakob-nanobind-v1.9.2_GH0.tar.gz) = 785164
+SHA256 (Tessil-robin-map-188c455_GH0.tar.gz) = c3f05ed8933a1f9aa57295c8ad17bd44756cf5cf030a95325c61aa862fa19680
+SIZE (Tessil-robin-map-188c455_GH0.tar.gz) = 70577
diff --git a/devel/py-nanobind/files/patch-pyproject.toml b/devel/py-nanobind/files/patch-pyproject.toml
new file mode 100644
index 000000000000..90fb521c5bd4
--- /dev/null
+++ b/devel/py-nanobind/files/patch-pyproject.toml
@@ -0,0 +1,9 @@
+--- pyproject.toml.orig 2024-04-25 15:40:44 UTC
++++ pyproject.toml
+@@ -1,5 +1,5 @@
+ [build-system]
+-requires = ["setuptools>=42", "wheel", "scikit-build", "cmake>=3.17", "ninja"]
++requires = ["setuptools>=42", "wheel", "scikit-build"]
+ build-backend = "setuptools.build_meta"
+
+
diff --git a/devel/py-nanobind/pkg-descr b/devel/py-nanobind/pkg-descr
new file mode 100644
index 000000000000..52bfaa1ab0b0
--- /dev/null
+++ b/devel/py-nanobind/pkg-descr
@@ -0,0 +1,5 @@
+nanobind is a small binding library that exposes C++ types in Python and vice
+versa. It is reminiscent of Boost.Python and pybind11 and uses near-identical
+syntax. In contrast to these existing tools, nanobind is more efficient:
+bindings compile in a shorter amount of time, produce smaller binaries, and have
+better runtime performance.