kdePackages.koi: patch hardcoded binary paths
Co-authored-by: alexyao2015 <33379584+alexyao2015@users.noreply.github.com>
This commit is contained in:
co-authored by
alexyao2015
parent
785f27ea90
commit
b95aad0ec0
@@ -0,0 +1,44 @@
|
||||
diff --git a/src/plugins/colorscheme.cpp b/src/plugins/colorscheme.cpp
|
||||
index 7c51806..4d8015b 100644
|
||||
--- a/src/plugins/colorscheme.cpp
|
||||
+++ b/src/plugins/colorscheme.cpp
|
||||
@@ -3,16 +3,7 @@
|
||||
#include <QProcess>
|
||||
|
||||
void ColorScheme::setTheme(QString themeName) {
|
||||
- QProcess process;
|
||||
- QString locateProgram = "whereis";
|
||||
- QStringList programToLocate = {"plasma-apply-colorscheme"};
|
||||
-
|
||||
- process.start(locateProgram, programToLocate);
|
||||
- process.waitForFinished();
|
||||
-
|
||||
- QString program(process.readAllStandardOutput());
|
||||
- program.replace("plasma-apply-colorscheme: ", "");
|
||||
- program.replace("\n", "");
|
||||
+ QString program("@plasma-apply-colorscheme@");
|
||||
|
||||
QStringList arguments{themeName};
|
||||
QProcess::startDetached(program, arguments);
|
||||
diff --git a/src/plugins/icons.cpp b/src/plugins/icons.cpp
|
||||
index 1cc306f..745d042 100644
|
||||
--- a/src/plugins/icons.cpp
|
||||
+++ b/src/plugins/icons.cpp
|
||||
@@ -5,16 +5,7 @@
|
||||
void Icons::setTheme(QString iconTheme) {
|
||||
|
||||
// locate plasma-changeicons program
|
||||
- QProcess process;
|
||||
- QString locateProgram = "whereis";
|
||||
- QStringList programToLocate = {"plasma-changeicons"};
|
||||
-
|
||||
- process.start(locateProgram, programToLocate);
|
||||
- process.waitForFinished();
|
||||
-
|
||||
- QString program(process.readAllStandardOutput());
|
||||
- program.replace("plasma-changeicons: ", "");
|
||||
- program.replace("\n", "");
|
||||
+ QString program("@plasma-changeicons@");
|
||||
|
||||
// apply the icon theme
|
||||
QStringList arguments{iconTheme};
|
||||
Vendored
+25
@@ -7,6 +7,10 @@
|
||||
kcoreaddons,
|
||||
kwidgetsaddons,
|
||||
wrapQtAppsHook,
|
||||
kdbusaddons,
|
||||
kde-cli-tools,
|
||||
plasma-workspace,
|
||||
qtstyleplugin-kvantum,
|
||||
}:
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
pname = "koi";
|
||||
@@ -19,6 +23,27 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
hash = "sha256-fXLGlq41Qwdp0cYJcNqPlYnlpVXsZk0imYxP7Bgdcvw=";
|
||||
};
|
||||
|
||||
patches = [
|
||||
# koi tries to access KDE utility binaries at their absolute paths or by using `whereis`.
|
||||
# We patch the absolute paths below in `postPatch` and replace the `whereis` invocations
|
||||
# here with a placeholder that is also substituted in `postPatch`.
|
||||
./0001-locate-plasma-tools.patch
|
||||
];
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace src/utils.cpp \
|
||||
--replace-fail /usr/bin/kquitapp6 ${lib.getExe' kdbusaddons "kquitapp6"} \
|
||||
--replace-fail /usr/bin/kstart ${lib.getExe' kde-cli-tools "kstart"}
|
||||
substituteInPlace src/plugins/plasmastyle.cpp \
|
||||
--replace-fail /usr/bin/plasma-apply-desktoptheme ${lib.getExe' plasma-workspace "plasma-apply-desktoptheme"}
|
||||
substituteInPlace src/plugins/colorscheme.cpp \
|
||||
--replace-fail '@plasma-apply-colorscheme@' ${lib.getExe' plasma-workspace "plasma-apply-colorscheme"}
|
||||
substituteInPlace src/plugins/icons.cpp \
|
||||
--replace-fail '@plasma-changeicons@' ${plasma-workspace}/libexec/plasma-changeicons
|
||||
substituteInPlace src/plugins/kvantumstyle.cpp \
|
||||
--replace-fail /usr/bin/kvantummanager ${lib.getExe' qtstyleplugin-kvantum "kvantummanager"}
|
||||
'';
|
||||
|
||||
nativeBuildInputs = [
|
||||
cmake
|
||||
wrapQtAppsHook
|
||||
|
||||
Reference in New Issue
Block a user