[tracker-miners/sam/sandbox-rewrite-2: 3/3] Add run-uninstalled script
- From: Sam Thursfield <sthursfield src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker-miners/sam/sandbox-rewrite-2: 3/3] Add run-uninstalled script
- Date: Sun, 15 Sep 2019 22:28:53 +0000 (UTC)
commit be60895c56f3203297af3701d3a9025addb119e1
Author: Sam Thursfield <sam afuera me uk>
Date: Tue Sep 10 20:48:30 2019 +0200
Add run-uninstalled script
This is part of
https://gitlab.gnome.org/GNOME/tracker/merge_requests/133.
meson.build | 12 ++++++++++++
run-uninstalled.in | 48 ++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 60 insertions(+)
---
diff --git a/meson.build b/meson.build
index a7d38e3e9..e65ef3626 100644
--- a/meson.build
+++ b/meson.build
@@ -35,9 +35,11 @@ if get_option('tracker_core') == 'system'
# If we are building against an installed version of tracker core rather than
# having it as a subproject, these 'uninstalled' locations point to the actual
# installed locations.
+ tracker_uninstalled_cli_dir = join_paths (tracker_sparql.get_pkgconfig_variable('exec_prefix'), 'bin')
tracker_uninstalled_domain_rule = join_paths
(tracker_sparql.get_pkgconfig_variable('domain_ontologies_dir'), 'default.rule')
tracker_uninstalled_nepomuk_ontologies_dir =
join_paths(tracker_sparql.get_pkgconfig_variable('ontologies_dir'), 'nepomuk')
tracker_uninstalled_stop_words_dir = join_paths(tracker_sparql.get_pkgconfig_variable('datadir'),
'tracker', 'stop-words')
+ tracker_uninstalled_testutils_dir = join_paths(tracker_sparql.get_pkgconfig_variable('libdir',
'tracker-2.0', 'trackertestutils'))
else
tracker_subproject = subproject('tracker',
default_options: [
@@ -52,9 +54,11 @@ else
tracker_store = tracker_subproject.get_variable('tracker_store')
tracker_store_path = tracker_store.full_path()
+ tracker_uninstalled_cli_dir = tracker_subproject.get_variable('tracker_uninstalled_cli_dir')
tracker_uninstalled_domain_rule = tracker_subproject.get_variable('tracker_uninstalled_domain_rule')
tracker_uninstalled_nepomuk_ontologies_dir =
tracker_subproject.get_variable('tracker_uninstalled_nepomuk_ontologies_dir')
tracker_uninstalled_stop_words_dir = tracker_subproject.get_variable('tracker_uninstalled_stop_words_dir')
+ tracker_uninstalled_testutils_dir = tracker_subproject.get_variable('tracker_uninstalled_testutils_dir')
tracker_common_enums_header = tracker_subproject.get_variable('tracker_common_enums_header')
tracker_gsettings_schemas = tracker_subproject.get_variable('tracker_gsettings_schemas')
@@ -423,6 +427,14 @@ subdir('po')
meson.add_install_script('meson_integration_commands.sh', glib_compile_schemas.path(), gsettings_schema_dir)
+run_uninstalled_conf = configuration_data()
+run_uninstalled_conf.set('tracker_uninstalled_cli_dir', tracker_uninstalled_cli_dir)
+run_uninstalled_conf.set('tracker_uninstalled_testutils_dir', tracker_uninstalled_testutils_dir)
+configure_file(
+ input: 'run-uninstalled.in',
+ output: 'run-uninstalled',
+ configuration: run_uninstalled_conf)
+
summary = [
'\nBuild Configuration:',
' Prefix: ' + get_option('prefix'),
diff --git a/run-uninstalled.in b/run-uninstalled.in
new file mode 100755
index 000000000..2f960be47
--- /dev/null
+++ b/run-uninstalled.in
@@ -0,0 +1,48 @@
+#!/usr/bin/python3
+#
+# Copyright (C) 2019 Sam Thursfield <sam afuera me uk>
+#
+# This is a tool for running development versions of Tracker the build tree.
+#
+# See README.md in tracker.git for usage information.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+#
+
+import os
+import pathlib
+import sys
+
+TRACKER_UNINSTALLED_CLI_DIR = "@tracker_uninstalled_cli_dir@"
+TRACKER_UNINSTALLED_TESTUTILS_DIR = "@tracker_uninstalled_testutils_dir@"
+
+cli_dir = TRACKER_UNINSTALLED_CLI_DIR
+testutils_dir = TRACKER_UNINSTALLED_TESTUTILS_DIR
+
+build_directory = pathlib.Path(__file__).parent
+dbus_config = build_directory.joinpath('tests/test-bus.conf')
+
+env = os.environ
+
+# Add the `tracker` CLI to PATH.
+path = env.get('PATH', '').split(':')
+env['PATH'] = ':'.join([cli_dir] + path)
+
+# Add trackertestutils module to PYTHONPATH
+pythonpath = env.get('PYTHONPATH', '').split(':')
+env['PYTHONPATH'] = ':'.join([testutils_dir] + pythonpath)
+
+args = [sys.executable, '-m', 'trackertestutils', '--dbus-config', dbus_config] + sys.argv[1:]
+os.execve(sys.executable, args, env)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]