kdePackages.kde-gtk-config: hardcode more dependency paths

This commit is contained in:
K900 2024-08-07 10:09:04 +03:00
parent 4b596e927e
commit 508a0a890c
2 changed files with 43 additions and 1 deletions

View File

@ -1,5 +1,9 @@
{
lib,
mkKdeDerivation,
substituteAll,
procps,
xsettingsd,
pkg-config,
wrapGAppsHook3,
sass,
@ -11,7 +15,17 @@ mkKdeDerivation {
# The gtkconfig KDED module will crash the daemon if the GSettings schemas
# aren't found.
patches = [./0001-gsettings-schemas-path.patch];
patches = [
./0001-gsettings-schemas-path.patch
(
substituteAll {
src = ./dependency-paths.patch;
pgrep = lib.getExe' procps "pgrep";
xsettingsd = lib.getExe xsettingsd;
}
)
];
preConfigure = ''
NIX_CFLAGS_COMPILE+=" -DGSETTINGS_SCHEMAS_PATH=\"$GSETTINGS_SCHEMAS_PATH\""
'';
@ -21,4 +35,10 @@ mkKdeDerivation {
dontWrapGApps = true; # There is nothing to wrap
extraCmakeFlags = ["-DGLIB_SCHEMAS_DIR=${gsettings-desktop-schemas.out}/"];
# Hardcoded as QStrings, which are UTF-16 so Nix can't pick these up automatically
postFixup = ''
mkdir -p $out/nix-support
echo "${procps} ${xsettingsd}" > $out/nix-support/depends
'';
}

View File

@ -0,0 +1,22 @@
diff --git a/kded/config_editor/xsettings.cpp b/kded/config_editor/xsettings.cpp
index 1f9fe5b..9824973 100644
--- a/kded/config_editor/xsettings.cpp
+++ b/kded/config_editor/xsettings.cpp
@@ -46,7 +46,7 @@ void replaceValueInXSettingsdContents(QString &xSettingsdContents, const QString
pid_t pidOfXSettingsd()
{
QProcess pgrep;
- pgrep.start(QStringLiteral("pgrep"),
+ pgrep.start(QStringLiteral("@pgrep@"),
QStringList{
QStringLiteral("-u"),
QString::number(getuid()),
@@ -67,7 +67,7 @@ reloadXSettingsd(void *)
{
pid_t xSettingsdPid = pidOfXSettingsd();
if (xSettingsdPid == 0) {
- QProcess::startDetached(QStandardPaths::findExecutable(QStringLiteral("xsettingsd")), QStringList());
+ QProcess::startDetached(QStringLiteral("@xsettingsd@"), QStringList());
} else {
kill(xSettingsdPid, SIGHUP);
}