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.
This commit is contained in:
eljamm
2024-08-02 09:58:39 +01:00
parent 2d06eed03c
commit 532ba73a97
+2 -4
View File
@@ -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 = ''