Package: icedove
Version: 1.5.0.10.dfsg1-3
Severity: important
Tags: patch

myspell is being obsoleted by hunspell and there is a plan to make
the myspell dictionaries directory to the hunspell one (to make it
easier to transition the dictionary packages).

Unfortunately, while hunspell can use myspell dictionaries, myspell
can't use hunspell ones.

While icedove doesn't build using the system myspell, it uses an
internal version, and thus is also prone to break with hunspell
dictionaries soon.

Attached here is a patch to make the myspell component use an external
hunspell instead of the internal myspell. You should add
--enable-system-hunspell to the configure command line, and build
depend on libhunspell-dev (>= 1.1.5-2). Note that if you don't add
--enable-system-hunspell, the patched icedove would successfully build
using the internal myspell.

Cheers

Mike
--- icedove/configure.in.orig
+++ icedove/configure.in
@@ -3755,6 +3755,19 @@
 
 AC_DEFINE_UNQUOTED(MOZ_DEFAULT_TOOLKIT,"$MOZ_WIDGET_TOOLKIT")
 
+dnl system HunSpell Support
+dnl ========================================================
+MOZ_ARG_ENABLE_BOOL(system-hunspell,
+[  --enable-system-hunspell  Use system hunspell (located with pkgconfig)],
+    SYSTEM_HUNSPELL=1 )
+
+if test -n "$SYSTEM_HUNSPELL"; then
+    PKG_CHECK_MODULES(MOZ_HUNSPELL, hunspell)
+fi
+
+AC_SUBST(SYSTEM_HUNSPELL)
+AC_SUBST(MOZ_HUNSPELL_LIBS)
+
 dnl ========================================================
 dnl = Enable the toolkit as needed                         =
 dnl ========================================================
--- icedove/config/autoconf.mk.in.orig
+++ icedove/config/autoconf.mk.in
@@ -182,6 +182,10 @@
 NECKO_SMALL_BUFFERS = @NECKO_SMALL_BUFFERS@
 NECKO_COOKIES = @NECKO_COOKIES@
 
+MOZ_NATIVE_HUNSPELL = @SYSTEM_HUNSPELL@
+MOZ_HUNSPELL_LIBS = @MOZ_HUNSPELL_LIBS@
+MOZ_HUNSPELL_CFLAGS = @MOZ_HUNSPELL_CFLAGS@
+
 MOZ_NATIVE_ZLIB	= @SYSTEM_ZLIB@
 MOZ_NATIVE_JPEG	= @SYSTEM_JPEG@
 MOZ_NATIVE_PNG	= @SYSTEM_PNG@
--- icedove/extensions/spellcheck/myspell/src/mozMySpell.h.orig
+++ icedove/extensions/spellcheck/myspell/src/mozMySpell.h
@@ -56,7 +56,12 @@
 #ifndef mozMySpell_h__
 #define mozMySpell_h__
 
+#if MOZ_NATIVE_HUNSPELL
+#include "hunspell.hxx"
+#define MySpell Hunspell
+#else
 #include "myspell.hxx"
+#endif
 #include "mozISpellCheckingEngine.h"
 #include "mozIPersonalDictionary.h"
 #include "nsString.h"
--- icedove/extensions/spellcheck/myspell/src/Makefile.in.orig
+++ icedove/extensions/spellcheck/myspell/src/Makefile.in
@@ -59,21 +59,30 @@
 		  spellchecker \
 		  $(NULL)
 
-CPPSRCS =         affentry.cpp \
+CPPSRCS =	  mozMySpell.cpp \
+		  mozMySpellFactory.cpp \
+                  $(NULL)
+
+ifndef MOZ_NATIVE_HUNSPELL
+CPPSRCS +=         affentry.cpp \
 		  affixmgr.cpp \
 		  hashmgr.cpp \
 		  suggestmgr.cpp \
 		  csutil.cpp \
 		  myspell.cpp \
-		  mozMySpell.cpp \
-		  mozMySpellFactory.cpp \
                   $(NULL)
+endif
 
 EXTRA_DSO_LDOPTS = \
 		$(LIBS_DIR) \
 		$(XPCOM_LIBS) \
 		$(NSPR_LIBS) \
 		$(MOZ_UNICHARUTIL_LIBS) \
+		$(MOZ_HUNSPELL_LIBS) \
 		$(NULL)
 
 include $(topsrcdir)/config/rules.mk
+
+ifdef MOZ_NATIVE_HUNSPELL
+CXXFLAGS += $(MOZ_HUNSPELL_CFLAGS) -DMOZ_NATIVE_HUNSPELL
+endif

Reply via email to