From nobody Thu Aug 15 16:04:20 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 4Wl9111jjqz5SPHf; Thu, 15 Aug 2024 16:04:21 +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 4Wl9110Vycz4Xc9; Thu, 15 Aug 2024 16:04:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723737861; 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=SUr9gndVkV+ImJ9rEqulruGdGomfgEK8mV68bN0KK7g=; b=yCSkIHKy1JrHKGKwaK6aybvvoOZaG46CXyMueVXlCC0cml8kvM120g/WUNvNm8Qv+OTdTA qaxvYPvTbTjcoybzfnXMpSX/vQlBRMdpuFSRM1HYCYysN03CCELj+/EQjDPHyR63Vj5gNq l7ElB/T3SnQLWN6AF/8JTi3ZS07jA+s+EOzkMz4O6jlDZ1ty+LNqSQeoUoGJgxpeYSjvs6 QO94t6uyUVb/SGVbC/dKiAHC/FkQm5VBxvibVVK0TnLoJ5+CkNMrMMU2PS8VILzzLjEN51 S/iJdtbTqHFp2t2aBI+qzGdQvbfpNG3xANri2RFsdYZWhi0louBXUPLzappaGw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1723737861; a=rsa-sha256; cv=none; b=TOwsRcWuchzo5hAWzZC7SqBfk2swrkI3+wJYW1VqPdgLCUtv+4+GLF5rFFOxca+4FSE7S7 KCIveHrY7khlcT32CStWxDpjzvMi3ADEFZLIqECeoQsGOTxWYIXzrpSYLSiqYR0RP41hhk AiPxLqrrfq4mklaz4vVB6LSPYYbEHrSqexeYsJghn29zDCYR6gIhDbSSNdYjgSdZBG/Wxx whjyCwlaVLkYm9Dmn3k7Rg/TfiFYqyd8OegbMbA/tCE8/FHvjT17ZL0j+1UzOf7u6qQRMS 32vXmfy1Hl21FK3BeE5nNXpR1tQenldYR/SsbFtRkLY2PdLNbCY0GiNoLpBSLg== 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=1723737861; 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=SUr9gndVkV+ImJ9rEqulruGdGomfgEK8mV68bN0KK7g=; b=seiOXsfWenPpbqk+v00R99DeGZyYOK/r8YsdmRvXpUq/ziMa7bMen46XAWUhs7t9uXzXwV /zqAXa5mbxrlgtrnOmm04h6orNuesclpxPdFpQUQ1wx9EhtmvmsYYctmUfIwnryIOCvBro P4WU/RB52mKhBxc9KVRAe0xnbKqxgNbafQ2ENDwedETbYApg4XEUukvYfOONU0fMz4qYUJ upgEV/mokxj6/SaQCLeZVUifSGcXEgjllX87AfMI+YJm38Ac93ZoQ+F3RCDsI/XnimwjQS HwBDLsqCu0d3VOhlq3Y4H4GkqCbwSgruGnV3sgY6ucpnkfP30I0YweOoB72PBA== 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 4Wl91106NqzVGc; Thu, 15 Aug 2024 16:04:21 +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 47FG4Kt5086252; Thu, 15 Aug 2024 16:04:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47FG4KIY086249; Thu, 15 Aug 2024 16:04:20 GMT (envelope-from git) Date: Thu, 15 Aug 2024 16:04:20 GMT Message-Id: <202408151604.47FG4KIY086249@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Po-Chuan Hsieh Subject: git: 9c8d5c323a8f - main - devel/pybind11_protobuf: Add pybind11_protobuf 0.0.0.20240809 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: sunpoet X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9c8d5c323a8f0ec3dc3c882483979dd8f9e98c23 Auto-Submitted: auto-generated The branch main has been updated by sunpoet: URL: https://cgit.FreeBSD.org/ports/commit/?id=9c8d5c323a8f0ec3dc3c882483979dd8f9e98c23 commit 9c8d5c323a8f0ec3dc3c882483979dd8f9e98c23 Author: Po-Chuan Hsieh AuthorDate: 2024-08-15 16:00:07 +0000 Commit: Po-Chuan Hsieh CommitDate: 2024-08-15 16:00:07 +0000 devel/pybind11_protobuf: Add pybind11_protobuf 0.0.0.20240809 pybind11_protobuf provides pybind11 bindings for Google's Protocol Buffers. These adapters make Protocol Buffer message types work with Pybind11 bindings. --- devel/Makefile | 1 + devel/pybind11_protobuf/Makefile | 30 ++++ devel/pybind11_protobuf/distinfo | 3 + devel/pybind11_protobuf/files/patch-CMakeLists.txt | 169 +++++++++++++++++++++ devel/pybind11_protobuf/pkg-descr | 2 + devel/pybind11_protobuf/pkg-plist | 5 + 6 files changed, 210 insertions(+) diff --git a/devel/Makefile b/devel/Makefile index 5e7edde752aa..d35a1a028d2c 100644 --- a/devel/Makefile +++ b/devel/Makefile @@ -6095,6 +6095,7 @@ SUBDIR += pybind11 SUBDIR += pybind11-json SUBDIR += pybind11_abseil + SUBDIR += pybind11_protobuf SUBDIR += pybugz SUBDIR += pycanberra SUBDIR += pycdc diff --git a/devel/pybind11_protobuf/Makefile b/devel/pybind11_protobuf/Makefile new file mode 100644 index 000000000000..88cd22cc3eb7 --- /dev/null +++ b/devel/pybind11_protobuf/Makefile @@ -0,0 +1,30 @@ +PORTNAME= pybind11_protobuf +PORTVERSION= 0.0.0.20240809 +CATEGORIES= devel + +MAINTAINER= sunpoet@FreeBSD.org +COMMENT= Pybind11 bindings for Google's Protocol Buffers +WWW= https://github.com/pybind/pybind11_protobuf + +LICENSE= BSD3CLAUSE +LICENSE_FILE= ${WRKSRC}/LICENSE + +BUILD_DEPENDS= abseil>=20230125:devel/abseil \ + pybind11>=2.11.1:devel/pybind11 +LIB_DEPENDS= libabsl_base.so:devel/abseil \ + libprotobuf.so:devel/protobuf + +USES= cmake compiler:c++17-lang python + +CFLAGS+= -I${WRKSRC} +CMAKE_ARGS= -DCMAKE_INSTALL_PYDIR=${PYTHON_SITELIBDIR} +CMAKE_OFF= BUILD_TESTING +CMAKE_ON= USE_SYSTEM_ABSEIL \ + USE_SYSTEM_PROTOBUF \ + USE_SYSTEM_PYBIND + +USE_GITHUB= yes +GH_ACCOUNT= pybind +GH_TAGNAME= f1b2459 + +.include diff --git a/devel/pybind11_protobuf/distinfo b/devel/pybind11_protobuf/distinfo new file mode 100644 index 000000000000..ad0ae136ad66 --- /dev/null +++ b/devel/pybind11_protobuf/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1723644507 +SHA256 (pybind-pybind11_protobuf-0.0.0.20240809-f1b2459_GH0.tar.gz) = ac216afa9a50c37834906f224fbe8d3e47b2b0299cb12ff12588233a479413ee +SIZE (pybind-pybind11_protobuf-0.0.0.20240809-f1b2459_GH0.tar.gz) = 56508 diff --git a/devel/pybind11_protobuf/files/patch-CMakeLists.txt b/devel/pybind11_protobuf/files/patch-CMakeLists.txt new file mode 100644 index 000000000000..8bbae9aae903 --- /dev/null +++ b/devel/pybind11_protobuf/files/patch-CMakeLists.txt @@ -0,0 +1,169 @@ +--- CMakeLists.txt.orig 2024-08-09 17:15:35 UTC ++++ CMakeLists.txt +@@ -39,9 +39,9 @@ if(USE_SYSTEM_PROTOBUF) + set(_absl_package_args 20230125) + endif() + if(USE_SYSTEM_PROTOBUF) +- set(_protobuf_package_args 4.23.3 REQUIRED) ++ set(_protobuf_package_args REQUIRED) + else() +- set(_protobuf_package_args 4.23.3) ++ set(_protobuf_package_args) + endif() + if(USE_SYSTEM_PYBIND) + set(_pybind11_package_args 2.11.1 REQUIRED) +@@ -52,32 +52,11 @@ set(ABSL_ENABLE_INSTALL ON) + set(ABSL_PROPAGATE_CXX_STD ON) + set(ABSL_ENABLE_INSTALL ON) + +-include(FetchContent) +-FetchContent_Declare( +- absl +- GIT_REPOSITORY "https://github.com/abseil/abseil-cpp.git" +- GIT_TAG 20230125.3 +- FIND_PACKAGE_ARGS ${_absl_package_args} NAMES absl) +- +-# cmake-format: off +-FetchContent_Declare( +- Protobuf +- GIT_REPOSITORY "https://github.com/protocolbuffers/protobuf.git" +- GIT_TAG v23.3 +- GIT_SUBMODULES "" +- FIND_PACKAGE_ARGS ${_protobuf_package_args} NAMES protobuf) +-set(protobuf_BUILD_TESTS OFF CACHE INTERNAL "") +-# cmake-format: on +- +-FetchContent_Declare( +- pybind11 +- GIT_REPOSITORY "https://github.com/pybind/pybind11.git" +- GIT_TAG v2.11.1 +- FIND_PACKAGE_ARGS ${_pybind11_package_args} NAMES pybind11) +- + message(CHECK_START "Checking for external dependencies") ++find_package(absl ${_absl_package_args}) ++find_package(protobuf ${_protobuf_package_args}) ++find_package(pybind11 ${_pybind11_package_args}) + list(APPEND CMAKE_MESSAGE_INDENT " ") +-FetchContent_MakeAvailable(absl Protobuf pybind11) + list(POP_BACK CMAKE_MESSAGE_INDENT) + + # ============================================================================ +@@ -97,7 +76,7 @@ add_library( + # ============================================================================ + # pybind11_native_proto_caster shared library + add_library( +- pybind11_native_proto_caster STATIC ++ pybind11_native_proto_caster SHARED + # bazel: pybind_library: native_proto_caster + pybind11_protobuf/native_proto_caster.h + # bazel: pybind_library: enum_type_caster +@@ -106,6 +85,16 @@ add_library( + pybind11_protobuf/proto_cast_util.cc + pybind11_protobuf/proto_cast_util.h + pybind11_protobuf/proto_caster_impl.h) ++add_library( ++ pybind11_native_proto_caster_static STATIC ++ # bazel: pybind_library: native_proto_caster ++ pybind11_protobuf/native_proto_caster.h ++ # bazel: pybind_library: enum_type_caster ++ pybind11_protobuf/enum_type_caster.h ++ # bazel: pybind_library: proto_cast_util ++ pybind11_protobuf/proto_cast_util.cc ++ pybind11_protobuf/proto_cast_util.h ++ pybind11_protobuf/proto_caster_impl.h) + + target_link_libraries( + pybind11_native_proto_caster +@@ -117,22 +106,45 @@ target_link_libraries( + protobuf::libprotobuf + pybind11::pybind11 + ${Python_LIBRARIES}) ++target_link_libraries( ++ pybind11_native_proto_caster_static ++ absl::flat_hash_map ++ absl::flat_hash_set ++ absl::hash ++ absl::strings ++ absl::optional ++ protobuf::libprotobuf ++ pybind11::pybind11 ++ ${Python_LIBRARIES}) + + target_include_directories( + pybind11_native_proto_caster + PRIVATE ${PROJECT_SOURCE_DIR} ${protobuf_INCLUDE_DIRS} ${protobuf_SOURCE_DIR} + ${pybind11_INCLUDE_DIRS}) ++target_include_directories( ++ pybind11_native_proto_caster_static ++ PRIVATE ${PROJECT_SOURCE_DIR} ${protobuf_INCLUDE_DIRS} ${protobuf_SOURCE_DIR} ++ ${pybind11_INCLUDE_DIRS}) ++set_target_properties(pybind11_native_proto_caster_static PROPERTIES OUTPUT_NAME pybind11_native_proto_caster) + + # ============================================================================ + # pybind11_wrapped_proto_caster shared library + add_library( +- pybind11_wrapped_proto_caster STATIC ++ pybind11_wrapped_proto_caster SHARED + # bazel: pybind_library: wrapped_proto_caster + pybind11_protobuf/wrapped_proto_caster.h + # bazel: pybind_library: proto_cast_util + pybind11_protobuf/proto_cast_util.cc + pybind11_protobuf/proto_cast_util.h + pybind11_protobuf/proto_caster_impl.h) ++add_library( ++ pybind11_wrapped_proto_caster_static STATIC ++ # bazel: pybind_library: wrapped_proto_caster ++ pybind11_protobuf/wrapped_proto_caster.h ++ # bazel: pybind_library: proto_cast_util ++ pybind11_protobuf/proto_cast_util.cc ++ pybind11_protobuf/proto_cast_util.h ++ pybind11_protobuf/proto_caster_impl.h) + + target_link_libraries( + pybind11_wrapped_proto_caster +@@ -144,11 +156,26 @@ target_link_libraries( + protobuf::libprotobuf + pybind11::pybind11 + ${Python_LIBRARIES}) ++target_link_libraries( ++ pybind11_wrapped_proto_caster_static ++ absl::flat_hash_map ++ absl::flat_hash_set ++ absl::hash ++ absl::strings ++ absl::optional ++ protobuf::libprotobuf ++ pybind11::pybind11 ++ ${Python_LIBRARIES}) + + target_include_directories( + pybind11_wrapped_proto_caster + PRIVATE ${PROJECT_SOURCE_DIR} ${protobuf_INCLUDE_DIRS} ${protobuf_SOURCE_DIR} + ${pybind11_INCLUDE_DIRS}) ++target_include_directories( ++ pybind11_wrapped_proto_caster_static ++ PRIVATE ${PROJECT_SOURCE_DIR} ${protobuf_INCLUDE_DIRS} ${protobuf_SOURCE_DIR} ++ ${pybind11_INCLUDE_DIRS}) ++set_target_properties(pybind11_wrapped_proto_caster_static PROPERTIES OUTPUT_NAME pybind11_wrapped_proto_caster) + + if(BUILD_TESTING) + add_subdirectory(pybind11_protobuf/tests) +@@ -171,3 +198,18 @@ endif() + # + # proto_cast_util + # ++ ++install( ++ TARGETS pybind11_native_proto_caster pybind11_native_proto_caster_static pybind11_wrapped_proto_caster pybind11_wrapped_proto_caster_static ++ EXPORT pybind11_protobufTargets ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR} ++) ++install( ++ TARGETS pybind11_proto_utils ++ EXPORT pybind11_protobufTargets ++ LIBRARY DESTINATION ${CMAKE_INSTALL_PYDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_PYDIR} ++ RUNTIME DESTINATION ${CMAKE_INSTALL_PYDIR} ++) diff --git a/devel/pybind11_protobuf/pkg-descr b/devel/pybind11_protobuf/pkg-descr new file mode 100644 index 000000000000..f09891059e83 --- /dev/null +++ b/devel/pybind11_protobuf/pkg-descr @@ -0,0 +1,2 @@ +pybind11_protobuf provides pybind11 bindings for Google's Protocol Buffers. +These adapters make Protocol Buffer message types work with Pybind11 bindings. diff --git a/devel/pybind11_protobuf/pkg-plist b/devel/pybind11_protobuf/pkg-plist new file mode 100644 index 000000000000..f37f88738eb5 --- /dev/null +++ b/devel/pybind11_protobuf/pkg-plist @@ -0,0 +1,5 @@ +lib/libpybind11_native_proto_caster.a +lib/libpybind11_native_proto_caster.so +lib/libpybind11_wrapped_proto_caster.a +lib/libpybind11_wrapped_proto_caster.so +%%PYTHON_SITELIBDIR%%/pybind11_proto_utils%%PYTHON_EXT_SUFFIX%%.so