diff mbox series

[1/1] package/sdbus-cpp: use basu on systems without systemd

Message ID 20240606154920.1571261-1-bobrofon@gmail.com
State New
Headers show
Series [1/1] package/sdbus-cpp: use basu on systems without systemd | expand

Commit Message

Sergey Bobrenok June 6, 2024, 3:49 p.m. UTC
Since version 1.4.0, sdbus-cpp supports building with basu library
instead of libsystemd and can be used on systems without systemd.

Signed-off-by: Sergey Bobrenok <bobrofon@gmail.com>
---
 package/sdbus-cpp/Config.in    | 22 +++++++++++++++++++---
 package/sdbus-cpp/sdbus-cpp.mk | 10 +++++++++-
 2 files changed, 28 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/package/sdbus-cpp/Config.in b/package/sdbus-cpp/Config.in
index 010efaafcf..f7e5dcc7c6 100644
--- a/package/sdbus-cpp/Config.in
+++ b/package/sdbus-cpp/Config.in
@@ -1,8 +1,14 @@ 
 config BR2_PACKAGE_SDBUS_CPP
 	bool "sdbus-c++"
+	depends on BR2_USE_MMU # dbus
 	depends on BR2_INSTALL_LIBSTDCPP
-	depends on BR2_PACKAGE_SYSTEMD
+	depends on BR2_USE_WCHAR || BR2_PACKAGE_SYSTEMD # basu
+	depends on BR2_ENABLE_LOCALE || BR2_PACKAGE_SYSTEMD # basu
+	depends on BR2_TOOLCHAIN_HAS_SYNC_4 || BR2_PACKAGE_SYSTEMD # basu
+	depends on BR2_TOOLCHAIN_HAS_THREADS
+	depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_17 || BR2_PACKAGE_SYSTEMD # basu
 	depends on BR2_TOOLCHAIN_GCC_AT_LEAST_8 # C++20
+	select BR2_PACKAGE_BASU if !BR2_PACKAGE_SYSTEMD
 	help
 	  sdbus-c++ is a high-level C++ D-Bus library for Linux
 	  designed to provide expressive, easy-to-use API in modern C++.
@@ -11,6 +17,16 @@  config BR2_PACKAGE_SDBUS_CPP
 
 	  https://github.com/Kistler-Group/sdbus-cpp
 
-comment "sdbus-c++ needs systemd and a toolchain w/ C++, gcc >= 8"
-	depends on !BR2_INSTALL_LIBSTDCPP || !BR2_PACKAGE_SYSTEMD || \
+comment "sdbus-c++ needs systemd and a toolchain w/ C++, threads, gcc >= 8"
+	depends on BR2_USE_MMU
+	depends on BR2_PACKAGE_SYSTEMD
+	depends on !BR2_INSTALL_LIBSTDCPP || !BR2_TOOLCHAIN_HAS_THREADS || \
+		!BR2_TOOLCHAIN_GCC_AT_LEAST_8
+
+comment "sdbus-c++ needs a toolchain w/ C++, wchar, locale, threads, headers >= 3.17, gcc >= 8"
+	depends on BR2_USE_MMU
+	depends on BR2_TOOLCHAIN_HAS_SYNC_4
+	depends on !BR2_PACKAGE_SYSTEMD
+	depends on !BR2_INSTALL_LIBSTDCPP || !BR2_USE_WCHAR || !BR2_ENABLE_LOCALE || \
+		!BR2_TOOLCHAIN_HAS_THREADS || !BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_17 || \
 		!BR2_TOOLCHAIN_GCC_AT_LEAST_8
diff --git a/package/sdbus-cpp/sdbus-cpp.mk b/package/sdbus-cpp/sdbus-cpp.mk
index 2994f079c9..bcac802162 100644
--- a/package/sdbus-cpp/sdbus-cpp.mk
+++ b/package/sdbus-cpp/sdbus-cpp.mk
@@ -7,10 +7,18 @@ 
 SDBUS_CPP_VERSION = 2.0.0
 SDBUS_CPP_SITE = $(call github,Kistler-Group,sdbus-cpp,v$(SDBUS_CPP_VERSION))
 SDBUS_CPP_INSTALL_STAGING = YES
-SDBUS_CPP_DEPENDENCIES = host-pkgconf systemd
+SDBUS_CPP_DEPENDENCIES = host-pkgconf
 SDBUS_CPP_LICENSE = LGPL-2.1+ with exception (headers)
 SDBUS_CPP_LICENSE_FILES = COPYING COPYING-LGPL-Exception
 
+ifeq ($(BR2_PACKAGE_SYSTEMD),y)
+SDBUS_CPP_DEPENDENCIES += systemd
+SDBUS_CPP_CONF_OPTS += -DSDBUSCPP_SDBUS_LIB=systemd
+else
+SDBUS_CPP_DEPENDENCIES += basu
+SDBUS_CPP_CONF_OPTS += -DSDBUSCPP_SDBUS_LIB=basu
+endif
+
 # Host build for sdbus-c++-xml2cpp
 HOST_SDBUS_CPP_DEPENDENCIES = host-pkgconf host-systemd
 HOST_SDBUS_CPP_CONF_OPTS = \