Date: Mon, 22 Nov 2021 19:54:08 GMT From: Jan Beich <jbeich@FreeBSD.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org Subject: git: d05e8a33332c - main - devel/sdbus-cpp: add new port Message-ID: <202111221954.1AMJs8L5032990@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch main has been updated by jbeich: URL: https://cgit.FreeBSD.org/ports/commit/?id=d05e8a33332c2a3e4519178d69ee7c91dfe51eb7 commit d05e8a33332c2a3e4519178d69ee7c91dfe51eb7 Author: Jan Beich <jbeich@FreeBSD.org> AuthorDate: 2021-10-25 07:02:37 +0000 Commit: Jan Beich <jbeich@FreeBSD.org> CommitDate: 2021-11-22 19:53:24 +0000 devel/sdbus-cpp: add new port sdbus-c++ is a high-level C++ D-Bus library for Linux designed to provide expressive, easy-to-use API in modern C++. It adds another layer of abstraction on top of sd-bus, a nice, fresh C D-Bus implementation by systemd. sdbus-c++ has been written primarily as a replacement of dbus-c++, which currently suffers from a number of (unresolved) bugs, concurrency issues and inherent design complexities and limitations. sdbus-c++ has learned from dbus-c++ and has chosen a different path, a path of simple yet powerful design that is intuitive and friendly to the user and inherently free of those bugs. Even though sdbus-c++ uses sd-bus library, it is not necessarily constrained to systemd and can perfectly be used in non-systemd environments as well. https://github.com/Kistler-Group/sdbus-cpp --- devel/Makefile | 1 + devel/sdbus-cpp/Makefile | 32 ++++++ devel/sdbus-cpp/distinfo | 3 + devel/sdbus-cpp/files/patch-basu | 214 +++++++++++++++++++++++++++++++++++++++ devel/sdbus-cpp/pkg-descr | 17 ++++ devel/sdbus-cpp/pkg-plist | 29 ++++++ 6 files changed, 296 insertions(+) diff --git a/devel/Makefile b/devel/Makefile index 2865db59f806..09095e62564a 100644 --- a/devel/Makefile +++ b/devel/Makefile @@ -6974,6 +6974,7 @@ SUBDIR += schilybase SUBDIR += scons SUBDIR += sd-mux-ctrl + SUBDIR += sdbus-cpp SUBDIR += sdl12 SUBDIR += sdl12-compat SUBDIR += sdl20 diff --git a/devel/sdbus-cpp/Makefile b/devel/sdbus-cpp/Makefile new file mode 100644 index 000000000000..ddeba68570af --- /dev/null +++ b/devel/sdbus-cpp/Makefile @@ -0,0 +1,32 @@ +PORTNAME= sdbus-cpp +DISTVERSIONPREFIX= v +DISTVERSION= 1.0.0 +CATEGORIES= devel + +MAINTAINER= jbeich@FreeBSD.org +COMMENT= High-level C++ D-Bus library + +LICENSE= LGPL21+ +LICENSE_FILE= ${WRKSRC}/COPYING + +LIB_DEPENDS= libbasu.so:devel/basu \ + libexpat.so:textproc/expat2 +TEST_DEPENDS= googletest>0:devel/googletest + +USES= cmake:testing compiler:c++17-lang pkgconfig +USE_GITHUB= yes +USE_LDCONFIG= yes +GH_ACCOUNT= Kistler-Group +CMAKE_ON= BUILD_CODE_GEN +CMAKE_OFF= BUILD_DOC +CMAKE_TESTING_ON= BUILD_TESTS + +.include <bsd.port.options.mk> + +.if ${OPSYS} != FreeBSD || ${OSVERSION} < 1300134 +LIB_DEPENDS+= libepoll-shim.so:devel/libepoll-shim +CFLAGS+= `pkg-config --cflags epoll-shim` +LDFLAGS+= `pkg-config --libs epoll-shim` +.endif + +.include <bsd.port.mk> diff --git a/devel/sdbus-cpp/distinfo b/devel/sdbus-cpp/distinfo new file mode 100644 index 000000000000..9e0e6fe34089 --- /dev/null +++ b/devel/sdbus-cpp/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1635145357 +SHA256 (Kistler-Group-sdbus-cpp-v1.0.0_GH0.tar.gz) = 3db82112c0d8a171a4115d761e3a592b62091fa7600988736652595178ae4e94 +SIZE (Kistler-Group-sdbus-cpp-v1.0.0_GH0.tar.gz) = 202061 diff --git a/devel/sdbus-cpp/files/patch-basu b/devel/sdbus-cpp/files/patch-basu new file mode 100644 index 000000000000..aae455b3c498 --- /dev/null +++ b/devel/sdbus-cpp/files/patch-basu @@ -0,0 +1,214 @@ +libsystemd is Linux-only, so replace with basu + +--- CMakeLists.txt.orig 2021-10-25 07:02:37 UTC ++++ CMakeLists.txt +@@ -16,15 +16,14 @@ option(BUILD_LIBSYSTEMD "Build libsystemd static libra + + if(NOT BUILD_LIBSYSTEMD) + find_package(PkgConfig REQUIRED) +- pkg_check_modules(Systemd IMPORTED_TARGET GLOBAL libsystemd>=236) ++ pkg_check_modules(Systemd IMPORTED_TARGET GLOBAL basu) + if(NOT TARGET PkgConfig::Systemd) + message(FATAL_ERROR "libsystemd of version at least 236 is required, but was not found " + "(you may turn BUILD_LIBSYSTEMD on for sdbus-c++ to try downloading " + "and building libsystemd in as part of sdbus-c++ during configuration)") + endif() + add_library(Systemd::Libsystemd ALIAS PkgConfig::Systemd) +- string(REGEX MATCHALL "([0-9]+)" SYSTEMD_VERSION_LIST "${Systemd_VERSION}") +- list(GET SYSTEMD_VERSION_LIST 0 LIBSYSTEMD_VERSION) ++ set(LIBSYSTEMD_VERSION "239") + message(STATUS "Building with libsystemd v${LIBSYSTEMD_VERSION}") + else() + # Build static libsystemd library as an external project +--- src/Connection.cpp.orig 2021-10-25 07:02:37 UTC ++++ src/Connection.cpp +@@ -30,7 +30,7 @@ + #include <sdbus-c++/Message.h> + #include <sdbus-c++/Error.h> + #include "ScopeGuard.h" +-#include <systemd/sd-bus.h> ++#include <basu/sd-bus.h> + #include <unistd.h> + #include <poll.h> + #include <sys/eventfd.h> +--- src/Connection.h.orig 2021-10-25 07:02:37 UTC ++++ src/Connection.h +@@ -32,7 +32,7 @@ + #include "IConnection.h" + #include "ScopeGuard.h" + #include "ISdBus.h" +-#include <systemd/sd-bus.h> ++#include <basu/sd-bus.h> + #include <memory> + #include <thread> + #include <string> +--- src/Error.cpp.orig 2021-10-25 07:02:37 UTC ++++ src/Error.cpp +@@ -25,7 +25,7 @@ + */ + + #include <sdbus-c++/Error.h> +-#include <systemd/sd-bus.h> ++#include <basu/sd-bus.h> + #include "ScopeGuard.h" + + namespace sdbus +--- src/Flags.cpp.orig 2021-10-25 07:02:37 UTC ++++ src/Flags.cpp +@@ -25,7 +25,7 @@ + */ + + #include <sdbus-c++/Flags.h> +-#include <systemd/sd-bus.h> ++#include <basu/sd-bus.h> + + namespace sdbus + { +--- src/IConnection.h.orig 2021-10-25 07:02:37 UTC ++++ src/IConnection.h +@@ -27,7 +27,7 @@ + #ifndef SDBUS_CXX_INTERNAL_ICONNECTION_H_ + #define SDBUS_CXX_INTERNAL_ICONNECTION_H_ + +-#include <systemd/sd-bus.h> ++#include <basu/sd-bus.h> + #include <string> + #include <memory> + #include <functional> +--- src/ISdBus.h.orig 2021-10-25 07:02:37 UTC ++++ src/ISdBus.h +@@ -28,7 +28,7 @@ + #ifndef SDBUS_CXX_ISDBUS_H + #define SDBUS_CXX_ISDBUS_H + +-#include <systemd/sd-bus.h> ++#include <basu/sd-bus.h> + + namespace sdbus::internal { + +--- src/Message.cpp.orig 2021-10-25 07:02:37 UTC ++++ src/Message.cpp +@@ -31,7 +31,7 @@ + #include "ISdBus.h" + #include "IConnection.h" + #include "ScopeGuard.h" +-#include <systemd/sd-bus.h> ++#include <basu/sd-bus.h> + #include <cassert> + + namespace sdbus { +--- src/Object.cpp.orig 2021-10-25 07:02:37 UTC ++++ src/Object.cpp +@@ -34,7 +34,7 @@ + #include "ScopeGuard.h" + #include "IConnection.h" + #include "VTableUtils.h" +-#include <systemd/sd-bus.h> ++#include <basu/sd-bus.h> + #include <utility> + #include <cassert> + +--- src/Object.h.orig 2021-10-25 07:02:37 UTC ++++ src/Object.h +@@ -29,7 +29,7 @@ + + #include <sdbus-c++/IObject.h> + #include "IConnection.h" +-#include <systemd/sd-bus.h> ++#include <basu/sd-bus.h> + #include <string> + #include <map> + #include <vector> +--- src/Proxy.cpp.orig 2021-10-25 07:02:37 UTC ++++ src/Proxy.cpp +@@ -31,7 +31,7 @@ + #include "sdbus-c++/IConnection.h" + #include "sdbus-c++/Error.h" + #include "ScopeGuard.h" +-#include <systemd/sd-bus.h> ++#include <basu/sd-bus.h> + #include <cassert> + #include <chrono> + #include <utility> +--- src/Proxy.h.orig 2021-10-25 07:02:37 UTC ++++ src/Proxy.h +@@ -29,7 +29,7 @@ + + #include <sdbus-c++/IProxy.h> + #include "IConnection.h" +-#include <systemd/sd-bus.h> ++#include <basu/sd-bus.h> + #include <string> + #include <memory> + #include <map> +--- src/SdBus.cpp.orig 2021-10-25 07:02:37 UTC ++++ src/SdBus.cpp +@@ -178,7 +178,8 @@ int SdBus::sd_bus_open_system(sd_bus **ret) + + int SdBus::sd_bus_open_system_remote(sd_bus **ret, const char *host) + { +- return ::sd_bus_open_system_remote(ret, host); ++ // Removed in https://git.sr.ht/~emersion/basu/commit/01d33b244eb6 ++ return -EOPNOTSUPP; + } + + int SdBus::sd_bus_request_name(sd_bus *bus, const char *name, uint64_t flags) +--- src/Types.cpp.orig 2021-10-25 07:02:37 UTC ++++ src/Types.cpp +@@ -27,7 +27,7 @@ + #include <sdbus-c++/Types.h> + #include <sdbus-c++/Error.h> + #include "MessageUtils.h" +-#include <systemd/sd-bus.h> ++#include <basu/sd-bus.h> + #include <cassert> + + namespace sdbus { +--- src/VTableUtils.c.orig 2021-10-25 07:02:37 UTC ++++ src/VTableUtils.c +@@ -25,7 +25,7 @@ + */ + + #include "VTableUtils.h" +-#include <systemd/sd-bus.h> ++#include <basu/sd-bus.h> + + sd_bus_vtable createVTableStartItem(uint64_t flags) + { +--- src/VTableUtils.h.orig 2021-10-25 07:02:37 UTC ++++ src/VTableUtils.h +@@ -27,7 +27,7 @@ + #ifndef SDBUS_CXX_INTERNAL_VTABLEUTILS_H_ + #define SDBUS_CXX_INTERNAL_VTABLEUTILS_H_ + +-#include <systemd/sd-bus.h> ++#include <basu/sd-bus.h> + #include <stdbool.h> + + #ifdef __cplusplus +--- tests/integrationtests/AdaptorAndProxy_test.cpp.orig 2021-10-25 07:02:37 UTC ++++ tests/integrationtests/AdaptorAndProxy_test.cpp +@@ -510,8 +510,8 @@ TEST_F(SdbusTestObject, AnswersMachineUuidViaPeerInter + // a non-systemd Linux), org.freedesktop.DBus.Peer.GetMachineId() will not work. To solve + // this, you can create /etc/machine-id yourself as symlink to /var/lib/dbus/machine-id, + // and then org.freedesktop.DBus.Peer.GetMachineId() will start to work. +- if (::access("/etc/machine-id", F_OK) == -1) +- GTEST_SKIP() << "/etc/machine-id file does not exist, GetMachineId() will not work"; ++ if (::access("/var/lib/dbus/machine-id", F_OK) == -1) ++ GTEST_SKIP() << "/var/lib/dbus/machine-id file does not exist, GetMachineId() will not work"; + + ASSERT_NO_THROW(m_proxy->GetMachineId()); + } +--- tests/integrationtests/DBusStandardInterfacesTests.cpp.orig 2021-10-25 07:02:37 UTC ++++ tests/integrationtests/DBusStandardInterfacesTests.cpp +@@ -65,8 +65,8 @@ TEST_F(SdbusTestObject, AnswersMachineUuidViaPeerInter + // a non-systemd Linux), org.freedesktop.DBus.Peer.GetMachineId() will not work. To solve + // this, you can create /etc/machine-id yourself as symlink to /var/lib/dbus/machine-id, + // and then org.freedesktop.DBus.Peer.GetMachineId() will start to work. +- if (::access("/etc/machine-id", F_OK) == -1) +- GTEST_SKIP() << "/etc/machine-id file does not exist, GetMachineId() will not work"; ++ if (::access("/var/lib/dbus/machine-id", F_OK) == -1) ++ GTEST_SKIP() << "/var/lib/dbus/machine-id file does not exist, GetMachineId() will not work"; + + ASSERT_NO_THROW(m_proxy->GetMachineId()); + } diff --git a/devel/sdbus-cpp/pkg-descr b/devel/sdbus-cpp/pkg-descr new file mode 100644 index 000000000000..fb42c05bdab8 --- /dev/null +++ b/devel/sdbus-cpp/pkg-descr @@ -0,0 +1,17 @@ +sdbus-c++ is a high-level C++ D-Bus library for Linux designed to +provide expressive, easy-to-use API in modern C++. It adds another +layer of abstraction on top of sd-bus, a nice, fresh C D-Bus +implementation by systemd. + +sdbus-c++ has been written primarily as a replacement of dbus-c++, +which currently suffers from a number of (unresolved) bugs, +concurrency issues and inherent design complexities and +limitations. sdbus-c++ has learned from dbus-c++ and has chosen a +different path, a path of simple yet powerful design that is intuitive +and friendly to the user and inherently free of those bugs. + +Even though sdbus-c++ uses sd-bus library, it is not necessarily +constrained to systemd and can perfectly be used in non-systemd +environments as well. + +WWW: https://github.com/Kistler-Group/sdbus-cpp diff --git a/devel/sdbus-cpp/pkg-plist b/devel/sdbus-cpp/pkg-plist new file mode 100644 index 000000000000..4fafa806f51a --- /dev/null +++ b/devel/sdbus-cpp/pkg-plist @@ -0,0 +1,29 @@ +bin/sdbus-c++-xml2cpp +include/sdbus-c++/AdaptorInterfaces.h +include/sdbus-c++/ConvenienceApiClasses.h +include/sdbus-c++/ConvenienceApiClasses.inl +include/sdbus-c++/Error.h +include/sdbus-c++/Flags.h +include/sdbus-c++/IConnection.h +include/sdbus-c++/IObject.h +include/sdbus-c++/IProxy.h +include/sdbus-c++/Message.h +include/sdbus-c++/MethodResult.h +include/sdbus-c++/ProxyInterfaces.h +include/sdbus-c++/StandardInterfaces.h +include/sdbus-c++/TypeTraits.h +include/sdbus-c++/Types.h +include/sdbus-c++/sdbus-c++.h +lib/cmake/sdbus-c++-tools/sdbus-c++-tools-config-version.cmake +lib/cmake/sdbus-c++-tools/sdbus-c++-tools-config.cmake +lib/cmake/sdbus-c++-tools/sdbus-c++-tools-targets-%%CMAKE_BUILD_TYPE%%.cmake +lib/cmake/sdbus-c++-tools/sdbus-c++-tools-targets.cmake +lib/cmake/sdbus-c++/sdbus-c++-config-version.cmake +lib/cmake/sdbus-c++/sdbus-c++-config.cmake +lib/cmake/sdbus-c++/sdbus-c++-targets-%%CMAKE_BUILD_TYPE%%.cmake +lib/cmake/sdbus-c++/sdbus-c++-targets.cmake +lib/libsdbus-c++.so +lib/libsdbus-c++.so.1 +lib/libsdbus-c++.so.1.0.0 +libdata/pkgconfig/sdbus-c++-tools.pc +libdata/pkgconfig/sdbus-c++.pc
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202111221954.1AMJs8L5032990>