[tracker-miners/sam/run-uninstalled-fix] Fix run-uninstalled workflow



commit 4ca42bdd89c488522bf234deef60151cbffaaa0b
Author: Sam Thursfield <sam afuera me uk>
Date:   Tue Feb 18 00:35:45 2020 +0100

    Fix run-uninstalled workflow
    
    This makes the 'run-uninstalled' tool work again, including running
    CLI commands as expected.
    
    One small issue is that `./run-uninstalled -- tracker --help` will list
    builtin commands in the 'extra commands' list, but this isn't a big
    problem.

 meson.build                                   |  4 +++-
 run-uninstalled.in                            |  8 +++++++-
 src/tracker/make-uninstalled-command-links.sh | 28 +++++++++++++++++++++++++++
 src/tracker/meson.build                       |  3 +++
 4 files changed, 41 insertions(+), 2 deletions(-)
---
diff --git a/meson.build b/meson.build
index 4958d506c..e5aec685e 100644
--- a/meson.build
+++ b/meson.build
@@ -416,11 +416,13 @@ 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_sparql_uninstalled_dir', tracker_sparql_uninstalled_dir)
 run_uninstalled_conf.set('tracker_uninstalled_cli_dir', tracker_uninstalled_cli_dir)
+run_uninstalled_conf.set('tracker_uninstalled_cli_subcommands_dir', meson.current_build_dir() / 'src' / 
'tracker' / 'subcommands')
+run_uninstalled_conf.set('tracker_uninstalled_domain_rule', meson.current_build_dir() / 'tests' / 
'functional-tests' / 'test-domain.rule')
 run_uninstalled_conf.set('tracker_uninstalled_extract_rules_dir', tracker_uninstalled_extract_rules_dir)
 run_uninstalled_conf.set('tracker_uninstalled_extractors_dir', meson.current_build_dir() / 'src' / 
'tracker-extract')
 run_uninstalled_conf.set('tracker_uninstalled_miner_services_dir', tracker_uninstalled_miner_services_dir)
-run_uninstalled_conf.set('tracker_uninstalled_nepomuk_ontologies_dir', 
tracker_uninstalled_nepomuk_ontologies_dir)
 run_uninstalled_conf.set('tracker_uninstalled_stop_words_dir', tracker_uninstalled_stop_words_dir)
 run_uninstalled_conf.set('tracker_uninstalled_testutils_dir', tracker_uninstalled_testutils_dir)
 run_uninstalled_conf.set('tracker_uninstalled_writeback_modules_dir', 
tracker_uninstalled_writeback_modules_dir)
diff --git a/run-uninstalled.in b/run-uninstalled.in
index beb450b3c..8d2bcf51f 100755
--- a/run-uninstalled.in
+++ b/run-uninstalled.in
@@ -26,6 +26,7 @@ import pathlib
 import sys
 
 cli_dir = "@tracker_uninstalled_cli_dir@"
+tracker_sparql_dir = "@tracker_sparql_uninstalled_dir@"
 testutils_dir = "@tracker_uninstalled_testutils_dir@"
 
 build_directory = pathlib.Path(__file__).parent
@@ -37,17 +38,22 @@ env = os.environ
 path = env.get('PATH', '').split(':')
 env['PATH'] = ':'.join([cli_dir] + path)
 
+# Add GObject typelib to GI_TYPELIB_PATH
+gipath = env.get('GI_TYPELIB_PATH', '').split(':')
+env['GI_TYPELIB_PATH'] = ':'.join([tracker_sparql_dir] + gipath)
+
 # Add trackertestutils module to PYTHONPATH
 pythonpath = env.get('PYTHONPATH', '').split(':')
 env['PYTHONPATH'] = ':'.join([testutils_dir] + pythonpath)
 
 env['GSETTINGS_SCHEMA_DIR'] = '@uninstalled_gsettings_schema_dir@'
 
-env['TRACKER_DB_ONTOLOGIES_DIR'] = "@tracker_uninstalled_nepomuk_ontologies_dir@"
+env['TRACKER_CLI_SUBCOMMANDS_DIR'] = "@tracker_uninstalled_cli_subcommands_dir@"
 env['TRACKER_EXTRACTOR_RULES_DIR'] = "@tracker_uninstalled_extract_rules_dir@"
 env['TRACKER_EXTRACTORS_DIR'] = "@tracker_uninstalled_extractors_dir@"
 env['TRACKER_LANGUAGE_STOP_WORDS_DIR'] = "@tracker_uninstalled_stop_words_dir@"
 env['TRACKER_MINER_SERVICES_DIR'] = "@tracker_uninstalled_miner_services_dir@"
+env['TRACKER_TEST_DOMAIN_ONTOLOGY_RULE'] = "@tracker_uninstalled_domain_rule@"
 env['TRACKER_WRITEBACK_MODULES_DIR'] = "@tracker_uninstalled_writeback_modules_dir@"
 
 args = [sys.executable, '-m', 'trackertestutils', '--dbus-config', dbus_config] + sys.argv[1:]
diff --git a/src/tracker/make-uninstalled-command-links.sh b/src/tracker/make-uninstalled-command-links.sh
new file mode 100644
index 000000000..64228323f
--- /dev/null
+++ b/src/tracker/make-uninstalled-command-links.sh
@@ -0,0 +1,28 @@
+#!/bin/sh
+
+set -e
+
+cli_dir=$1
+shift
+
+subcommands_dir=$MESON_BUILD_ROOT/$MESON_SUBDIR/subcommands
+
+mkdir -p $subcommands_dir
+
+for l in `find $subcommands_dir -type l`
+do
+    rm $l
+done
+
+# Link to commands from tracker.git.
+# FIXME: it would be nice to not hardcode this list.
+ln -s $cli_dir/tracker $subcommands_dir/endpoint
+ln -s $cli_dir/tracker $subcommands_dir/info
+ln -s $cli_dir/tracker $subcommands_dir/sparql
+ln -s $cli_dir/tracker $subcommands_dir/sql
+
+# Link to commands from tracker-miners.git.
+for subcommand in $@
+do
+    ln -s $MESON_BUILD_ROOT/$MESON_SUBDIR/$subcommand $subcommands_dir/$subcommand
+done
diff --git a/src/tracker/meson.build b/src/tracker/meson.build
index e1afe8c41..1e03cbcf0 100644
--- a/src/tracker/meson.build
+++ b/src/tracker/meson.build
@@ -30,3 +30,6 @@ foreach m: modules
         include_directories: [commoninc, configinc, srcinc],
     )
 endforeach
+
+run_command('./make-uninstalled-command-links.sh', tracker_uninstalled_cli_dir, modules,
+            check: true)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]