diff --git a/pkgs/desktops/plasma-5/kwin/default.nix b/pkgs/desktops/plasma-5/kwin/default.nix index ab8cc4d2498..08f0e346855 100644 --- a/pkgs/desktops/plasma-5/kwin/default.nix +++ b/pkgs/desktops/plasma-5/kwin/default.nix @@ -25,10 +25,9 @@ mkDerivation { udev wayland xcb-util-cursor xwayland ]; patches = copyPathsToStore (lib.readPathsFromFile ./. ./series); - postPatch = '' - substituteInPlace main_wayland.cpp \ - --subst-var-by xwayland ${lib.getBin xwayland}/bin/Xwayland - ''; + NIX_CFLAGS_COMPILE = [ + ''-DNIXPKGS_XWAYLAND="${lib.getBin xwayland}/bin/Xwayland"'' + ]; cmakeFlags = [ "-DCMAKE_SKIP_BUILD_RPATH=OFF" ]; postInstall = '' # Some package(s) refer to these service types by the wrong name. diff --git a/pkgs/desktops/plasma-5/kwin/xwayland.patch b/pkgs/desktops/plasma-5/kwin/xwayland.patch index 5fde01d08bf..51f15c87d27 100644 --- a/pkgs/desktops/plasma-5/kwin/xwayland.patch +++ b/pkgs/desktops/plasma-5/kwin/xwayland.patch @@ -7,7 +7,7 @@ Index: kwin-5.7.3/main_wayland.cpp m_xwaylandProcess = new Process(kwinApp()); m_xwaylandProcess->setProcessChannelMode(QProcess::ForwardedErrorChannel); - m_xwaylandProcess->setProgram(QStringLiteral("Xwayland")); -+ m_xwaylandProcess->setProgram(QStringLiteral("@xwayland@")); ++ m_xwaylandProcess->setProgram(QLatin1String(NIXPKGS_XWAYLAND)); QProcessEnvironment env = m_environment; env.insert("WAYLAND_SOCKET", QByteArray::number(wlfd)); m_xwaylandProcess->setProcessEnvironment(env);