Skip to content

Make metainfo and .desktop files spec compliant #5892

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

Merged
merged 2 commits into from
Feb 8, 2017

Conversation

ximion
Copy link
Contributor

@ximion ximion commented Jan 20, 2017

This resolves bug #5890

The AppStream/Metainfo spec has changed a bit, and the file shipped with Arduino doesn't work at all currently, since it was apparently written against a draft version of the initial spec which was never fully supported (congrats, looks like you were one of the earliest adopters!).
This patch updates the metainfo file to match the current version of the specification as found at https://www.freedesktop.org/software/appstream/docs/sect-Metadata-Application.html

Additionally, I also updated the .desktop file to follow the reverse-DNS scheme. This is a new requirement of the desktop-entry specification for modern applications to be D-Bus activatable and work well on Wayland.
The AppStream spec highly recommends using that scheme too, so I adapted it to be used in the .desktop and metainfo files.
You can read more about this at https://specifications.freedesktop.org/desktop-entry-spec/latest/ar01s02.html

If you have any questions, let me know!
You can validate the current metadata using appstreamcli validate <metainfofile>.

NOTE: I haven't tested if the script works yet (but it should).
If the .desktop filename change is not wanted, we can also go without it - just let me know and I'll adapt the patch.

@mastrolinux mastrolinux added the in progress Work on this item is in progress label Jan 20, 2017
Copy link
Collaborator

@matthijskooijman matthijskooijman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added some questions to this commit.

I also just noticed #5280, which makes similar changes. Could you have a look and see if there's anything in there that is missing in this PR?

<!-- See https://www.freedesktop.org/software/appstream/docs/chap-Quickstart.html -->
<component type="desktop-application">
<id>cc.arduino.arduinoide.desktop</id>
<metadata_license>FSFAP</metadata_license>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the FSFAP identifier predefined by the appstream specification? If not, I'm not sure if it is well-known enough to use the acronym here. Also, any pressing reason to change the license? The FSFAP looks easier to integrate with other licenses that CC-BY-SA, though.

Changing the license does involve consent of all contributors. In this case, that is @mavit (who originally wrote this file in #1572) and Federico, but I'm assuming his copyright is with Arduino, so that's not an issue.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it is well-defined and recommended for these texts, as it does not require a large license text to be shipped with the metainfo file and because it is very short. See https://spdx.org/licenses/FSFAP.html

In any case, I did not intend to change the license, that was by accident - CC-BY-SA-3.0 is totally fine and I changed it back in the new revision.

<updatecontact>[email protected]</updatecontact>
</application>

<update_contact>[email protected]</update_contact>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we should update this to an arduino.cc address (developers mailing list perhaps)? @cmaglie?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I no-longer maintain the Fedora package of Arduino, so certainly wouldn't object to this.

if [ -f "${HOME}/.local/share/applications/arduino-arduinoide.desktop" ]; then
rm "${HOME}/.local/share/applications/arduino-arduinoide.desktop"
fi

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should have a comment stating this was the name used in older scripts (perhaps add an OLD_RESOURCE_NAME var?)

@@ -6,7 +6,7 @@
# If called with the "-u" option, it will undo the changes.

# Resource name to use (including vendor prefix)
RESOURCE_NAME=arduino-arduinoide
RESOURCE_NAME=cc.arduino.arduinoide
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the .desktop suffix intentionally missing here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it gets added later in the script (so the ID can be used by multiple things)

@ximion
Copy link
Contributor Author

ximion commented Jan 22, 2017

I updated the patch with all changes from @mavit included.

@facchinm facchinm added the OS: Linux Specific to the Linux version of the Arduino IDE label Jan 24, 2017
@facchinm facchinm merged commit 0b549ef into arduino:master Feb 8, 2017
@mastrolinux mastrolinux removed the in progress Work on this item is in progress label Feb 8, 2017
@facchinm
Copy link
Member

facchinm commented Feb 8, 2017

Merged, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OS: Linux Specific to the Linux version of the Arduino IDE
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants