[tracker] meson: Fix build with libstemmer



commit fe77c4dbf6d7e3abe145a979f697b227a83cdb6e
Author: Sam Thursfield <sam afuera me uk>
Date:   Sat Dec 16 15:02:10 2017 +0000

    meson: Fix build with libstemmer
    
    Based on a patch by Jeremy Bicha <jbicha ubuntu com>.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=790373

 meson.build                       |    4 ++--
 meson_options.txt                 |    2 +-
 src/libtracker-common/meson.build |    4 ++++
 3 files changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/meson.build b/meson.build
index 36e0084..8a159af 100644
--- a/meson.build
+++ b/meson.build
@@ -54,8 +54,8 @@ enable_fts = get_option('fts')
 
 have_libstemmer = false
 if get_option('stemmer') != 'no'
-    stemmer = cc.find_library('stemmer')
-    if stemmer.found()
+    libstemmer = cc.find_library('stemmer', required: false)
+    if libstemmer.found()
         have_libstemmer = true
     elif get_option('stemmer') == 'yes'
         error('stemmer support explicitly requested, but stemmer library couldn\'t be found')
diff --git a/meson_options.txt b/meson_options.txt
index 496d356..05c65c9 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -7,7 +7,7 @@ option('functional_tests', type: 'boolean', value: true,
 option('journal', type: 'boolean', value: true,
        description: 'Enable database journal backup mechanism')
 
-option('stemmer', type: 'combo', choices: ['auto', 'no', 'yes'], value: 'no',
+option('stemmer', type: 'combo', choices: ['auto', 'no', 'yes'], value: 'auto',
        description: 'Enable stemming words while indexing')
 option('unicode_support', type: 'combo', choices: ['icu', 'unistring', 'auto'], value: 'auto',
        description: 'Unicode support library to use')
diff --git a/src/libtracker-common/meson.build b/src/libtracker-common/meson.build
index d56d909..4e82e6c 100644
--- a/src/libtracker-common/meson.build
+++ b/src/libtracker-common/meson.build
@@ -38,6 +38,10 @@ endif
 # FIXME: need to link against -lkvm on OpenBSD, see configure.ac
 tracker_common_dependencies = [glib, gio, gio_unix, libmath]
 
+if have_libstemmer
+  tracker_common_dependencies += [libstemmer]
+endif
+
 libtracker_common = library('tracker-common',
   tracker_common_sources,
   dependencies: tracker_common_dependencies + [unicode_library],


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