From 532ba73a97a88f0fcad8d86dc7fef9f50f9b4e33 Mon Sep 17 00:00:00 2001 From: eljamm Date: Fri, 2 Aug 2024 09:28:18 +0100 Subject: [PATCH] albert: use substituteInPlace instead of sed This is more robust and automatic to check if the file still exists in the same location and if we can still replace the string. --- pkgs/applications/misc/albert/default.nix | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/pkgs/applications/misc/albert/default.nix b/pkgs/applications/misc/albert/default.nix index a3ddd48990ef..b0c10117baa9 100644 --- a/pkgs/applications/misc/albert/default.nix +++ b/pkgs/applications/misc/albert/default.nix @@ -58,10 +58,8 @@ stdenv.mkDerivation (finalAttrs: { postPatch = '' find -type f -name CMakeLists.txt -exec sed -i {} -e '/INSTALL_RPATH/d' \; - # WARN: This is necessary for albert to detect the package libraries. - # Please check if the file below has changed upstream before updating. - sed -i src/app/qtpluginprovider.cpp \ - -e "/QStringList install_paths;/a install_paths << QFileInfo(\"$out/lib\").canonicalFilePath();" + substituteInPlace src/app/qtpluginprovider.cpp \ + --replace-fail "QStringList install_paths;" "QStringList install_paths;${"\n"}install_paths << QFileInfo(\"$out/lib\").canonicalFilePath();" ''; postFixup = ''