diff --git a/devel/sdbus-cpp/Makefile b/devel/sdbus-cpp/Makefile index 623c2cd39ac0..cb594b5ae465 100644 --- a/devel/sdbus-cpp/Makefile +++ b/devel/sdbus-cpp/Makefile @@ -1,34 +1,34 @@ PORTNAME= sdbus-cpp DISTVERSIONPREFIX= v DISTVERSION= 1.3.0 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= devel MAINTAINER= jbeich@FreeBSD.org COMMENT= High-level C++ D-Bus library WWW= https://github.com/Kistler-Group/sdbus-cpp 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 # XXX Drop after FreeBSD 12.4 EOL around 2023-12-31 # https://cgit.freebsd.org/src/commit/?id=7a202823aa54 .if !exists(/usr/include/sys/eventfd.h) LIB_DEPENDS+= libepoll-shim.so:devel/libepoll-shim CFLAGS+= `pkg-config --cflags epoll-shim` LDFLAGS+= `pkg-config --libs epoll-shim` .endif .include diff --git a/devel/sdbus-cpp/files/patch-basu b/devel/sdbus-cpp/files/patch-basu index c0fd46fa455d..79391ccc797b 100644 --- a/devel/sdbus-cpp/files/patch-basu +++ b/devel/sdbus-cpp/files/patch-basu @@ -1,220 +1,288 @@ libsystemd is Linux-only, so replace with basu --- CMakeLists.txt.orig 2023-08-20 09:45:44 UTC +++ CMakeLists.txt -@@ -12,13 +12,13 @@ include(GNUInstallDirs) # Installation directories for - # PERFORMING CHECKS & PREPARING THE DEPENDENCIES - #------------------------------- - --set(LIBSYSTEMD "libsystemd") -+set(LIBSYSTEMD "basu") - - option(BUILD_LIBSYSTEMD "Build libsystemd static library and incorporate it into libsdbus-c++" OFF) - - 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(WARNING "libsystemd not found, checking for libelogind instead") - pkg_check_modules(Systemd IMPORTED_TARGET GLOBAL libelogind>=236) -@@ -36,8 +36,7 @@ if(NOT BUILD_LIBSYSTEMD) - "and incorporate libsystemd as embedded library within sdbus-c++)") +@@ -26,6 +26,11 @@ if(NOT BUILD_LIBSYSTEMD) + set(LIBSYSTEMD "libelogind") + string(REPLACE "." ";" VERSION_LIST ${Systemd_VERSION}) + list(GET VERSION_LIST 0 Systemd_VERSION) ++ else() ++ pkg_check_modules(Systemd IMPORTED_TARGET GLOBAL basu) ++ set(LIBSYSTEMD "basu") ++ # https://git.sr.ht/~emersion/basu/commit/d4d185d29a26 ++ set(Systemd_VERSION "240") + endif() 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 + if(NOT TARGET PkgConfig::Systemd) +--- src/Connection.cpp.orig 2023-08-20 09:45:44 UTC +++ src/Connection.cpp -@@ -30,7 +30,7 @@ +@@ -31,7 +31,13 @@ #include #include #include "ScopeGuard.h" --#include ++#if __has_include() + #include ++#elif __has_include() ++#include ++#else +#include ++#endif #include #include #include ---- src/Connection.h.orig 2021-10-25 07:02:37 UTC +--- src/Connection.h.orig 2023-08-20 09:45:44 UTC +++ src/Connection.h -@@ -32,7 +32,7 @@ +@@ -32,7 +32,13 @@ #include "IConnection.h" #include "ScopeGuard.h" #include "ISdBus.h" --#include ++#if __has_include() + #include ++#elif __has_include() ++#include ++#else +#include ++#endif #include #include #include ---- src/Error.cpp.orig 2021-10-25 07:02:37 UTC +--- src/Error.cpp.orig 2023-08-20 09:45:44 UTC +++ src/Error.cpp -@@ -25,7 +25,7 @@ +@@ -25,7 +25,13 @@ */ #include --#include ++#if __has_include() + #include ++#elif __has_include() ++#include ++#else +#include ++#endif #include "ScopeGuard.h" namespace sdbus ---- src/Flags.cpp.orig 2021-10-25 07:02:37 UTC +--- src/Flags.cpp.orig 2023-08-20 09:45:44 UTC +++ src/Flags.cpp -@@ -25,7 +25,7 @@ +@@ -25,7 +25,13 @@ */ #include --#include ++#if __has_include() + #include ++#elif __has_include() ++#include ++#else +#include ++#endif namespace sdbus { ---- src/IConnection.h.orig 2022-08-09 07:50:33 UTC +--- src/IConnection.h.orig 2023-08-20 09:45:44 UTC +++ src/IConnection.h -@@ -28,7 +28,7 @@ +@@ -28,7 +28,13 @@ #define SDBUS_CXX_INTERNAL_ICONNECTION_H_ #include --#include ++#if __has_include() + #include ++#elif __has_include() ++#include ++#else +#include ++#endif #include #include #include ---- src/ISdBus.h.orig 2021-10-25 07:02:37 UTC +--- src/ISdBus.h.orig 2023-08-20 09:45:44 UTC +++ src/ISdBus.h -@@ -28,7 +28,7 @@ +@@ -28,7 +28,13 @@ #ifndef SDBUS_CXX_ISDBUS_H #define SDBUS_CXX_ISDBUS_H --#include ++#if __has_include() + #include ++#elif __has_include() ++#include ++#else +#include ++#endif namespace sdbus::internal { ---- src/Message.cpp.orig 2021-10-25 07:02:37 UTC +--- src/Message.cpp.orig 2023-08-20 09:45:44 UTC +++ src/Message.cpp -@@ -31,7 +31,7 @@ +@@ -31,7 +31,13 @@ #include "ISdBus.h" #include "IConnection.h" #include "ScopeGuard.h" --#include ++#if __has_include() + #include ++#elif __has_include() ++#include ++#else +#include ++#endif #include namespace sdbus { ---- src/Object.cpp.orig 2021-10-25 07:02:37 UTC +--- src/Object.cpp.orig 2023-08-20 09:45:44 UTC +++ src/Object.cpp -@@ -34,7 +34,7 @@ - #include "ScopeGuard.h" +@@ -35,7 +35,13 @@ #include "IConnection.h" + #include "Utils.h" #include "VTableUtils.h" --#include ++#if __has_include() + #include ++#elif __has_include() ++#include ++#else +#include ++#endif #include #include ---- src/Object.h.orig 2021-10-25 07:02:37 UTC +--- src/Object.h.orig 2023-08-20 09:45:44 UTC +++ src/Object.h -@@ -29,7 +29,7 @@ +@@ -29,7 +29,13 @@ #include #include "IConnection.h" --#include ++#if __has_include() + #include ++#elif __has_include() ++#include ++#else +#include ++#endif #include #include #include ---- src/Proxy.cpp.orig 2021-10-25 07:02:37 UTC +--- src/Proxy.cpp.orig 2023-08-20 09:45:44 UTC +++ src/Proxy.cpp -@@ -31,7 +31,7 @@ +@@ -32,7 +32,13 @@ #include "sdbus-c++/IConnection.h" #include "sdbus-c++/Error.h" #include "ScopeGuard.h" --#include ++#if __has_include() + #include ++#elif __has_include() ++#include ++#else +#include ++#endif #include #include #include ---- src/Proxy.h.orig 2021-10-25 07:02:37 UTC +--- src/Proxy.h.orig 2023-08-20 09:45:44 UTC +++ src/Proxy.h -@@ -29,7 +29,7 @@ +@@ -29,7 +29,13 @@ #include #include "IConnection.h" --#include ++#if __has_include() + #include ++#elif __has_include() ++#include ++#else +#include ++#endif #include #include #include ---- src/SdBus.cpp.orig 2021-10-25 07:02:37 UTC +--- src/SdBus.cpp.orig 2023-08-20 09:45:44 UTC +++ src/SdBus.cpp -@@ -178,7 +178,8 @@ int SdBus::sd_bus_open_system(sd_bus **ret) +@@ -224,7 +224,12 @@ int SdBus::sd_bus_open_system_remote(sd_bus **ret, con int SdBus::sd_bus_open_system_remote(sd_bus **ret, const char *host) { -- return ::sd_bus_open_system_remote(ret, host); ++#if __has_include() || __has_include() + return ::sd_bus_open_system_remote(ret, host); ++#else + // Removed in https://git.sr.ht/~emersion/basu/commit/01d33b244eb6 + return -EOPNOTSUPP; ++#endif } 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.orig 2023-08-20 09:45:44 UTC +++ src/Types.cpp -@@ -27,7 +27,7 @@ +@@ -27,7 +27,13 @@ #include #include #include "MessageUtils.h" --#include ++#if __has_include() + #include ++#elif __has_include() ++#include ++#else +#include ++#endif #include namespace sdbus { ---- src/Utils.h.orig 2022-08-09 07:50:33 UTC +--- src/Utils.h.orig 2023-08-20 09:45:44 UTC +++ src/Utils.h -@@ -28,7 +28,7 @@ +@@ -28,7 +28,13 @@ #define SDBUS_CXX_INTERNAL_UTILS_H_ #include --#include ++#if __has_include() + #include ++#elif __has_include() ++#include ++#else +#include ++#endif #if LIBSYSTEMD_VERSION>=246 #define SDBUS_CHECK_OBJECT_PATH(_PATH) \ ---- src/VTableUtils.c.orig 2021-10-25 07:02:37 UTC +--- src/VTableUtils.c.orig 2023-08-20 09:45:44 UTC +++ src/VTableUtils.c -@@ -25,7 +25,7 @@ +@@ -25,7 +25,13 @@ */ #include "VTableUtils.h" --#include ++#if __has_include() + #include ++#elif __has_include() ++#include ++#else +#include ++#endif sd_bus_vtable createVTableStartItem(uint64_t flags) { ---- src/VTableUtils.h.orig 2021-10-25 07:02:37 UTC +--- src/VTableUtils.h.orig 2023-08-20 09:45:44 UTC +++ src/VTableUtils.h -@@ -27,7 +27,7 @@ +@@ -27,7 +27,13 @@ #ifndef SDBUS_CXX_INTERNAL_VTABLEUTILS_H_ #define SDBUS_CXX_INTERNAL_VTABLEUTILS_H_ --#include ++#if __has_include() + #include ++#elif __has_include() ++#include ++#else +#include ++#endif #include #ifdef __cplusplus ---- tests/integrationtests/DBusStandardInterfacesTests.cpp.orig 2021-10-25 07:02:37 UTC +--- tests/integrationtests/DBusStandardInterfacesTests.cpp.orig 2023-08-20 09:45:44 UTC +++ tests/integrationtests/DBusStandardInterfacesTests.cpp -@@ -65,8 +65,8 @@ TEST_F(SdbusTestObject, AnswersMachineUuidViaPeerInter +@@ -65,8 +65,14 @@ 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"; ++#if __has_include() + if (::access("/etc/machine-id", F_OK) == -1) + GTEST_SKIP() << "/etc/machine-id file does not exist, GetMachineId() will not work"; ++#else ++ if (::access("/etc/machine-id", F_OK) == -1 && ++ ::access("/var/lib/dbus/machine-id", F_OK) == -1) ++ GTEST_SKIP() << "/etc/machine-id and /var/lib/dbus/machine-id file do not exist, GetMachineId() will not work"; ++#endif ASSERT_NO_THROW(m_proxy->GetMachineId()); }