#1076340 dolphin-emu: Add Appstream metainfo announcing HW support

Package:
dolphin-emu
Source:
dolphin-emu
Description:
Gamecube and Wii emulator
Submitter:
Petter Reinholdtsen
Date:
2025-01-25 09:09:02 UTC
Severity:
normal
Tags:
#1076340#5
Date:
2024-07-14 18:19:09 UTC
From:
To:
Here is a patch to add Appstream metainfo XML announcing the hardware
handled by this package.

Including this information in the package will ensure programs mapping
hardware to packages using Appstream information, like the isenkram
package, will know that this package is useful on machines where the USB
IDs are discovered.

I only added the USB ids listed in Data/51-usb-device.rules.  I notice
several more are listed in Source/Core/UICommon/USBUtils.cpp, but do not
know if their existence should suggest an installation of this package.

diff --git a/debian/dolphin-emu.install b/debian/dolphin-emu.install
index 4f906df0..9bc65156 100644
--- a/debian/dolphin-emu.install
+++ b/debian/dolphin-emu.install
@@ -1,4 +1,5 @@
 Data/51-usb-device.rules /usr/lib/udev/rules.d
+org.dolphin-emu.metainfo.xml /usr/share/metainfo
 usr/games/dolphin-emu
 usr/games/dolphin-emu-nogui
 usr/games/dolphin-tool
diff --git a/debian/patches/1000-appstream-metainfo.patch b/debian/patches/1000-appstream-metainfo.patch
new file mode 100644
index 00000000..ac4d25a5
--- /dev/null
+++ b/debian/patches/1000-appstream-metainfo.patch
@@ -0,0 +1,30 @@
+Description: Added AppStream metainfo with hardware provides.
+ Allow mapping from hardware to package.
+Author: Petter Reinholdtsen
+Bug-Debian: https://bugs.debian.org/?
+Forwarded: no
+Last-Update: 2024-07-14
+---
+Index: dolphin-emu-salsa/org.dolphin-emu.metainfo.xml
+===================================================================
+--- /dev/null  1970-01-01 00:00:00.000000000 +0000
++++ dolphin-emu-salsa/org.dolphin-emu.metainfo.xml     2024-07-14 20:11:38.029350170 +0200
+@@ -0,0 +1,18 @@
++<?xml version="1.0" encoding="UTF-8"?>
++<component>
++  <id>org.dolphin-emu</id>
++  <metadata_license>MIT</metadata_license>
++  <name>dolphin-emu</name>
++  <summary>Gamecube and Wii emulator</summary>
++  <description>
++    <p>Dolphin is an emulator for two recent Nintendo video game
++    consoles: the GameCube and the Wii. It allows PC gamers to enjoy
++    games for these two consoles in full HD (1080p) with several
++    enhancements: compatibility with all PC controllers, turbo speed,
++    networked multiplayer, and even more.</p>
++  </description>
++  <provides>
++    <modalias>usb:v057Ep0306d*</modalias>
++    <modalias>usb:v057Ep0330d*</modalias>
++  </provides>
++</component>
diff --git a/debian/patches/series b/debian/patches/series
index 48f89b9e..6e2b91a7 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -4,3 +4,4 @@ xxhash.diff
 zlib.diff
 implot.patch
 mgba_videosize.patch
+1000-appstream-metainfo.patch

#1076340#10
Date:
2024-07-14 19:34:43 UTC
From:
To:
Control: tags -1 + upstream

AppStream metainfo should ideally be added upstream, rather than in one
specific downstream; or if it can't be upstreamed, it seems like the unique
identifier should at least be consistent between downstreams if possible.

The Flatpak app is org.DolphinEmu.dolphin-emu (although that's somewhat
wrong, because upstream doesn't own dolphinemu.org - it should ideally be
something like org.dolphin_emu.dolphin-emu, by the "replace dashes with
underscores where syntactically necessary" rule in
<https://www.freedesktop.org/software/appstream/docs/chap-Metadata.html#tag-id-generic>).

org.dolphin_emu.dolphin-emu would be more conventional than org.dolphin-emu,
despite the redundancy.

    smcv

#1076340#17
Date:
2024-07-14 20:18:05 UTC
From:
To:
[Simon McVittie]

While I agree, and this being the reason I provided it as a file applied
using debian/patches/ and not just a file in debian/, I do not really
care much about upstream.  I do care about appstream from Debian, and
leave upstreaming it in the competent hands of others.  I got 80 more
Debian packages to report patches for. :)

I do not care much which ID is picked.  I made one using the URL in the
Homepage field of debian/control.

#1076340#22
Date:
2025-01-25 08:45:05 UTC
From:
To:
I've sent a patch upstream to add hardware information into the
AppStream metainfo XML file in the Flatpak directory,
<URL: https://github.com/dolphin-emu/dolphin/pull/13308 >.

It might be useful if you want to install the upstream metainfo file in
Debian.  It is unclear to me which approach you would rather use to
provide package information using AppStream.  With more clues, I can
help make a new patch.

#1076340#27
Date:
2025-01-25 09:11:24 UTC
From:
To:
I have also sent a patch upstream to change the ID and fix a few
validation issues with the XML file,
<URL: https://github.com/dolphin-emu/dolphin/pull/13309 >.

Given the amount of open pull requests in the upstream project, it might
not be a good idea to wait for these to be applied before fixing the
Debian Appstream content. :)