aboutsummaryrefslogtreecommitdiffstats
path: root/community/gnome-games/tracker3.patch
blob: 31905ee60ca32dc6462bc3673a60ea7f11535a29 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
From 695c6dd2debacf64ec7174b60fa277dd82f9c177 Mon Sep 17 00:00:00 2001
From: Jean Felder <jean.felder@gmail.com>
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 531c072a4e2eac1faf54c70c681da2abfe16edcb Mon Sep 17 00:00:00 2001
From: Jean Felder <jean.felder@gmail.com>
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 8f0fbb80..9116dd0a 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 44af7b36775aae83b6981ea97f0a304c760751c8 Mon Sep 17 00:00:00 2001
From: Jean Felder <jean.felder@gmail.com>
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