lomiri.morph-browser: Patch desktop icon path to be absolute

Because Lomiri App Launch parses it on Lomiri startup, and having a relative Icon entry somehow corrupts the search paths.
This commit is contained in:
OPNA2608 2024-03-02 13:42:44 +01:00 committed by Weijia Wang
parent b6fd92ab77
commit dd3f11b8f6

View File

@ -56,9 +56,12 @@ stdenv.mkDerivation (finalAttrs: {
substituteInPlace src/{Morph,Ubuntu}/CMakeLists.txt \ substituteInPlace src/{Morph,Ubuntu}/CMakeLists.txt \
--replace '/usr/lib/''${CMAKE_LIBRARY_ARCHITECTURE}/qt5/qml' "\''${CMAKE_INSTALL_PREFIX}/${qtbase.qtQmlPrefix}" --replace '/usr/lib/''${CMAKE_LIBRARY_ARCHITECTURE}/qt5/qml' "\''${CMAKE_INSTALL_PREFIX}/${qtbase.qtQmlPrefix}"
# Don't use absolute paths in desktop file # We normally don't want to use absolute paths in desktop file, but this one is special
# There appears to be some issue in lomiri-app-launch's lookup of relative Icon entries (while lomiri is starting up?)
# that makes the session segfault.
# As a compromise, hardcode /run/current-system
substituteInPlace src/app/webbrowser/morph-browser.desktop.in.in \ substituteInPlace src/app/webbrowser/morph-browser.desktop.in.in \
--replace 'Icon=@CMAKE_INSTALL_FULL_DATADIR@/morph-browser/morph-browser.svg' 'Icon=morph-browser' \ --replace 'Icon=@CMAKE_INSTALL_FULL_DATADIR@/morph-browser/morph-browser.svg' 'Icon=/run/current-system/sw/share/icons/hicolor/scalable/apps/morph-browser.svg' \
--replace 'X-Lomiri-Splash-Image=@CMAKE_INSTALL_FULL_DATADIR@/morph-browser/morph-browser-splash.svg' 'X-Lomiri-Splash-Image=lomiri-app-launch/splash/morph-browser.svg' --replace 'X-Lomiri-Splash-Image=@CMAKE_INSTALL_FULL_DATADIR@/morph-browser/morph-browser-splash.svg' 'X-Lomiri-Splash-Image=lomiri-app-launch/splash/morph-browser.svg'
'' + lib.optionalString (!finalAttrs.doCheck) '' '' + lib.optionalString (!finalAttrs.doCheck) ''
substituteInPlace CMakeLists.txt \ substituteInPlace CMakeLists.txt \
@ -124,7 +127,13 @@ stdenv.mkDerivation (finalAttrs: {
passthru = { passthru = {
updateScript = gitUpdater { }; updateScript = gitUpdater { };
tests.standalone = nixosTests.morph-browser; tests = {
# Test of morph-browser itself
standalone = nixosTests.morph-browser;
# Lomiri-specific issues with the desktop file may break the entire session, make sure it still works
lomiri = nixosTests.lomiri;
};
}; };
meta = with lib; { meta = with lib; {