Skip to content

Commit 5af7165

Browse files
committed
Make metainfo and .desktop files spec compliant
This resolves bug #5890
1 parent 44c0c73 commit 5af7165

File tree

2 files changed

+27
-7
lines changed

2 files changed

+27
-7
lines changed

build/linux/dist/appdata.xml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<!-- See https://wiki.gnome.org/GnomeGoals/AppDataGnomeSoftware -->
3-
<application>
4-
<id type="desktop">arduino.desktop</id>
5-
<licence>CC-BY-SA</licence>
2+
<!-- See https://www.freedesktop.org/software/appstream/docs/chap-Quickstart.html -->
3+
<component type="desktop-application">
4+
<id>cc.arduino.arduinoide.desktop</id>
5+
<metadata_license>CC-BY-SA-3.0</metadata_license>
6+
7+
<name>Arduino IDE</name>
8+
<summary>Open-source electronics prototyping platform</summary>
9+
610
<description>
711
<p>
812
Arduino is an open-source electronics prototyping platform based
@@ -15,10 +19,13 @@
1519
to develop and upload code to compatible microcontrollers.
1620
</p>
1721
</description>
22+
1823
<screenshots>
1924
<screenshot type="default" width="624" height="351">http://mavit.fedorapeople.org/appdata/arduino-screenshot.png</screenshot>
2025
<screenshot width="704" height="396">http://mavit.fedorapeople.org/appdata/arduino-photo.jpg</screenshot>
2126
</screenshots>
27+
2228
<url type="homepage">http://www.arduino.cc/</url>
23-
<updatecontact>arduino.appdata.xml@mavit.org.uk</updatecontact>
24-
</application>
29+
30+
<update_contact>arduino.appdata.xml@mavit.org.uk</update_contact>
31+
</component>

build/linux/dist/install.sh

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# If called with the "-u" option, it will undo the changes.
77

88
# Resource name to use (including vendor prefix)
9-
RESOURCE_NAME=arduino-arduinoide
9+
RESOURCE_NAME=cc.arduino.arduinoide
1010

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

88+
mkdir -p "${HOME}/.local/share/metainfo"
89+
cp "${SCRIPT_PATH}/lib/appdata.xml" "${HOME}/.local/share/metainfo/${RESOURCE_NAME}.appdata.xml"
90+
8891
# Copy desktop icon if desktop dir exists (was found)
8992
if [ -d "${XDG_DESKTOP_DIR}" ]; then
9093
cp "${TMP_DIR}/${RESOURCE_NAME}.desktop" "${XDG_DESKTOP_DIR}/"
@@ -137,14 +140,24 @@ xdg_uninstall_f() {
137140
# Uninstall by simply removing desktop files (fallback), incl. old one
138141
simple_uninstall_f() {
139142

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

148+
# delete another legacy .desktop file
149+
if [ -f "${HOME}/.local/share/applications/arduino-arduinoide.desktop" ]; then
150+
rm "${HOME}/.local/share/applications/arduino-arduinoide.desktop"
151+
fi
152+
144153
if [ -f "${HOME}/.local/share/applications/${RESOURCE_NAME}.desktop" ]; then
145154
rm "${HOME}/.local/share/applications/${RESOURCE_NAME}.desktop"
146155
fi
147156

157+
if [ -f "${HOME}/.local/share/metainfo/${RESOURCE_NAME}.appdata.xml" ]; then
158+
rm "${HOME}/.local/share/metainfo/${RESOURCE_NAME}.appdata.xml"
159+
fi
160+
148161
if [ -f "${XDG_DESKTOP_DIR}/arduino.desktop" ]; then
149162
rm "${XDG_DESKTOP_DIR}/arduino.desktop"
150163
fi

0 commit comments

Comments
 (0)