Are .desktop-file icons paths still being fixed by snapcraft?

I’ve just received the following from automated review:

invalid icon path ‘/usr/share/icons/hicolor/scalable/apps/jami.svg’. Should either specify the basename of the file (with or without file extension), ${SNAP}/path/to/icon orsnap..[.(png|svg)] when using icon sets in meta/gui/icons. If using snapcraft, consider using ‘desktop: ’ since the Icon paths in the desktop will be rewritten to use ${SNAP}/. lint-snap-v2_desktop_file_icon (jami.desktop, /usr/share/icons/hicolor/scalable/apps/jami.svg)

There, it is clearly stated that snapcraft will rewrite the desktop-file’s paths to include ${SNAP} if correctly set in the yaml. I have this set in the yaml:

apps:
  jami:
    command: usr/bin/jami-gnome
    command-chain:
    - bin/desktop-launch
    - snap/command-chain/alsa-launch
    - bin/jami-gnome-wrapper
    common-id: net.jami.Jami
    desktop: usr/share/applications/jami-gnome.desktop
    slots:
    ...
    plugs:
    ...

As you can see, the desktop is specified and I have confirmed that the desktop file is using that name and path when installed. This should, therefore, surely have meant that the icon path is fixed, which I have specified in the desktop file as /usr/share/icons/hicolor/scalable/apps/jami.svg and the file correctly exists at $SNAP/usr/share/icons/hicolor/scalable/apps/jami.svg.

Is the wording in the above rejection still correct? Does snapcraft still rewrite the icon path? Have I done something wrong?

The source code for the jami snap is at Fix icon path in snapcraft.yaml · diddlesnaps/jami@8dd1998 · GitHub (I’m about to modify the source to manually insert the ${SNAP} prefix, which is why I’ve linked to the commit hash here).

2 Likes