From 17ed39827aee62f8649b852d44be2ceaa9f6a82e Mon Sep 17 00:00:00 2001 From: Roland Winklmeier Date: Wed, 4 Oct 2017 11:26:37 +0200 Subject: [PATCH] Generate DBus session.conf from template for each platform individually Before this commit we used to have a static session.conf. But the session configuration needs to be different for Mac OS and Windows. Our static one was Windows only. This caused the packaged DBus daemon to fail on Mac OS. This commit solves this by generating the config file at qmake time with special configuration for each operating system. ref T170 --- src/blackmisc/blackmisc.pro | 23 ++++++- .../blackmisc/share/dbus-1/session.conf.in | 60 +++++++++---------- 2 files changed, 52 insertions(+), 31 deletions(-) rename etc/dbus-1/session.conf => src/blackmisc/share/dbus-1/session.conf.in (52%) diff --git a/src/blackmisc/blackmisc.pro b/src/blackmisc/blackmisc.pro index 03463f959..a0956e08c 100644 --- a/src/blackmisc/blackmisc.pro +++ b/src/blackmisc/blackmisc.pro @@ -70,7 +70,24 @@ win32-g++ { DESTDIR = $$DestRoot/lib DLLDESTDIR = $$DestRoot/bin -OTHER_FILES += $$TRANSLATIONS readme.txt buildconfig.cpp.in +OTHER_FILES += $$TRANSLATIONS readme.txt share/dbus-1/session.conf.in + +win32 { + DBUS_SESSION_BUS_LISTEN_ADDRESS = "autolaunch:" + DBUS_SESSION_CONF_MAYBE_AUTH_EXTERNAL = "" +} + +macx { + DBUS_SESSION_BUS_LISTEN_ADDRESS = "launchd:env=DBUS_LAUNCHD_SESSION_BUS_SOCKET" + DBUS_SESSION_CONF_MAYBE_AUTH_EXTERNAL = "EXTERNAL" +} + +win32|macx { + dbus_session_conf.input = share/dbus-1/session.conf.in + dbus_session_conf.output = $$DestRoot/share/dbus-1/session.conf + QMAKE_SUBSTITUTES += dbus_session_conf +} + win32 { dlltarget.path = $$PREFIX/bin @@ -80,4 +97,8 @@ win32 { INSTALLS += target } +package_dbus_conf.path = $$PREFIX/share/dbus-1 +package_dbus_conf.files += $$DestRoot/share/dbus-1/*.conf +INSTALLS += package_dbus_conf + load(common_post) diff --git a/etc/dbus-1/session.conf b/src/blackmisc/share/dbus-1/session.conf.in similarity index 52% rename from etc/dbus-1/session.conf rename to src/blackmisc/share/dbus-1/session.conf.in index 707be8672..705f4e47e 100644 --- a/etc/dbus-1/session.conf +++ b/src/blackmisc/share/dbus-1/session.conf.in @@ -2,17 +2,17 @@ Add a session-local.conf and edit that rather than changing this file directly. --> - + - + session - - autolaunch: + $$DBUS_SESSION_BUS_LISTEN_ADDRESS - + $$DBUS_SESSION_CONF_MAYBE_AUTH_EXTERNAL - + - + - + - + session.d - - session-local.conf + session-local.conf - contexts/dbus_contexts + contexts/dbus_contexts - - 1000000000 - 250000000 - 1000000000 - 250000000 - 1000000000 + + 1000000000 + 250000000 + 1000000000 + 250000000 + 1000000000 - 120000 - 240000 - 150000 - 100000 - 10000 - 100000 - 10000 - 50000 - 50000 - 50000 + 120000 + 240000 + 150000 + 100000 + 10000 + 100000 + 10000 + 50000 + 50000 + 50000