Author: anssi
Date: Mon Feb 12 16:00:31 2007
New Revision: 119044

Added:
   packages/cooker/enchant/current/SOURCES/enchant-cvs-voikko-provider.patch
Removed:
   
packages/cooker/enchant/current/SOURCES/enchant-voikko-provider-mutexed.patch.bz2
Modified:
   packages/cooker/enchant/current/SPECS/enchant.spec

Log:
- update patch1 with 1.3.0 compatible version from CVS
- add some comments about moduledir (SILENT)


Added: packages/cooker/enchant/current/SOURCES/enchant-cvs-voikko-provider.patch
==============================================================================
--- (empty file)
+++ packages/cooker/enchant/current/SOURCES/enchant-cvs-voikko-provider.patch   
Mon Feb 12 16:00:31 2007
@@ -0,0 +1,273 @@
+diff -Nurp -x '*~' enchant/configure.in enchant-new/configure.in
+--- enchant/configure.in       2006-07-22 20:35:34.000000000 +0300
++++ enchant-new/configure.in   2006-10-17 22:07:01.000000000 +0300
+@@ -197,6 +197,35 @@ fi
+ 
+ AM_CONDITIONAL(WITH_ASPELL, test "$build_aspell" = yes)
+ 
++check_voikko=yes
++build_voikko=no
++
++AC_ARG_ENABLE(voikko, [  --disable-voikko     enable the voikko backend 
[default=auto]], check_voikko="$enableval", check_voikko=yes)
++
++AC_ARG_WITH(voikko-prefix, [  --with-voikko-prefix=DIR
++                          specify under which prefix voikko is installed.], 
voikko_prefix="$withval", )
++
++if test "x$check_voikko" != "xno"; then
++   saved_LDFLAGS=$LDFLAGS
++
++   VOIKKO_INC=
++   VOIKKO_LIBS="-lvoikko"
++   if test "x$voikko_prefix" != "x"; then
++       LDFLAGS="-L$voikko_prefix/lib "$LDFLAGS
++       VOIKKO_INC="-I$voikko_prefix/include"
++       VOIKKO_LIBS="-L$voikko_prefix/lib "$VOIKKO_LIBS
++   fi
++
++   AC_CHECK_LIB(voikko,voikko_init,build_voikko=yes)
++
++   LDFLAGS=$saved_LDFLAGS
++
++   AC_SUBST(VOIKKO_INC)
++   AC_SUBST(VOIKKO_LIBS)
++fi
++
++AM_CONDITIONAL(WITH_VOIKKO, test "$build_voikko" = yes)
++
+ build_uspell=no
+ 
+ check_uspell=yes
+@@ -266,6 +295,7 @@ src/uspell/Makefile
+ src/myspell/Makefile
+ src/hspell/Makefile
+ src/applespell/Makefile
++src/voikko/Makefile
+ tests/Makefile
+ tests/ispell
+ doc/Makefile
+@@ -291,5 +321,6 @@ $PACKAGE-$VERSION
+       Build Uspell backend:           ${build_uspell}
+       Build Hspell backend:           ${build_hspell}
+       Build Myspell/Hunspell backend: ${build_myspell}
++      Build Voikko backend:           ${build_voikko}
+       Build a relocatable library:    ${relocatable_library}
+ "
+diff -Nurp -x '*~' enchant/data/enchant.ordering 
enchant-new/data/enchant.ordering
+--- enchant/data/enchant.ordering      2005-11-28 07:05:26.000000000 +0200
++++ enchant-new/data/enchant.ordering  2006-10-17 21:56:53.000000000 +0300
+@@ -1,4 +1,6 @@
+ *:myspell,aspell,ispell
++fi:voikko,ispell,myspell,aspell
++fi_FI:voikko,ispell,myspell,aspell
+ he:hspell,myspell
+ he_IL:hspell,myspell
+ yi:uspell
+diff -Nurp -x '*~' enchant/src/Makefile.am enchant-new/src/Makefile.am
+--- enchant/src/Makefile.am    2006-05-06 19:02:16.000000000 +0300
++++ enchant-new/src/Makefile.am        2006-10-17 21:56:53.000000000 +0300
+@@ -1,4 +1,4 @@
+-SUBDIRS=. aspell ispell uspell myspell hspell applespell
++SUBDIRS=. aspell ispell uspell myspell hspell applespell voikko
+ 
+ INCLUDES=-I$(top_srcdir) $(ENCHANT_CFLAGS) 
-DENCHANT_GLOBAL_MODULE_DIR=\"$(libdir)/enchant\" 
-DENCHANT_GLOBAL_ORDERING=\"$(datadir)/enchant\" -D_ENCHANT_BUILD=1
+ 
+diff -Nurp -x '*~' enchant/src/voikko/Makefile.am 
enchant-new/src/voikko/Makefile.am
+--- enchant/src/voikko/Makefile.am     1970-01-01 02:00:00.000000000 +0200
++++ enchant-new/src/voikko/Makefile.am 2006-10-17 21:56:53.000000000 +0300
+@@ -0,0 +1,15 @@
++if WITH_VOIKKO
++target_lib = libenchant_voikko.la
++else
++target_lib =
++endif
++
++INCLUDES=-I$(top_srcdir)/src $(ENCHANT_CFLAGS) @VOIKKO_INC@ -D_ENCHANT_BUILD=1
++
++voikko_LTLIBRARIES = $(target_lib)
++voikkodir= $(libdir)/enchant
++
++libenchant_voikko_la_LIBADD= $(ENCHANT_LIBS) $(VOIKKO_LIBS) 
$(top_builddir)/src/libenchant.la
++libenchant_voikko_la_LDFLAGS = -module -avoid-version -no-undefined
++libenchant_voikko_la_SOURCES = voikko_provider.c
++libenchant_voikko_lalibdir=$(libdir)/enchant
+diff -Nurp -x '*~' enchant/src/voikko/voikko_provider.c 
enchant-new/src/voikko/voikko_provider.c
+--- enchant/src/voikko/voikko_provider.c       1970-01-01 02:00:00.000000000 
+0200
++++ enchant-new/src/voikko/voikko_provider.c   2006-10-17 22:27:10.000000000 
+0300
+@@ -0,0 +1,177 @@
++/* vim: set sw=8: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; 
c-basic-offset: 8 -*- */
++/* enchant
++ * Copyright (C) 2003,2004 Dom Lachowicz
++ *               2006 Harri Pitkänen
++ *               2006 Anssi Hannula <[EMAIL PROTECTED]>
++ *
++ * This library is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU Lesser General Public
++ * License as published by the Free Software Foundation; either
++ * version 2.1 of the License, or (at your option) any later version.
++ *
++ * This library 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
++ * Lesser General Public License for more details.
++ *
++ * You should have received a copy of the GNU Lesser General Public
++ * License along with this library; if not, write to the
++ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
++ * Boston, MA 02111-1307, USA.
++ *
++ * In addition, as a special exception, Dom Lachowicz
++ * gives permission to link the code of this program with
++ * non-LGPL Spelling Provider libraries (eg: a MSFT Office
++ * spell checker backend) and distribute linked combinations including
++ * the two.  You must obey the GNU Lesser General Public License in all
++ * respects for all of the code used other than said providers.  If you modify
++ * this file, you may extend this exception to your version of the
++ * file, but you are not obligated to do so.  If you do not wish to
++ * do so, delete this exception statement from your version.
++ */
++
++#include <stdio.h>
++#include <stdlib.h>
++#include <string.h>
++
++#include <glib.h>
++#include <libvoikko/voikko.h>
++
++#include "enchant.h"
++#include "enchant-provider.h"
++
++ENCHANT_PLUGIN_DECLARE("Voikko")
++
++static int
++voikko_dict_check (EnchantDict * me, const char *const word, size_t len)
++{
++      int result;
++      int voikko_handle;
++
++      if (word == NULL || len == 0)
++              return 0;
++      voikko_handle = (long) me->user_data;
++      result = voikko_spell_cstr(voikko_handle, word);
++      if (result == VOIKKO_SPELL_FAILED)
++              return 1;
++      else if (result == VOIKKO_SPELL_OK)
++              return 0;
++      else
++              return -1;
++}
++
++static char **
++voikko_dict_suggest (EnchantDict * me, const char *const word,
++                   size_t len, size_t * out_n_suggs)
++{
++      char **sugg_arr;
++      int voikko_handle;
++
++      if (word == NULL || len == 0)
++              return NULL;
++      voikko_handle = (long) me->user_data;
++      sugg_arr = voikko_suggest_cstr(voikko_handle, word);
++      if (sugg_arr == NULL)
++              return NULL;
++      for (*out_n_suggs = 0; sugg_arr[*out_n_suggs] != NULL; 
(*out_n_suggs)++);
++      return sugg_arr;
++}
++
++static EnchantDict *
++voikko_provider_request_dict (EnchantProvider * me, const char *const tag)
++{
++      EnchantDict *dict;
++      const char * voikko_error;
++      int voikko_handle;
++
++      /* Only Finnish is supported at the moment */
++      if (strncmp(tag, "fi_FI", 6) != 0 && strncmp(tag, "fi", 3) != 0)
++              return NULL;
++      
++      voikko_error = voikko_init(&voikko_handle, "fi_FI", 0);
++      if (voikko_error) {
++              enchant_provider_set_error(me, voikko_error);
++              return NULL;
++      }
++
++      dict = g_new0 (EnchantDict, 1);
++      dict->user_data = (void *)(long) voikko_handle;
++      dict->check = voikko_dict_check;
++      dict->suggest = voikko_dict_suggest;
++
++      return dict;
++}
++
++static void
++voikko_provider_dispose_dict (EnchantProvider * me, EnchantDict * dict)
++{
++      voikko_terminate((long) dict->user_data);
++      g_free (dict);
++}
++
++static char **
++voikko_provider_list_dicts (EnchantProvider * me, 
++                          size_t * out_n_dicts)
++{
++      char ** out_list = NULL;
++      int voikko_handle;
++      *out_n_dicts = 0;
++
++      if (voikko_init(&voikko_handle, "fi_FI", 0) == NULL) {
++              voikko_terminate(voikko_handle);
++              *out_n_dicts = 1;
++              out_list = g_new0 (char *, *out_n_dicts + 1);
++              out_list[0] = g_strdup("fi_FI");
++      }
++
++      return out_list;
++}
++
++static void
++voikko_provider_free_string_list (EnchantProvider * me, char **str_list)
++{
++      g_strfreev (str_list);
++}
++
++static void
++voikko_provider_dispose (EnchantProvider * me)
++{
++      g_free (me);
++}
++
++static char *
++voikko_provider_identify (EnchantProvider * me)
++{
++      return "voikko";
++}
++
++static char *
++voikko_provider_describe (EnchantProvider * me)
++{
++      return "Voikko Provider";
++}
++
++#ifdef __cplusplus
++extern "C" {
++#endif
++
++ENCHANT_MODULE_EXPORT (EnchantProvider *) 
++init_enchant_provider (void)
++{
++      EnchantProvider *provider;
++
++      provider = g_new0 (EnchantProvider, 1);
++      provider->dispose = voikko_provider_dispose;
++      provider->request_dict = voikko_provider_request_dict;
++      provider->dispose_dict = voikko_provider_dispose_dict;
++      provider->identify = voikko_provider_identify;
++      provider->describe = voikko_provider_describe;
++      provider->list_dicts = voikko_provider_list_dicts;
++      provider->free_string_list = voikko_provider_free_string_list;
++
++      return provider;
++}
++
++#ifdef __cplusplus
++}
++#endif

