What version of Desktop Entry file is allowed in Flathub?

I tried to build a Flatpak with a Desktop Entry file (.desktop file) using the key Version=1.5.
Version 1.5 of Desktop Entry file allows us to use the key SingleMainWindow.
This key is used by Zotero upstream project (that I’m packaging).
But the Flathub bot failed to build saying the Version 1.5 “is not a known version” and also refused the key SingleMainWindow.
What version of Desktop Entry file is allowed?

About the versions of Desktop Entry file see here.

1 Like

I’m just guessing… what happens if you remove the Version key and keep the SingleMainWindow key?

I’m asking because I see a couple of apps using this key and they don’t have any Version key, see the first results (joplin and PortfolioPerformance) in this search.

Someone tried without the Version key, keeping only the SingleMainWindowkey. But it also failed with the warning:

Running: desktop-file-install --dir=/app/share/applications --set-key=Exec --set-value='zotero -url %U' --set-key=Icon --set-value=org.zotero.Zotero zotero.desktop --add-mime-type=x-scheme-handler/zotero
FB: Running 'flatpak build --die-with-parent --env=FLATPAK_BUILDER_BUILDDIR=/run/build/zotero --nofilesystem=host:reset --filesystem=/srv/buildbot/worker/build-x86_64-2/build/.flatpak-builder/build/zotero-1 --bind-mount=/run/build/zotero=/srv/buildbot/worker/build-x86_64-2/build/.flatpak-builder/build/zotero-1 --build-dir=/run/build/zotero --bind-mount=/run/ccache=/srv/buildbot/worker/build-x86_64-2/build/.flatpak-builder/ccache --unshare=network --env=SOURCE_DATE_EPOCH=1647585808 '--env=CFLAGS=-O2 -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer ' '--env=CXXFLAGS=-O2 -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer ' '--env=LDFLAGS=-L/app/lib -Wl,-z,relro,-z,now -Wl,--as-needed ' --env=CCACHE_DIR=/run/ccache/disabled --env=PATH=/app/bin:/usr/bin --env=LD_LIBRARY_PATH=/app/lib --env=PKG_CONFIG_PATH=/app/lib/pkgconfig:/app/share/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig --env=FLATPAK_BUILDER_N_JOBS=48 /srv/buildbot/worker/build-x86_64-2/build/.flatpak-builder/rofiles/rofiles-6EO70G /bin/sh -c 'desktop-file-install --dir=/app/share/applications --set-key=Exec --set-value='\''zotero -url %U'\'' --set-key=Icon --set-value=org.zotero.Zotero zotero.desktop --add-mime-type=x-scheme-handler/zotero'' on host
/app/share/applications/zotero.desktop: error: file contains key "SingleMainWindow" in group "Desktop Entry", but keys extending the format should start with "X-"
Error on file "zotero.desktop": Failed to validate the created desktop file
FB: host_command_exited_cb 683543 256

1.4, at least until desktop-file-utils 0.27 is released, and Flathub build servers have the updated package.

instead of using desktop-file-install, just use install and desktop-file-edit.