commit: 694c2f33afd1ecf34e7af3dae16b3a236487f938 Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org> AuthorDate: Wed Jan 22 21:33:50 2025 +0000 Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org> CommitDate: Wed Jan 22 23:14:35 2025 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=694c2f33
net-irc/quassel: Fix notifications within Plasma 6 Closes: https://bugs.gentoo.org/939921 Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org> .../files/quassel-0.14.0-fix-notifyrc.patch | 101 +++++++++++++++++++++ net-irc/quassel/quassel-0.14.0-r4.ebuild | 8 ++ 2 files changed, 109 insertions(+) diff --git a/net-irc/quassel/files/quassel-0.14.0-fix-notifyrc.patch b/net-irc/quassel/files/quassel-0.14.0-fix-notifyrc.patch new file mode 100644 index 000000000000..e670ef14c22f --- /dev/null +++ b/net-irc/quassel/files/quassel-0.14.0-fix-notifyrc.patch @@ -0,0 +1,101 @@ +From f17bfbabb1f2cabfbc312f42e9628fd9905cde2b Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Wolfgang=20M=C3=BCller?= <wolf@oriole.systems> +Date: Wed, 18 Sep 2024 13:37:36 +0200 +Subject: [PATCH 1/2] uisupport: Use correct application name in KAboutData + +In commit 020c1634 (uisupport: fix application name for .desktop shell +integration, 2023-04-18), a call to setDesktopFileName() was added to +provide the correct .desktop file name for shell integration. However, +it also changed the application name from "quassel" to "quasselclient", +which does not match the application name Quassel sets when not built +with support for KDE, and breaks integration with KNotifications. + +The reason for this is that KNotifications expects the filename of the +global notification configuration file (quassel.notifyrc) to match the +application name [1]. With "quasselclient" now set as the application name +through KAboutData, this is no longer the case, and notifications simply +do not appear. + +Instead, use the previous application name, "quassel". This fixes +notifications for KDE and does not regress shell integration since we +still set the correct desktop file name. + +[1] https://api.kde.org/frameworks/knotifications/html/index.html +--- + src/uisupport/aboutdata.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/uisupport/aboutdata.cpp b/src/uisupport/aboutdata.cpp +index 380e54a54..afade4d33 100644 +--- a/src/uisupport/aboutdata.cpp ++++ b/src/uisupport/aboutdata.cpp +@@ -114,7 +114,7 @@ AboutData& AboutData::addCredits(std::initializer_list<AboutPerson> credits) + + KAboutData AboutData::kAboutData() const + { +- KAboutData aboutData(Quassel::buildInfo().clientApplicationName, tr("Quassel IRC"), Quassel::buildInfo().plainVersionString); ++ KAboutData aboutData(Quassel::buildInfo().applicationName, tr("Quassel IRC"), Quassel::buildInfo().plainVersionString); + aboutData.addLicense(KAboutLicense::GPL_V2); + aboutData.addLicense(KAboutLicense::GPL_V3); + aboutData.setShortDescription(tr("A modern, distributed IRC client")); + +From 4d6cb4424296e172a95d24f27c1cff54fccde372 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Wolfgang=20M=C3=BCller?= <wolf@oriole.systems> +Date: Wed, 18 Sep 2024 14:34:35 +0200 +Subject: [PATCH 2/2] data: Set DesktopEntry correctly in notifyrc + +KNotifications requires the DesktopEntry field in notifyrc to match the +base name of the application's desktop file [1]. Monolithic installs come +with a "quassel.desktop" file, which matches what is set presently in +notifyrc. However, client installs come with "quasselclient.desktop", +and do not match. + +To match up these values dynamically, introduce a notifyrc.in template +containing a placeholder which will be replaced by cmake. Since a system +can technically have both a monolithic binary and a client installed at +the same time, and we can't install two separate notifyrc files because +the application name stays the same throughout, assume the user prefers +the monolithic install when configured. + +[1] https://api.kde.org/frameworks/knotifications/html/index.html +--- + data/CMakeLists.txt | 10 +++++++++- + data/{quassel.notifyrc => quassel.notifyrc.in} | 2 +- + 2 files changed, 10 insertions(+), 2 deletions(-) + rename data/{quassel.notifyrc => quassel.notifyrc.in} (99%) + +diff --git a/data/CMakeLists.txt b/data/CMakeLists.txt +index 099d53b09..509e2c554 100644 +--- a/data/CMakeLists.txt ++++ b/data/CMakeLists.txt +@@ -1,6 +1,14 @@ + if (BUILD_GUI) + if (WITH_KF5) +- install(FILES quassel.notifyrc DESTINATION ${CMAKE_INSTALL_KNOTIFY5RCDIR}) ++ set(DESKTOP_FILE "quasselclient") ++ ++ if (WANT_MONO) ++ set(DESKTOP_FILE "quassel") ++ endif() ++ ++ configure_file(quassel.notifyrc.in quassel.notifyrc @ONLY) ++ ++ install(FILES ${CMAKE_BINARY_DIR}/data/quassel.notifyrc DESTINATION ${CMAKE_INSTALL_KNOTIFY5RCDIR}) + endif() + + if (UNIX AND NOT APPLE) +diff --git a/data/quassel.notifyrc b/data/quassel.notifyrc.in +similarity index 99% +rename from data/quassel.notifyrc +rename to data/quassel.notifyrc.in +index 733b379a7..c20638fbb 100644 +--- a/data/quassel.notifyrc ++++ b/data/quassel.notifyrc.in +@@ -1,6 +1,6 @@ + [Global] + IconName=quassel +-DesktopEntry=quassel ++DesktopEntry=@DESKTOP_FILE@ + Comment=Quassel IRC + Comment[ast]=Quassel IRC + Comment[ca]=Xat IRC Quassel diff --git a/net-irc/quassel/quassel-0.14.0-r4.ebuild b/net-irc/quassel/quassel-0.14.0-r4.ebuild index 21f66af6ba66..f489415229c9 100644 --- a/net-irc/quassel/quassel-0.14.0-r4.ebuild +++ b/net-irc/quassel/quassel-0.14.0-r4.ebuild @@ -101,6 +101,14 @@ BDEPEND=" DOCS=( AUTHORS ChangeLog README.md ) +PATCHES=( + "${FILESDIR}/${P}-cxxflags.patch" + "${FILESDIR}/${P}-fix-desktop-application-name.patch" + "${FILESDIR}/${P}-fix-exec-script.patch" + "${FILESDIR}/${P}-fix-mpris-script.patch" + "${FILESDIR}/${P}-fix-notifyrc.patch" +) + src_configure() { local mycmakeargs=( -DUSE_CCACHE=OFF