From 7735313b0cef406c7921d0cc8dfdf6541f50728c Mon Sep 17 00:00:00 2001 From: Joshua Goins Date: Thu, 9 Nov 2023 16:34:55 -0500 Subject: [PATCH] Add DBus service for NeoChat and link to KUnifiedPush if found --- src/CMakeLists.txt | 11 ++++++++++- src/org.kde.neochat.service.in | 5 +++++ 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 src/org.kde.neochat.service.in diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 35dd407f6..f33dc48e1 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -483,9 +483,18 @@ if (TARGET KF6::KIOWidgets) target_compile_definitions(neochat PUBLIC -DHAVE_KIO) endif() +if (TARGET KUnifiedPush) + target_compile_definitions(neochat PUBLIC -DHAVE_KUNIFIEDPUSH) + target_link_libraries(neochat PUBLIC KUnifiedPush) + + if (NOT ANDROID) + configure_file(org.kde.neochat.service.in ${CMAKE_CURRENT_BINARY_DIR}/org.kde.neochat.service) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/org.kde.neochat.service DESTINATION ${KDE_INSTALL_DBUSSERVICEDIR}) + endif() +endif() + install(TARGETS neochat-app ${KDE_INSTALL_TARGETS_DEFAULT_ARGS}) if (NOT ANDROID AND NOT WIN32 AND NOT APPLE) install(FILES plasma-runner-neochat.desktop DESTINATION ${KDE_INSTALL_DATAROOTDIR}/krunner/dbusplugins) endif() - diff --git a/src/org.kde.neochat.service.in b/src/org.kde.neochat.service.in new file mode 100644 index 000000000..e8aec21d2 --- /dev/null +++ b/src/org.kde.neochat.service.in @@ -0,0 +1,5 @@ +# SPDX-FileCopyrightText: none +# SPDX-License-Identifier: CC0-1.0 +[D-BUS Service] +Name=org.kde.neochat +Exec=@CMAKE_INSTALL_PREFIX@/bin/neochat --notify \ No newline at end of file