rpms/lyx/devel lyx-1.6.5-enchant.patch, NONE, 1.1 lyx-1.6.5-xdg_open.patch, NONE, 1.1 .cvsignore, 1.40, 1.41 lyx.spec, 1.102, 1.103 sources, 1.38, 1.39 lyx-1.6.4-autoconf_2.64.patch, 1.1, NONE lyx-1.6.4-enchant.patch, 1.1, NONE lyx-1.6.4-xdg_open.patch, 1.1, NONE

José Abílio Oliveira Matos jamatos at fedoraproject.org
Wed Dec 9 23:08:29 UTC 2009


Author: jamatos

Update of /cvs/pkgs/rpms/lyx/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv6707

Modified Files:
	.cvsignore lyx.spec sources 
Added Files:
	lyx-1.6.5-enchant.patch lyx-1.6.5-xdg_open.patch 
Removed Files:
	lyx-1.6.4-autoconf_2.64.patch lyx-1.6.4-enchant.patch 
	lyx-1.6.4-xdg_open.patch 
Log Message:
* Wed Dec  9 2009 José Matos <jamatos at fc.up.pt> - 1.6.5-1
- lyx-1.6.5


lyx-1.6.5-enchant.patch:
 config.h.in                           |    3 
 config/spell.m4                       |   33 ++++++++-
 src/Enchant.cpp                       |  122 ++++++++++++++++++++++++++++++++++
 src/Enchant.h                         |   78 +++++++++++++++++++++
 src/Makefile.am                       |    9 +-
 src/frontends/qt4/GuiPrefs.cpp        |    6 +
 src/frontends/qt4/GuiSpellchecker.cpp |    9 +-
 src/frontends/qt4/GuiView.cpp         |    2 
 8 files changed, 251 insertions(+), 11 deletions(-)

