sublime-merge: Avoid absolute exec paths in desktop file

When user installed a new version of SM (or just a different derivation),
GNOME Shell would lose the association of the windows with the icon.
Since the package needs to be installed in order for the desktop file
to be available, having the path absolute is useless any way.

Same change as the one for sublime4 in the parent commit.
This commit is contained in:
Jan Tojnar 2022-09-16 17:57:45 +02:00
parent 98315b4307
commit 2901fd1b0c

View file

@ -98,7 +98,7 @@ in stdenv.mkDerivation (rec {
makeWrapper "''$${primaryBinary}/${primaryBinary}" "$out/bin/${primaryBinary}"
'' + builtins.concatStringsSep "" (map (binaryAlias: "ln -s $out/bin/${primaryBinary} $out/bin/${binaryAlias}\n") primaryBinaryAliases) + ''
mkdir -p "$out/share/applications"
substitute "''$${primaryBinary}/${primaryBinary}.desktop" "$out/share/applications/${primaryBinary}.desktop" --replace "/opt/${primaryBinary}/${primaryBinary}" "$out/bin/${primaryBinary}"
substitute "''$${primaryBinary}/${primaryBinary}.desktop" "$out/share/applications/${primaryBinary}.desktop" --replace "/opt/${primaryBinary}/${primaryBinary}" "${primaryBinary}"
for directory in ''$${primaryBinary}/Icon/*; do
size=$(basename $directory)
mkdir -p "$out/share/icons/hicolor/$size/apps"