[tracker] build: Do not link libtracker-data.so to libtracker-sparql.so



commit 6799d903e9767288b10b02e1f362e040a02f69ed
Author: Carlos Garnacho <carlosg gnome org>
Date:   Thu Oct 11 18:36:48 2018 +0200

    build: Do not link libtracker-data.so to libtracker-sparql.so
    
    Even though libtracker-data uses types from libtracker-sparql, this
    is the wrong way around. However, doing the right thing here still
    breaks because meson is playing smart here and passes --no-undefined
    for every shared library by default, so build breaks with obviously
    undefined symbols.
    
    Correct the dependency tree to be exactly how it was with autotools,
    and override b_lundef when building libtracker-data to leave the
    borrowed symbols undefined. The gaps will be filled in because
    everyone must link with libtracker-sparql.
    
    Closes: https://gitlab.gnome.org/GNOME/tracker/issues/44

 src/libtracker-data/meson.build   | 11 ++++++++---
 src/libtracker-fts/meson.build    |  2 +-
 src/libtracker-sparql/meson.build |  2 +-
 src/tracker-store/meson.build     |  3 +--
 tests/libtracker-data/meson.build |  2 +-
 5 files changed, 12 insertions(+), 8 deletions(-)
---
diff --git a/src/libtracker-data/meson.build b/src/libtracker-data/meson.build
index b5d4f3cb7..d5c384b2b 100644
--- a/src/libtracker-data/meson.build
+++ b/src/libtracker-data/meson.build
@@ -9,7 +9,8 @@ libtracker_data_vala = static_library('tracker-sparql-query',
     'tracker-sparql-scanner.vala',
     'tracker-turtle-reader.vala',
     '../libtracker-common/libtracker-common.vapi',
-    '../libtracker-data/libtracker-data.vapi',
+    'libtracker-data.vapi',
+    tracker_sparql_vapi,
     tracker_common_enum_header,
     c_args: tracker_c_args,
     vala_args: [
@@ -21,7 +22,7 @@ libtracker_data_vala = static_library('tracker-sparql-query',
     ],
     # This doesn't depend on tracker_common_dep because of
     # https://github.com/mesonbuild/meson/issues/671
-    dependencies: [glib, gio, tracker_sparql_intermediate_dep],
+    dependencies: [glib, gio],
     include_directories: [commoninc, configinc, srcinc],
 )
 
@@ -32,7 +33,7 @@ tracker_data_enums = gnome.mkenums('tracker-data-enum-types',
 )
 
 tracker_data_dependencies = [
-    tracker_sparql_intermediate_dep, gvdb_dep, sqlite, uuid,
+    tracker_common_dep, gvdb_dep, sqlite, uuid,
 ]
 
 if get_option('fts')
@@ -68,6 +69,10 @@ libtracker_data = library('tracker-data',
     # This doesn't depend on tracker_common_dep because of
     # https://github.com/mesonbuild/meson/issues/671
     link_with: [libtracker_data_vala],
+    # We do *not* want --no-undefined here, this library uses
+    # symbols from libtracker-sparql, but does not mean it should
+    # be linked to it.
+    override_options: ['b_lundef=false'],
     dependencies: tracker_data_dependencies + [unicode_library],
     include_directories: [commoninc, configinc, srcinc],
 )
diff --git a/src/libtracker-fts/meson.build b/src/libtracker-fts/meson.build
index 1392699f8..5ab4409f8 100644
--- a/src/libtracker-fts/meson.build
+++ b/src/libtracker-fts/meson.build
@@ -11,7 +11,7 @@ libtracker_fts = static_library('tracker-fts',
     'tracker-fts-config.c',
     'tracker-fts-tokenizer.c',
     libtracker_fts_fts5,
-    dependencies: [tracker_common_dep, tracker_sparql_intermediate_dep],
+    dependencies: [tracker_common_dep],
     c_args: tracker_c_args
 )
 
diff --git a/src/libtracker-sparql/meson.build b/src/libtracker-sparql/meson.build
index 90e10ec04..b74c4e337 100644
--- a/src/libtracker-sparql/meson.build
+++ b/src/libtracker-sparql/meson.build
@@ -98,7 +98,7 @@ install_headers(
     subdir: 'tracker-@0@/libtracker-sparql'.format(tracker_api_version))
 
 # FIXME: we can't depend properly on the generated .vapi to do this.
-custom_target('tracker-sparql-' + tracker_api_version + '.vapi',
+tracker_sparql_vapi = custom_target('tracker-sparql-' + tracker_api_version + '.vapi',
     #input: 'tracker-sparql-intermediate-vala.vapi',
     output: 'tracker-sparql-' + tracker_api_version + '.vapi',
     command: [
diff --git a/src/tracker-store/meson.build b/src/tracker-store/meson.build
index 8d69ae572..057dbb254 100644
--- a/src/tracker-store/meson.build
+++ b/src/tracker-store/meson.build
@@ -26,8 +26,7 @@ tracker_store = executable('tracker-store',
     ],
     vala_args: [ '--pkg', 'posix' ],
     dependencies: [
-        tracker_common_dep, tracker_data_dep, tracker_sparql_direct_dep,
-        gio_unix
+        tracker_common_dep, tracker_sparql_dep, tracker_data_dep, tracker_sparql_direct_dep, gio_unix
     ],
     install: true,
     install_dir: join_paths(get_option('prefix'), get_option('libexecdir')),
diff --git a/tests/libtracker-data/meson.build b/tests/libtracker-data/meson.build
index 37719cd1a..6ede0da47 100644
--- a/tests/libtracker-data/meson.build
+++ b/tests/libtracker-data/meson.build
@@ -14,7 +14,7 @@ libtracker_data_slow_tests = [
 libtracker_data_test_environment = environment()
 libtracker_data_test_environment.set('TRACKER_LANGUAGE_STOP_WORDS_DIR', 
'@0@/src/libtracker-common/stop-words'.format(source_root))
 
-libtracker_data_test_deps = [tracker_common_dep, tracker_data_dep]
+libtracker_data_test_deps = [tracker_common_dep, tracker_data_dep, tracker_sparql_dep]
 
 foreach base_name: libtracker_data_tests
     source = 'tracker-@0@-test.c'.format(base_name)


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