pantheon.elementary-feedback: load metadata from correct location

This commit is contained in:
Bobby Rong 2022-05-28 12:21:51 +08:00
parent e741166e62
commit 874fb627c4
No known key found for this signature in database
GPG Key ID: ED07364437C91161
2 changed files with 25 additions and 0 deletions

View File

@ -27,6 +27,14 @@ stdenv.mkDerivation rec {
sha256 = "sha256-YLYHaFQAAeSt25xHF7xDJWhw+rbH9SpzoRoXaYP42jg=";
};
patches = [
# The standard location to the metadata pool where metadata
# will be read from is likely hardcoded as /usr/share/metainfo
# https://github.com/ximion/appstream/blob/v0.15.2/src/as-pool.c#L117
# https://www.freedesktop.org/software/appstream/docs/chap-Metadata.html#spec-component-location
./fix-metadata-path.patch
];
nativeBuildInputs = [
meson
ninja

View File

@ -0,0 +1,17 @@
diff --git a/src/MainWindow.vala b/src/MainWindow.vala
index 6fee9d3..b0eb28c 100644
--- a/src/MainWindow.vala
+++ b/src/MainWindow.vala
@@ -89,6 +89,12 @@ public class Feedback.MainWindow : Gtk.ApplicationWindow {
#endif
}
+#if HAS_APPSTREAM_0_15
+ appstream_pool.add_extra_data_location ("/run/current-system/sw/share/metainfo/", AppStream.FormatStyle.METAINFO);
+#else
+ appstream_pool.add_metadata_location ("/run/current-system/sw/share/metainfo/");
+#endif
+
// flatpak's appstream files exists only inside they sandbox
unowned var appdata_dir = "/var/lib/flatpak/app/%s/current/active/files/share/appdata";
foreach (var app in app_entries) {