aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRasmus Thomsen <oss@cogitri.dev>2020-09-05 14:04:25 +0200
committerRasmus Thomsen <oss@cogitri.dev>2020-09-10 17:05:24 +0000
commite858372c3ea5a3b83db70de2bad08a37221c531b (patch)
tree9582dc27d2219b8d9e7387ed2ec3acee4b1ebdf6
parent64d5506b8b5b099ecc39b2eb32f01197681a987c (diff)
downloadaports-e858372c3ea5a3b83db70de2bad08a37221c531b.tar.gz
aports-e858372c3ea5a3b83db70de2bad08a37221c531b.tar.bz2
aports-e858372c3ea5a3b83db70de2bad08a37221c531b.tar.xz
community/gnome-boxes: rebuild against tracker3
-rw-r--r--community/gnome-boxes/APKBUILD8
-rw-r--r--community/gnome-boxes/tracker3.patch226
2 files changed, 231 insertions, 3 deletions
diff --git a/community/gnome-boxes/APKBUILD b/community/gnome-boxes/APKBUILD
index 67ac7770ac..3c7763e0a6 100644
--- a/community/gnome-boxes/APKBUILD
+++ b/community/gnome-boxes/APKBUILD
@@ -2,7 +2,7 @@
# Maintainer: Rasmus Thomsen <oss@cogitri.dev>
pkgname=gnome-boxes
pkgver=3.37.90
-pkgrel=0
+pkgrel=1
pkgdesc="Virtualization made simple"
url="https://wiki.gnome.org/Apps/Boxes"
# https://build.alpinelinux.org/buildlogs/build-edge-ppc64le/testing/gnome-boxes/gnome-boxes-3.34.0-r0.log
@@ -14,7 +14,8 @@ makedepends="meson vala libarchive-dev glib-dev gtk+3.0-dev gtk-vnc-dev
libxml2-dev spice-gtk-dev tracker-dev vte3-dev webkit2gtk-dev
libgudev-dev freerdp-dev itstool gtksourceview4-dev libhandy-dev"
subpackages="$pkgname-lang"
-source="https://download.gnome.org/sources/gnome-boxes/${pkgver%.*}/gnome-boxes-$pkgver.tar.xz"
+source="https://download.gnome.org/sources/gnome-boxes/${pkgver%.*}/gnome-boxes-$pkgver.tar.xz
+ tracker3.patch"
build() {
abuild-meson . output
@@ -29,4 +30,5 @@ package() {
DESTDIR="$pkgdir" meson install --no-rebuild -C output
}
-sha512sums="e5c67272686120f5e7ae7a220afb9f9cd669063f359cdb4b7442b9fe5690cb3378827a492ccb0217d4fd966ce91a09b8b315fa7cfa201e94f55d8694c93297de gnome-boxes-3.37.90.tar.xz"
+sha512sums="e5c67272686120f5e7ae7a220afb9f9cd669063f359cdb4b7442b9fe5690cb3378827a492ccb0217d4fd966ce91a09b8b315fa7cfa201e94f55d8694c93297de gnome-boxes-3.37.90.tar.xz
+aeaed29d5b2a6dca19a8bf71ea4ec1a696c78e678623b64c2229529c31148d0bdc0c2c297a891c05b7674f47db3968f588c79c6daebb48466378e1e7e050deca tracker3.patch"
diff --git a/community/gnome-boxes/tracker3.patch b/community/gnome-boxes/tracker3.patch
new file mode 100644
index 0000000000..5f8262597a
--- /dev/null
+++ b/community/gnome-boxes/tracker3.patch
@@ -0,0 +1,226 @@
+From 436f20854a290819e2bd7ef70cfe15b5adcb272c Mon Sep 17 00:00:00 2001
+From: Carlos Garnacho <carlosg@gnome.org>
+Date: Sun, 14 Jun 2020 22:54:19 +0200
+Subject: [PATCH 1/2] media-manager: Port to Tracker 3
+
+The SparqlConnection constructor API changed, since Boxes does
+purely readonly use of Tracker, it's most convenient to use the bus
+connection here.
+
+Also specify the tracker:Software graph for queries, as ISO image data
+will be written to it.
+
+As all versions of tracker 3.x are guaranteed to have the osinfo:language,
+we don't need the fallback queries either.
+---
+ src/media-manager.vala | 3 ++-
+ src/meson.build | 2 +-
+ src/tracker-iso-query.vala | 18 +++++-------------
+ 3 files changed, 8 insertions(+), 15 deletions(-)
+
+diff --git a/src/media-manager.vala b/src/media-manager.vala
+index 79b198c3..c5648240 100644
+--- a/src/media-manager.vala
++++ b/src/media-manager.vala
+@@ -226,7 +226,8 @@ private MediaManager () {
+ os_db = new OSDatabase ();
+ os_db.load.begin ();
+ try {
+- connection = Sparql.Connection.get ();
++ connection = Sparql.Connection.bus_new ("org.freedesktop.Tracker3.Miner.Files",
++ null, null);
+ } catch (GLib.Error error) {
+ critical ("Error connecting to Tracker: %s", error.message);
+ }
+diff --git a/src/meson.build b/src/meson.build
+index 028750c5..f38d7d80 100644
+--- a/src/meson.build
++++ b/src/meson.build
+@@ -144,7 +144,7 @@ dependencies = [
+ dependency ('libvirt-gobject-1.0', version: '>= 3.0.0'),
+ dependency ('libxml-2.0', version: '>= 2.7.8'),
+ dependency ('spice-client-gtk-3.0', version: '>= 0.32'),
+- dependency ('tracker-sparql-2.0'),
++ dependency ('tracker-sparql-3.0'),
+ dependency ('vte-2.91', version: '>= 0.40.2'),
+ dependency ('webkit2gtk-4.0', version: '>= 2.26.0'),
+ dependency ('libhandy-0.0', version: '>= 0.0.11'),
+diff --git a/src/tracker-iso-query.vala b/src/tracker-iso-query.vala
+index ba920644..276e880e 100644
+--- a/src/tracker-iso-query.vala
++++ b/src/tracker-iso-query.vala
+@@ -3,21 +3,15 @@
+ using Tracker;
+
+ private class Boxes.TrackerISOQuery {
+- private const string LANG_QUERY = "ASK { osinfo:language a <http://www.w3.org/1999/02/22-rdf-syntax-ns#Property> }";
+- private const string ISO_QUERY = "SELECT nie:url(?iso) nie:title(?iso)\n" +
+- " osinfo:id(?iso) osinfo:mediaId(?iso)\n" +
++ private const string ISO_QUERY = "SELECT nie:isStoredAs(?iso) nie:title(?iso)\n" +
++ " osinfo:id(?iso) osinfo:mediaId(?iso) osinfo:language(?iso)\n" +
++ "FROM tracker:Software " +
+ "{ ?iso nfo:isBootable true }";
+- private const string ISO_QUERY_LANG = "SELECT nie:url(?iso) nie:title(?iso)\n" +
+- " osinfo:id(?iso) osinfo:mediaId(?iso) osinfo:language(?iso)\n" +
+- "{ ?iso nfo:isBootable true }";
+
+ private Sparql.Cursor cursor;
+
+ public async TrackerISOQuery (Sparql.Connection connection) throws GLib.Error {
+ var iso_query = ISO_QUERY;
+- var cursor = yield connection.query_async (LANG_QUERY);
+- if ((yield cursor.next_async ()) && cursor.get_boolean (0))
+- iso_query = ISO_QUERY_LANG;
+ debug ("Tracker SPARQL query: %s", iso_query);
+
+ this.cursor = yield connection.query_async (iso_query);
+@@ -48,11 +42,9 @@ public async bool fetch_next_iso_data (out string path,
+ title = cursor.get_string (1);
+ os_id = cursor.get_string (2);
+ media_id = cursor.get_string (3);
+- if (cursor.n_columns > 4) {
+- var languages = cursor.get_string (4);
++ var languages = cursor.get_string (4);
+
+- lang_list = (languages != null)? languages.split (",") : new string[]{};
+- }
++ lang_list = (languages != null)? languages.split (",") : new string[]{};
+
+ return true;
+ }
+--
+GitLab
+
+
+From b0f6de66106853fc2186268ff8bf3e7fcfae769d Mon Sep 17 00:00:00 2001
+From: Sam Thursfield <sam@afuera.me.uk>
+Date: Sun, 2 Aug 2020 14:08:44 +0200
+Subject: [PATCH 2/2] Bundle Tracker Miners inside the Flatpak
+
+This allows Boxes to use Tracker for indexing on systems which don't
+have Tracker 3 available on the host.
+---
+ build-aux/flatpak/org.gnome.Boxes.json | 49 +++++---------------------
+ src/media-manager.vala | 11 ++++++
+ 2 files changed, 20 insertions(+), 40 deletions(-)
+
+diff --git a/build-aux/flatpak/org.gnome.Boxes.json b/build-aux/flatpak/org.gnome.Boxes.json
+index 8b53caed..92da2abe 100644
+--- a/build-aux/flatpak/org.gnome.Boxes.json
++++ b/build-aux/flatpak/org.gnome.Boxes.json
+@@ -16,14 +16,13 @@
+ "--system-talk-name=org.freedesktop.timedate1",
+ "--system-talk-name=org.freedesktop.Accounts",
+ "--filesystem=/var/lib/AccountsService/icons:ro",
+- "--talk-name=org.freedesktop.Tracker1",
+- "--env=TRACKER_SPARQL_BACKEND=bus",
+ "--talk-name=org.freedesktop.secrets",
+ "--filesystem=xdg-run/dconf",
+ "--filesystem=~/.config/dconf:ro",
+ "--filesystem=home",
+ "--talk-name=ca.desrt.dconf",
+- "--env=DCONF_USER_CONFIG_DIR=.config/dconf"
++ "--env=DCONF_USER_CONFIG_DIR=.config/dconf",
++ "--add-policy=Tracker3.dbus:org.freedesktop.Tracker3.Miner.Files=tracker:Software"
+ ],
+ "modules" : [
+ {
+@@ -275,59 +274,29 @@
+ }
+ ]
+ },
+- {
+- "name" : "tracker",
+- "buildsystem" : "meson",
+- "cleanup" : [
+- "/bin",
+- "/etc",
+- "/libexec"
+- ],
+- "config-opts" : [
+- "-Dbash_completion=no",
+- "-Dfunctional_tests=false",
+- "-Dman=false",
+- "-Ddocs=false",
+- "-Dsystemd_user_services=no"
+- ],
+- "sources" : [
+- {
+- "type" : "git",
+- "url" : "https://gitlab.gnome.org/GNOME/tracker.git",
+- "branch": "tracker-2.3"
+- }
+- ]
+- },
+ {
+ "name": "tracker-miners",
+ "buildsystem": "meson",
+ "cleanup": [
+ "/etc",
+- "/lib",
+ "/libexec",
+- "/share/dbus-1/services/org.freedesktop.Tracker1.Miner.Extract.service",
+- "/share/dbus-1/services/org.freedesktop.Tracker1.Writeback.service",
+- "/share/tracker/miners/org.freedesktop.Tracker1.Miner.Applications.service",
+- "/share/tracker/miners/org.freedesktop.Tracker1.Miner.Extract.service",
+- "/share/tracker/miners/org.freedesktop.Tracker1.Miner.RSS.service",
+- "/share/tracker-miners",
+- "/share/glib-2.0/schemas/org.freedesktop.Tracker.Extract.gschema.xml",
+- "/share/glib-2.0/schemas/org.freedesktop.Tracker.Writeback.gschema.xml"
++ "/share/tracker/miners"
+ ],
+ "config-opts": [
+- "-Dextract=false",
++ "-Ddomain_prefix=org.gnome.BoxesDevel",
++ "-Dextract=true",
+ "-Dgeneric_media_extractor=none",
+- "-Dminer_apps=false",
++ "-Dman=false",
+ "-Dminer_fs=true",
++ "-Dminer_fs_cache_location=$XDG_CACHE_HOME/gnome-boxes/miner/files",
+ "-Dminer_rss=false",
+- "-Dsystemd_user_services=no",
++ "-Dsystemd_user_services=false",
+ "-Dwriteback=false"
+ ],
+ "sources": [
+ {
+ "type": "git",
+- "url": "https://gitlab.gnome.org/GNOME/tracker-miners.git",
+- "branch" : "tracker-miners-2.3"
++ "url": "https://gitlab.gnome.org/GNOME/tracker-miners.git"
+ }
+ ]
+ },
+diff --git a/src/media-manager.vala b/src/media-manager.vala
+index c5648240..da758d17 100644
+--- a/src/media-manager.vala
++++ b/src/media-manager.vala
+@@ -1,5 +1,6 @@
+ // This file is part of GNOME Boxes. License: LGPLv2+
+
++using Config;
+ using Osinfo;
+ using Tracker;
+
+@@ -229,7 +230,17 @@ private MediaManager () {
+ connection = Sparql.Connection.bus_new ("org.freedesktop.Tracker3.Miner.Files",
+ null, null);
+ } catch (GLib.Error error) {
++#if !FLATPAK
+ critical ("Error connecting to Tracker: %s", error.message);
++#else
++ message ("Error connecting to host Tracker Miners: %s", error.message);
++ try {
++ connection = Sparql.Connection.bus_new (Config.APPLICATION_ID + "Tracker3.Miner.Files",
++ null, null);
++ } catch (GLib.Error error) {
++ critical ("Error starting local Tracker Miners: %s", error.message);
++ }
++#endif
+ }
+ }
+
+--
+GitLab
+