Thanks for working on this!
Are you running the snapcraft command in the snap folder or in the parent folder? You should run it in the parent folder so that `$PWD/snap/gui contains the desktop file and icon.
You don’t need to add this line when the desktop file is already in snap/gui. The desktop key should only be used if the desktop launcher is generated when your application builds.
Probably, the reason why meta/gui doesn’t contain the files yet is because the snap build fails before those files are copied. First, it copies any desktop launchers specified with the desktop keyword. Then it copies any desktop launchers from meta/gui.
Some more comments:
command: desktop-launch python3 $SNAP/pynsource-gui.py: You don’t need to manually adddesktop-launchany more when you use thegnome-3-28extension. The extension adds it to the command chain for you.- The variable
$SNAPis meant to be used after installation of your snap. It points to the directory of your snap after it is intalled. You should not use it during build. These are some of the variables to use during build: https://snapcraft.io/docs/parts-lifecycle#heading--parts-directories. If your build generates the desktop file and you want to use that one, you can do something likedesktop: ${SNAPCRAFT_STAGE}/usr/share/applications/pynsource.desktop - You can also remove the plugs desktop, desktop-legacy, gsettings and x11 as these are also added by the gnome-3-28 extension.
- It’s better to use
audio-playbackinstead ofpulseaudio. thepulseaudioplug is deprecated.audio-playbackgives access to the same functionality and is auto-connected to new snaps. - You also don’t need the
LD_LIBRARY_PATH: $LD_LIBRARY_PATH:$SNAP/usr/lib/x86_64-linux-gnu/pulseaudioline because thegnome-3-28extension takes care of that.