From nobody Sun Aug 11 18:37:22 2024 X-Original-To: dev-commits-ports-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WhmbR0lyqz5TP21; Sun, 11 Aug 2024 18:37:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WhmbR07Y6z4RK0; Sun, 11 Aug 2024 18:37:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723401443; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SeimIr30P4GBZ34fwbUlGS0fpPT7ymLIvhyyrQdAJR8=; b=n5GKKteUhjjZXN/m16hIHMLqQ/2czfI+Fp0qjU1j+H8UotSw96v9mj03PfBky+fss0LLzq +xFCTil0cGe9bSpK7/9lgMySl4U85UNxKDpYhyYSlHrt+P/q8nKQIk1gZZ5NKQ79wVLHKl 5CS/2xmAr3mYVNm3QDXE+iwvKqGBAKx2qBmpkQxfMNujWXHxlSmJSbtiXcCC7o426UokO2 vtAZxzBG/ENC7UgVxaxnhpCWQs+tLXeYm9Fx7J74e8fPHwdM4dJmEeHB/l/J/XZcvwcUJi VIr5E0+HENTrzFdunRI+3PDBDNbHSNBThDW27FlpJlUkPI+VIYgOGveZy/dDTA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1723401443; a=rsa-sha256; cv=none; b=c24wwfGrGW6gNy5zHyJ8e9eUMOgyPM3Avk7nzdtXvZBthZL6SqadCQfzFwiG219Nj9cl1P oqNejBoGeJvL6rVNMLaO/woDfk4hCcxVV6eBS2VPM0NHQZ/miogvgR4eOTHU1L6x4fvyxn Do4+vNxYM6HmS1//+DYxAzcydnsXm7RSFVVPnWtyYPcUcdU169jctbsimCtA+gk7mHR4gZ WH5opMpz/SSuF9jzOLqguBQzYzsUMLWZT21TFGbS31u4YqM8HVVe+KIA9Jvg1AFmFBKfPE btvcw9PpUfbDPhbzj0m6gofo+fIrvuylRZZGUEVrCPqcTSY+O+qpHTSqWO6SQA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723401443; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SeimIr30P4GBZ34fwbUlGS0fpPT7ymLIvhyyrQdAJR8=; b=Cdv7lGvrzHdgo1pAMr6zBmMpbFDnoz3sUkag9x7QUlked5Z0XZk7jjQiMNxd8WIhR/J8+u HwiaywHg0aiH2IKXefgj3KnYz+kpbm+7xjfHSCrSqau8CntP9NAMcSxDJTwGG8pnuEgb8J S8FzvdveeCC40YojJIN5cv750kDksbQfAHdqqCpnreuOs6bbNkGZSy8xfSEUGenkJsrYgm MCoXKOo944aNvUkEFWFpw5kUJ0Oqn+iJmeloe6vzQKBARcbvEd13npDc4oby9e03UnQZD9 GA7cayQ74ybcMBggrsLvf+HDQSyi7H5VGbdxqWbnO3ne51iUiQ0goTtO0CJkMQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WhmbQ6mdBzvX1; Sun, 11 Aug 2024 18:37:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47BIbMH3077116; Sun, 11 Aug 2024 18:37:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47BIbM80077113; Sun, 11 Aug 2024 18:37:22 GMT (envelope-from git) Date: Sun, 11 Aug 2024 18:37:22 GMT Message-Id: <202408111837.47BIbM80077113@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Yuri Victorovich Subject: git: 7971fb54fa95 - main - devel/nanobind: New port: Tiny and efficient C++/Python bindings (C++ version) List-Id: Commit messages for all branches of the ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-ports-all@freebsd.org Sender: owner-dev-commits-ports-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: yuri X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7971fb54fa95547cdddfb13b8a2c0abb673b8d10 Auto-Submitted: auto-generated The branch main has been updated by yuri: URL: https://cgit.FreeBSD.org/ports/commit/?id=7971fb54fa95547cdddfb13b8a2c0abb673b8d10 commit 7971fb54fa95547cdddfb13b8a2c0abb673b8d10 Author: Yuri Victorovich AuthorDate: 2024-08-11 18:36:37 +0000 Commit: Yuri Victorovich CommitDate: 2024-08-11 18:37:20 +0000 devel/nanobind: New port: Tiny and efficient C++/Python bindings (C++ version) --- devel/Makefile | 1 + devel/nanobind/Makefile | 46 ++++++++++++++++++++++++++++++++++ devel/nanobind/distinfo | 5 ++++ devel/nanobind/files/myext.cpp | 8 ++++++ devel/nanobind/files/test.py | 5 ++++ devel/nanobind/pkg-descr | 5 ++++ devel/nanobind/pkg-plist | 57 ++++++++++++++++++++++++++++++++++++++++++ 7 files changed, 127 insertions(+) diff --git a/devel/Makefile b/devel/Makefile index 87d1846b8477..4786d0e9c760 100644 --- a/devel/Makefile +++ b/devel/Makefile @@ -1681,6 +1681,7 @@ SUBDIR += myrepos SUBDIR += nana SUBDIR += nano-signal-slot + SUBDIR += nanobind SUBDIR += nanopb SUBDIR += nant SUBDIR += nasm diff --git a/devel/nanobind/Makefile b/devel/nanobind/Makefile new file mode 100644 index 000000000000..a66823ddd61e --- /dev/null +++ b/devel/nanobind/Makefile @@ -0,0 +1,46 @@ +PORTNAME= nanobind +DISTVERSIONPREFIX= v +DISTVERSION= 2.1.0 +CATEGORIES= devel + +MAINTAINER= yuri@FreeBSD.org +COMMENT= Tiny and efficient C++/Python bindings (C++ version) +WWW= https://github.com/wjakob/nanobind + +LICENSE= BSD3CLAUSE +LICENSE_FILE= ${WRKSRC}/LICENSE + +BUILD_DEPENDS= robin-map>0:devel/robin-map +RUN_DEPENDS= robin-map>0:devel/robin-map + +USES= localbase python + +USE_GITHUB= yes +GH_ACCOUNT= wjakob + +CXXFLAGS+= -I${WRKSRC}/include \ + -I${PYTHON_INCLUDEDIR} + +do-build: # cmake scripts don't build the shared library + @cd ${WRKSRC}/src && \ + ${SETENV} ${MAKE_ENV} ${CXX} \ + ${CXXFLAGS} ${LDFLAGS} \ + -fPIC \ + -shared \ + -Wl,-soname=libnanobind.so \ + -o libnanobind.so \ + nb_combined.cpp + +do-install: + # install headers + cd ${WRKSRC}/include && ${COPYTREE_SHARE} . ${STAGEDIR}${PREFIX}/include + # install shared library + ${INSTALL_LIB} ${WRKSRC}/src/libnanobind.so ${STAGEDIR}${PREFIX}/lib + +do-test: # test fails because it doesn't create the PyInit_xx function + @cd ${WRKSRC} && \ + ${CXX} ${CXXFLAGS} ${LDFLAGS} -shared -o ${FILESDIR}/myext.cpp -o myext${PYTHON_EXT_SUFFIX}.so -L${LOCALBASE}/lib -lnanobind && \ + ${CP} ${FILESDIR}/test.py . && \ + ${PYTHON_CMD} ${FILESDIR}/test.py + +.include diff --git a/devel/nanobind/distinfo b/devel/nanobind/distinfo new file mode 100644 index 000000000000..544977c86605 --- /dev/null +++ b/devel/nanobind/distinfo @@ -0,0 +1,5 @@ +TIMESTAMP = 1723358161 +SHA256 (wjakob-nanobind-v2.1.0_GH0.tar.gz) = c37c53c60ada5fe1c956e24bd4b83af669a2309bf952bd251f36a7d2fa3bacf0 +SIZE (wjakob-nanobind-v2.1.0_GH0.tar.gz) = 850714 +SHA256 (Tessil-robin-map-188c455_GH0.tar.gz) = c3f05ed8933a1f9aa57295c8ad17bd44756cf5cf030a95325c61aa862fa19680 +SIZE (Tessil-robin-map-188c455_GH0.tar.gz) = 70577 diff --git a/devel/nanobind/files/myext.cpp b/devel/nanobind/files/myext.cpp new file mode 100644 index 000000000000..4205447d5f80 --- /dev/null +++ b/devel/nanobind/files/myext.cpp @@ -0,0 +1,8 @@ +#include + +int add(int a, int b) { return a + b; } + +NB_MODULE(myext, m) { + m.def("add", &add); +} + diff --git a/devel/nanobind/files/test.py b/devel/nanobind/files/test.py new file mode 100644 index 000000000000..35bf61155c3c --- /dev/null +++ b/devel/nanobind/files/test.py @@ -0,0 +1,5 @@ + +import myext + + +print('Test succeeded.') diff --git a/devel/nanobind/pkg-descr b/devel/nanobind/pkg-descr new file mode 100644 index 000000000000..52bfaa1ab0b0 --- /dev/null +++ b/devel/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. diff --git a/devel/nanobind/pkg-plist b/devel/nanobind/pkg-plist new file mode 100644 index 000000000000..401fdc113df1 --- /dev/null +++ b/devel/nanobind/pkg-plist @@ -0,0 +1,57 @@ +include/nanobind/eigen/dense.h +include/nanobind/eigen/sparse.h +include/nanobind/eval.h +include/nanobind/intrusive/counter.h +include/nanobind/intrusive/counter.inl +include/nanobind/intrusive/ref.h +include/nanobind/make_iterator.h +include/nanobind/nanobind.h +include/nanobind/nb_accessor.h +include/nanobind/nb_attr.h +include/nanobind/nb_call.h +include/nanobind/nb_cast.h +include/nanobind/nb_class.h +include/nanobind/nb_defs.h +include/nanobind/nb_descr.h +include/nanobind/nb_enums.h +include/nanobind/nb_error.h +include/nanobind/nb_func.h +include/nanobind/nb_lib.h +include/nanobind/nb_misc.h +include/nanobind/nb_python.h +include/nanobind/nb_traits.h +include/nanobind/nb_tuple.h +include/nanobind/nb_types.h +include/nanobind/ndarray.h +include/nanobind/operators.h +include/nanobind/stl/array.h +include/nanobind/stl/bind_map.h +include/nanobind/stl/bind_vector.h +include/nanobind/stl/chrono.h +include/nanobind/stl/complex.h +include/nanobind/stl/detail/chrono.h +include/nanobind/stl/detail/nb_array.h +include/nanobind/stl/detail/nb_dict.h +include/nanobind/stl/detail/nb_list.h +include/nanobind/stl/detail/nb_set.h +include/nanobind/stl/detail/traits.h +include/nanobind/stl/filesystem.h +include/nanobind/stl/function.h +include/nanobind/stl/list.h +include/nanobind/stl/map.h +include/nanobind/stl/optional.h +include/nanobind/stl/pair.h +include/nanobind/stl/set.h +include/nanobind/stl/shared_ptr.h +include/nanobind/stl/string.h +include/nanobind/stl/string_view.h +include/nanobind/stl/tuple.h +include/nanobind/stl/unique_ptr.h +include/nanobind/stl/unordered_map.h +include/nanobind/stl/unordered_set.h +include/nanobind/stl/variant.h +include/nanobind/stl/vector.h +include/nanobind/stl/wstring.h +include/nanobind/trampoline.h +include/nanobind/typing.h +lib/libnanobind.so