[Xfce4-commits] <postler:master> Allow disabling of libstemmer with --disable-libstemmer

Christian Dywan noreply at xfce.org
Fri Aug 12 22:06:01 CEST 2011


Updating branch refs/heads/master
         to d5056bb1c52c7515cb4c60a05056125d1fe44311 (commit)
       from 4d464d5ea9ff1f1fc96ce67e86e13053481aceeb (commit)

commit d5056bb1c52c7515cb4c60a05056125d1fe44311
Author: Christian Dywan <christian at twotoasts.de>
Date:   Fri Aug 12 21:31:50 2011 +0200

    Allow disabling of libstemmer with --disable-libstemmer
    
    It's not packaged in all of the big distributions.

 README                     |    4 ++--
 postler/postler-index.vala |    2 ++
 wscript                    |   14 ++++++++++----
 3 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/README b/README
index 303fa83..2038eb9 100644
--- a/README
+++ b/README
@@ -8,9 +8,9 @@ by default, offline access is integral. Contact completion and address book
 integration are provided by Dexter.
 
 Requirements: GIO 2.26, GTK+ 2.18, WebkitGTK+ 1.1.18, Unique 0.9, libnotify,
-              libcanberra, (Berkeley) db, openssl, libstemmer
+              libcanberra, (Berkeley) db, openssl
 
-Recommended: libfolks, Zeitgeist, libindicate, Dexter, lynx
+Recommended: libfolks, Zeitgeist, libindicate, Dexter, lynx, libstemmer
 
 For installation instructions read INSTALL.
 
diff --git a/postler/postler-index.vala b/postler/postler-index.vala
index 6908485..699f4ae 100644
--- a/postler/postler-index.vala
+++ b/postler/postler-index.vala
@@ -309,6 +309,7 @@ namespace Postler {
                             continue;
                         }
 
+#if HAVE_STEMMER
                         if (!literal) {
                             string? stemmed = null;
                             foreach (var lang in Intl.get_language_names ()) {
@@ -327,6 +328,7 @@ namespace Postler {
                             if (stemmed != null)
                                 word = stemmed;
                         }
+#endif
 
                         /* * is a wildcard, ' must be escaped by doubling it */
                         string escaped = word.replace ("*", "%").replace ("\'", "\'\'");
diff --git a/wscript b/wscript
index 853d6a2..2b0d618 100644
--- a/wscript
+++ b/wscript
@@ -172,10 +172,15 @@ def configure (conf):
     else:
         Utils.pprint ('YELLOW', 'Building without libindicate.')
 
-    check_function ('sb_stemmer_stem', 'libstemmer.h', 'stemmer')
-    if not conf.env['HAVE_SB_STEMMER_STEM']:
-        Utils.pprint ('RED', 'libstemmer was not found.')
-        sys.exit (1)
+    if option_enabled ('libstemmer'):
+        check_function ('sb_stemmer_stem', 'libstemmer.h', 'stemmer', mandatory=False)
+        if not conf.env['HAVE_SB_STEMMER_STEM']:
+            Utils.pprint ('RED', 'libstemmer was not found.\n' \
+                                 'If you want to build without it, pass --disable-libstemmer.')
+            sys.exit (1)
+        conf.env.append_value ('VALAFLAGS', '-D HAVE_STEMMER')
+    else:
+        Utils.pprint ('YELLOW', 'Building without libstemmer.')
 
     # isync
     conf.check (header_name='sys/filio.h')
@@ -304,6 +309,7 @@ def set_options (opt):
     add_enable_option ('libfolks', 'libfolks support (Telepathy, EDS)')
     add_enable_option ('zeitgeist', 'Zeitgeist support (Synapse, Unity)')
     add_enable_option ('libindicate', 'Messaging Menu support (Ayatana)')
+    add_enable_option ('libstemmer', 'libstemmer support (Searching word stems)')
 
 # Taken from Geany's wscript, modified to support LINGUAS variable
 def write_linguas_file (self):


More information about the Xfce4-commits mailing list