flathub / org.freedesktop.appstream.cli

https://flathub.org/apps/details/org.freedesktop.appstream.cli
0 stars 1 forks source link

Keyboard and pointing device are not recognized on flatpak version #11

Open xanscale opened 2 months ago

xanscale commented 2 months ago
<requires>
    <memory>8192</memory>
    <control>keyboard</control>
    <control>pointing</control>
    <display_length compare="ge">768</display_length>
</requires>
$ appstreamcli --version
Version AppStream: 1.0.3

$ flatpak run org.freedesktop.appstream.cli --version
Version AppStream: 1.0.3
$ appstreamcli is-satisfied com.google.AndroidStudio.appdata.xml
Relation check for: */*/*/com.google.AndroidStudio.desktop/*

Requirements:
 ✔ This system has enough memory for this software.
 ✔ Physical keyboard found.
 ✔ Pointing device found (for example, a mouse or touchpad).
 • Unable to check display size: Can not read information without GUI toolkit access.
$ flatpak run org.freedesktop.appstream.cli is-satisfied com.google.AndroidStudio.appdata.xml
Relation check for: */*/*/com.google.AndroidStudio.desktop/*

Requirements:
 ✔ This system has enough memory for this software.
 ✘ This software requires a keyboard for input.
 ✘ This software requires a pointing device (e.g. a mouse) for input.
 • Unable to check display size: Can not read information without GUI toolkit access.
ximion commented 2 months ago

Hmm, I guess we need to give the Flatpak permission to enumerate udev devices then...

xanscale commented 2 months ago

seams connected to https://gitlab.gnome.org/GNOME/gnome-software/-/issues/2449

ximion commented 2 months ago

seams connected to https://gitlab.gnome.org/GNOME/gnome-software/-/issues/2449

It isn't, the problem with GNOME Software is that it doesn't use libappstream to determine compatibility, which causes a lot of issues. And due to its internal design, making it use the same code isn't trivial either.

This bug on the other hand is just libsystemd being unable to read hardware information in the Flatpak bundle.

xanscale commented 2 months ago

"it doesn't use libappstream", realy?

i assumed that, lol

ximion commented 2 months ago

Oh, it does use libappstream, but not for this particular feature for some reason. It reads data with libappstream, then makes libas convert the data back into XML text, generates a binary cache from the XML and then operates on that, using libas datatypes where possible later.

But of course, the libas API operates on AsComponent structures and not on GNOME Software's database structure when determining installability. The "best" solution would probably be to temporarily load the component back from the GS database, which would give correct answers and use little code, but would be even more wasteful as it adds yet another conversion (a small one at least, not like the massive XML rewrites upon initial loading of data - this is most pronounced on APT-based distros where some YAML->XML conversion also happens).