Commit dd3f11b8 authored by OPNA2608's avatar OPNA2608 Committed by Weijia Wang
Browse files

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.
parent b6fd92ab
Loading
Loading
Loading
Loading
+12 −3
Original line number Diff line number Diff line
@@ -56,9 +56,12 @@ stdenv.mkDerivation (finalAttrs: {
    substituteInPlace src/{Morph,Ubuntu}/CMakeLists.txt \
      --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 \
      --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'
  '' + lib.optionalString (!finalAttrs.doCheck) ''
    substituteInPlace CMakeLists.txt \
@@ -124,7 +127,13 @@ stdenv.mkDerivation (finalAttrs: {

  passthru = {
    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; {