Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kdesu: provide a script in bin and look for daemon first in /run/wrappers/bin #93306

Merged
merged 4 commits into from
Aug 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 15 additions & 1 deletion pkgs/desktops/plasma-5/kde-cli-tools.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
mkDerivation, extra-cmake-modules, kdoctools,
lib, mkDerivation, extra-cmake-modules, kdoctools,
kcmutils, kconfig, kdesu, ki18n, kiconthemes, kinit, kio, kwindowsystem,
qtsvg, qtx11extras, kactivities, plasma-workspace
}:
Expand All @@ -11,4 +11,18 @@ mkDerivation {
kcmutils kconfig kdesu ki18n kiconthemes kinit kio kwindowsystem qtsvg
qtx11extras kactivities plasma-workspace
];
postInstall = ''
# install a symlink in bin so that kdesu can eventually be found in PATH
mkdir -p $out/bin
ln -s $out/libexec/kf5/kdesu $out/bin
'';
dontWrapQtApps = true;
preFixup = ''
for program in $out/bin/*; do
wrapQtApp $program
done

# kdesu looks for kdeinit5 in PATH
wrapQtApp $out/libexec/kf5/kdesu --suffix PATH : ${lib.getBin kinit}/bin
'';
}
2 changes: 1 addition & 1 deletion pkgs/development/libraries/kde-frameworks/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ let
kdeclarative = callPackage ./kdeclarative.nix {};
kded = callPackage ./kded.nix {};
kdesignerplugin = callPackage ./kdesignerplugin.nix {};
kdesu = callPackage ./kdesu.nix {};
kdesu = callPackage ./kdesu {};
kdewebkit = callPackage ./kdewebkit.nix {};
kemoticons = callPackage ./kemoticons.nix {};
kglobalaccel = callPackage ./kglobalaccel.nix {};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ mkDerivation {
buildInputs = [ kcoreaddons ki18n kpty kservice qtbase ];
propagatedBuildInputs = [ kpty ];
outputs = [ "out" "dev" ];
patches = [ ./kdesu-search-for-wrapped-daemon-first.patch ];
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
From 01af4d2a098e5819c09bca37568941dcd4b89d0b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jos=C3=A9=20Romildo=20Malaquias?= <malaquias@gmail.com>
Date: Thu, 16 Jul 2020 13:21:42 -0300
Subject: [PATCH] Search for the daemon first in /run/wrappers/bin

If looking first in libexec, the eventually wrapped one in
/run/wrappers/bin can not be found.
---
src/client.cpp | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/src/client.cpp b/src/client.cpp
index 44fbacd..6b5abf5 100644
--- a/src/client.cpp
+++ b/src/client.cpp
@@ -378,11 +378,14 @@ int KDEsuClient::stopServer()

static QString findDaemon()
{
- QString daemon = QFile::decodeName(CMAKE_INSTALL_FULL_LIBEXECDIR_KF5 "/kdesud");
- if (!QFile::exists(daemon)) { // if not in libexec, find it in PATH
- daemon = QStandardPaths::findExecutable(QStringLiteral("kdesud"));
- if (daemon.isEmpty()) {
- qWarning() << "kdesud daemon not found.";
+ QString daemon = QFile::decodeName("/run/wrappers/bin/kdesud");
+ if (!QFile::exists(daemon)) { // if not in wrappers
+ daemon = QFile::decodeName(CMAKE_INSTALL_FULL_LIBEXECDIR_KF5 "/kdesud");
+ if (!QFile::exists(daemon)) { // if not in libexec, find it in PATH
+ daemon = QStandardPaths::findExecutable(QStringLiteral("kdesud"));
+ if (daemon.isEmpty()) {
+ qWarning() << "kdesud daemon not found.";
+ }
}
}
return daemon;
--
2.27.0