forked from Kistler-Group/sdbus-cpp
feat: add FreeBSD support (#358)
* chore: don't use systemd headers with elogind
In file included from src/VTableUtils.c:27:
src/VTableUtils.h:30:10: fatal error: 'systemd/sd-bus.h' file not found
#include <systemd/sd-bus.h>
^~~~~~~~~~~~~~~~~~
* chore: add basu support
Similar to elogind but also supported on non-Linux.
* chore(tests): permit /var/lib/machine-id on non-systemd
https://github.com/elogind/elogind/commit/84fdc0fc61c1
https://git.sr.ht/~emersion/basu/commit/8324e6729231
* chore(ci): add simple freebsd job
Mainly to cover libc++ and basu.
* chore(ci): explicitly pass CMAKE_INSTALL_PREFIX
Some sdbus-cpp tests require configuring system bus. However, Linux
testing relies on writing outside of prefix in order to affect current
system bus instance instead of launching a dedicated one.
* chore(tests): respect CMAKE_INSTALL_PREFIX for system bus config
DBus isn't part of base system on BSDs, so may not use /etc for configs.
Also, testing installation failed as non-root:
$ cmake -DBUILD_TESTS=1 -DCMAKE_INSTALL_PREFIX=/tmp/sdbus-cpp_prefix -DTESTS_INSTALL_PATH=/tmp/sdbus-cpp_prefix/tests
$ cmake --build .
$ cmake --install .
[...]
CMake Error at tests/cmake_install.cmake:105 (file):
file cannot create directory: /etc/dbus-1/system.d. Maybe need
administrative privileges.
* chore(tests): temporarily skip 1 test on FreeBSD to keep CI happy
* chore(ci): run tests in freebsd job
This commit is contained in:
committed by
Stanislav Angelovič
parent
290078d6af
commit
1e2d13a04a
+1
-1
@@ -31,7 +31,7 @@
|
||||
#include <sdbus-c++/Message.h>
|
||||
#include <sdbus-c++/Error.h>
|
||||
#include "ScopeGuard.h"
|
||||
#include <systemd/sd-bus.h>
|
||||
#include SDBUS_HEADER
|
||||
#include <unistd.h>
|
||||
#include <poll.h>
|
||||
#include <sys/eventfd.h>
|
||||
|
||||
+1
-1
@@ -32,7 +32,7 @@
|
||||
#include "IConnection.h"
|
||||
#include "ScopeGuard.h"
|
||||
#include "ISdBus.h"
|
||||
#include <systemd/sd-bus.h>
|
||||
#include SDBUS_HEADER
|
||||
#include <memory>
|
||||
#include <thread>
|
||||
#include <string>
|
||||
|
||||
+1
-1
@@ -25,7 +25,7 @@
|
||||
*/
|
||||
|
||||
#include <sdbus-c++/Error.h>
|
||||
#include <systemd/sd-bus.h>
|
||||
#include SDBUS_HEADER
|
||||
#include "ScopeGuard.h"
|
||||
|
||||
namespace sdbus
|
||||
|
||||
+1
-1
@@ -25,7 +25,7 @@
|
||||
*/
|
||||
|
||||
#include <sdbus-c++/Flags.h>
|
||||
#include <systemd/sd-bus.h>
|
||||
#include SDBUS_HEADER
|
||||
|
||||
namespace sdbus
|
||||
{
|
||||
|
||||
+1
-1
@@ -28,7 +28,7 @@
|
||||
#define SDBUS_CXX_INTERNAL_ICONNECTION_H_
|
||||
|
||||
#include <sdbus-c++/IConnection.h>
|
||||
#include <systemd/sd-bus.h>
|
||||
#include SDBUS_HEADER
|
||||
#include <string>
|
||||
#include <memory>
|
||||
#include <functional>
|
||||
|
||||
+1
-1
@@ -28,7 +28,7 @@
|
||||
#ifndef SDBUS_CXX_ISDBUS_H
|
||||
#define SDBUS_CXX_ISDBUS_H
|
||||
|
||||
#include <systemd/sd-bus.h>
|
||||
#include SDBUS_HEADER
|
||||
|
||||
namespace sdbus::internal {
|
||||
|
||||
|
||||
+1
-1
@@ -31,7 +31,7 @@
|
||||
#include "ISdBus.h"
|
||||
#include "IConnection.h"
|
||||
#include "ScopeGuard.h"
|
||||
#include <systemd/sd-bus.h>
|
||||
#include SDBUS_HEADER
|
||||
#include <cassert>
|
||||
|
||||
namespace sdbus {
|
||||
|
||||
+1
-1
@@ -35,7 +35,7 @@
|
||||
#include "IConnection.h"
|
||||
#include "Utils.h"
|
||||
#include "VTableUtils.h"
|
||||
#include <systemd/sd-bus.h>
|
||||
#include SDBUS_HEADER
|
||||
#include <utility>
|
||||
#include <cassert>
|
||||
|
||||
|
||||
+1
-1
@@ -29,7 +29,7 @@
|
||||
|
||||
#include <sdbus-c++/IObject.h>
|
||||
#include "IConnection.h"
|
||||
#include <systemd/sd-bus.h>
|
||||
#include SDBUS_HEADER
|
||||
#include <string>
|
||||
#include <map>
|
||||
#include <vector>
|
||||
|
||||
+1
-1
@@ -32,7 +32,7 @@
|
||||
#include "sdbus-c++/IConnection.h"
|
||||
#include "sdbus-c++/Error.h"
|
||||
#include "ScopeGuard.h"
|
||||
#include <systemd/sd-bus.h>
|
||||
#include SDBUS_HEADER
|
||||
#include <cassert>
|
||||
#include <chrono>
|
||||
#include <utility>
|
||||
|
||||
+1
-1
@@ -29,7 +29,7 @@
|
||||
|
||||
#include <sdbus-c++/IProxy.h>
|
||||
#include "IConnection.h"
|
||||
#include <systemd/sd-bus.h>
|
||||
#include SDBUS_HEADER
|
||||
#include <string>
|
||||
#include <memory>
|
||||
#include <map>
|
||||
|
||||
@@ -224,7 +224,12 @@ int SdBus::sd_bus_open_user_with_address(sd_bus **ret, const char* address)
|
||||
|
||||
int SdBus::sd_bus_open_system_remote(sd_bus **ret, const char *host)
|
||||
{
|
||||
#ifdef SDBUS_basu
|
||||
// https://git.sr.ht/~emersion/basu/commit/01d33b244eb6
|
||||
return -EOPNOTSUPP;
|
||||
#else
|
||||
return ::sd_bus_open_system_remote(ret, host);
|
||||
#endif
|
||||
}
|
||||
|
||||
int SdBus::sd_bus_request_name(sd_bus *bus, const char *name, uint64_t flags)
|
||||
|
||||
+1
-1
@@ -27,7 +27,7 @@
|
||||
#include <sdbus-c++/Types.h>
|
||||
#include <sdbus-c++/Error.h>
|
||||
#include "MessageUtils.h"
|
||||
#include <systemd/sd-bus.h>
|
||||
#include SDBUS_HEADER
|
||||
#include <cassert>
|
||||
|
||||
namespace sdbus {
|
||||
|
||||
+1
-1
@@ -28,7 +28,7 @@
|
||||
#define SDBUS_CXX_INTERNAL_UTILS_H_
|
||||
|
||||
#include <sdbus-c++/Error.h>
|
||||
#include <systemd/sd-bus.h>
|
||||
#include SDBUS_HEADER
|
||||
|
||||
#if LIBSYSTEMD_VERSION>=246
|
||||
#define SDBUS_CHECK_OBJECT_PATH(_PATH) \
|
||||
|
||||
+1
-1
@@ -25,7 +25,7 @@
|
||||
*/
|
||||
|
||||
#include "VTableUtils.h"
|
||||
#include <systemd/sd-bus.h>
|
||||
#include SDBUS_HEADER
|
||||
|
||||
sd_bus_vtable createVTableStartItem(uint64_t flags)
|
||||
{
|
||||
|
||||
+1
-1
@@ -27,7 +27,7 @@
|
||||
#ifndef SDBUS_CXX_INTERNAL_VTABLEUTILS_H_
|
||||
#define SDBUS_CXX_INTERNAL_VTABLEUTILS_H_
|
||||
|
||||
#include <systemd/sd-bus.h>
|
||||
#include SDBUS_HEADER
|
||||
#include <stdbool.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
Reference in New Issue
Block a user