--- NEW FILE lyx-1.6.5-enchant.patch ---
diff -ru --new-file lyx-1.6.5.orig/config/spell.m4 lyx-1.6.5/config/spell.m4
--- lyx-1.6.5.orig/config/spell.m4	2007-04-26 22:50:16.000000000 +0100
+++ lyx-1.6.5/config/spell.m4	2009-12-09 20:40:11.443642911 +0000
@@ -1,3 +1,23 @@
+# Macro to add for using enchant spellchecker libraries!     -*- sh -*-
+AC_DEFUN([CHECK_WITH_ENCHANT],
+[
+    lyx_use_enchant=true
+    AC_ARG_WITH(enchant,	AC_HELP_STRING([--with-enchant],[use Enchant libraries]))
+    test "$with_enchant" = "no" && lyx_use_enchant=false
+
+    if $lyx_use_enchant; then
+        PKG_CHECK_MODULES([ENCHANT], [enchant], [], [lyx_use_aspell=false])
+	AC_MSG_CHECKING([whether to use enchant])
+	if $lyx_use_enchant ; then
+	    AC_MSG_RESULT(yes)
+	    AC_DEFINE(USE_ENCHANT, 1, [Define as 1 to use the enchant library])
+	    lyx_flags="$lyx_flags use-enchant"
+	else
+	    AC_MSG_RESULT(no)
+	fi
+    fi
+    ])
+
 # Macro to add for using aspell spellchecker libraries!     -*- sh -*-
 # Only checks for "new" aspell, > 0.50
 AC_DEFUN([CHECK_WITH_ASPELL],
@@ -50,14 +70,18 @@
 ### Check if we want spell libraries, prefer new aspell
 AC_DEFUN([LYX_CHECK_SPELL_ENGINES],
 [
+    lyx_use_enchant=false
     lyx_use_aspell=false
     lyx_use_pspell=false
     lyx_use_ispell=false
 
-    dnl Prefer use of the aspell library over pspell.
-    CHECK_WITH_ASPELL
-    if $lyx_use_aspell ; then : ; else
-        CHECK_WITH_PSPELL
+    dnl Prefer in order of enchant, aspell, pspell
+    CHECK_WITH_ENCHANT
+    if $lyx_use_enchant ; then : ; else
+        CHECK_WITH_ASPELL
+        if $lyx_use_aspell ; then : ; else
+            CHECK_WITH_PSPELL
+        fi
     fi
 
     dnl check for the ability to communicate through unix pipes
@@ -76,6 +100,7 @@
       AC_MSG_RESULT(no)
     fi
 
+    AM_CONDITIONAL(USE_ENCHANT, $lyx_use_enchant)
     AM_CONDITIONAL(USE_ASPELL, $lyx_use_aspell)
     AM_CONDITIONAL(USE_PSPELL, $lyx_use_pspell)
     AM_CONDITIONAL(USE_ISPELL, $lyx_use_ispell)
diff -ru --new-file lyx-1.6.5.orig/config.h.in lyx-1.6.5/config.h.in
--- lyx-1.6.5.orig/config.h.in	2009-12-05 13:42:56.000000000 +0000
+++ lyx-1.6.5/config.h.in	2009-12-09 20:40:11.443642911 +0000
@@ -503,6 +503,9 @@
 /* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
 #undef TIME_WITH_SYS_TIME
 
+/* Define as 1 to use the enchant library */
+#undef USE_ENCHANT
+
 /* Define as 1 to use the aspell library */
 #undef USE_ASPELL
 
diff -ru --new-file lyx-1.6.5.orig/src/Enchant.cpp lyx-1.6.5/src/Enchant.cpp
--- lyx-1.6.5.orig/src/Enchant.cpp	1970-01-01 01:00:00.000000000 +0100
+++ lyx-1.6.5/src/Enchant.cpp	2009-12-09 20:40:11.472766701 +0000
@@ -0,0 +1,122 @@
+/**
+ * \file Enchant.cpp
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
+ *
+ * \author Caolán McNamara
+ *
+ * Full author contact details are available in file CREDITS.
+ */
+
+#include <config.h>
+
+#include "support/debug.h"
+
+#include <enchant++.h>
+
+#include "Enchant.h"
+#include "LyXRC.h"
+#include "WordLangTuple.h"
+
+#include "support/lassert.h"
+
+using namespace std;
+
+namespace lyx {
+
+Enchant::Enchant(BufferParams const &, string const & lang)
+{
+	addSpeller(lang);
+}
+
+
+Enchant::~Enchant()
+{
+	Spellers::iterator it = spellers_.begin();
+	Spellers::iterator end = spellers_.end();
+
+	for (; it != end; ++it) {
+		delete it->second.speller;
+	}
+}
+
+
+void Enchant::addSpeller(string const & lang)
+{
+	enchant::Broker * instance = enchant::Broker::instance();
+	enchant::Dict * dict = instance->request_dict(lang);
+
+	if (dict) {
+		Speller m;
+		m.speller = dict;
+		spellers_[lang] = m;
+	}
+}
+
+
+Enchant::Result Enchant::check(WordLangTuple const & word)
+{
+	Result res = UNKNOWN_WORD;
+
+	Spellers::iterator it = spellers_.find(word.lang_code());
+	if (it == spellers_.end()) {
+		addSpeller(word.lang_code());
+		it = spellers_.find(word.lang_code());
+		// FIXME
+		if (it == spellers_.end())
+			return res;
+	}
+
+	enchant::Dict * m = it->second.speller;
+
+	std::string utf8word(to_utf8(word.word()));
+
+	if (m->check(utf8word))
+		return OK;
+
+	m->suggest(utf8word, els);
+	if (els.empty())
+		res = UNKNOWN_WORD;
+	else
+		res = SUGGESTED_WORDS;
+
+	return res;
+}
+
+
+void Enchant::insert(WordLangTuple const & word)
+{
+	Spellers::iterator it = spellers_.find(word.lang_code());
+	if (it != spellers_.end())
+		it->second.speller->add(to_utf8(word.word()));
+}
+
+
+void Enchant::accept(WordLangTuple const & word)
+{
+	Spellers::iterator it = spellers_.find(word.lang_code());
+	if (it != spellers_.end())
+		it->second.speller->add_to_session(to_utf8(word.word()));
+}
+
+
+docstring const Enchant::nextMiss()
+{
+	docstring str;
+
+	if (!els.empty()) {
+		str = from_utf8(els.front());
+		els.erase(els.begin());
+	}
+
+	return str;
+}
+
+
+docstring const Enchant::error()
+{
+	return docstring();
+}
+
+
+} // namespace lyx
diff -ru --new-file lyx-1.6.5.orig/src/Enchant.h lyx-1.6.5/src/Enchant.h
--- lyx-1.6.5.orig/src/Enchant.h	1970-01-01 01:00:00.000000000 +0100
+++ lyx-1.6.5/src/Enchant.h	2009-12-09 20:40:11.472766701 +0000
@@ -0,0 +1,78 @@
+// -*- C++ -*-
+/**
+ * \file Enchant.h
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
+ *
+ * \author Caolán McNamara
+ *
+ * Full author contact details are available in file CREDITS.
+ */
+
+#ifndef LYX_ENCHANT_H
+#define LYX_ENCHANT_H
+
+#include "SpellBase.h"
+
+#include <map>
+#include <string>
+
+namespace enchant {
+    class Dict;
+}
+
+namespace lyx {
+
+class BufferParams;
+
+
+class Enchant : public SpellBase {
+public:
+	/**
+	 * Initialise the spellchecker with the given buffer params and language.
+	 */
+	Enchant(BufferParams const & params, std::string const & lang);
+
+	virtual ~Enchant();
+
+	/**
+	 * return true if the spellchecker instance still exists
+	 * Always true for enchant, since there is no separate process
+	 */
+	virtual bool alive() { return true; }
+
+	/// check the given word and return the result
+	virtual enum Result check(WordLangTuple const &);
+
+	/// insert the given word into the personal dictionary
+	virtual void insert(WordLangTuple const &);
+
+	/// accept the given word temporarily
+	virtual void accept(WordLangTuple const &);
+
+	/// return the next near miss after a SUGGESTED_WORDS result
+	virtual docstring const nextMiss();
+
+	/// give an error message on messy exit
+	virtual docstring const error();
+
+private:
+	/// add a speller of the given language
+	void addSpeller(std::string const & lang);
+
+	struct Speller {
+		enchant::Dict* speller;
+	};
+
+	typedef std::map<std::string, Speller> Spellers;
+
+	/// the spellers
+	Spellers spellers_;
+
+        std::vector<std::string> els;
+};
+
+
+} // namespace lyx
+
+#endif // LYX_ENCHANT_H
diff -ru --new-file lyx-1.6.5.orig/src/frontends/qt4/GuiPrefs.cpp lyx-1.6.5/src/frontends/qt4/GuiPrefs.cpp
--- lyx-1.6.5.orig/src/frontends/qt4/GuiPrefs.cpp	2009-10-24 18:10:48.000000000 +0100
+++ lyx-1.6.5/src/frontends/qt4/GuiPrefs.cpp	2009-12-09 20:40:11.467788824 +0000
@@ -1148,6 +1148,9 @@
 	spellCommandCO->addItem(qt_("ispell"));
 	spellCommandCO->addItem(qt_("aspell"));
 	spellCommandCO->addItem(qt_("hspell"));
+#ifdef USE_ENCHANT
+	spellCommandCO->addItem(qt_("enchant (library)"));
+#else
 #ifdef USE_PSPELL
 	spellCommandCO->addItem(qt_("pspell (library)"));
 #else
@@ -1155,6 +1158,7 @@
 	spellCommandCO->addItem(qt_("aspell (library)"));
 #endif
 #endif
+#endif
 }
 
 
@@ -1199,7 +1203,7 @@
 	}
 
 	if (rc.use_spell_lib) {
-#if defined(USE_ASPELL) || defined(USE_PSPELL)
+#if defined(USE_ENCHANT) || defined(USE_ASPELL) || defined(USE_PSPELL)
 		spellCommandCO->setCurrentIndex(3);
 #endif
 	}
diff -ru --new-file lyx-1.6.5.orig/src/frontends/qt4/GuiSpellchecker.cpp lyx-1.6.5/src/frontends/qt4/GuiSpellchecker.cpp
--- lyx-1.6.5.orig/src/frontends/qt4/GuiSpellchecker.cpp	2009-07-08 12:03:41.000000000 +0100
+++ lyx-1.6.5/src/frontends/qt4/GuiSpellchecker.cpp	2009-12-09 20:40:11.469773116 +0000
@@ -32,7 +32,9 @@
 
 #include <QListWidgetItem>
 
-#if defined(USE_ASPELL)
+#if defined(USE_ENCHANT)
+# include "Enchant.h"
+#elif defined(USE_ASPELL)
 # include "ASpell_local.h"
 #elif defined(USE_PSPELL)
 # include "PSpell.h"
@@ -205,7 +207,10 @@
 		      ? lyxrc.isp_alt_lang
 		      : bp.language->code();
 
-#if defined(USE_ASPELL)
+#if defined(USE_ENCHANT)
+	if (lyxrc.use_spell_lib)
+		return new Enchant(bp, lang);
+#elif defined(USE_ASPELL)
 	if (lyxrc.use_spell_lib)
 		return new ASpell(bp, lang);
 #elif defined(USE_PSPELL)
diff -ru --new-file lyx-1.6.5.orig/src/frontends/qt4/GuiView.cpp lyx-1.6.5/src/frontends/qt4/GuiView.cpp
--- lyx-1.6.5.orig/src/frontends/qt4/GuiView.cpp	2009-08-31 08:37:56.000000000 +0100
+++ lyx-1.6.5/src/frontends/qt4/GuiView.cpp	2009-12-09 20:40:11.470768301 +0000
@@ -1232,7 +1232,7 @@
 		else if (name == "latexlog")
 			enable = FileName(buf->logName()).isReadableFile();
 		else if (name == "spellchecker")
-#if defined (USE_ASPELL) || defined (USE_ISPELL) || defined (USE_PSPELL)
+#if defined (USE_ENCHANT) || defined (USE_ASPELL) || defined (USE_ISPELL) || defined (USE_PSPELL)
 			enable = !buf->isReadonly();
 #else
 			enable = false;
diff -ru --new-file lyx-1.6.5.orig/src/Makefile.am lyx-1.6.5/src/Makefile.am
--- lyx-1.6.5.orig/src/Makefile.am	2009-09-13 21:49:30.000000000 +0100
+++ lyx-1.6.5/src/Makefile.am	2009-12-09 20:42:57.038771937 +0000
@@ -4,7 +4,7 @@
 
 DISTCLEANFILES += config.h libintl.h
 
-AM_CPPFLAGS += $(PCH_FLAGS) -I$(top_srcdir)/src $(BOOST_INCLUDES)
+AM_CPPFLAGS += $(PCH_FLAGS) -I$(top_srcdir)/src $(BOOST_INCLUDES) $(ENCHANT_CFLAGS)
 AM_CPPFLAGS += $(QT4_CPPFLAGS) $(QT4_CORE_INCLUDES)
 
 if BUILD_CLIENT_SUBDIR
@@ -20,7 +20,7 @@
 	paper.h \
 	pch.h
 
-OTHERLIBS = $(BOOST_LIBS) $(INTLLIBS) $(MYTHES_LIBS) $(AIKSAURUS_LIBS) @LIBS@ $(SOCKET_LIBS) $(LIBPSAPI)
+OTHERLIBS = $(BOOST_LIBS) $(INTLLIBS) $(MYTHES_LIBS) $(AIKSAURUS_LIBS) $(ENCHANT_LIBS) @LIBS@ $(SOCKET_LIBS) $(LIBPSAPI)
 
 noinst_LTLIBRARIES = liblyxcore.la
 bin_PROGRAMS = lyx
@@ -46,6 +46,9 @@
 
 BUILT_SOURCES = $(PCH_FILE)
 
+if USE_ENCHANT
+ENCHANT = Enchant.cpp Enchant.h
+endif
 if USE_ASPELL
 ASPELL = ASpell.cpp ASpell_local.h
 endif
@@ -62,7 +65,7 @@
 # and in fact libtools seems not able to do that.
 lyx_SOURCES = \
 	main.cpp \
-	$(ASPELL) $(PSPELL) $(ISPELL) SpellBase.cpp \
+	$(ENCHANT) $(ASPELL) $(PSPELL) $(ISPELL) SpellBase.cpp \
 	BiblioInfo.h \
 	BiblioInfo.cpp \
 	Box.cpp \

lyx-1.6.5-xdg_open.patch:
 configure.py |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

--- NEW FILE lyx-1.6.5-xdg_open.patch ---
diff -up lyx-1.6.4/lib/configure.py.xdg_open lyx-1.6.4/lib/configure.py
--- lyx-1.6.4/lib/configure.py.xdg_open	2009-08-13 07:16:07.000000000 -0500
+++ lyx-1.6.4/lib/configure.py	2009-08-22 08:56:01.332263836 -0500
@@ -264,7 +264,7 @@ def checkFormatEntries(dtl_tools):  
     checkViewer('a FEN viewer and editor', ['xboard -lpf $$i -mode EditPosition'],
         rc_entry = [r'\Format fen        fen     FEN                    "" "%%"	"%%"	""'])
     #
-    path, iv = checkViewer('a raster image viewer', ['xv', 'kview', 'gimp-remote', 'gimp'])
+    path, iv = checkViewer('a raster image viewer', ['xdg-open', 'xv', 'kview', 'gimp-remote', 'gimp'])
     path, ie = checkViewer('a raster image editor', ['gimp-remote', 'gimp'])
     addToRC(r'''\Format bmp        bmp     BMP                    "" "%s"	"%s"	""
 \Format gif        gif     GIF                    "" "%s"	"%s"	""
@@ -307,23 +307,23 @@ def checkFormatEntries(dtl_tools):  
     #
     #checkProg('a Postscript interpreter', ['gs'],
     #  rc_entry = [ r'\ps_command "%%"' ])
-    checkViewer('a Postscript previewer', ['kghostview', 'okular', 'evince', 'gv', 'ghostview -swap'],
+    checkViewer('a Postscript previewer', ['xdg-open', 'okular', 'kghostview', 'evince', 'gv', 'ghostview -swap'],
         rc_entry = [r'''\Format eps        eps     EPS                    "" "%%"	""	"vector"
 \Format ps         ps      Postscript             t  "%%"	""	"document,vector"'''])
     #
-    checkViewer('a PDF previewer', ['kpdf', 'okular', 'evince', 'kghostview', 'xpdf', 'acrobat', 'acroread', \
+    checkViewer('a PDF previewer', ['xdg-open', 'okular', 'kpdf', 'evince', 'kghostview', 'xpdf', 'acrobat', 'acroread', \
 		    'gv', 'ghostview'],
         rc_entry = [r'''\Format pdf        pdf    "PDF (ps2pdf)"          P  "%%"	""	"document,vector"
 \Format pdf2       pdf    "PDF (pdflatex)"        F  "%%"	""	"document,vector"
 \Format pdf3       pdf    "PDF (dvipdfm)"         m  "%%"	""	"document,vector"'''])
     #
-    checkViewer('a DVI previewer', ['xdvi', 'kdvi', 'okular', 'dviout -Set=!m'],
+    checkViewer('a DVI previewer', ['xdg-open', 'xdvi', 'kdvi', 'okular', 'dviout -Set=!m'],
         rc_entry = [r'\Format dvi        dvi     DVI                    D  "%%"	""	"document,vector"'])
     if dtl_tools:
         # Windows only: DraftDVI
         addToRC(r'\Format dvi2       dvi     DraftDVI               ""	""	""	"vector"')
     #
-    checkViewer('an HTML previewer', ['firefox', 'mozilla file://$$p$$i', 'netscape'],
+    checkViewer('an HTML previewer', ['xdg-open', 'htmlview', 'firefox', 'mozilla file://$$p$$i', 'netscape'],
         rc_entry = [r'\Format html       html    HTML                   H  "%%"	""	"document"'])
     #
     checkViewer('Noteedit', ['noteedit'],


Index: .cvsignore
===================================================================
RCS file: /cvs/pkgs/rpms/lyx/devel/.cvsignore,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -p -r1.40 -r1.41
--- .cvsignore	22 Aug 2009 18:07:28 -0000	1.40
+++ .cvsignore	9 Dec 2009 23:08:28 -0000	1.41
@@ -1 +1,2 @@
 lyx-1.6.4.tar.bz2
+lyx-1.6.5.tar.bz2


Index: lyx.spec
===================================================================
RCS file: /cvs/pkgs/rpms/lyx/devel/lyx.spec,v
retrieving revision 1.102
retrieving revision 1.103
diff -u -p -r1.102 -r1.103
--- lyx.spec	19 Nov 2009 21:12:42 -0000	1.102
+++ lyx.spec	9 Dec 2009 23:08:29 -0000	1.103
@@ -23,8 +23,8 @@ BuildRequires: fontpackages-devel
 
 Summary: WYSIWYM (What You See Is What You Mean) document processor
 Name:	 lyx
-Version: 1.6.4
-Release: 3%{?dist}
+Version: 1.6.5
+Release: 1%{?dist}
 
 License: GPLv2+
 Group: 	 Applications/Publishing
@@ -33,11 +33,10 @@ Url: 	 http://www.lyx.org/
 Source0: ftp://ftp.devel.lyx.org/pub/lyx/stable/lyx-%{version}%{?pre}.tar.bz2
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
-Patch1: lyx-1.6.4-xdg_open.patch
-Patch2: lyx-1.6.4-autoconf_2.64.patch
+Patch1: lyx-1.6.5-xdg_open.patch
 ## upstreamed patches
 # http://bugzilla.redhat.com/524046 , http://www.lyx.org/trc/ticket/6226
-Patch50: lyx-1.6.4-enchant.patch
+Patch50: lyx-1.6.5-enchant.patch
 
 Source1: lyxrc.dist
 
@@ -246,7 +245,6 @@ Requires: %{fontname}-fonts-common = %{v
 %setup -q -n %{name}-%{version}%{?pre}
 
 %patch1 -p1 -b .xdg_open
-%patch2 -p1 -b .autoconf_2.64
 
 %patch50 -p1 -b .enchant
 
@@ -448,6 +446,9 @@ fc-cache %{_fontdir} 2> /dev/null ||:
 
 
 %changelog
+* Wed Dec  9 2009 José Matos <jamatos at fc.up.pt> - 1.6.5-1
+- lyx-1.6.5
+
 * Thu Nov 19 2009 José Matos <jamatos at fc.up.pt> - 1.6.4-3
 - LyX supports autoconf 2.64 (should be upstream for 1.6.5)
 


Index: sources
===================================================================
RCS file: /cvs/pkgs/rpms/lyx/devel/sources,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -p -r1.38 -r1.39
--- sources	22 Aug 2009 18:07:28 -0000	1.38
+++ sources	9 Dec 2009 23:08:29 -0000	1.39
@@ -1 +1,2 @@
 3dd759f91acd7765c304336c51aa3a2a  lyx-1.6.4.tar.bz2
+35a10d8cb8e4bdd296092d9d981330c9  lyx-1.6.5.tar.bz2


--- lyx-1.6.4-autoconf_2.64.patch DELETED ---


--- lyx-1.6.4-enchant.patch DELETED ---


--- lyx-1.6.4-xdg_open.patch DELETED ---




More information about the fedora-extras-commits mailing list