Modified: packages/cooker/enchant/current/SPECS/enchant.spec
==============================================================================
--- packages/cooker/enchant/current/SPECS/enchant.spec  (original)
+++ packages/cooker/enchant/current/SPECS/enchant.spec  Mon Feb 12 16:00:31 2007
@@ -11,7 +11,7 @@
 Source0:       
http://www.abisource.com/downloads/enchant/%{version}/%{name}-%{version}.tar.bz2
 # mpol: change default ordering for nl; first myspell
 Patch0:                enchant-1.2.0-ordering-nl.patch.bz2
-Patch1:                enchant-voikko-provider-mutexed.patch.bz2
+Patch1:                enchant-cvs-voikko-provider.patch
 BuildRequires: glib2-devel >= 2.0.0
 BuildRequires: aspell-devel
 BuildRequires: pkgconfig
@@ -89,7 +89,10 @@
 %{_libdir}/lib*.so.%{major}*
 %dir %{_libdir}/enchant
 # todo: split backends in seperate packages?
-# (anssi) nope. nothing would pull them, then
+# (anssi) Nope. Nothing would pull them, then.
+# But we could move them to /usr/lib/enchant-%major/
+# to allow simultaneous installation with future
+# libenchant2.
 %{_libdir}/enchant/lib*.so*
 
 %files -n %{libname}-devel

Reply via email to