From 508a0a890cf9d073253414cbacb0c8f7630cbb1e Mon Sep 17 00:00:00 2001 From: K900 Date: Wed, 7 Aug 2024 10:09:04 +0300 Subject: [PATCH] kdePackages.kde-gtk-config: hardcode more dependency paths --- pkgs/kde/plasma/kde-gtk-config/default.nix | 22 ++++++++++++++++++- .../kde-gtk-config/dependency-paths.patch | 22 +++++++++++++++++++ 2 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 pkgs/kde/plasma/kde-gtk-config/dependency-paths.patch diff --git a/pkgs/kde/plasma/kde-gtk-config/default.nix b/pkgs/kde/plasma/kde-gtk-config/default.nix index 3126e2f8d9c0..045358ffbde5 100644 --- a/pkgs/kde/plasma/kde-gtk-config/default.nix +++ b/pkgs/kde/plasma/kde-gtk-config/default.nix @@ -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 + ''; } diff --git a/pkgs/kde/plasma/kde-gtk-config/dependency-paths.patch b/pkgs/kde/plasma/kde-gtk-config/dependency-paths.patch new file mode 100644 index 000000000000..b54c8e7a5162 --- /dev/null +++ b/pkgs/kde/plasma/kde-gtk-config/dependency-paths.patch @@ -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); + }