]> cloud.milkyroute.net Git - dolphin.git/commitdiff
D-Bus activation systemd service
authorHenri Chain <henri.chain@enioka.com>
Wed, 21 Oct 2020 10:20:56 +0000 (10:20 +0000)
committerHenri Chain <henri.chain@enioka.com>
Thu, 19 Nov 2020 09:40:56 +0000 (10:40 +0100)
Correctly scopes dolphin in systemd service `app-org.kde.dolphin.service` when dbus-activated (while still working if systemd is not present), as per https://systemd.io/DESKTOP_ENVIRONMENTS/

uses new ECM modules:
- https://invent.kde.org/frameworks/extra-cmake-modules/-/merge_requests/5 to simplify the systemd service templating + install
- https://invent.kde.org/frameworks/extra-cmake-modules/-/merge_requests/17 to generate the dbus service file automatically

needs https://invent.kde.org/frameworks/extra-cmake-modules/-/merge_requests/25

CMakeLists.txt
org.kde.dolphin.FileManager1.service.in [deleted file]
plasma-dolphin.service.in [new file with mode: 0644]

index 0795758663e76755e69b32e1c7a2a033efcf9447..96291da51357a3fe16f9dd99e0af9409b0c9c24c 100644 (file)
@@ -8,7 +8,7 @@ set (RELEASE_SERVICE_VERSION "${RELEASE_SERVICE_VERSION_MAJOR}.${RELEASE_SERVICE
 project(Dolphin VERSION ${RELEASE_SERVICE_VERSION})
 
 set(QT_MIN_VERSION "5.14.0")
-set(KF5_MIN_VERSION "5.73.0")
+set(KF5_MIN_VERSION "5.75.0")
 
 # ECM setup
 find_package(ECM ${KF5_MIN_VERSION} CONFIG REQUIRED)
@@ -16,6 +16,8 @@ set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake)
 
 include(ECMSetupVersion)
 include(ECMGenerateHeaders)
+include(ECMGenerateDBusServiceFile)
+include(ECMConfiguredInstall)
 include(CMakePackageConfigHelpers)
 include(GenerateExportHeader)
 include(FeatureSummary)
@@ -166,10 +168,16 @@ install(FILES
     COMPONENT Devel
 )
 
-configure_file(org.kde.dolphin.FileManager1.service.in
-               ${CMAKE_CURRENT_BINARY_DIR}/org.kde.dolphin.FileManager1.service)
-install(FILES ${CMAKE_CURRENT_BINARY_DIR}/org.kde.dolphin.FileManager1.service
-        DESTINATION ${KDE_INSTALL_DBUSSERVICEDIR})
+ecm_generate_dbus_service_file(
+   NAME org.freedesktop.FileManager1
+   EXECUTABLE "${KDE_INSTALL_FULL_BINDIR}/dolphin --daemon"
+   SYSTEMD_SERVICE plasma-dolphin.service
+   DESTINATION ${KDE_INSTALL_DBUSSERVICEDIR}
+   RENAME org.kde.dolphin.FileManager1.service
+)
+
+ecm_install_configured_files(INPUT plasma-dolphin.service.in DESTINATION ${SYSTEMD_USER_UNIT_INSTALL_DIR})
+
 install(FILES dolphin.categories  DESTINATION  ${KDE_INSTALL_LOGGINGCATEGORIESDIR})
 
 feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)
diff --git a/org.kde.dolphin.FileManager1.service.in b/org.kde.dolphin.FileManager1.service.in
deleted file mode 100644 (file)
index c1258bb..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-[D-BUS Service]
-Name=org.freedesktop.FileManager1
-Exec=@CMAKE_INSTALL_PREFIX@/bin/dolphin --daemon
diff --git a/plasma-dolphin.service.in b/plasma-dolphin.service.in
new file mode 100644 (file)
index 0000000..d4cdd69
--- /dev/null
@@ -0,0 +1,8 @@
+[Unit]
+Description=Dolphin file manager
+PartOf=graphical-session.target
+
+[Service]
+ExecStart=@KDE_INSTALL_FULL_BINDIR@/dolphin --daemon
+BusName=org.freedesktop.FileManager1
+Slice=background.slice