git: 4aca28e21343 - 2023Q3 - devel/sdbus-cpp: switch to upstreamed patch

From: Jan Beich <jbeich_at_FreeBSD.org>
Date: Sat, 23 Sep 2023 01:16:46 UTC
The branch 2023Q3 has been updated by jbeich:

URL: https://cgit.FreeBSD.org/ports/commit/?id=4aca28e21343f57d37284d21b7b5526b59863f4b

commit 4aca28e21343f57d37284d21b7b5526b59863f4b
Author:     Jan Beich <jbeich@FreeBSD.org>
AuthorDate: 2023-09-08 19:57:26 +0000
Commit:     Jan Beich <jbeich@FreeBSD.org>
CommitDate: 2023-09-23 01:14:56 +0000

    devel/sdbus-cpp: switch to upstreamed patch
    
    (cherry picked from commit b80e4a374020da30c567ed84918767f02f835109)
    (cherry picked from commit 48cb5e90d88c5fa1e46caeb85d7d250b4b9fb7a2)
    (cherry picked from commit 350db94e025c1d58711ab9bf2b6295b84c772cb0)
---
 devel/sdbus-cpp/Makefile         |   3 +
 devel/sdbus-cpp/distinfo         |   2 +
 devel/sdbus-cpp/files/patch-basu | 288 ---------------------------------------
 3 files changed, 5 insertions(+), 288 deletions(-)

diff --git a/devel/sdbus-cpp/Makefile b/devel/sdbus-cpp/Makefile
index b80a4ce59a77..8df207770fdf 100644
--- a/devel/sdbus-cpp/Makefile
+++ b/devel/sdbus-cpp/Makefile
@@ -4,6 +4,9 @@ DISTVERSION=	1.3.0
 PORTREVISION=	2
 CATEGORIES=	devel
 
+PATCH_SITES=	https://github.com/${GH_ACCOUNT}/${GH_PROJECT}/commit/
+PATCHFILES+=	1e2d13a04a98.patch:-p1 # https://github.com/Kistler-Group/sdbus-cpp/pull/358
+
 MAINTAINER=	jbeich@FreeBSD.org
 COMMENT=	High-level C++ D-Bus library
 WWW=		https://github.com/Kistler-Group/sdbus-cpp
diff --git a/devel/sdbus-cpp/distinfo b/devel/sdbus-cpp/distinfo
index 5d09bebdfaf8..c0c426a64d10 100644
--- a/devel/sdbus-cpp/distinfo
+++ b/devel/sdbus-cpp/distinfo
@@ -1,3 +1,5 @@
 TIMESTAMP = 1692524744
 SHA256 (Kistler-Group-sdbus-cpp-v1.3.0_GH0.tar.gz) = d44f59abdd64d8f1ca3af7db58bc6518cb081fc9ff16285c3d75a68f5c073d10
 SIZE (Kistler-Group-sdbus-cpp-v1.3.0_GH0.tar.gz) = 217150
