Page MenuHomeWildfire Games

Use rDNS-style Linux AppStream ID and standardize on "com.play0ad.zeroad"
AbandonedPublic

Authored by ngraham on Dec 29 2017, 8:03 PM.

Details

Reviewers
None
Summary

0ad's AppStream file re-uses the desktop file name rather than defining its own. This causes the AppStream ID to drift out of sync for downstream packagers like Flathub that require the use of rDNS-style AppStream IDs. When an app is available from multiple sources but they don't have the same AppStream ID, they'll show up as different apps rather than two different instances of the same app, but with multiple versions available. This patch standardizes the AppStream ID on "com.play0ad.zeroad" to prevent that from happening.

Test Plan

Not really able to test since this is a change that only affects downstream packagers (of which I am not one, just an interested party)

Diff Detail

Repository
rP 0 A.D. Public Repository
Branch
master
Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 4243
Build 7460: Vulcan BuildJenkins
Build 7459: arc lint + arc unit

Event Timeline

ngraham created this revision.Dec 29 2017, 8:03 PM
Owners added a subscriber: Restricted Owners Package.Dec 29 2017, 8:03 PM
Vulcan added a subscriber: Vulcan.Dec 29 2017, 9:39 PM

Successful build - Chance fights ever on the side of the prudent.

Updating workspaces...
Build (release)...
Build (debug)...
Running release tests...
Running cxxtest tests (308 tests)....................................................................................................................................................................................................................................................................................................................OK!
Running debug tests...
Running cxxtest tests (308 tests)....................................................................................................................................................................................................................................................................................................................OK!
Checking XML files...
elexis added a subscriber: elexis.Dec 29 2017, 10:07 PM

I had D683 to offer, but I didn't look at it since the last release.

What I still really would like input on would be the id and launchable field.

So I guess I got my input now, thanks! :-)

ngraham added a comment.EditedDec 29 2017, 10:11 PM

Awesome, feel free to ignore this patch if the work was already planned.

The ID should be an rDNS-style URL (ideally matching the one already used on Flathub), and the Desktop file should either match the ID (with ".desktop" added onto the end), or else you need to define the <launchable> tag in the AppStream file to tell AppStream how to associate the ID with the program's desktop file. Here's an example pair of ideally-formated files from the Lollypop music player:

You could use com.wildfiregames.0ad as your App ID, but unfortunately Flathub already used something different (com.play0ad.zeroad) and they don't yet support renaming (it's planned though).

smcv added a subscriber: smcv.Jan 12 2018, 2:34 PM

You could use com.wildfiregames.0ad as your App ID

That is not a suitable app ID if you ever want to use it in a context where a D-Bus bus name is required (like a DBusActivatable .desktop file), because D-Bus bus name components cannot start with a digit; I don't know why, but the decision was made years ago and can't be changed now without breaking apps' assumptions. The suggested encoding in the Desktop Entry specification and in the D-Bus Specification (next version, to be released soon) is to prepend an underscore to leading digits (com.wildfiregames._0ad) and replace hyphen/minus with underscores, to get the same string to be syntactically valid in as many contexts as possible (AppStream, D-Bus, Flatpak, etc.).

The maintainer of the AppStream specification is going to incorporate the same recommendation at some point, but does not currently have time to make that change.

OK, com.play0ad.zeroad it is, then--which is what my patch implements.

ngraham updated this revision to Diff 6184.Mar 16 2018, 2:56 AM
ngraham abandoned this revision.Apr 29 2018, 6:57 PM

Abandoning in favor of the more expansive D683: Update AppData.