aboutsummaryrefslogtreecommitdiffstats
path: root/community/gnome-software
diff options
context:
space:
mode:
Diffstat (limited to 'community/gnome-software')
-rw-r--r--community/gnome-software/0001-gs-external-appstream-utils-use-external-appstream-s.patch39
-rw-r--r--community/gnome-software/0002-disable-some-non-desired-preferences.patch38
-rw-r--r--community/gnome-software/0002-gs-external-appstream-utils-hash-url-to-allow-same-b.patch110
-rw-r--r--community/gnome-software/0003-lib-cleanup-public-headers-and-mark-gs-test.h-as-pub.patch81
-rw-r--r--community/gnome-software/APKBUILD73
-rw-r--r--community/gnome-software/appstream-no-python2.patch11
-rw-r--r--community/gnome-software/gnome-software.post-upgrade8
-rw-r--r--community/gnome-software/org.gnome.software.gschema.override5
-rw-r--r--community/gnome-software/support-appstream-1.0.patch503
9 files changed, 605 insertions, 263 deletions
diff --git a/community/gnome-software/0001-gs-external-appstream-utils-use-external-appstream-s.patch b/community/gnome-software/0001-gs-external-appstream-utils-use-external-appstream-s.patch
deleted file mode 100644
index 7881ae6a403..00000000000
--- a/community/gnome-software/0001-gs-external-appstream-utils-use-external-appstream-s.patch
+++ /dev/null
@@ -1,39 +0,0 @@
-From 715db5606279efbb5b47ae734db7ffd407b25d79 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Pablo=20Correa=20G=C3=B3mez?= <ablocorrea@hotmail.com>
-Date: Tue, 28 Dec 2021 20:03:00 +0100
-Subject: [PATCH] gs-external-appstream-utils: use
- external-appstream-system-wide key
-
-The key had been defined when it was introduced, but it was not
-implemented in code. The logic that decided whether to install
-the external appstream files system-wide or just to the current
-user has a bug, where it read "external-appstream-urls" instead
-of "external-appstream-system-wide". This is fixed in this commit.
-
-Additionally, before the fix, the memory returned by g_settings_get_strv
-was never freed, causing a memory leak. Also, as "external-appstream-urls"
-must have been set for the code to reach gs_external_appstream_refresh_url,
-gs_external_appstream_refresh_user was dead code. This is also fixed
-in this commit
-
-(cherry picked from commit 7e8a1978f0e297fc052456fbc5da9218a1389903)
----
- lib/gs-external-appstream-utils.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/lib/gs-external-appstream-utils.c b/lib/gs-external-appstream-utils.c
-index 73c567443..39d71b299 100644
---- a/lib/gs-external-appstream-utils.c
-+++ b/lib/gs-external-appstream-utils.c
-@@ -236,7 +236,7 @@ gs_external_appstream_refresh_url (GsPlugin *plugin,
- GCancellable *cancellable,
- GError **error)
- {
-- if (g_settings_get_strv (settings, "external-appstream-urls")) {
-+ if (g_settings_get_boolean (settings, "external-appstream-system-wide")) {
- return gs_external_appstream_refresh_sys (plugin, url,
- cache_age,
- cancellable,
---
-2.36.1
-
diff --git a/community/gnome-software/0002-disable-some-non-desired-preferences.patch b/community/gnome-software/0002-disable-some-non-desired-preferences.patch
new file mode 100644
index 00000000000..27bc017c4ec
--- /dev/null
+++ b/community/gnome-software/0002-disable-some-non-desired-preferences.patch
@@ -0,0 +1,38 @@
+From f68d22bd9041c56510f14ff2ed8e723cea821542 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Pablo=20Correa=20G=C3=B3mez?= <ablocorrea@hotmail.com>
+Date: Mon, 17 Jan 2022 01:40:42 +0100
+Subject: [PATCH] disable some non-desired preferences
+
+The automatic updates can be dangerous, as applications are updated live,
+and kernel or mkinitfs could be installed at any time. This includes
+on very low battery or before user shuts-down the phone.
+
+In addition, we only want free software apps. If technical users want
+non-free apps, they can always undo the override
+---
+ src/gs-prefs-dialog.ui | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/src/gs-prefs-dialog.ui b/src/gs-prefs-dialog.ui
+index baded1673..1c75176d3 100644
+--- a/src/gs-prefs-dialog.ui
++++ b/src/gs-prefs-dialog.ui
+@@ -16,6 +16,7 @@
+ <property name="description" translatable="yes">To avoid charges and network caps, software updates are not automatically downloaded on mobile or metered connections.</property>
+ <child>
+ <object class="AdwActionRow" id="automatic_updates_row">
++ <property name="sensitive">False</property>
+ <property name="title" translatable="yes">Automatic _Updates</property>
+ <property name="subtitle" translatable="yes">Downloads and installs software updates in the background, when possible</property>
+ <property name="subtitle_lines">0</property>
+@@ -44,6 +45,7 @@
+ </child>
+ <child>
+ <object class="AdwActionRow" id="show_only_free_apps_row">
++ <property name="sensitive">False</property>
+ <property name="title" translatable="yes">Show Only _Free Apps</property>
+ <property name="subtitle" translatable="yes">Show only freely licensed apps and hide any proprietary apps</property>
+ <property name="subtitle_lines">0</property>
+--
+2.42.0
+
diff --git a/community/gnome-software/0002-gs-external-appstream-utils-hash-url-to-allow-same-b.patch b/community/gnome-software/0002-gs-external-appstream-utils-hash-url-to-allow-same-b.patch
deleted file mode 100644
index 13364c0c7ce..00000000000
--- a/community/gnome-software/0002-gs-external-appstream-utils-hash-url-to-allow-same-b.patch
+++ /dev/null
@@ -1,110 +0,0 @@
-From c877bd004188fbfb2a7ff5ee539614a77d89e741 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Pablo=20Correa=20G=C3=B3mez?= <ablocorrea@hotmail.com>
-Date: Fri, 31 Dec 2021 00:46:38 +0100
-Subject: [PATCH] gs-external-appstream-utils: hash url to allow same basename
-
-Component files generated by tools like appstream-generator all
-have the same basename: Components-$(ARCH).xml.gz
-In consequence, before this patch, if multiple urls are specified
-in "external-appstream-urls" and have the same basename, the secondly
-downloaded file will either override the first one (user installs),
-or skip the download because a file with the said basename already exits
-(system-wide installs). Hashing the url and adding the hash to the
-basename solves this problem.
-
-(cherry picked from commit 576d336e4994741e64b9384e7e05748b614cf981)
----
- lib/gs-external-appstream-utils.c | 26 +++++++++++++++++++-------
- 1 file changed, 19 insertions(+), 7 deletions(-)
-
-diff --git a/lib/gs-external-appstream-utils.c b/lib/gs-external-appstream-utils.c
-index 39d71b299..82c5f7001 100644
---- a/lib/gs-external-appstream-utils.c
-+++ b/lib/gs-external-appstream-utils.c
-@@ -87,6 +87,7 @@ gs_external_appstream_get_modification_date (const gchar *file_path)
- static gboolean
- gs_external_appstream_refresh_sys (GsPlugin *plugin,
- const gchar *url,
-+ const gchar *basename,
- guint cache_age,
- GCancellable *cancellable,
- GError **error)
-@@ -96,7 +97,6 @@ gs_external_appstream_refresh_sys (GsPlugin *plugin,
- guint status_code;
- gboolean file_written;
- g_autofree gchar *tmp_file_path = NULL;
-- g_autofree gchar *file_name = NULL;
- g_autofree gchar *local_mod_date = NULL;
- g_autofree gchar *target_file_path = NULL;
- g_autoptr(GFileIOStream) iostream = NULL;
-@@ -104,8 +104,7 @@ gs_external_appstream_refresh_sys (GsPlugin *plugin,
- g_autoptr(SoupMessage) msg = NULL;
-
- /* check age */
-- file_name = g_path_get_basename (url);
-- target_file_path = gs_external_appstream_utils_get_file_cache_path (file_name);
-+ target_file_path = gs_external_appstream_utils_get_file_cache_path (basename);
- if (!gs_external_appstream_check (target_file_path, cache_age)) {
- g_debug ("skipping updating external appstream file %s: "
- "cache age is older than file",
-@@ -145,7 +144,7 @@ gs_external_appstream_refresh_sys (GsPlugin *plugin,
- /* write the download contents into a file that will be copied into
- * the system */
- tmp_file_path = gs_utils_get_cache_filename ("external-appstream",
-- file_name,
-+ basename,
- GS_UTILS_CACHE_FLAG_WRITEABLE |
- GS_UTILS_CACHE_FLAG_CREATE_DIRECTORY,
- error);
-@@ -196,18 +195,17 @@ gs_external_appstream_refresh_sys (GsPlugin *plugin,
- static gboolean
- gs_external_appstream_refresh_user (GsPlugin *plugin,
- const gchar *url,
-+ const gchar *basename,
- guint cache_age,
- GCancellable *cancellable,
- GError **error)
- {
- guint file_age;
-- g_autofree gchar *basename = NULL;
- g_autofree gchar *fullpath = NULL;
- g_autoptr(GFile) file = NULL;
- g_autoptr(GsApp) app_dl = gs_app_new (gs_plugin_get_name (plugin));
-
- /* check age */
-- basename = g_path_get_basename (url);
- fullpath = g_build_filename (g_get_user_data_dir (),
- "app-info",
- "xmls",
-@@ -236,13 +234,27 @@ gs_external_appstream_refresh_url (GsPlugin *plugin,
- GCancellable *cancellable,
- GError **error)
- {
-+ g_autofree gchar *basename = NULL;
-+ g_autofree gchar *basename_url = g_path_get_basename (url);
-+ /* make sure different uris with same basenames differ */
-+ g_autofree gchar *hash = g_compute_checksum_for_string (G_CHECKSUM_SHA1,
-+ url, -1);
-+ if (hash == NULL) {
-+ g_set_error (error, GS_PLUGIN_ERROR, GS_PLUGIN_ERROR_FAILED,
-+ "Failed to hash url %s", url);
-+ return FALSE;
-+ }
-+ basename = g_strdup_printf ("%s-%s", hash, basename_url);
-+
- if (g_settings_get_boolean (settings, "external-appstream-system-wide")) {
- return gs_external_appstream_refresh_sys (plugin, url,
-+ basename,
- cache_age,
- cancellable,
- error);
- }
-- return gs_external_appstream_refresh_user (plugin, url, cache_age,
-+ return gs_external_appstream_refresh_user (plugin, url, basename,
-+ cache_age,
- cancellable, error);
- }
-
---
-2.36.1
-
diff --git a/community/gnome-software/0003-lib-cleanup-public-headers-and-mark-gs-test.h-as-pub.patch b/community/gnome-software/0003-lib-cleanup-public-headers-and-mark-gs-test.h-as-pub.patch
deleted file mode 100644
index 79fa0e1b912..00000000000
--- a/community/gnome-software/0003-lib-cleanup-public-headers-and-mark-gs-test.h-as-pub.patch
+++ /dev/null
@@ -1,81 +0,0 @@
-From d971b745734ae13219f5f66684ad4127923ab3e3 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Pablo=20Correa=20G=C3=B3mez?= <ablocorrea@hotmail.com>
-Date: Tue, 22 Feb 2022 22:26:35 +0100
-Subject: [PATCH] lib: cleanup public headers and mark gs-test.h as public
-
-Backport of https://gitlab.gnome.org/GNOME/gnome-software/-/merge_requests/1192
-to fix building test in the out-of-tree plugin
----
- lib/gs-app-list-private.h | 1 -
- lib/gs-app-list.h | 1 +
- lib/gs-plugin-job.h | 2 +-
- lib/gs-plugin-loader.h | 2 +-
- lib/meson.build | 1 +
- 5 files changed, 4 insertions(+), 3 deletions(-)
-
-diff --git a/lib/gs-app-list-private.h b/lib/gs-app-list-private.h
-index 3bf908c16..9f540a620 100644
---- a/lib/gs-app-list-private.h
-+++ b/lib/gs-app-list-private.h
-@@ -33,7 +33,6 @@ typedef enum {
- GS_APP_LIST_FLAG_LAST /*< skip >*/
- } GsAppListFlags;
-
--GsAppList *gs_app_list_copy (GsAppList *list);
- guint gs_app_list_get_size_peak (GsAppList *list);
- void gs_app_list_filter_duplicates (GsAppList *list,
- GsAppListFilterFlags flags);
-diff --git a/lib/gs-app-list.h b/lib/gs-app-list.h
-index 1330e8048..80e5e5976 100644
---- a/lib/gs-app-list.h
-+++ b/lib/gs-app-list.h
-@@ -65,6 +65,7 @@ typedef gboolean (*GsAppListFilterFunc) (GsApp *app,
- gpointer user_data);
-
- GsAppList *gs_app_list_new (void);
-+GsAppList *gs_app_list_copy (GsAppList *list);
- void gs_app_list_add (GsAppList *list,
- GsApp *app);
- void gs_app_list_add_list (GsAppList *list,
-diff --git a/lib/gs-plugin-job.h b/lib/gs-plugin-job.h
-index 2bd619c63..47420b4fe 100644
---- a/lib/gs-plugin-job.h
-+++ b/lib/gs-plugin-job.h
-@@ -10,7 +10,7 @@
-
- #include <glib-object.h>
-
--#include "gs-app-list-private.h"
-+#include "gs-app-list.h"
- #include "gs-category.h"
- #include "gs-plugin-types.h"
-
-diff --git a/lib/gs-plugin-loader.h b/lib/gs-plugin-loader.h
-index 71fd35af8..bd56bc0d4 100644
---- a/lib/gs-plugin-loader.h
-+++ b/lib/gs-plugin-loader.h
-@@ -16,8 +16,8 @@
- #include "gs-category-manager.h"
- #include "gs-odrs-provider.h"
- #include "gs-plugin-event.h"
--#include "gs-plugin-private.h"
- #include "gs-plugin-job.h"
-+#include "gs-plugin.h"
-
- G_BEGIN_DECLS
-
-diff --git a/lib/meson.build b/lib/meson.build
-index 3b8c92339..ceb2ea9a9 100644
---- a/lib/meson.build
-+++ b/lib/meson.build
-@@ -26,6 +26,7 @@ libgnomesoftware_public_headers = [
- 'gs-plugin-types.h',
- 'gs-plugin-vfuncs.h',
- 'gs-remote-icon.h',
-+ 'gs-test.h',
- 'gs-utils.h'
- ]
-
---
-2.36.1
-
diff --git a/community/gnome-software/APKBUILD b/community/gnome-software/APKBUILD
index c77b04eb155..ffe4df2ce1a 100644
--- a/community/gnome-software/APKBUILD
+++ b/community/gnome-software/APKBUILD
@@ -1,24 +1,43 @@
# Contributor: Rasmus Thomsen <oss@cogitri.dev>
-# Maintainer: Pablo Correa Gomez <ablocorrea@hotmail.com>
+# Maintainer: team/gnome <ablocorrea@hotmail.com>
pkgname=gnome-software
-pkgver=41.5
-pkgrel=0
+pkgver=45.3
+pkgrel=2
pkgdesc="Software lets you install and update applications and system extensions"
url="https://wiki.gnome.org/Apps/Software"
-# s390x and riscv64 blocked by polkit
-arch="all !s390x !riscv64"
+arch="all"
license="GPL-2.0-or-later"
-makedepends="meson appstream-dev gdk-pixbuf-dev libxmlb-dev glib-dev gtk+3.0-dev
- json-glib-dev libsoup-dev gspell-dev polkit-dev gtk-doc ostree-dev
- flatpak-dev libgudev-dev libhandy1-dev gsettings-desktop-schemas-dev"
+makedepends="
+ appstream-dev
+ flatpak-dev
+ gdk-pixbuf-dev
+ glib-dev
+ gsettings-desktop-schemas-dev
+ gtk4.0-dev
+ gtk-doc
+ json-glib-dev
+ libadwaita-dev
+ libgudev-dev
+ libsoup3-dev
+ libxmlb-dev
+ meson
+ ostree-dev
+ polkit-dev
+ "
options="!check" # lots of failing tests
install="$pkgname.post-upgrade"
-subpackages="$pkgname-lang $pkgname-doc $pkgname-dbg
- $pkgname-dev $pkgname-lib $pkgname-plugin-flatpak:flatpak_plugin"
+subpackages="
+ $pkgname-dbg
+ $pkgname-lang
+ $pkgname-doc
+ $pkgname-dev
+ $pkgname-lib
+ $pkgname-plugin-flatpak:flatpak_plugin
+ "
source="https://download.gnome.org/sources/gnome-software/${pkgver%.*}/gnome-software-$pkgver.tar.xz
- 0001-gs-external-appstream-utils-use-external-appstream-s.patch
- 0002-gs-external-appstream-utils-hash-url-to-allow-same-b.patch
- 0003-lib-cleanup-public-headers-and-mark-gs-test.h-as-pub.patch
+ 0002-disable-some-non-desired-preferences.patch
+ appstream-no-python2.patch
+ support-appstream-1.0.patch
org.gnome.software.gschema.override
"
@@ -32,27 +51,24 @@ build() {
*) conf="-Dfwupd=false" ;;
esac
-
abuild-meson \
- -Dvalgrind=false \
-Dmalcontent=false \
-Dpackagekit=false \
- -Dexternal_appstream=true \
+ -Dhardcoded_proprietary_webapps=false \
+ -Dtests=false \
$conf \
. output
- meson compile ${JOBS:+-j ${JOBS}} -C output
+ meson compile -C output
}
check() {
- meson test --no-rebuild -v -C output
+ meson test --no-rebuild --print-errorlogs -C output
}
package() {
- depends="gnome-software-plugin-apk"
DESTDIR="$pkgdir" meson install --no-rebuild -C output
- mkdir -p "$pkgdir"/usr/share/glib-2.0/schemas/
- sed "s|@CARCH@|$CARCH|g" "$srcdir"/org.gnome.software.gschema.override > \
- "$pkgdir"/usr/share/glib-2.0/schemas/org.gnome.software.gschema.override
+ install -Dm644 "$srcdir"/org.gnome.software.gschema.override \
+ -t "$pkgdir"/usr/share/glib-2.0/schemas/
}
dev() {
@@ -73,14 +89,13 @@ flatpak_plugin() {
install_if="$pkgname=$pkgver-r$pkgrel flatpak"
depends=""
- amove usr/lib/gnome-software/plugins-16/libgs_plugin_flatpak.so
+ amove usr/lib/gnome-software/plugins-20/libgs_plugin_flatpak.so
amove usr/share/metainfo/org.gnome.Software.Plugin.Flatpak.metainfo.xml
}
-
sha512sums="
-60701d50dd8e7fa01c05c8ee7823b053d40b0fa145419601ece732827527d4d7ae9af178b5b6622ac4d729d3d430c14981a2fd4b0f086dd6d05a49fd507f2cb6 gnome-software-41.5.tar.xz
-52e4f99a4e1e2e688b1dcb146bcad3f3ba0e804af841d3837de5a7905f90689dc6258e625476a5fa402e8cfb5f7b814f3bdb0cf0dfab5ca8ebbf6193099e9916 0001-gs-external-appstream-utils-use-external-appstream-s.patch
-467e023cc953f1d7caf83a4087f7f6311f64d20da32dafb2a97bd7488bb597e2d407d1166937c1776c0add199508ac45f361d7754687f638e518dbfaa8f80c6e 0002-gs-external-appstream-utils-hash-url-to-allow-same-b.patch
-4f3248916d8d15753dc22580e71a37cbfd42bb81ee0befcc51cbbbc5ce8a6573be9dae8d049c9c10fbdcf6292b83fda0d2175d1f6554e7ee8f08024ce6bdffe9 0003-lib-cleanup-public-headers-and-mark-gs-test.h-as-pub.patch
-dc83eba4b5da759b6bc72d0f30ba4e9338684eb0d32d3e2b7989341ee6f8efc15b09dda88d1dc3cc6a2de0a2ae22a41c2fdbfe352b5d7c7ecff44c2d6035e17f org.gnome.software.gschema.override
+45c8c92c9bd046b37b3fb4e817a0ea83fe9323d019f86140357f90bb2a0bf9dda5d33798c4b4d78303e2402c6cb603a4ff467e260e734b7ba97f07ebfaf4044c gnome-software-45.3.tar.xz
+3d35757225a7221d2a29c578c8f5281ce396729eda1811f8977079e67ba19bd0e656d1f4bb80f4dcde3a2a759991ea195267a6de1cf4729b07460c8f7c0c1aab 0002-disable-some-non-desired-preferences.patch
+69c9dcefb05e59e33badeca212bf955a180e4a0bc2493c4ec319c7697b6bad23f5a6553302136c2db9f0d52ef49de01c1cae35c3bcbcbe60b17a2f79fc8b4af7 appstream-no-python2.patch
+1dd58f8a38b6299bfc3c68b6b290081e8282a912363fa5196ec5ddd796f27c3271ac1fc9ca0348c495d8adc41c6c9a33b926c0eafbc00a0cf41900617f87b038 support-appstream-1.0.patch
+fa82dfdaaa89554ae0882be6ed25ebcb48e7c9120c645401f369d1f888712002b2627900f629515136d66cf05dcb7d3a09d2bfd775c8063d3ec2d39c64cb1a5b org.gnome.software.gschema.override
"
diff --git a/community/gnome-software/appstream-no-python2.patch b/community/gnome-software/appstream-no-python2.patch
new file mode 100644
index 00000000000..b71b583c436
--- /dev/null
+++ b/community/gnome-software/appstream-no-python2.patch
@@ -0,0 +1,11 @@
+--- a/lib/gs-appstream.c
++++ b/lib/gs-appstream.c
+@@ -587,8 +587,6 @@ gs_appstream_refine_add_provides (GsApp *app, XbNode *component, GError **error)
+ kind = AS_PROVIDED_KIND_FIRMWARE_RUNTIME;
+ else if (g_strcmp0 (fw_type, "flashed") == 0)
+ kind = AS_PROVIDED_KIND_FIRMWARE_FLASHED;
+- } else if (g_strcmp0 (element_name, "python2") == 0) {
+- kind = AS_PROVIDED_KIND_PYTHON_2;
+ } else if (g_strcmp0 (element_name, "python3") == 0) {
+ kind = AS_PROVIDED_KIND_PYTHON;
+ } else if (g_strcmp0 (element_name, "dbus") == 0) {
diff --git a/community/gnome-software/gnome-software.post-upgrade b/community/gnome-software/gnome-software.post-upgrade
index 40ff5d155e9..879d588b3f6 100644
--- a/community/gnome-software/gnome-software.post-upgrade
+++ b/community/gnome-software/gnome-software.post-upgrade
@@ -1,4 +1,8 @@
#!/bin/sh
-# Can be removed once GNOME 41.3 exists in all stable releases
-rm -f /var/cache/app-info/xmls/org.gnome.Software-Components-*.xml.gz
+# Can be removed once GNOME 42 exists in two subsequent stable releases
+rm -f /var/cache/app-info/xmls/org.gnome.Software-*.xml.gz
+rmdir -p --ignore-fail-on-non-empty /var/cache/app-info/xmls/ || exit 0
+
+# Taken care of by alpine-appstream-downloader
+rm -f /var/cache/swcatalog/xml/org.gnome.Software-*
diff --git a/community/gnome-software/org.gnome.software.gschema.override b/community/gnome-software/org.gnome.software.gschema.override
index d3a1aec1d1a..b20b3e085b6 100644
--- a/community/gnome-software/org.gnome.software.gschema.override
+++ b/community/gnome-software/org.gnome.software.gschema.override
@@ -1,3 +1,4 @@
[org.gnome.software]
-external-appstream-urls=['https://appstream.alpinelinux.org/data/edge/main/Components-@CARCH@.xml.gz', 'https://appstream.alpinelinux.org/data/edge/community/Components-@CARCH@.xml.gz', 'https://appstream.alpinelinux.org/data/edge/testing/Components-@CARCH@.xml.gz']
-external-appstream-system-wide=true
+download-updates=false
+show-only-free-apps=true
+official-repos=['alpinelinux-edge-main', 'alpinelinux-edge-community', 'alpinelinux-edge-testing', 'alpinelinux-v*-main', 'alpinelinux-v*-community']
diff --git a/community/gnome-software/support-appstream-1.0.patch b/community/gnome-software/support-appstream-1.0.patch
new file mode 100644
index 00000000000..9830143f919
--- /dev/null
+++ b/community/gnome-software/support-appstream-1.0.patch
@@ -0,0 +1,503 @@
+From 88fc05d2a83e2d5588d4f39e9bba0cb7abeb07de Mon Sep 17 00:00:00 2001
+From: Matthias Klumpp <matthias@tenstral.net>
+Date: Sun, 8 Oct 2023 20:22:44 +0200
+Subject: [PATCH] Adjust to build with AppStream 1.0 as well as 0.16.x
+
+---
+ lib/gs-app.c | 4 ++
+ lib/gs-appstream.c | 61 +++++++++++++++++++-----
+ lib/gs-utils.c | 8 ++--
+ meson.build | 22 +--------
+ plugins/core/gs-plugin-appstream.c | 8 ----
+ plugins/fwupd/gs-fwupd-app.c | 8 ++++
+ plugins/fwupd/gs-plugin-fwupd.c | 4 ++
+ src/gs-hardware-support-context-dialog.c | 6 +++
+ src/gs-repos-dialog.c | 4 ++
+ src/gs-screenshot-carousel.c | 4 +-
+ src/gs-screenshot-image.c | 41 ++++++++++++----
+ src/gs-screenshot-image.h | 7 +++
+ subprojects/appstream.wrap | 2 +-
+ 13 files changed, 122 insertions(+), 57 deletions(-)
+
+diff --git a/lib/gs-app.c b/lib/gs-app.c
+index 2308de504d..ea348f8c01 100644
+--- a/lib/gs-app.c
++++ b/lib/gs-app.c
+@@ -609,7 +609,11 @@ gs_app_to_string_append (GsApp *app, GString *str)
+ AsScreenshot *ss = g_ptr_array_index (priv->screenshots, i);
+ g_autofree gchar *key = NULL;
+ tmp = as_screenshot_get_caption (ss);
++#if AS_CHECK_VERSION(1, 0, 0)
++ im = as_screenshot_get_image (ss, 0, 0, 1);
++#else
+ im = as_screenshot_get_image (ss, 0, 0);
++#endif
+ if (im == NULL)
+ continue;
+ key = g_strdup_printf ("screenshot-%02u", i);
+diff --git a/lib/gs-appstream.c b/lib/gs-appstream.c
+index deca176dcf..6504d6f25e 100644
+--- a/lib/gs-appstream.c
++++ b/lib/gs-appstream.c
+@@ -1011,8 +1011,11 @@ gs_appstream_refine_app_relation (GsApp *app,
+ as_relation_set_item_kind (relation, AS_RELATION_ITEM_KIND_CONTROL);
+ as_relation_set_value_control_kind (relation, as_control_kind_from_string (xb_node_get_text (child)));
+ } else if (g_str_equal (item_kind, "display_length")) {
+- AsDisplayLengthKind display_length_kind;
+ const gchar *compare;
++ const gchar *side;
++#if !AS_CHECK_VERSION(1, 0, 0)
++ AsDisplayLengthKind display_length_kind;
++#endif
+
+ /* https://www.freedesktop.org/software/appstream/docs/chap-Metadata.html#tag-relations-display_length */
+ as_relation_set_item_kind (relation, AS_RELATION_ITEM_KIND_DISPLAY_LENGTH);
+@@ -1020,15 +1023,21 @@ gs_appstream_refine_app_relation (GsApp *app,
+ compare = xb_node_get_attr (child, "compare");
+ as_relation_set_compare (relation, (compare != NULL) ? as_relation_compare_from_string (compare) : AS_RELATION_COMPARE_GE);
+
++#if AS_CHECK_VERSION(1, 0, 0)
++ side = xb_node_get_attr (child, "side");
++ as_relation_set_display_side_kind (relation, (side != NULL) ? as_display_side_kind_from_string (side) : AS_DISPLAY_SIDE_KIND_SHORTEST);
++ as_relation_set_value_px (relation, xb_node_get_text_as_uint (child));
++#else
+ display_length_kind = as_display_length_kind_from_string (xb_node_get_text (child));
+ if (display_length_kind != AS_DISPLAY_LENGTH_KIND_UNKNOWN) {
+ /* Ignore the `side` attribute */
+ as_relation_set_value_display_length_kind (relation, display_length_kind);
+ } else {
+- const gchar *side = xb_node_get_attr (child, "side");
++ side = xb_node_get_attr (child, "side");
+ as_relation_set_display_side_kind (relation, (side != NULL) ? as_display_side_kind_from_string (side) : AS_DISPLAY_SIDE_KIND_SHORTEST);
+ as_relation_set_value_px (relation, xb_node_get_text_as_uint (child));
+ }
++#endif
+ } else {
+ g_debug ("Relation type ‘%s’ not currently supported for %s; ignoring",
+ item_kind, gs_app_get_id (app));
+@@ -1472,7 +1481,7 @@ gs_appstream_refine_app (GsPlugin *plugin,
+ }
+
+ typedef struct {
+- AsSearchTokenMatch match_value;
++ guint16 match_value;
+ XbQuery *query;
+ } GsAppstreamSearchHelper;
+
+@@ -1522,7 +1531,7 @@ gs_appstream_silo_search_component (GPtrArray *array, XbNode *component, const g
+ }
+
+ typedef struct {
+- AsSearchTokenMatch match_value;
++ guint16 match_value;
+ const gchar *xpath;
+ } Query;
+
+@@ -1539,6 +1548,11 @@ gs_appstream_do_search (GsPlugin *plugin,
+ g_autoptr(GPtrArray) array = g_ptr_array_new_with_free_func ((GDestroyNotify) gs_appstream_search_helper_free);
+ g_autoptr(GPtrArray) components = NULL;
+ g_autoptr(GTimer) timer = g_timer_new ();
++#if AS_CHECK_VERSION(1, 0, 0)
++ const guint16 component_id_weight = as_utils_get_tag_search_weight ("id");
++#else
++ const guint16 component_id_weight = AS_SEARCH_TOKEN_MATCH_ID;
++#endif
+
+ g_return_val_if_fail (GS_IS_PLUGIN (plugin), FALSE);
+ g_return_val_if_fail (XB_IS_SILO (silo), FALSE);
+@@ -1585,7 +1599,7 @@ gs_appstream_do_search (GsPlugin *plugin,
+ * Drop the ID token from it as it’s the highest
+ * numeric value but isn’t visible to the user in the
+ * UI, which leads to confusing results ordering. */
+- gs_app_set_match_value (app, match_value & (~AS_SEARCH_TOKEN_MATCH_ID));
++ gs_app_set_match_value (app, match_value & (~component_id_weight));
+ gs_app_list_add (list, app);
+
+ if (gs_app_get_kind (app) == AS_COMPONENT_KIND_ADDON) {
+@@ -1624,18 +1638,32 @@ gs_appstream_search (GsPlugin *plugin,
+ GCancellable *cancellable,
+ GError **error)
+ {
++#if AS_CHECK_VERSION(1, 0, 0)
++ guint16 pkgname_weight = as_utils_get_tag_search_weight ("pkgname");
++ guint16 name_weight = as_utils_get_tag_search_weight ("name");
++ guint16 id_weight = as_utils_get_tag_search_weight ("id");
+ const Query queries[] = {
+- #ifdef HAVE_AS_SEARCH_TOKEN_MATCH_MEDIATYPE
+- { AS_SEARCH_TOKEN_MATCH_MEDIATYPE, "mimetypes/mimetype[text()~=stem(?)]" },
+- #else
+- { AS_SEARCH_TOKEN_MATCH_MIMETYPE, "mimetypes/mimetype[text()~=stem(?)]" },
+- #endif
++ { as_utils_get_tag_search_weight ("mediatype"), "provides/mediatype[text()~=stem(?)]" },
+ /* Search once with a tokenize-and-casefold operator (`~=`) to support casefolded
+ * full-text search, then again using substring matching (`contains()`), to
+ * support prefix matching. Only do the prefix matches on a few fields, and at a
+ * lower priority, otherwise things will get confusing.
+- *
++ *
+ * See https://gitlab.gnome.org/GNOME/gnome-software/-/issues/2277 */
++ { pkgname_weight, "pkgname[text()~=stem(?)]" },
++ { pkgname_weight / 2, "pkgname[contains(text(),stem(?))]" },
++ { as_utils_get_tag_search_weight ("summary"), "summary[text()~=stem(?)]" },
++ { name_weight, "name[text()~=stem(?)]" },
++ { name_weight / 2, "name[contains(text(),stem(?))]" },
++ { as_utils_get_tag_search_weight ("keyword"), "keywords/keyword[text()~=stem(?)]" },
++ { id_weight, "id[text()~=stem(?)]" },
++ { id_weight, "launchable[text()~=stem(?)]" },
++ { as_utils_get_tag_search_weight ("origin"), "../components[@origin~=stem(?)]" },
++ { 0, NULL }
++ };
++#else
++ const Query queries[] = {
++ { AS_SEARCH_TOKEN_MATCH_MEDIATYPE, "mimetypes/mimetype[text()~=stem(?)]" },
+ { AS_SEARCH_TOKEN_MATCH_PKGNAME, "pkgname[text()~=stem(?)]" },
+ { AS_SEARCH_TOKEN_MATCH_PKGNAME / 2, "pkgname[contains(text(),stem(?))]" },
+ { AS_SEARCH_TOKEN_MATCH_SUMMARY, "summary[text()~=stem(?)]" },
+@@ -1647,6 +1675,7 @@ gs_appstream_search (GsPlugin *plugin,
+ { AS_SEARCH_TOKEN_MATCH_ORIGIN, "../components[@origin~=stem(?)]" },
+ { AS_SEARCH_TOKEN_MATCH_NONE, NULL }
+ };
++#endif
+
+ return gs_appstream_do_search (plugin, silo, values, queries, list, cancellable, error);
+ }
+@@ -1659,11 +1688,21 @@ gs_appstream_search_developer_apps (GsPlugin *plugin,
+ GCancellable *cancellable,
+ GError **error)
+ {
++#if AS_CHECK_VERSION(1, 0, 0)
++ const Query queries[] = {
++ { as_utils_get_tag_search_weight ("pkgname"), "developer/name[text()~=stem(?)]" },
++ { as_utils_get_tag_search_weight ("summary"), "project_group[text()~=stem(?)]" },
++ /* for legacy support */
++ { as_utils_get_tag_search_weight ("pkgname"), "developer_name[text()~=stem(?)]" },
++ { 0, NULL }
++ };
++#else
+ const Query queries[] = {
+ { AS_SEARCH_TOKEN_MATCH_PKGNAME, "developer_name[text()~=stem(?)]" },
+ { AS_SEARCH_TOKEN_MATCH_SUMMARY, "project_group[text()~=stem(?)]" },
+ { AS_SEARCH_TOKEN_MATCH_NONE, NULL }
+ };
++#endif
+
+ return gs_appstream_do_search (plugin, silo, values, queries, list, cancellable, error);
+ }
+diff --git a/lib/gs-utils.c b/lib/gs-utils.c
+index cf9073025f..19e6ebd046 100644
+--- a/lib/gs-utils.c
++++ b/lib/gs-utils.c
+@@ -1694,9 +1694,9 @@ gs_utils_gstring_replace (GString *str,
+ const gchar *find,
+ const gchar *replace)
+ {
+- #ifdef HAVE_AS_GSTRING_REPLACE_WITH_FOUR_ARGS
++#if AS_CHECK_VERSION(1, 0, 0)
+ as_gstring_replace (str, find, replace, 0);
+- #else
+- as_gstring_replace (str, find, replace);
+- #endif
++#else
++ as_gstring_replace2 (str, find, replace, 0);
++#endif
+ }
+diff --git a/meson.build b/meson.build
+index bc19669dd5..8c82464cdb 100644
+--- a/meson.build
++++ b/meson.build
+@@ -113,7 +113,7 @@ add_project_arguments('-D_GNU_SOURCE', language : 'c')
+ conf.set('HAVE_LINUX_UNISTD_H', cc.has_header('linux/unistd.h'))
+
+ appstream = dependency('appstream',
+- version : '>= 0.14.0',
++ version : '>= 0.16.4',
+ fallback : ['appstream', 'appstream_dep'],
+ default_options : [
+ 'docs=false',
+@@ -121,26 +121,6 @@ appstream = dependency('appstream',
+ 'install-docs=false'
+ ]
+ )
+-if appstream.type_name() == 'internal'
+-else
+- if meson.get_compiler('c').has_header_symbol('appstream.h', 'AS_SEARCH_TOKEN_MATCH_MEDIATYPE', dependencies: appstream)
+- conf.set('HAVE_AS_SEARCH_TOKEN_MATCH_MEDIATYPE', '1')
+- endif
+- if meson.get_compiler('c').has_header_symbol('appstream.h', 'AS_FORMAT_STYLE_CATALOG', dependencies: appstream)
+- conf.set('HAVE_AS_FORMAT_STYLE_CATALOG', '1')
+- endif
+- if meson.get_compiler('c').has_function('as_metadata_components_to_catalog', prefix: '#include <appstream.h>', dependencies: appstream)
+- conf.set('HAVE_AS_METADATA_COMPONENTS_TO_CATALOG', '1')
+- endif
+- if meson.get_compiler('c').links('''#include <appstream.h>
+- int main (void)
+- {
+- as_gstring_replace (NULL, "a", "b", 0);
+- return 0;
+- }''', name: 'as_gstring_replace() has four arguments', dependencies: appstream)
+- conf.set('HAVE_AS_GSTRING_REPLACE_WITH_FOUR_ARGS', '1')
+- endif
+-endif
+
+ gdk_pixbuf = dependency('gdk-pixbuf-2.0', version : '>= 2.32.0')
+ libxmlb = dependency('xmlb', version : '>= 0.1.7', fallback : ['libxmlb', 'libxmlb_dep'])
+diff --git a/plugins/core/gs-plugin-appstream.c b/plugins/core/gs-plugin-appstream.c
+index cf9f3022b1..ef3226a591 100644
+--- a/plugins/core/gs-plugin-appstream.c
++++ b/plugins/core/gs-plugin-appstream.c
+@@ -414,11 +414,7 @@ gs_plugin_appstream_load_dep11_cb (XbBuilderSource *self,
+ if (bytes == NULL)
+ return NULL;
+
+- #ifdef HAVE_AS_FORMAT_STYLE_CATALOG
+ as_metadata_set_format_style (mdata, AS_FORMAT_STYLE_CATALOG);
+- #else
+- as_metadata_set_format_style (mdata, AS_FORMAT_STYLE_COLLECTION);
+- #endif
+ as_metadata_parse_bytes (mdata,
+ bytes,
+ AS_FORMAT_KIND_YAML,
+@@ -428,11 +424,7 @@ gs_plugin_appstream_load_dep11_cb (XbBuilderSource *self,
+ return NULL;
+ }
+
+- #ifdef HAVE_AS_METADATA_COMPONENTS_TO_CATALOG
+ xml = as_metadata_components_to_catalog (mdata, AS_FORMAT_KIND_XML, &tmp_error);
+- #else
+- xml = as_metadata_components_to_collection (mdata, AS_FORMAT_KIND_XML, &tmp_error);
+- #endif
+ if (xml == NULL) {
+ // This API currently returns NULL if there is nothing to serialize, so we
+ // have to test if this is an error or not.
+diff --git a/plugins/fwupd/gs-fwupd-app.c b/plugins/fwupd/gs-fwupd-app.c
+index 6dcda6ee92..5d3254da59 100644
+--- a/plugins/fwupd/gs-fwupd-app.c
++++ b/plugins/fwupd/gs-fwupd-app.c
+@@ -164,7 +164,11 @@ gs_fwupd_app_set_from_device (GsApp *app,
+ gs_app_set_install_date (app, fwupd_device_get_created (dev));
+ if (fwupd_device_get_description (dev) != NULL) {
+ g_autofree gchar *tmp = NULL;
++#if AS_CHECK_VERSION(1, 0, 0)
++ tmp = as_markup_convert (fwupd_device_get_description (dev), AS_MARKUP_KIND_TEXT, NULL);
++#else
+ tmp = as_markup_convert_simple (fwupd_device_get_description (dev), NULL);
++#endif
+ if (tmp != NULL)
+ gs_app_set_description (app, GS_APP_QUALITY_NORMAL, tmp);
+ }
+@@ -402,7 +406,11 @@ gs_fwupd_app_set_from_release (GsApp *app, FwupdRelease *rel)
+ }
+ if (fwupd_release_get_description (rel) != NULL) {
+ g_autofree gchar *tmp = NULL;
++#if AS_CHECK_VERSION(1, 0, 0)
++ tmp = as_markup_convert (fwupd_release_get_description (rel), AS_MARKUP_KIND_TEXT, NULL);
++#else
+ tmp = as_markup_convert_simple (fwupd_release_get_description (rel), NULL);
++#endif
+ if (tmp != NULL)
+ gs_app_set_update_details_text (app, tmp);
+ }
+diff --git a/plugins/fwupd/gs-plugin-fwupd.c b/plugins/fwupd/gs-plugin-fwupd.c
+index d8c0cd2dd4..a9b05028a0 100644
+--- a/plugins/fwupd/gs-plugin-fwupd.c
++++ b/plugins/fwupd/gs-plugin-fwupd.c
+@@ -727,7 +727,11 @@ gs_plugin_add_updates (GsPlugin *plugin,
+ g_autofree gchar *desc = NULL;
+ if (fwupd_release_get_description (rel) == NULL)
+ continue;
++#if AS_CHECK_VERSION(1, 0, 0)
++ desc = as_markup_convert (fwupd_release_get_description (rel), AS_MARKUP_KIND_TEXT, NULL);
++#else
+ desc = as_markup_convert_simple (fwupd_release_get_description (rel), NULL);
++#endif
+ if (desc == NULL)
+ continue;
+ g_string_append_printf (update_desc,
+diff --git a/src/gs-hardware-support-context-dialog.c b/src/gs-hardware-support-context-dialog.c
+index 0e48c8c266..14653401de 100644
+--- a/src/gs-hardware-support-context-dialog.c
++++ b/src/gs-hardware-support-context-dialog.c
+@@ -461,6 +461,7 @@ gs_hardware_support_context_dialog_get_display_support (GdkMonitor *monitor,
+ AsRelationCompare comparator = as_relation_get_compare (relation);
+ Range current_display_comparand, relation_comparand;
+
++#if !AS_CHECK_VERSION(1, 0, 0)
+ /* From https://www.freedesktop.org/software/appstream/docs/chap-Metadata.html#tag-requires-recommends-display_length */
+ Range display_lengths[] = {
+ [AS_DISPLAY_LENGTH_KIND_XSMALL] = { 0, 360 },
+@@ -469,6 +470,7 @@ gs_hardware_support_context_dialog_get_display_support (GdkMonitor *monitor,
+ [AS_DISPLAY_LENGTH_KIND_LARGE] = { 1024, 3840 },
+ [AS_DISPLAY_LENGTH_KIND_XLARGE] = { 3840, G_MAXUINT },
+ };
++#endif
+
+ any_display_relations_set = TRUE;
+
+@@ -485,11 +487,14 @@ gs_hardware_support_context_dialog_get_display_support (GdkMonitor *monitor,
+ case AS_DISPLAY_SIDE_KIND_LAST:
+ default:
+ current_display_comparand.min = current_display_comparand.max = MAX (current_screen_size.width, current_screen_size.height);
++#if !AS_CHECK_VERSION(1, 0, 0)
+ relation_comparand.min = display_lengths[as_relation_get_value_display_length_kind (relation)].min;
+ relation_comparand.max = display_lengths[as_relation_get_value_display_length_kind (relation)].max;
++#endif
+ break;
+ }
+
++#if !AS_CHECK_VERSION(1, 0, 0)
+ if (evaluate_display_comparison (display_lengths[AS_DISPLAY_LENGTH_KIND_SMALL], comparator, relation_comparand)) {
+ *mobile_relation_kind_out = max_relation_kind (*mobile_relation_kind_out, as_relation_get_kind (relation));
+ *mobile_match_out = TRUE;
+@@ -499,6 +504,7 @@ gs_hardware_support_context_dialog_get_display_support (GdkMonitor *monitor,
+ *desktop_relation_kind_out = max_relation_kind (*desktop_relation_kind_out, as_relation_get_kind (relation));
+ *desktop_match_out = TRUE;
+ }
++#endif
+
+ if (evaluate_display_comparison (current_display_comparand, comparator, relation_comparand)) {
+ *current_relation_kind_out = max_relation_kind (*current_relation_kind_out, as_relation_get_kind (relation));
+diff --git a/src/gs-repos-dialog.c b/src/gs-repos-dialog.c
+index c41c4944a1..7dac0416d9 100644
+--- a/src/gs-repos-dialog.c
++++ b/src/gs-repos-dialog.c
+@@ -154,7 +154,11 @@ enable_repo (GsReposDialog *dialog,
+ g_autoptr(GError) error = NULL;
+
+ /* convert from AppStream markup */
++#if AS_CHECK_VERSION(1, 0, 0)
++ message = as_markup_convert (gs_app_get_agreement (repo), AS_MARKUP_KIND_TEXT, &error);
++#else
+ message = as_markup_convert_simple (gs_app_get_agreement (repo), &error);
++#endif
+ if (message == NULL) {
+ /* failed, so just try and show the original markup */
+ message = g_strdup (gs_app_get_agreement (repo));
+diff --git a/src/gs-screenshot-carousel.c b/src/gs-screenshot-carousel.c
+index 04bbf86a1e..d269af6605 100644
+--- a/src/gs-screenshot-carousel.c
++++ b/src/gs-screenshot-carousel.c
+@@ -141,8 +141,8 @@ gs_screenshot_carousel_load_screenshots (GsScreenshotCarousel *self, GsApp *app,
+ gtk_widget_set_can_focus (gtk_widget_get_first_child (ssimg), FALSE);
+ gs_screenshot_image_set_screenshot (GS_SCREENSHOT_IMAGE (ssimg), ss);
+ gs_screenshot_image_set_size (GS_SCREENSHOT_IMAGE (ssimg),
+- AS_IMAGE_NORMAL_WIDTH,
+- AS_IMAGE_NORMAL_HEIGHT);
++ GS_IMAGE_NORMAL_WIDTH,
++ GS_IMAGE_NORMAL_HEIGHT);
+ gtk_widget_add_css_class (ssimg, "screenshot-image-main");
+ gs_screenshot_image_load_async (GS_SCREENSHOT_IMAGE (ssimg), cancellable);
+
+diff --git a/src/gs-screenshot-image.c b/src/gs-screenshot-image.c
+index 93dba68f96..6b4db03d06 100644
+--- a/src/gs-screenshot-image.c
++++ b/src/gs-screenshot-image.c
+@@ -293,13 +293,13 @@ gs_screenshot_image_save_downloaded_img (GsScreenshotImage *ssimg,
+ if (images->len > 1)
+ return TRUE;
+
+- if (width == AS_IMAGE_THUMBNAIL_WIDTH &&
+- height == AS_IMAGE_THUMBNAIL_HEIGHT) {
+- width = AS_IMAGE_NORMAL_WIDTH;
+- height = AS_IMAGE_NORMAL_HEIGHT;
++ if (width == GS_IMAGE_THUMBNAIL_WIDTH &&
++ height == GS_IMAGE_THUMBNAIL_HEIGHT) {
++ width = GS_IMAGE_NORMAL_WIDTH;
++ height = GS_IMAGE_NORMAL_HEIGHT;
+ } else {
+- width = AS_IMAGE_THUMBNAIL_WIDTH;
+- height = AS_IMAGE_THUMBNAIL_HEIGHT;
++ width = GS_IMAGE_THUMBNAIL_WIDTH;
++ height = GS_IMAGE_THUMBNAIL_HEIGHT;
+ }
+
+ width *= ssimg->scale;
+@@ -591,16 +591,30 @@ gs_screenshot_image_get_url (GsScreenshotImage *ssimg)
+ } else if (as_screenshot_get_media_kind (ssimg->screenshot) == AS_SCREENSHOT_MEDIA_KIND_IMAGE) {
+ AsImage *im;
+
++#if AS_CHECK_VERSION(1, 0, 0)
++ im = as_screenshot_get_image (ssimg->screenshot,
++ ssimg->width,
++ ssimg->height,
++ ssimg->scale);
++#else
+ im = as_screenshot_get_image (ssimg->screenshot,
+ ssimg->width * ssimg->scale,
+ ssimg->height * ssimg->scale);
++#endif
+
+ /* if we've failed to load a HiDPI image, fallback to LoDPI */
+ if (im == NULL && ssimg->scale > 1) {
+ ssimg->scale = 1;
++#if AS_CHECK_VERSION(1, 0, 0)
++ im = as_screenshot_get_image (ssimg->screenshot,
++ ssimg->width,
++ ssimg->height,
++ 1);
++#else
+ im = as_screenshot_get_image (ssimg->screenshot,
+ ssimg->width,
+ ssimg->height);
++#endif
+ }
+
+ if (im)
+@@ -707,15 +721,22 @@ gs_screenshot_image_load_async (GsScreenshotImage *ssimg,
+ * smaller version of it straight away */
+ if (!ssimg->showing_image &&
+ as_screenshot_get_media_kind (ssimg->screenshot) == AS_SCREENSHOT_MEDIA_KIND_IMAGE &&
+- ssimg->width > AS_IMAGE_THUMBNAIL_WIDTH &&
+- ssimg->height > AS_IMAGE_THUMBNAIL_HEIGHT) {
++ ssimg->width > GS_IMAGE_THUMBNAIL_WIDTH &&
++ ssimg->height > GS_IMAGE_THUMBNAIL_HEIGHT) {
+ const gchar *url_thumb;
+ g_autofree gchar *basename_thumb = NULL;
+ g_autofree gchar *cache_kind_thumb = NULL;
+ AsImage *im;
++#if AS_CHECK_VERSION(1, 0, 0)
+ im = as_screenshot_get_image (ssimg->screenshot,
+- AS_IMAGE_THUMBNAIL_WIDTH * ssimg->scale,
+- AS_IMAGE_THUMBNAIL_HEIGHT * ssimg->scale);
++ GS_IMAGE_THUMBNAIL_WIDTH,
++ GS_IMAGE_THUMBNAIL_HEIGHT,
++ ssimg->scale);
++#else
++ im = as_screenshot_get_image (ssimg->screenshot,
++ GS_IMAGE_THUMBNAIL_WIDTH * ssimg->scale,
++ GS_IMAGE_THUMBNAIL_HEIGHT * ssimg->scale);
++#endif
+ url_thumb = as_image_get_url (im);
+ basename_thumb = gs_screenshot_get_cachefn_for_url (url_thumb);
+ cache_kind_thumb = g_build_filename ("screenshots", "112x63", NULL);
+diff --git a/src/gs-screenshot-image.h b/src/gs-screenshot-image.h
+index 1f6cf81ce6..6e45f5d20a 100644
+--- a/src/gs-screenshot-image.h
++++ b/src/gs-screenshot-image.h
+@@ -21,6 +21,13 @@ G_BEGIN_DECLS
+
+ G_DECLARE_FINAL_TYPE (GsScreenshotImage, gs_screenshot_image, GS, SCREENSHOT_IMAGE, GtkWidget)
+
++#define GS_IMAGE_LARGE_HEIGHT 423
++#define GS_IMAGE_LARGE_WIDTH 752
++#define GS_IMAGE_NORMAL_HEIGHT 351
++#define GS_IMAGE_NORMAL_WIDTH 624
++#define GS_IMAGE_THUMBNAIL_HEIGHT 63
++#define GS_IMAGE_THUMBNAIL_WIDTH 112
++
+ GtkWidget *gs_screenshot_image_new (SoupSession *session);
+
+ AsScreenshot *gs_screenshot_image_get_screenshot (GsScreenshotImage *ssimg);
+diff --git a/subprojects/appstream.wrap b/subprojects/appstream.wrap
+index 6f0beb0cbc..5763a32c64 100644
+--- a/subprojects/appstream.wrap
++++ b/subprojects/appstream.wrap
+@@ -1,5 +1,5 @@
+ [wrap-git]
+ directory = appstream
+ url = https://github.com/ximion/appstream.git
+-revision = v0.14.1
++revision = v0.16.3
+ depth = 1
+--
+GitLab
+