Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Linux AppStream metadata #2603

Merged
merged 3 commits into from
Nov 23, 2024
Merged

Conversation

MateusRodCosta
Copy link
Contributor

Created for Flathub submission in flathub/flathub#5877, see also #2588

AppStream specification documentation: https://www.freedesktop.org/software/appstream/docs/

@niamu
Copy link
Member

niamu commented Nov 23, 2024

Just confirming that this doesn't need to be placed anywhere special or linked in any way before we merge this.

If it definitely is okay here - which is probably the best place for it - can you just attach a comment to the top of the file indicating that this only needed for the FlatPak release?

Also can you make the change in the Makefile under build/hawkthorne-linux.AppImage to only copy AppRun, hawkthorne.png, and love.desktop as we don't need to include this metadata file for the AppImage.

Finally, feel free to add your username to the CONTRIBUTORS file and run make contributors to update the credits. There's a minor bug in credits.py that I'd be grateful if you could patch as part of this PR before running that command as well:

diff --git a/scripts/credits.py b/scripts/credits.py
index e7adc90c..917a21b5 100644
--- a/scripts/credits.py
+++ b/scripts/credits.py
@@ -8,7 +8,9 @@ with open('CONTRIBUTORS', 'r') as f:

 with open('CONTRIBUTORS', 'w') as f:
     for name in sorted(names):
-        f.write(name + "\n")
+        name = name.strip()
+        if name != "":
+            f.write(name + "\n")

 template = jinja2.Template(open('templates/credits.lua').read())
 print(template.render(contributors=[l.strip().replace("'", "\\'") for l in open('CONTRIBUTORS')]))

Thanks!

@MateusRodCosta
Copy link
Contributor Author

Just confirming that this doesn't need to be placed anywhere special or linked in any way before we merge this.

Not really, just having it in the main repo in a place so we can say upstream manages it and it is the source-of-truth for that info should be enough.
Also of course in a way that I could just grab if I made a full clone of the repo or could still download even if I grabbed the released .love.

If it definitely is okay here - which is probably the best place for it - can you just attach a comment to the top of the file indicating that this only needed for the FlatPak release?

More precisely AppStream is the Linux standard so you can ship some metadata that can be shown on app stores. It is mainly useful for apps on distro repos and flatpaks, AppImages don't really benefit from it as they don't rely on app stores (at least as far as I know).
But, yeah, I can add a comment.

Also can you make the change in the Makefile under build/hawkthorne-linux.AppImage to only copy AppRun, hawkthorne.png, and love.desktop as we don't need to include this metadata file for the AppImage.

Sure, will do.

Finally, feel free to add your username to the CONTRIBUTORS file and run make contributors to update the credits. There's a minor bug in credits.py that I'd be grateful if you could patch as part of this PR before running that command as well:

Sure.

@niamu niamu merged commit 6b2c36d into hawkthorne:master Nov 23, 2024
1 check passed
@niamu
Copy link
Member

niamu commented Nov 23, 2024

Thanks for contributing!

@hfiguiere
Copy link

Just confirming that this doesn't need to be placed anywhere special

it gets installed in $PREFIX/share/metainfo. It's the standard location.

@niamu
Copy link
Member

niamu commented Nov 24, 2024

@hfiguiere Sorry, I need more clarity. Is that something that we need to change here? My question was more about how flathub needs to fetch this file from this repository and the initial response I got back was that it didn't matter as long as we were the maintainers of the metadata file.

@hfiguiere
Copy link

the best practice is to ship it in the tarball and that make install or equivalent install it in the location mentionned. This is not specific to flatpak either.

@niamu
Copy link
Member

niamu commented Nov 24, 2024

Ok, just so you know, we don't have a make install and only currently offer an AppImage so I'm not sure how this is applicable.

@hfiguiere
Copy link

as I said it's not specific to flatpak. And you should have a make install rule too. (your appimage can reuse it).

See AppImage documentation
https://docs.appimage.org/packaging-guide/optional/appstream.html

@MateusRodCosta
Copy link
Contributor Author

Tbf, I didn't know AppImages had AppStream integration, I thought that due to their "portable" behavior they didn't need them since I assumed it is mostly useful for app stores integration.
I myself only have flatpak, RPM and (likely outdated) PKGBUILD packaging experience and I normally don't use AppImages, so I couldn't really have known. 😅

Well, there's already a hawkthorne.love.zip download which is just the .love insize a .zip, if we had a hawkthorne-linux.tar.gz containing the .love game, the .desktop file, the .png for the icon and the .metainfo.xml metadata I believe it should be enough for me to handle on the flatpak manifest side.

the best practice is to ship it in the tarball and that make install or equivalent install it in the location mentionned. This is not specific to flatpak either.

Just a note, most games nowadays likely either assume they are self-contained or handled by some type of launcher, and not something restricted to a hierarchy similar to Linux's.
I believe it's more beneficial in this case to just ask them to ship the game and other files needed for integration (desktop file, icon, metadata) in a .tar.gz and properly setup things to where it is expected when building the flatpak.

Of course, since they already have the AppImage I can look into adding the AppStream data to it as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants