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
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 26 additions & 8 deletions build/linux/dist/appdata.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- See https://wiki.gnome.org/GnomeGoals/AppDataGnomeSoftware -->
<application>
<id type="desktop">arduino.desktop</id>
<licence>CC-BY-SA</licence>
<!-- See https://www.freedesktop.org/software/appstream/docs/chap-Quickstart.html -->
<component type="desktop-application">
<id>cc.arduino.arduinoide.desktop</id>
<metadata_license>CC-BY-SA-3.0</metadata_license>
<developer_name>Arduino LLC</developer_name>

<name>Arduino IDE</name>
<summary>Open-source electronics prototyping platform</summary>

<description>
<p>
Arduino is an open-source electronics prototyping platform based
Expand All @@ -15,10 +20,23 @@
to develop and upload code to compatible microcontrollers.
</p>
</description>

<screenshots>
<screenshot type="default" width="624" height="351">http://mavit.fedorapeople.org/appdata/arduino-screenshot.png</screenshot>
<screenshot width="704" height="396">http://mavit.fedorapeople.org/appdata/arduino-photo.jpg</screenshot>
<screenshot type="default">
<image>https://mavit.fedorapeople.org/appdata/arduino-screenshot.png</image>
<caption>The Arduino IDE showing a simple example program</caption>
</screenshot>
<screenshot>
<image>https://mavit.fedorapeople.org/appdata/arduino-photo.jpg</image>
<caption>Arduino hardware being connected to a breadboard</caption>
</screenshot>
</screenshots>

<url type="homepage">http://www.arduino.cc/</url>
<updatecontact>[email protected]</updatecontact>
</application>
<url type="help">https://www.arduino.cc/en/Guide/HomePage</url>
<url type="bugtracker">https://github.com/arduino/Arduino/issues</url>
<url type="translate">https://github.com/arduino/Arduino/tree/master/arduino-core/src/processing/app/i18n</url>
<url type="donation">https://www.arduino.cc/en/Main/Contribute</url>

<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.

</component>
15 changes: 14 additions & 1 deletion build/linux/dist/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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)


# Get absolute path from which this script file was executed
# (Could be changed to "pwd -P" to resolve symlinks to their target)
Expand Down Expand Up @@ -85,6 +85,9 @@ simple_install_f() {
mkdir -p "${HOME}/.local/share/applications"
cp "${TMP_DIR}/${RESOURCE_NAME}.desktop" "${HOME}/.local/share/applications/"

mkdir -p "${HOME}/.local/share/metainfo"
cp "${SCRIPT_PATH}/lib/appdata.xml" "${HOME}/.local/share/metainfo/${RESOURCE_NAME}.appdata.xml"

# Copy desktop icon if desktop dir exists (was found)
if [ -d "${XDG_DESKTOP_DIR}" ]; then
cp "${TMP_DIR}/${RESOURCE_NAME}.desktop" "${XDG_DESKTOP_DIR}/"
Expand Down Expand Up @@ -137,14 +140,24 @@ xdg_uninstall_f() {
# Uninstall by simply removing desktop files (fallback), incl. old one
simple_uninstall_f() {

# delete legacy cruft .desktop file
if [ -f "${HOME}/.local/share/applications/arduino.desktop" ]; then
rm "${HOME}/.local/share/applications/arduino.desktop"
fi

# delete another legacy .desktop file
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?)

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

if [ -f "${HOME}/.local/share/metainfo/${RESOURCE_NAME}.appdata.xml" ]; then
rm "${HOME}/.local/share/metainfo/${RESOURCE_NAME}.appdata.xml"
fi

if [ -f "${XDG_DESKTOP_DIR}/arduino.desktop" ]; then
rm "${XDG_DESKTOP_DIR}/arduino.desktop"
fi
Expand Down