Skip to content

Commit

Permalink
devel/py-nanobind: New port: Tiny and efficient C++/Python bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
yurivict committed Apr 26, 2024
1 parent 4585013 commit a2851b7
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 0 deletions.
1 change: 1 addition & 0 deletions devel/Makefile
Expand Up @@ -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
Expand Down
37 changes: 37 additions & 0 deletions 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>
5 changes: 5 additions & 0 deletions 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
9 changes: 9 additions & 0 deletions 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"


5 changes: 5 additions & 0 deletions 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.

0 comments on commit a2851b7

Please sign in to comment.