From cf204ed29949f23a69e8acfea57bfccbcdfab6c4 Mon Sep 17 00:00:00 2001 From: Kalev Lember Date: Mar 16 2021 12:08:21 +0000 Subject: Switch to tracker 3 Backport upstream MR for switching from tracker 2.x to tracker 3.x. https://gitlab.gnome.org/GNOME/gnome-games/-/merge_requests/424 --- diff --git a/gnome-games.spec b/gnome-games.spec index aede1ed..e958ed3 100644 --- a/gnome-games.spec +++ b/gnome-games.spec @@ -2,13 +2,17 @@ Name: gnome-games Version: 3.38.0 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Simple game launcher for GNOME License: GPLv3+ URL: https://wiki.gnome.org/Apps/Games Source0: https://gitlab.gnome.org/GNOME/gnome-games/-/archive/%{version}/%{name}-%{version}.tar.gz +# Switch to tracker 3 +# https://gitlab.gnome.org/GNOME/gnome-games/-/merge_requests/424 +Patch0: tracker3.patch + BuildRequires: desktop-file-utils BuildRequires: intltool BuildRequires: libappstream-glib @@ -25,7 +29,7 @@ BuildRequires: pkgconfig(libsoup-2.4) BuildRequires: pkgconfig(libxml-2.0) BuildRequires: pkgconfig(retro-gtk-1) BuildRequires: pkgconfig(sqlite3) -BuildRequires: pkgconfig(tracker-sparql-2.0) +BuildRequires: pkgconfig(tracker-sparql-3.0) %if 0%{?fedora} >= 30 BuildRequires: pkgconfig(manette-0.2) >= 0.2.0 %endif @@ -57,7 +61,7 @@ tools or video game development tools. %prep -%autosetup +%autosetup -p1 %build @@ -94,6 +98,9 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/*.desktop %changelog +* Tue Mar 16 2021 Kalev Lember - 3.38.0-3 +- Switch to tracker 3 + * Tue Jan 26 2021 Fedora Release Engineering - 3.38.0-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild diff --git a/tracker3.patch b/tracker3.patch new file mode 100644 index 0000000..abf13a5 --- /dev/null +++ b/tracker3.patch @@ -0,0 +1,161 @@ +From ba6f2e8461093eeaebd485910f69c61265131adf Mon Sep 17 00:00:00 2001 +From: Jean Felder +Date: Fri, 4 Sep 2020 23:11:35 +0200 +Subject: [PATCH 1/3] application: Remove an empty line at the end of file + +--- + src/ui/application.vala | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/src/ui/application.vala b/src/ui/application.vala +index ab738c4b..d65b7ae1 100644 +--- a/src/ui/application.vala ++++ b/src/ui/application.vala +@@ -579,4 +579,3 @@ public class Games.Application : Gtk.Application { + return GLib.Application.get_default () as Application; + } + } +- +-- +GitLab + + +From d38e93160a8e16776bb1fdc46f547365d3f2c9ee Mon Sep 17 00:00:00 2001 +From: Jean Felder +Date: Sat, 30 May 2020 18:48:06 +0200 +Subject: [PATCH 2/3] Port to tracker3 + +With tracker3, tracker-miner-fs dumps data in different graphs. Games +only needs to access data stored in the tracker:Software graph. + +'tracker_sparql_connection_get' has been replaced by +'tracker_sparql_connection_bus_new'. +--- + meson.build | 2 +- + plugins/desktop/src/desktop-plugin.vala | 2 +- + src/tracker/mime-type-tracker-uri-query.vala | 2 +- + src/ui/application.vala | 4 ++-- + 4 files changed, 5 insertions(+), 5 deletions(-) + +diff --git a/meson.build b/meson.build +index a46681b9..fbab320c 100644 +--- a/meson.build ++++ b/meson.build +@@ -45,7 +45,7 @@ retro_gtk_dep = dependency ('retro-gtk-1', version: '>=' + retro_gtk_min_version + rsvg_dep = dependency ('librsvg-2.0') + soup_dep = dependency ('libsoup-2.4') + sqlite_dep = dependency ('sqlite3') +-tracker_sparql_dep = dependency ('tracker-sparql-2.0') ++tracker_sparql_dep = dependency ('tracker-sparql-3.0') + xml_dep = dependency ('libxml-2.0') + + srcdir = join_paths (meson.source_root (), 'src') +diff --git a/plugins/desktop/src/desktop-plugin.vala b/plugins/desktop/src/desktop-plugin.vala +index 93f824c8..1c9da904 100644 +--- a/plugins/desktop/src/desktop-plugin.vala ++++ b/plugins/desktop/src/desktop-plugin.vala +@@ -19,7 +19,7 @@ private class Games.DesktopPlugin : Object, Plugin { + public UriSource[] get_uri_sources () { + var query = new DesktopTrackerUriQuery (); + try { +- var connection = Tracker.Sparql.Connection.@get (); ++ var connection = Tracker.Sparql.Connection.@bus_new ("org.freedesktop.Tracker3.Miner.Files", null, null); + var uri_source = new TrackerUriSource (connection); + uri_source.add_query (query); + +diff --git a/src/tracker/mime-type-tracker-uri-query.vala b/src/tracker/mime-type-tracker-uri-query.vala +index d536899a..bf7b889a 100644 +--- a/src/tracker/mime-type-tracker-uri-query.vala ++++ b/src/tracker/mime-type-tracker-uri-query.vala +@@ -8,6 +8,6 @@ public class Games.MimeTypeTrackerUriQuery : Object, TrackerUriQuery { + } + + public string get_query () { +- return @"SELECT DISTINCT nie:url(?urn) WHERE { ?urn nie:mimeType \"$mime_type\" . }"; ++ return @"SELECT DISTINCT nie:isStoredAs(?urn) { GRAPH tracker:Software { ?urn nie:mimeType \"$mime_type\" . } }"; + } + } +diff --git a/src/ui/application.vala b/src/ui/application.vala +index d65b7ae1..80cf4f46 100644 +--- a/src/ui/application.vala ++++ b/src/ui/application.vala +@@ -2,7 +2,7 @@ + + public class Games.Application : Gtk.Application { + const string HELP_URI = "https://wiki.gnome.org/Apps/Games/Documentation"; +- const string TEST_QUERY = "SELECT nie:url(?f) WHERE { ?f fts:match 'test query to check tracker' }"; ++ const string TEST_QUERY = "SELECT nie:isStoredAs(?f) WHERE { GRAPH tracker:Software { ?f fts:match 'test query to check tracker' } }"; + + private static bool? is_flatpak; + +@@ -345,7 +345,7 @@ public class Games.Application : Gtk.Application { + + TrackerUriSource tracker_uri_source = null; + try { +- var connection = Tracker.Sparql.Connection.@get (); ++ var connection = Tracker.Sparql.Connection.@bus_new ("org.freedesktop.Tracker3.Miner.Files", null, null); + connection.query (TEST_QUERY); + tracker_uri_source = new TrackerUriSource (connection); + } +-- +GitLab + + +From 4550d24a05b6ea9d9f95f44faf0696e91f7a0211 Mon Sep 17 00:00:00 2001 +From: Jean Felder +Date: Fri, 4 Sep 2020 23:03:12 +0200 +Subject: [PATCH 3/3] flatpak: Port to tracker3 + +The add-policy permission allows to use the portal from Tracker +3. Games only needs the tracker:Software graph. +TRACKER_BACKEND can be removed. It does not do anything for Tracker 3. +--- + flatpak/org.gnome.Games.json | 25 +------------------------ + 1 file changed, 1 insertion(+), 24 deletions(-) + +diff --git a/flatpak/org.gnome.Games.json b/flatpak/org.gnome.Games.json +index bddd58ba..3b68761c 100644 +--- a/flatpak/org.gnome.Games.json ++++ b/flatpak/org.gnome.Games.json +@@ -15,8 +15,7 @@ + "--socket=wayland", + "--device=dri", + "--socket=pulseaudio", +- "--talk-name=org.freedesktop.Tracker1", +- "--env=TRACKER_SPARQL_BACKEND=bus", ++ "--add-policy=Tracker3.dbus:org.freedesktop.Tracker3.Miner.Files=tracker:Software", + "--share=network", + "--device=all", + "--talk-name=org.freedesktop.Flatpak", +@@ -76,28 +75,6 @@ + "mkdir -p /app/lib/libretro/extra.d" + ] + }, +- { +- "name" : "tracker", +- "buildsystem" : "meson", +- "config-opts" : [ +- "-Ddocs=false", +- "-Dfts=false", +- "-Dfunctional_tests=false", +- "-Djournal=false", +- "-Dnetwork_manager=disabled", +- "-Dstemmer=disabled", +- "-Dbash_completion=no", +- "-Ddbus_services=/app/share/dbus-1/services", +- "-Dsystemd_user_services=no" +- ], +- "sources" : [ +- { +- "type" : "git", +- "url" : "https://gitlab.gnome.org/GNOME/tracker.git", +- "branch" : "tracker-2.3" +- } +- ] +- }, + { + "name" : "grilo", + "buildsystem" : "meson", +-- +GitLab +