Metainfo files in upstream or flathub repo?

Hi everyone, I’m packaging an application for flathub and I’m a bit confused about where the metainfo and desktop files should go. As of now, they’re upstream, but seeing that flathub uses the metainfo to display information about the app in the store, I think that the metainfo file should go in the flathub repo. However, I see a lot of application repos that don’t include the metainfo file, but still display the information in flathub. How does that work?

Technically, all that matters is that the files are installed in the right locations and are named as expected.

E.g.
tld.domain.yourapp.appdata.xml in /app/share/metainfo/,
tld.domain.yourapp.desktop in /app/share/applications/,
etc.

See the flatpak docs for more information.

No it should not Requirements | Flathub Documentation

Okay, its doing that. My follow up question is how does the flathub repo get the metainfo of the application when it is upstream and not in the repo?

When you build your application it gets installed if it is hooked to your buildsystem.

Otherwise install it manually in the manifest with post-install and install -Dm0644 <source> ${FLATPAK_DEST}/share/metainfo/${FLATPAK_ID}.metainfo.xml as the install command.

It is Flathub that does this, right?

I mean Flathub downloads from upstream (as necessary) and then builds and installs the files in the correct locations on its servers (which explains why Flathub has access to the metainfo) and when the user installs the application it just copies the files from Flathub?

1 Like

You specify the source in the manifest file, flatpak-builder downloads it and installs it according to the commands specified in the manifest

I meant in the case where someone is searching for the application on flathub. Flatpak-builder wouldn’t be running on flathub, right?

This makes sense. Thanks!

if you mean how the cli shows data, it downloads and parses this file https://dl.flathub.org/repo/appstream/x86/appstream.xml.gz

Which is basically a long list of combined metainfo files of all apps that are available

This topic was automatically closed after 4 days. New replies are no longer allowed.