Browse Source

Merge pull request #17300 from TDT-AG/pr/20211210-dbus

dbus: add debug option and move service to procd and update/fix compile CMAKE_OPTIONS
lilik-openwrt-22.03
Florian Eckert 3 years ago
committed by GitHub
parent
commit
6b81a51fc5
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 70 additions and 8 deletions
  1. +7
    -0
      utils/dbus/Config.in
  2. +16
    -3
      utils/dbus/Makefile
  3. +20
    -5
      utils/dbus/files/dbus.init
  4. +27
    -0
      utils/dbus/patches/020-cmake-fix-tmp-session-search.patch

+ 7
- 0
utils/dbus/Config.in View File

@ -0,0 +1,7 @@
if PACKAGE_dbus
config DBUS_VERBOSE
bool "Enable verbose error strings"
default n
endif

+ 16
- 3
utils/dbus/Makefile View File

@ -19,6 +19,9 @@ PKG_MAINTAINER:=
PKG_LICENSE:=AFL-2.1
PKG_CPE_ID:=cpe:/a:freedesktop:dbus
PKG_CONFIG_DEPENDS:= \
CONFIG_DBUS_VERBOSE
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/cmake.mk
@ -71,10 +74,13 @@ $(call Package/dbus/Default/description)
This package contains D-Bus utilities.
endef
define Package/dbus/config
source "$(SOURCE)/Config.in"
endef
CMAKE_OPTIONS += \
-DDBUS_SYSTEM_SOCKET=/var/run/dbus/system_bus_socket \
-DDBUS_SESSION_SOCKET_DIR=/tmp \
-DDBUS_SYSTEM_PID_FILE=/var/run/dbus.pid \
-DDBUS_BUILD_TESTS=OFF \
-DDBUS_LINUX=ON \
-DDBUS_DISABLE_ASSERT=ON \
@ -88,7 +94,12 @@ CMAKE_OPTIONS += \
-DDBUS_DISABLE_CHECKS=ON \
-DDBUS_BUILD_X11=OFF \
-DDBUS_ENABLE_DOXYGEN_DOCS=OFF \
-DENABLE_QT_HELP=OFF
-DDBUS_ENABLE_QTHELP_DOCS=OFF \
-DDBUS_ENABLE_XML_DOCS=OFF
ifeq ($(CONFIG_DBUS_VERBOSE),y)
CMAKE_OPTIONS += -DDBUS_ENABLE_VERBOSE_MODE=ON
endif
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include
@ -128,7 +139,9 @@ endef
define Package/dbus-utils/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/dbus-{monitor,send,update-activation-environment} $(1)/usr/bin/
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/dbus-monitor $(1)/usr/bin/
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/dbus-send $(1)/usr/bin/
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/dbus-test-tool $(1)/usr/bin/
endef
$(eval $(call BuildPackage,libdbus))


+ 20
- 5
utils/dbus/files/dbus.init View File

@ -3,15 +3,30 @@
START=60
SERVICE_PID_FILE=/var/run/dbus.pid
USE_PROCD=1
PROG=/usr/bin/dbus-daemon
start() {
# To enable this makes only sense if the dbus has been compiled with
# the option CONFIG_DBUS_VERBOSE=y
#DEBUG=1
start_service() {
mkdir -m 0755 -p /var/lib/dbus
mkdir -m 0755 -p /var/run/dbus
[ -x /usr/bin/dbus-uuidgen ] && /usr/bin/dbus-uuidgen --ensure
service_start /usr/bin/dbus-daemon --system
procd_open_instance
procd_set_param command "${PROG}"
procd_append_param command --system
procd_append_param command --nofork
[ -n "$DEBUG" ] && procd_set_param env DBUS_VERBOSE=1
procd_set_param stdout 1
procd_set_param stderr 1
procd_close_instance
}
stop() {
service_stop /usr/bin/dbus-daemon
stop_service() {
service_stop "${PROG}"
}

+ 27
- 0
utils/dbus/patches/020-cmake-fix-tmp-session-search.patch View File

@ -0,0 +1,27 @@
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -471,14 +471,16 @@ endif()
#### Find socket directories
if(UNIX)
- if(NOT $ENV{TMPDIR} STREQUAL "")
- set(DBUS_SESSION_SOCKET_DIR $ENV{TMPDIR})
- elseif(NOT $ENV{TEMP} STREQUAL "")
- set(DBUS_SESSION_SOCKET_DIR $ENV{TEMP})
- elseif(NOT $ENV{TMP} STREQUAL "")
- set(DBUS_SESSION_SOCKET_DIR $ENV{TMP})
- else()
- set(DBUS_SESSION_SOCKET_DIR /tmp)
+ if(NOT DEFINED DBUS_SESSION_SOCKET_DIR)
+ if(NOT $ENV{TMPDIR} STREQUAL "")
+ set(DBUS_SESSION_SOCKET_DIR $ENV{TMPDIR})
+ elseif(NOT $ENV{TEMP} STREQUAL "")
+ set(DBUS_SESSION_SOCKET_DIR $ENV{TEMP})
+ elseif(NOT $ENV{TMP} STREQUAL "")
+ set(DBUS_SESSION_SOCKET_DIR $ENV{TMP})
+ else()
+ set(DBUS_SESSION_SOCKET_DIR /tmp)
+ endif()
endif()
endif()

Loading…
Cancel
Save