summaryrefslogtreecommitdiff
path: root/data
diff options
context:
space:
mode:
authorSam Thursfield <sam@afuera.me.uk>2020-08-01 17:25:27 +0200
committerSam Thursfield <sam@afuera.me.uk>2020-09-02 18:50:17 +0200
commitf9c79fce6d90e7e5842f2c56a1ec98a151126874 (patch)
tree86f3ab12aa2c5e2e49ed81c046fdd18201b299fb /data
parent034a6a3394d9de5da743f9e62f6019ca37b50f1d (diff)
downloadnautilus-f9c79fce6d90e7e5842f2c56a1ec98a151126874.tar.gz
Use Tracker Miners inside Flatpak when not available on the host
This means the Nautilus flatpak will be able to use Tracker on systems which don't have Tracker 3 available on the host. It comes at a cost of increased resource consumption inside the Flatpak due running an extra indexer process there.
Diffstat (limited to 'data')
-rw-r--r--data/meson.build1
-rw-r--r--data/tracker/meson.build31
-rw-r--r--data/tracker/org.gnome.Nautilus.Tracker3.Miner.Extract.service.in7
-rw-r--r--data/tracker/org.gnome.Nautilus.Tracker3.Miner.Files.service.in7
-rw-r--r--data/tracker/org.gnome.Nautilus.domain.rule.in21
5 files changed, 67 insertions, 0 deletions
diff --git a/data/meson.build b/data/meson.build
index e51ed50b1..9a4e2ff52 100644
--- a/data/meson.build
+++ b/data/meson.build
@@ -139,3 +139,4 @@ if appstream_util.found()
endif
subdir('ontology')
+subdir('tracker')
diff --git a/data/tracker/meson.build b/data/tracker/meson.build
new file mode 100644
index 000000000..5320af164
--- /dev/null
+++ b/data/tracker/meson.build
@@ -0,0 +1,31 @@
+# Files needed for running Tracker inside the Flatpak sandbox, for systems
+# which don't have a suitable version of Tracker in the host OS.
+#
+# We must export the .service files from the sandbox so they work on the
+# session bus. This means the Tracker domain name must correspond with the
+# application ID.
+
+domain_ontologies_dir = get_option('datadir') / 'tracker3' / 'domain-ontologies'
+dbus_services_dir = get_option('datadir') / 'dbus-1' / 'services'
+
+tracker_domain_config = configuration_data()
+tracker_domain_config.set('application_id', application_id)
+tracker_domain_config.set('domain_rule', get_option('prefix') / domain_ontologies_dir / application_id + '.domain.rule')
+
+configure_file(
+ input: 'org.gnome.Nautilus.domain.rule.in',
+ output: application_id + '.domain.rule',
+ configuration: tracker_domain_config,
+ install_dir: domain_ontologies_dir)
+
+configure_file(
+ input: 'org.gnome.Nautilus.Tracker3.Miner.Extract.service.in',
+ output: application_id + '.Tracker3.Miner.Extract.service',
+ configuration: tracker_domain_config,
+ install_dir: dbus_services_dir)
+
+configure_file(
+ input: 'org.gnome.Nautilus.Tracker3.Miner.Files.service.in',
+ output: application_id + '.Tracker3.Miner.Files.service',
+ configuration: tracker_domain_config,
+ install_dir: dbus_services_dir)
diff --git a/data/tracker/org.gnome.Nautilus.Tracker3.Miner.Extract.service.in b/data/tracker/org.gnome.Nautilus.Tracker3.Miner.Extract.service.in
new file mode 100644
index 000000000..eb7a87aa6
--- /dev/null
+++ b/data/tracker/org.gnome.Nautilus.Tracker3.Miner.Extract.service.in
@@ -0,0 +1,7 @@
+[D-BUS Service]
+Name=@application_id@.Tracker3.Miner.Extract
+Exec=/app/libexec/tracker-extract-3 --domain-ontology @domain_rule@
+
+# Miner details needed for tracker-control
+Path=/org/freedesktop/Tracker3/Miner/Extract
+NameSuffix=Miner.Files
diff --git a/data/tracker/org.gnome.Nautilus.Tracker3.Miner.Files.service.in b/data/tracker/org.gnome.Nautilus.Tracker3.Miner.Files.service.in
new file mode 100644
index 000000000..4fa7371d1
--- /dev/null
+++ b/data/tracker/org.gnome.Nautilus.Tracker3.Miner.Files.service.in
@@ -0,0 +1,7 @@
+[D-BUS Service]
+Name=@application_id@.Tracker3.Miner.Files
+Exec=/app/libexec/tracker-miner-fs-3 --domain-ontology @domain_rule@ --initial-sleep 0
+
+# Miner details needed for tracker-control
+Path=/org/freedesktop/Tracker3/Miner/Files
+NameSuffix=Miner.Files
diff --git a/data/tracker/org.gnome.Nautilus.domain.rule.in b/data/tracker/org.gnome.Nautilus.domain.rule.in
new file mode 100644
index 000000000..ec0808e30
--- /dev/null
+++ b/data/tracker/org.gnome.Nautilus.domain.rule.in
@@ -0,0 +1,21 @@
+# This defines a private Tracker domain for Nautilus.
+#
+# It's used to run the Tracker indexer inside a Flatpak sandbox, when Nautilus
+# is running on a host that doesn't have a suitable version of Tracker
+# installed.
+
+[DomainOntology]
+# Location for the Tracker database
+CacheLocation=$XDG_CACHE_HOME/nautilus/miner/files
+
+# Name of the ontology to use, must be one located in
+# $(sharedir)/tracker/ontologies
+OntologyName=nepomuk
+
+# DBus name for the owner (not optional). Tracker will use
+# the domain as the prefix of the DBus name for all the
+# services related to this domain ontology.
+Domain=@application_id@
+
+# List of miners we expect to run in this domain.
+Miners=Miner.Files;Miner.Extract