+SHA256 (1e2d13a04a98.patch) = 374616d5a000a536d2947d3462a6b9ccf00777e2770a5a0bb3f87448f7b8786a
+SIZE (1e2d13a04a98.patch) = 17236
diff --git a/devel/sdbus-cpp/files/patch-basu b/devel/sdbus-cpp/files/patch-basu
deleted file mode 100644
index 79391ccc797b..000000000000
--- a/devel/sdbus-cpp/files/patch-basu
+++ /dev/null
@@ -1,288 +0,0 @@
-libsystemd is Linux-only, so replace with basu
-
---- CMakeLists.txt.orig	2023-08-20 09:45:44 UTC
-+++ CMakeLists.txt
-@@ -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()
-     if(NOT TARGET PkgConfig::Systemd)
---- src/Connection.cpp.orig	2023-08-20 09:45:44 UTC
-+++ src/Connection.cpp
-@@ -31,7 +31,13 @@
- #include <sdbus-c++/Message.h>
- #include <sdbus-c++/Error.h>
- #include "ScopeGuard.h"
-+#if __has_include(<systemd/sd-bus.h>)
- #include <systemd/sd-bus.h>
-+#elif __has_include(<elogind/sd-bus.h>)
-+#include <elogind/sd-bus.h>
-+#else
-+#include <basu/sd-bus.h>
-+#endif
- #include <unistd.h>
- #include <poll.h>
- #include <sys/eventfd.h>
---- src/Connection.h.orig	2023-08-20 09:45:44 UTC
-+++ src/Connection.h
-@@ -32,7 +32,13 @@
- #include "IConnection.h"
- #include "ScopeGuard.h"
- #include "ISdBus.h"
-+#if __has_include(<systemd/sd-bus.h>)
- #include <systemd/sd-bus.h>
-+#elif __has_include(<elogind/sd-bus.h>)
-+#include <elogind/sd-bus.h>
-+#else
-+#include <basu/sd-bus.h>
-+#endif
- #include <memory>
- #include <thread>
- #include <string>
---- src/Error.cpp.orig	2023-08-20 09:45:44 UTC
-+++ src/Error.cpp
-@@ -25,7 +25,13 @@
-  */
- 
- #include <sdbus-c++/Error.h>
-+#if __has_include(<systemd/sd-bus.h>)
- #include <systemd/sd-bus.h>
-+#elif __has_include(<elogind/sd-bus.h>)
-+#include <elogind/sd-bus.h>
-+#else
-+#include <basu/sd-bus.h>
-+#endif
- #include "ScopeGuard.h"
- 
- namespace sdbus
---- src/Flags.cpp.orig	2023-08-20 09:45:44 UTC
-+++ src/Flags.cpp
-@@ -25,7 +25,13 @@
-  */
- 
- #include <sdbus-c++/Flags.h>
-+#if __has_include(<systemd/sd-bus.h>)
- #include <systemd/sd-bus.h>
-+#elif __has_include(<elogind/sd-bus.h>)
-+#include <elogind/sd-bus.h>
-+#else
-+#include <basu/sd-bus.h>
-+#endif
- 
- namespace sdbus
- {
---- src/IConnection.h.orig	2023-08-20 09:45:44 UTC
-+++ src/IConnection.h
-@@ -28,7 +28,13 @@
- #define SDBUS_CXX_INTERNAL_ICONNECTION_H_
- 
- #include <sdbus-c++/IConnection.h>
-+#if __has_include(<systemd/sd-bus.h>)
- #include <systemd/sd-bus.h>
-+#elif __has_include(<elogind/sd-bus.h>)
-+#include <elogind/sd-bus.h>
-+#else
-+#include <basu/sd-bus.h>
-+#endif
- #include <string>
- #include <memory>
- #include <functional>
---- src/ISdBus.h.orig	2023-08-20 09:45:44 UTC
-+++ src/ISdBus.h
-@@ -28,7 +28,13 @@
- #ifndef SDBUS_CXX_ISDBUS_H
- #define SDBUS_CXX_ISDBUS_H
- 
-+#if __has_include(<systemd/sd-bus.h>)
- #include <systemd/sd-bus.h>
-+#elif __has_include(<elogind/sd-bus.h>)
-+#include <elogind/sd-bus.h>
-+#else
-+#include <basu/sd-bus.h>
-+#endif
- 
- namespace sdbus::internal {
- 
---- src/Message.cpp.orig	2023-08-20 09:45:44 UTC
-+++ src/Message.cpp
-@@ -31,7 +31,13 @@
- #include "ISdBus.h"
- #include "IConnection.h"
- #include "ScopeGuard.h"
-+#if __has_include(<systemd/sd-bus.h>)
- #include <systemd/sd-bus.h>
-+#elif __has_include(<elogind/sd-bus.h>)
-+#include <elogind/sd-bus.h>
-+#else
-+#include <basu/sd-bus.h>
-+#endif
- #include <cassert>
- 
- namespace sdbus {
---- src/Object.cpp.orig	2023-08-20 09:45:44 UTC
-+++ src/Object.cpp
-@@ -35,7 +35,13 @@
- #include "IConnection.h"
- #include "Utils.h"
- #include "VTableUtils.h"
-+#if __has_include(<systemd/sd-bus.h>)
- #include <systemd/sd-bus.h>
-+#elif __has_include(<elogind/sd-bus.h>)
-+#include <elogind/sd-bus.h>
-+#else
-+#include <basu/sd-bus.h>
-+#endif
- #include <utility>
- #include <cassert>
- 
---- src/Object.h.orig	2023-08-20 09:45:44 UTC
-+++ src/Object.h
-@@ -29,7 +29,13 @@
- 
- #include <sdbus-c++/IObject.h>
- #include "IConnection.h"
-+#if __has_include(<systemd/sd-bus.h>)
- #include <systemd/sd-bus.h>
-+#elif __has_include(<elogind/sd-bus.h>)
-+#include <elogind/sd-bus.h>
-+#else
-+#include <basu/sd-bus.h>
-+#endif
- #include <string>
- #include <map>
- #include <vector>
---- src/Proxy.cpp.orig	2023-08-20 09:45:44 UTC
-+++ src/Proxy.cpp
-@@ -32,7 +32,13 @@
- #include "sdbus-c++/IConnection.h"
- #include "sdbus-c++/Error.h"
- #include "ScopeGuard.h"
-+#if __has_include(<systemd/sd-bus.h>)
- #include <systemd/sd-bus.h>
-+#elif __has_include(<elogind/sd-bus.h>)
-+#include <elogind/sd-bus.h>
-+#else
-+#include <basu/sd-bus.h>
-+#endif
- #include <cassert>
- #include <chrono>
- #include <utility>
---- src/Proxy.h.orig	2023-08-20 09:45:44 UTC
-+++ src/Proxy.h
-@@ -29,7 +29,13 @@
- 
- #include <sdbus-c++/IProxy.h>
- #include "IConnection.h"
-+#if __has_include(<systemd/sd-bus.h>)
- #include <systemd/sd-bus.h>
-+#elif __has_include(<elogind/sd-bus.h>)
-+#include <elogind/sd-bus.h>
-+#else
-+#include <basu/sd-bus.h>
-+#endif
- #include <string>
- #include <memory>
- #include <map>
---- src/SdBus.cpp.orig	2023-08-20 09:45:44 UTC
-+++ src/SdBus.cpp
-@@ -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)
- {
-+#if __has_include(<systemd/sd-bus.h>) || __has_include(<elogind/sd-bus.h>)
-     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	2023-08-20 09:45:44 UTC
-+++ src/Types.cpp
-@@ -27,7 +27,13 @@
- #include <sdbus-c++/Types.h>
- #include <sdbus-c++/Error.h>
- #include "MessageUtils.h"
-+#if __has_include(<systemd/sd-bus.h>)
- #include <systemd/sd-bus.h>
-+#elif __has_include(<elogind/sd-bus.h>)
-+#include <elogind/sd-bus.h>
-+#else
-+#include <basu/sd-bus.h>
-+#endif
- #include <cassert>
- 
- namespace sdbus {
---- src/Utils.h.orig	2023-08-20 09:45:44 UTC
-+++ src/Utils.h
-@@ -28,7 +28,13 @@
- #define SDBUS_CXX_INTERNAL_UTILS_H_
- 
- #include <sdbus-c++/Error.h>
-+#if __has_include(<systemd/sd-bus.h>)
- #include <systemd/sd-bus.h>
-+#elif __has_include(<elogind/sd-bus.h>)
-+#include <elogind/sd-bus.h>
-+#else
-+#include <basu/sd-bus.h>
-+#endif
- 
- #if LIBSYSTEMD_VERSION>=246
- #define SDBUS_CHECK_OBJECT_PATH(_PATH)                                                                                              \
---- src/VTableUtils.c.orig	2023-08-20 09:45:44 UTC
-+++ src/VTableUtils.c
-@@ -25,7 +25,13 @@
-  */
- 
- #include "VTableUtils.h"
-+#if __has_include(<systemd/sd-bus.h>)
- #include <systemd/sd-bus.h>
-+#elif __has_include(<elogind/sd-bus.h>)
-+#include <elogind/sd-bus.h>
-+#else
-+#include <basu/sd-bus.h>
-+#endif
- 
- sd_bus_vtable createVTableStartItem(uint64_t flags)
- {
---- src/VTableUtils.h.orig	2023-08-20 09:45:44 UTC
-+++ src/VTableUtils.h
-@@ -27,7 +27,13 @@
- #ifndef SDBUS_CXX_INTERNAL_VTABLEUTILS_H_
- #define SDBUS_CXX_INTERNAL_VTABLEUTILS_H_
- 
-+#if __has_include(<systemd/sd-bus.h>)
- #include <systemd/sd-bus.h>
-+#elif __has_include(<elogind/sd-bus.h>)
-+#include <elogind/sd-bus.h>
-+#else
-+#include <basu/sd-bus.h>
-+#endif
- #include <stdbool.h>
- 
- #ifdef __cplusplus
---- tests/integrationtests/DBusStandardInterfacesTests.cpp.orig	2023-08-20 09:45:44 UTC
-+++ tests/integrationtests/DBusStandardInterfacesTests.cpp
-@@ -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 __has_include(<systemd/sd-bus.h>)
-     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());
- }