rpms/weechat/devel weechat-cmake-paths.patch, NONE, 1.1 weechat-cmake-pie.patch, NONE, 1.1 weechat-enchant.patch, NONE, 1.1 .cvsignore, 1.9, 1.10 sources, 1.9, 1.10 weechat.spec, 1.16, 1.17 weechat-0.3.0-cmake-paths.patch, 1.1, NONE weechat-0.3.0-cmake-pie.patch, 1.1, NONE weechat-gitHEAD.enchant.patch, 1.1, NONE
Paul P Komkoff Jr
stingray at fedoraproject.org
Fri May 7 09:24:13 UTC 2010
Author: stingray
Update of /cvs/pkgs/rpms/weechat/devel
In directory cvs01.phx2.fedoraproject.org:/tmp/cvs-serv5968
Modified Files:
.cvsignore sources weechat.spec
Added Files:
weechat-cmake-paths.patch weechat-cmake-pie.patch
weechat-enchant.patch
Removed Files:
weechat-0.3.0-cmake-paths.patch weechat-0.3.0-cmake-pie.patch
weechat-gitHEAD.enchant.patch
Log Message:
weechat-0.3.2-1
weechat-cmake-paths.patch:
CMakeLists.txt | 28 +++++++---------------------
src/plugins/CMakeLists.txt | 2 ++
src/plugins/alias/CMakeLists.txt | 2 +-
src/plugins/aspell/CMakeLists.txt | 2 +-
src/plugins/charset/CMakeLists.txt | 2 +-
src/plugins/demo/CMakeLists.txt | 2 +-
src/plugins/fifo/CMakeLists.txt | 2 +-
src/plugins/irc/CMakeLists.txt | 2 +-
src/plugins/logger/CMakeLists.txt | 2 +-
src/plugins/relay/CMakeLists.txt | 2 +-
src/plugins/scripts/lua/CMakeLists.txt | 2 +-
src/plugins/scripts/perl/CMakeLists.txt | 2 +-
src/plugins/scripts/python/CMakeLists.txt | 2 +-
src/plugins/scripts/ruby/CMakeLists.txt | 2 +-
src/plugins/scripts/tcl/CMakeLists.txt | 2 +-
src/plugins/xfer/CMakeLists.txt | 2 +-
16 files changed, 23 insertions(+), 35 deletions(-)
--- NEW FILE weechat-cmake-paths.patch ---
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8cce7fe..5f2fb3b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -32,27 +32,13 @@ SET(VERSION_PATCH "2")
SET(VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH})
SET(LICENSE "GPL3")
SET(PKG_STRING "${PROJECT_NAME} ${VERSION}")
-STRING(REPLACE "\";\"" "\ " PKG_STRING ${PKG_STRING})
-
-IF(DEFINED LIBDIR)
- SET(LIBDIR ${LIBDIR}/${PROJECT_NAME})
-ELSE(DEFINED LIBDIR)
- SET(LIBDIR ${CMAKE_INSTALL_PREFIX}/lib/${PROJECT_NAME})
-ENDIF(DEFINED LIBDIR)
-IF(NOT DEFINED SHAREDIR)
- SET(SHAREDIR ${CMAKE_INSTALL_PREFIX}/share)
-ENDIF(NOT DEFINED SHAREDIR)
+SET(LIBDIR ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}/${PROJECT_NAME})
+SET(SHAREDIR ${CMAKE_INSTALL_PREFIX}/share)
+SET(LOCALEDIR ${CMAKE_INSTALL_PREFIX}/share/locale)
+SET(INCLUDEDIR ${CMAKE_INSTALL_PREFIX}/include/${PROJECT_NAME})
-IF(NOT DEFINED LOCALEDIR)
- SET(LOCALEDIR ${SHAREDIR}/locale)
-ENDIF(NOT DEFINED LOCALEDIR)
-
-IF(DEFINED INCLUDEDIR)
- SET(INCLUDEDIR ${INCLUDEDIR}/${PROJECT_NAME})
-ELSE(DEFINED INCLUDEDIR)
- SET(INCLUDEDIR ${CMAKE_INSTALL_PREFIX}/include/${PROJECT_NAME})
-ENDIF(DEFINED INCLUDEDIR)
+STRING(REPLACE "\";\"" "\ " PKG_STRING ${PKG_STRING})
OPTION(DISABLE_NCURSES "Disable Ncurses interface")
OPTION(ENABLE_GTK "Enable GTK interface")
@@ -108,10 +94,10 @@ ADD_CUSTOM_TARGET(dist
SET(PACKAGE "${PROJECT_NAME}")
SET(prefix "${CMAKE_INSTALL_PREFIX}")
SET(exec_prefix "\${prefix}")
-SET(libdir "\${exec_prefix}/lib")
+SET(libdir "\${exec_prefix}/lib${LIB_SUFFIX}")
SET(includedir "\${prefix}/include")
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/weechat.pc.in ${CMAKE_CURRENT_BINARY_DIR}/weechat.pc @ONLY)
-INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/weechat.pc DESTINATION ${LIBDIR}/../pkgconfig)
+INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/weechat.pc DESTINATION ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}/pkgconfig)
# packages
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Fast, light and extensible chat client")
diff --git a/src/plugins/CMakeLists.txt b/src/plugins/CMakeLists.txt
index e4f0a84..a24c693 100644
--- a/src/plugins/CMakeLists.txt
+++ b/src/plugins/CMakeLists.txt
@@ -23,6 +23,8 @@ plugin-config.h plugin-config.c)
INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR})
ADD_LIBRARY(weechat_plugins STATIC ${LIB_PLUGINS_SRC})
+SET(PLUGIN_INSTALL_DIR lib${LIB_SUFFIX}/${PROJECT_NAME}/plugins)
+
INCLUDE(CheckIncludeFiles)
INCLUDE(CheckFunctionExists)
INCLUDE(CheckLibraryExists)
diff --git a/src/plugins/alias/CMakeLists.txt b/src/plugins/alias/CMakeLists.txt
index b9b0c0b..5d25f42 100644
--- a/src/plugins/alias/CMakeLists.txt
+++ b/src/plugins/alias/CMakeLists.txt
@@ -22,4 +22,4 @@ SET_TARGET_PROPERTIES(alias PROPERTIES PREFIX "")
TARGET_LINK_LIBRARIES(alias)
-INSTALL(TARGETS alias LIBRARY DESTINATION ${LIBDIR}/plugins)
+INSTALL(TARGETS alias LIBRARY DESTINATION ${PLUGIN_INSTALL_DIR})
diff --git a/src/plugins/aspell/CMakeLists.txt b/src/plugins/aspell/CMakeLists.txt
index ed3c408..5cadbac 100644
--- a/src/plugins/aspell/CMakeLists.txt
+++ b/src/plugins/aspell/CMakeLists.txt
@@ -25,4 +25,4 @@ IF(ASPELL_FOUND)
TARGET_LINK_LIBRARIES(aspell ${ASPELL_LIBRARY})
ENDIF(ASPELL_FOUND)
-INSTALL(TARGETS aspell LIBRARY DESTINATION ${LIBDIR}/plugins)
+INSTALL(TARGETS aspell LIBRARY DESTINATION ${PLUGIN_INSTALL_DIR})
diff --git a/src/plugins/charset/CMakeLists.txt b/src/plugins/charset/CMakeLists.txt
index eee2eb7..58a0868 100644
--- a/src/plugins/charset/CMakeLists.txt
+++ b/src/plugins/charset/CMakeLists.txt
@@ -26,4 +26,4 @@ IF(ICONV_FOUND)
ENDIF(ICONV_LIBRARY)
ENDIF(ICONV_FOUND)
-INSTALL(TARGETS charset LIBRARY DESTINATION ${LIBDIR}/plugins)
+INSTALL(TARGETS charset LIBRARY DESTINATION ${PLUGIN_INSTALL_DIR})
diff --git a/src/plugins/demo/CMakeLists.txt b/src/plugins/demo/CMakeLists.txt
index 99ff266..f0d51ee 100644
--- a/src/plugins/demo/CMakeLists.txt
+++ b/src/plugins/demo/CMakeLists.txt
@@ -19,4 +19,4 @@ SET_TARGET_PROPERTIES(demo PROPERTIES PREFIX "")
TARGET_LINK_LIBRARIES(demo)
-INSTALL(TARGETS demo LIBRARY DESTINATION ${LIBDIR}/plugins)
+INSTALL(TARGETS demo LIBRARY DESTINATION ${PLUGIN_INSTALL_DIR})
diff --git a/src/plugins/fifo/CMakeLists.txt b/src/plugins/fifo/CMakeLists.txt
index b7c43e2..23bbe15 100644
--- a/src/plugins/fifo/CMakeLists.txt
+++ b/src/plugins/fifo/CMakeLists.txt
@@ -21,4 +21,4 @@ SET_TARGET_PROPERTIES(fifo PROPERTIES PREFIX "")
TARGET_LINK_LIBRARIES(fifo)
-INSTALL(TARGETS fifo LIBRARY DESTINATION ${LIBDIR}/plugins)
+INSTALL(TARGETS fifo LIBRARY DESTINATION ${PLUGIN_INSTALL_DIR})
diff --git a/src/plugins/irc/CMakeLists.txt b/src/plugins/irc/CMakeLists.txt
index 65a22a6..568fc21 100644
--- a/src/plugins/irc/CMakeLists.txt
+++ b/src/plugins/irc/CMakeLists.txt
@@ -55,4 +55,4 @@ ENDIF(GCRYPT_FOUND)
TARGET_LINK_LIBRARIES(irc ${LINK_LIBS})
-INSTALL(TARGETS irc LIBRARY DESTINATION ${LIBDIR}/plugins)
+INSTALL(TARGETS irc LIBRARY DESTINATION ${PLUGIN_INSTALL_DIR})
diff --git a/src/plugins/logger/CMakeLists.txt b/src/plugins/logger/CMakeLists.txt
index 7865abb..413ee2b 100644
--- a/src/plugins/logger/CMakeLists.txt
+++ b/src/plugins/logger/CMakeLists.txt
@@ -24,4 +24,4 @@ SET_TARGET_PROPERTIES(logger PROPERTIES PREFIX "")
TARGET_LINK_LIBRARIES(logger)
-INSTALL(TARGETS logger LIBRARY DESTINATION ${LIBDIR}/plugins)
+INSTALL(TARGETS logger LIBRARY DESTINATION ${PLUGIN_INSTALL_DIR})
diff --git a/src/plugins/relay/CMakeLists.txt b/src/plugins/relay/CMakeLists.txt
index 401e61c..2e87109 100644
--- a/src/plugins/relay/CMakeLists.txt
+++ b/src/plugins/relay/CMakeLists.txt
@@ -30,4 +30,4 @@ SET_TARGET_PROPERTIES(relay PROPERTIES PREFIX "")
TARGET_LINK_LIBRARIES(relay)
-INSTALL(TARGETS relay LIBRARY DESTINATION ${LIBDIR}/plugins)
+INSTALL(TARGETS relay LIBRARY DESTINATION ${PLUGIN_INSTALL_DIR})
diff --git a/src/plugins/scripts/lua/CMakeLists.txt b/src/plugins/scripts/lua/CMakeLists.txt
index eede053..3c9d00a 100644
--- a/src/plugins/scripts/lua/CMakeLists.txt
+++ b/src/plugins/scripts/lua/CMakeLists.txt
@@ -28,4 +28,4 @@ IF(LUA_FOUND)
ENDIF(LUA_LIBRARY AND LUALIB_LIBRARY)
ENDIF(LUA_FOUND)
-INSTALL(TARGETS lua LIBRARY DESTINATION ${LIBDIR}/plugins)
+INSTALL(TARGETS lua LIBRARY DESTINATION ${PLUGIN_INSTALL_DIR})
diff --git a/src/plugins/scripts/perl/CMakeLists.txt b/src/plugins/scripts/perl/CMakeLists.txt
index 4fde8fc..6916689 100644
--- a/src/plugins/scripts/perl/CMakeLists.txt
+++ b/src/plugins/scripts/perl/CMakeLists.txt
@@ -35,4 +35,4 @@ IF(PERL_FOUND)
ENDIF(PERL_DYNALOADER)
ENDIF(PERL_FOUND)
-INSTALL(TARGETS perl LIBRARY DESTINATION ${LIBDIR}/plugins)
+INSTALL(TARGETS perl LIBRARY DESTINATION ${PLUGIN_INSTALL_DIR})
diff --git a/src/plugins/scripts/python/CMakeLists.txt b/src/plugins/scripts/python/CMakeLists.txt
index 484df59..2204831 100644
--- a/src/plugins/scripts/python/CMakeLists.txt
+++ b/src/plugins/scripts/python/CMakeLists.txt
@@ -25,4 +25,4 @@ IF(PYTHON_FOUND)
TARGET_LINK_LIBRARIES(python ${PYTHON_LIBRARY} weechat_scripts)
ENDIF(PYTHON_FOUND)
-INSTALL(TARGETS python LIBRARY DESTINATION ${LIBDIR}/plugins)
+INSTALL(TARGETS python LIBRARY DESTINATION ${PLUGIN_INSTALL_DIR})
diff --git a/src/plugins/scripts/ruby/CMakeLists.txt b/src/plugins/scripts/ruby/CMakeLists.txt
index f9b8538..2ab4d3f 100644
--- a/src/plugins/scripts/ruby/CMakeLists.txt
+++ b/src/plugins/scripts/ruby/CMakeLists.txt
@@ -24,4 +24,4 @@ IF(RUBY_FOUND)
TARGET_LINK_LIBRARIES(ruby ${RUBY_LIBRARY} weechat_scripts)
ENDIF(RUBY_FOUND)
-INSTALL(TARGETS ruby LIBRARY DESTINATION ${LIBDIR}/plugins)
+INSTALL(TARGETS ruby LIBRARY DESTINATION ${PLUGIN_INSTALL_DIR})
diff --git a/src/plugins/scripts/tcl/CMakeLists.txt b/src/plugins/scripts/tcl/CMakeLists.txt
index 1ac87f2..586f6e5 100644
--- a/src/plugins/scripts/tcl/CMakeLists.txt
+++ b/src/plugins/scripts/tcl/CMakeLists.txt
@@ -29,4 +29,4 @@ IF(TCL_FOUND)
ENDIF(TCL_FOUND)
-INSTALL(TARGETS tcl LIBRARY DESTINATION ${LIBDIR}/plugins)
+INSTALL(TARGETS tcl LIBRARY DESTINATION ${PLUGIN_INSTALL_DIR})
diff --git a/src/plugins/xfer/CMakeLists.txt b/src/plugins/xfer/CMakeLists.txt
index 22d81e7..e261439 100644
--- a/src/plugins/xfer/CMakeLists.txt
+++ b/src/plugins/xfer/CMakeLists.txt
@@ -30,4 +30,4 @@ SET_TARGET_PROPERTIES(xfer PROPERTIES PREFIX "")
TARGET_LINK_LIBRARIES(xfer)
-INSTALL(TARGETS xfer LIBRARY DESTINATION ${LIBDIR}/plugins)
+INSTALL(TARGETS xfer LIBRARY DESTINATION ${PLUGIN_INSTALL_DIR})
weechat-cmake-pie.patch:
CMakeLists.txt | 8 ++++++++
core/CMakeLists.txt | 2 ++
gui/CMakeLists.txt | 5 +++++
plugins/CMakeLists.txt | 3 +++
4 files changed, 18 insertions(+)
--- NEW FILE weechat-cmake-pie.patch ---
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 977f23b..aaa5162 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -18,6 +18,7 @@ ADD_DEFINITIONS(-DHAVE_CONFIG_H)
INCLUDE(CheckIncludeFiles)
INCLUDE(CheckFunctionExists)
+INCLUDE(CheckCCompilerFlag)
CHECK_INCLUDE_FILES("arpa/inet.h" HAVE_ARPA_INET_H)
CHECK_INCLUDE_FILES("limits.h" HAVE_LIMITS_H)
@@ -57,6 +58,13 @@ CHECK_FUNCTION_EXISTS(strpbrk HAVE_STRPBRK)
CHECK_FUNCTION_EXISTS(strrchr HAVE_STRRCHR)
CHECK_FUNCTION_EXISTS(strstr HAVE_STRSTR)
+CHECK_C_COMPILER_FLAG(-fPIE HAVE_FPIE_SUPPORT)
+if (HAVE_FPIE_SUPPORT)
+ set (WEECHAT_PIE_CFLAGS "-fPIE")
+ set (WEECHAT_PIE_LDFLAGS "-pie")
+else(HAVE_FPIE_SUPPORT)
+ message(STATUS "Your compiler doesn't support PIE flag")
+endif(HAVE_FPIE_SUPPORT)
#needs to be splitted in subdirectories
# FIXME: weechat_gui_common MUST be the first lib in the list
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt
index 79ca890..27ae058 100644
--- a/src/core/CMakeLists.txt
+++ b/src/core/CMakeLists.txt
@@ -34,6 +34,8 @@ wee-upgrade-file.c wee-upgrade-file.h
wee-utf8.c wee-utf8.h
wee-util.c wee-util.h)
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${WEECHAT_PIE_CFLAGS}")
+
# Check for flock support
INCLUDE(CheckSymbolExists)
CHECK_INCLUDE_FILES("sys/file.h" HAVE_SYS_FILE_H)
diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt
index 8ee717f..0aa8888 100644
--- a/src/gui/CMakeLists.txt
+++ b/src/gui/CMakeLists.txt
@@ -33,6 +33,11 @@ gui-main.h
gui-nicklist.c gui-nicklist.h
gui-window.c gui-window.h)
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${WEECHAT_PIE_CFLAGS}")
+SET(CMAKE_EXE_LINKER_FLAGS
+ "${CMAKE_EXE_LINKER_FLAGS} ${WEECHAT_PIE_LDFLAGS}")
+
+
INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR})
ADD_LIBRARY(weechat_gui_common STATIC ${LIB_GUI_COMMON_SRC})
diff --git a/src/plugins/CMakeLists.txt b/src/plugins/CMakeLists.txt
index a24c693..bdd7b6d 100644
--- a/src/plugins/CMakeLists.txt
+++ b/src/plugins/CMakeLists.txt
@@ -23,6 +23,9 @@ plugin-config.h plugin-config.c)
INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR})
ADD_LIBRARY(weechat_plugins STATIC ${LIB_PLUGINS_SRC})
+SET_TARGET_PROPERTIES(weechat_plugins
+ PROPERTIES COMPILE_FLAGS "${WEECHAT_PIE_CFLAGS}")
+
SET(PLUGIN_INSTALL_DIR lib${LIB_SUFFIX}/${PROJECT_NAME}/plugins)
INCLUDE(CheckIncludeFiles)
weechat-enchant.patch:
CMakeLists.txt | 2
Makefile.am | 1
cmake/FindENCHANT.cmake | 44 +++++++++
configure.in | 51 ++++++-----
src/plugins/CMakeLists.txt | 18 ++--
src/plugins/Makefile.am | 2
src/plugins/aspell/CMakeLists.txt | 14 ++-
src/plugins/aspell/Makefile.am | 4
src/plugins/aspell/weechat-aspell-config.c | 4
src/plugins/aspell/weechat-aspell-config.h | 2
src/plugins/aspell/weechat-aspell-speller.c | 45 ++++++++--
src/plugins/aspell/weechat-aspell-speller.h | 4
src/plugins/aspell/weechat-aspell.c | 125 +++++++++++++++++++++++-----
src/plugins/aspell/weechat-aspell.h | 8 +
14 files changed, 254 insertions(+), 70 deletions(-)
--- NEW FILE weechat-enchant.patch ---
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8cce7fe..4149391 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -61,7 +61,7 @@ OPTION(DISABLE_GCRYPT "Disable libgcrypt support")
OPTION(DISABLE_GNUTLS "Disable SSLv3/TLS connection support")
OPTION(DISABLE_LARGEFILE "Disable Large File Support")
OPTION(DISABLE_ALIAS "Disable Alias plugin")
-OPTION(DISABLE_ASPELL "Disable Aspell plugin")
+OPTION(DISABLE_SPELL "Disable Spell plugin")
OPTION(DISABLE_CHARSET "Disable Charset plugin")
OPTION(ENABLE_DEMO "Enable Demo plugin")
OPTION(DISABLE_FIFO "Disable FIFO plugin")
diff --git a/Makefile.am b/Makefile.am
index a82532f..77ca71c 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -26,6 +26,7 @@ EXTRA_DIST = CMakeLists.txt \
cmake/cmake_uninstall.cmake.in \
cmake/FindAsciidoc.cmake \
cmake/FindAspell.cmake \
+ cmake/FindENCHANT.cmake \
cmake/FindGcrypt.cmake \
cmake/FindGettext.cmake \
cmake/FindGnuTLS.cmake \
diff --git a/cmake/FindENCHANT.cmake b/cmake/FindENCHANT.cmake
new file mode 100644
index 0000000..9c13c48
--- /dev/null
+++ b/cmake/FindENCHANT.cmake
@@ -0,0 +1,44 @@
+# - Try to find the Enchant spell checker
+# Once done this will define
+#
+# ENCHANT_FOUND - system has ENCHANT
+# ENCHANT_INCLUDE_DIR - the ENCHANT include directory
+# ENCHANT_LIBRARIES - Link these to use ENCHANT
+# ENCHANT_DEFINITIONS - Compiler switches required for using ENCHANT
+
+# Copyright (c) 2006, Zack Rusin, <zack at kde.org>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+
+if (ENCHANT_INCLUDE_DIR AND ENCHANT_LIBRARIES)
+
+ # in cache already
+ set(ENCHANT_FOUND TRUE)
+
+else (ENCHANT_INCLUDE_DIR AND ENCHANT_LIBRARIES)
+ if (NOT WIN32)
+ # use pkg-config to get the directories and then use these values
+ # in the FIND_PATH() and FIND_LIBRARY() calls
+ find_package(PkgConfig)
+ pkg_check_modules(PC_ENCHANT QUIET enchant)
+ set(ENCHANT_DEFINITIONS ${PC_ENCHANT_CFLAGS_OTHER})
+ endif (NOT WIN32)
+
+ find_path(ENCHANT_INCLUDE_DIR
+ NAMES enchant++.h
+ HINTS ${PC_ENCHANT_INCLUDEDIR}
+ ${PC_ENCHANT_INCLUDE_DIRS}
+ PATH_SUFFIXES enchant )
+
+ find_library(ENCHANT_LIBRARIES NAMES enchant
+ HINTS ${PC_ENCHANT_LIBDIR}
+ ${PC_ENCHANT_LIBRARY_DIRS} )
+
+ include(FindPackageHandleStandardArgs)
+ find_package_handle_standard_args(ENCHANT DEFAULT_MSG ENCHANT_INCLUDE_DIR ENCHANT_LIBRARIES )
+
+ mark_as_advanced(ENCHANT_INCLUDE_DIR ENCHANT_LIBRARIES)
+
+endif (ENCHANT_INCLUDE_DIR AND ENCHANT_LIBRARIES)
diff --git a/configure.in b/configure.in
index 70d29b8..ae4b309 100644
--- a/configure.in
+++ b/configure.in
@@ -101,7 +101,7 @@ AH_VERBATIM([HAVE_GCRYPT], [#undef HAVE_GCRYPT])
AH_VERBATIM([HAVE_GNUTLS], [#undef HAVE_GNUTLS])
AH_VERBATIM([HAVE_FLOCK], [#undef HAVE_FLOCK])
AH_VERBATIM([PLUGIN_ALIAS], [#undef PLUGIN_ALIAS])
-AH_VERBATIM([PLUGIN_ASPELL], [#undef PLUGIN_ASPELL])
+AH_VERBATIM([PLUGIN_SPELL], [#undef PLUGIN_SPELL])
AH_VERBATIM([PLUGIN_CHARSET], [#undef PLUGIN_CHARSET])
AH_VERBATIM([PLUGIN_DEMO], [#undef PLUGIN_DEMO])
AH_VERBATIM([PLUGIN_FIFO], [#undef PLUGIN_FIFO])
@@ -126,7 +126,7 @@ AC_ARG_ENABLE(gcrypt, [ --disable-gcrypt turn off gcrypt support (
AC_ARG_ENABLE(gnutls, [ --disable-gnutls turn off gnutls support (default=compiled if found)],enable_gnutls=$enableval,enable_gnutls=yes)
AC_ARG_ENABLE(largefile, [ --disable-largefile turn off Large File Support (default=on)],enable_largefile=$enableval,enable_largefile=yes)
AC_ARG_ENABLE(alias, [ --disable-alias turn off Alias plugin (default=compiled)],enable_alias=$enableval,enable_alias=yes)
-AC_ARG_ENABLE(aspell, [ --disable-aspell turn off Aspell plugin (default=compiled)],enable_aspell=$enableval,enable_aspell=yes)
+AC_ARG_ENABLE(spell, [ --disable-spell turn off Spell plugin (default=compiled)],enable_spell=$enableval,enable_spell=yes)
AC_ARG_ENABLE(charset, [ --disable-charset turn off Charset plugin (default=compiled if found)],enable_charset=$enableval,enable_charset=yes)
AC_ARG_ENABLE(demo, [ --enable-demo turn on Demo plugin (default=off)],enable_demo=$enableval,enable_demo=no)
AC_ARG_ENABLE(fifo, [ --disable-fifo turn off Fifo plugin (default=compiled)],enable_fifo=$enableval,enable_fifo=yes)
@@ -302,36 +302,41 @@ else
not_asked="$not_asked alias"
fi
-# ---------------------------------- aspell ------------------------------------
+# ---------------------------------- spelling ----------------------------------
-if test "x$enable_aspell" = "xyes" ; then
- ASPELL_CFLAGS=""
- ASPELL_LFLAGS=""
+if test "x$enable_spell" = "xyes" ; then
+ # Check ENCHANT is available
+ PKG_CHECK_MODULES(ENCHANT, [enchant], [CFLAGS="$CFLAGS -DUSE_ENCHANT"],
+ # otherwise Check ASPELL is available
+ [
+ ASPELL_CFLAGS=""
+ ASPELL_LFLAGS=""
- AC_CHECK_HEADER(aspell.h,ac_found_aspell_header="yes",ac_found_aspell_header="no")
- AC_CHECK_LIB(aspell,new_aspell_speller,ac_found_aspell_lib="yes",ac_found_aspell_lib="no")
+ AC_CHECK_HEADER(aspell.h,ac_found_aspell_header="yes",ac_found_aspell_header="no")
+ AC_CHECK_LIB(aspell,new_aspell_speller,ac_found_aspell_lib="yes",ac_found_aspell_lib="no")
- AC_MSG_CHECKING(for aspell headers and librairies)
- if test "x$ac_found_aspell_header" = "xno" -o "x$ac_found_aspell_lib" = "xno" ; then
- AC_MSG_RESULT(no)
- AC_MSG_WARN([
+ AC_MSG_CHECKING(for aspell headers and librairies)
+ if test "x$ac_found_aspell_header" = "xno" -o "x$ac_found_aspell_lib" = "xno" ; then
+ AC_MSG_RESULT(no)
+ AC_MSG_WARN([
*** Aspell headers and/or libraries couldn't be found on your system.
*** Try to install them with your software package manager.
*** WeeChat will be built without Aspell support.])
- enable_aspell="no"
- not_found="$not_found aspell"
- else
- AC_MSG_RESULT(yes)
- ASPELL_LFLAGS="$ASPELL_LFLAGS -laspell"
+ enable_spell="no"
+ not_found="$not_found spell"
+ else
+ AC_MSG_RESULT(yes)
+ ASPELL_LFLAGS="$ASPELL_LFLAGS -laspell"
+ fi
fi
else
- not_asked="$not_asked aspell"
+ not_asked="$not_asked spell"
fi
-if test "x$enable_aspell" = "xyes" ; then
+if test "x$enable_spell" = "xyes" ; then
AC_SUBST(ASPELL_CFLAGS)
AC_SUBST(ASPELL_LFLAGS)
- AC_DEFINE(PLUGIN_ASPELL)
+ AC_DEFINE(PLUGIN_SPELL)
fi
# --------------------------------- charset ------------------------------------
@@ -973,7 +978,7 @@ AM_CONDITIONAL(GUI_WXWIDGETS, test "$enable_wxwidgets" = "yes")
AM_CONDITIONAL(GUI_GTK, test "$enable_gtk" = "yes")
AM_CONDITIONAL(GUI_QT, test "$enable_qt" = "yes")
AM_CONDITIONAL(PLUGIN_ALIAS, test "$enable_alias" = "yes")
-AM_CONDITIONAL(PLUGIN_ASPELL, test "$enable_aspell" = "yes")
+AM_CONDITIONAL(PLUGIN_SPELL, test "$enable_spell" = "yes")
AM_CONDITIONAL(PLUGIN_CHARSET, test "$enable_charset" = "yes")
AM_CONDITIONAL(PLUGIN_DEMO, test "$enable_demo" = "yes")
AM_CONDITIONAL(PLUGIN_FIFO, test "$enable_fifo" = "yes")
@@ -1051,8 +1056,8 @@ listplugins=""
if test "x$enable_alias" = "xyes"; then
listplugins="$listplugins alias"
fi
-if test "x$enable_aspell" = "xyes"; then
- listplugins="$listplugins aspell"
+if test "x$enable_spell" = "xyes"; then
+ listplugins="$listplugins spell"
fi
if test "x$enable_charset" = "xyes"; then
listplugins="$listplugins charset"
diff --git a/src/plugins/CMakeLists.txt b/src/plugins/CMakeLists.txt
index e4f0a84..19ebd8f 100644
--- a/src/plugins/CMakeLists.txt
+++ b/src/plugins/CMakeLists.txt
@@ -31,13 +31,19 @@ IF(NOT DISABLE_ALIAS)
ADD_SUBDIRECTORY( alias )
ENDIF(NOT DISABLE_ALIAS)
-IF(NOT DISABLE_ASPELL)
- # Check for aspell libraries
- FIND_PACKAGE(Aspell)
- IF(ASPELL_FOUND)
+IF(NOT DISABLE_SPELL)
+ # Check for enchant libraries
+ FIND_PACKAGE(ENCHANT)
+ IF(ENCHANT_FOUND)
ADD_SUBDIRECTORY( aspell )
- ENDIF(ASPELL_FOUND)
-ENDIF(NOT DISABLE_ASPELL)
+ ELSE(ENCHANT_FOUND)
+ # Check for aspell libraries
+ FIND_PACKAGE(Aspell)
+ IF(ASPELL_FOUND)
+ ADD_SUBDIRECTORY( aspell )
+ ENDIF(ASPELL_FOUND)
+ ENDIF(ENCHANT_FOUND)
+ENDIF(NOT DISABLE_SPELL)
IF(NOT DISABLE_CHARSET)
# Check for iconv support.
diff --git a/src/plugins/Makefile.am b/src/plugins/Makefile.am
index 802e62b..f163afb 100644
--- a/src/plugins/Makefile.am
+++ b/src/plugins/Makefile.am
@@ -30,7 +30,7 @@ if PLUGIN_ALIAS
alias_dir = alias
endif
-if PLUGIN_ASPELL
+if PLUGIN_SPELL
aspell_dir = aspell
endif
diff --git a/src/plugins/aspell/CMakeLists.txt b/src/plugins/aspell/CMakeLists.txt
index ed3c408..5df5543 100644
--- a/src/plugins/aspell/CMakeLists.txt
+++ b/src/plugins/aspell/CMakeLists.txt
@@ -20,9 +20,15 @@ weechat-aspell-config.c weechat-aspell-config.h
weechat-aspell-speller.c weechat-aspell-speller.h)
SET_TARGET_PROPERTIES(aspell PROPERTIES PREFIX "")
-IF(ASPELL_FOUND)
- INCLUDE_DIRECTORIES(${ASPELL_INCLUDE_PATH})
- TARGET_LINK_LIBRARIES(aspell ${ASPELL_LIBRARY})
-ENDIF(ASPELL_FOUND)
+IF(ENCHANT_FOUND)
+ INCLUDE_DIRECTORIES(${ENCHANT_INCLUDE_DIR})
+ TARGET_LINK_LIBRARIES(aspell ${ENCHANT_LIBRARIES})
+ ADD_DEFINITIONS(-DUSE_ENCHANT)
+ELSE(ENCHANT_FOUND)
+ IF(ASPELL_FOUND)
+ INCLUDE_DIRECTORIES(${ASPELL_INCLUDE_PATH})
+ TARGET_LINK_LIBRARIES(aspell ${ASPELL_LIBRARY})
+ ENDIF(ASPELL_FOUND)
+ENDIF(ENCHANT_FOUND)
INSTALL(TARGETS aspell LIBRARY DESTINATION ${LIBDIR}/plugins)
diff --git a/src/plugins/aspell/Makefile.am b/src/plugins/aspell/Makefile.am
index b1bde9d..e5fedc5 100644
--- a/src/plugins/aspell/Makefile.am
+++ b/src/plugins/aspell/Makefile.am
@@ -14,7 +14,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
-INCLUDES = -DLOCALEDIR=\"$(datadir)/locale\" $(ASPELL_CFLAGS)
+INCLUDES = -DLOCALEDIR=\"$(datadir)/locale\" $(ASPELL_CFLAGS) $(ENCHANT_CFLAGS)
libdir = ${weechat_libdir}/plugins
@@ -27,6 +27,6 @@ aspell_la_SOURCES = weechat-aspell.c \
weechat-aspell-speller.c \
weechat-aspell-speller.h
aspell_la_LDFLAGS = -module
-aspell_la_LIBADD = $(ASPELL_LFLAGS)
+aspell_la_LIBADD = $(ASPELL_LFLAGS) $(ENCHANT_LIBS)
EXTRA_DIST = CMakeLists.txt
diff --git a/src/plugins/aspell/weechat-aspell-config.c b/src/plugins/aspell/weechat-aspell-config.c
index 9f036be..5c11c56 100644
--- a/src/plugins/aspell/weechat-aspell-config.c
+++ b/src/plugins/aspell/weechat-aspell-config.c
@@ -210,7 +210,7 @@ weechat_aspell_config_dict_create_option (void *data,
{
weechat_printf (NULL,
_("%s%s: error creating aspell dictionary \"%s\" => \"%s\""),
- weechat_prefix ("error"), ASPELL_PLUGIN_NAME,
+ weechat_prefix ("error"), SPELL_PLUGIN_NAME,
option_name, value);
}
else
@@ -255,7 +255,7 @@ weechat_aspell_config_init ()
{
struct t_config_section *ptr_section;
- weechat_aspell_config_file = weechat_config_new (ASPELL_CONFIG_NAME,
+ weechat_aspell_config_file = weechat_config_new (SPELL_CONFIG_NAME,
NULL, NULL);
if (!weechat_aspell_config_file)
return 0;
diff --git a/src/plugins/aspell/weechat-aspell-config.h b/src/plugins/aspell/weechat-aspell-config.h
index 295401d..28b1dc0 100644
--- a/src/plugins/aspell/weechat-aspell-config.h
+++ b/src/plugins/aspell/weechat-aspell-config.h
@@ -20,7 +20,7 @@
#ifndef __WEECHAT_ASPELL_CONFIG_H
#define __WEECHAT_ASPELL_CONFIG_H 1
-#define ASPELL_CONFIG_NAME "aspell"
+#define SPELL_CONFIG_NAME "spell"
extern struct t_config_option *weechat_aspell_config_look_color;
diff --git a/src/plugins/aspell/weechat-aspell-speller.c b/src/plugins/aspell/weechat-aspell-speller.c
index c68339b..2ec2b9d 100644
--- a/src/plugins/aspell/weechat-aspell-speller.c
+++ b/src/plugins/aspell/weechat-aspell-speller.c
@@ -32,6 +32,9 @@
struct t_aspell_speller *weechat_aspell_spellers = NULL;
struct t_aspell_speller *last_weechat_aspell_speller = NULL;
+#ifdef USE_ENCHANT
+extern EnchantBroker *broker;
+#endif
/*
* weechat_aspell_speller_exists: return 1 if an aspell dict exists for a lang,
@@ -41,6 +44,9 @@ struct t_aspell_speller *last_weechat_aspell_speller = NULL;
int
weechat_aspell_speller_exists (const char *lang)
{
+#ifdef USE_ENCHANT
+ return enchant_broker_dict_exists(broker, lang);
+#else
struct AspellConfig *config;
AspellDictInfoList *list;
AspellDictInfoEnumeration *el;
@@ -66,6 +72,7 @@ weechat_aspell_speller_exists (const char *lang)
delete_aspell_config (config);
return rc;
+#endif
}
/*
@@ -92,7 +99,7 @@ weechat_aspell_speller_check_dictionaries (const char *dict_list)
weechat_printf (NULL,
_("%s: warning: dictionary \"%s\" is not "
"available on your system"),
- ASPELL_PLUGIN_NAME, argv[i]);
+ SPELL_PLUGIN_NAME, argv[i]);
}
}
weechat_string_free_split (argv);
@@ -128,8 +135,12 @@ struct t_aspell_speller *
weechat_aspell_speller_new (const char *lang)
{
struct t_aspell_speller *new_speller;
+#ifdef USE_ENCHANT
+ EnchantDict *ret;
+#else
AspellConfig *config;
AspellCanHaveError *ret;
+#endif
if (!lang)
return NULL;
@@ -138,9 +149,20 @@ weechat_aspell_speller_new (const char *lang)
{
weechat_printf (NULL,
"%s: creating new speller for lang \"%s\"",
- ASPELL_PLUGIN_NAME, lang);
+ SPELL_PLUGIN_NAME, lang);
}
+#ifdef USE_ENCHANT
+ ret = enchant_broker_request_dict (broker, lang);
+ if (!ret)
+ {
+ weechat_printf (NULL,
+ "%s%s: error: %s",
+ weechat_prefix ("error"), SPELL_PLUGIN_NAME,
+ lang);
+ return NULL;
+ }
+#else
/* create a speller instance for the newly created cell */
config = new_aspell_config();
aspell_config_replace (config, "lang", lang);
@@ -151,24 +173,29 @@ weechat_aspell_speller_new (const char *lang)
{
weechat_printf (NULL,
"%s%s: error: %s",
- weechat_prefix ("error"), ASPELL_PLUGIN_NAME,
+ weechat_prefix ("error"), SPELL_PLUGIN_NAME,
aspell_error_message (ret));
delete_aspell_config (config);
delete_aspell_can_have_error (ret);
return NULL;
}
-
+#endif
+
/* create and add a new speller cell */
new_speller = malloc (sizeof (*new_speller));
if (!new_speller)
{
weechat_printf (NULL,
_("%s%s: not enough memory to create new speller"),
- weechat_prefix ("error"), ASPELL_PLUGIN_NAME);
+ weechat_prefix ("error"), SPELL_PLUGIN_NAME);
return NULL;
}
+#ifdef USE_ENCHANT
+ new_speller->speller = ret;
+#else
new_speller->speller = to_aspell_speller (ret);
+#endif
new_speller->lang = strdup (lang);
/* add speller to list */
@@ -180,8 +207,10 @@ weechat_aspell_speller_new (const char *lang)
weechat_aspell_spellers = new_speller;
last_weechat_aspell_speller = new_speller;
+#ifndef USE_ENCHANT
/* free config */
delete_aspell_config (config);
+#endif
return new_speller;
}
@@ -200,14 +229,18 @@ weechat_aspell_speller_free (struct t_aspell_speller *speller)
{
weechat_printf (NULL,
"%s: removing speller for lang \"%s\"",
- ASPELL_PLUGIN_NAME, speller->lang);
+ SPELL_PLUGIN_NAME, speller->lang);
}
/* free data */
if (speller->speller)
{
+#ifdef USE_ENCHANT
+ enchant_broker_free_dict(broker, speller->speller);
+#else
aspell_speller_save_all_word_lists (speller->speller);
delete_aspell_speller (speller->speller);
+#endif
}
if (speller->lang)
free (speller->lang);
diff --git a/src/plugins/aspell/weechat-aspell-speller.h b/src/plugins/aspell/weechat-aspell-speller.h
index fbc7dcb..7b15666 100644
--- a/src/plugins/aspell/weechat-aspell-speller.h
+++ b/src/plugins/aspell/weechat-aspell-speller.h
@@ -22,7 +22,11 @@
struct t_aspell_speller
{
+#ifdef USE_ENCHANT
+ EnchantDict *speller; /* enchant speller */
+#else
AspellSpeller *speller; /* aspell speller */
+#endif
char *lang; /* language */
struct t_aspell_speller *prev_speller; /* pointer to next speller */
diff --git a/src/plugins/aspell/weechat-aspell.c b/src/plugins/aspell/weechat-aspell.c
index e62c141..d66751c 100644
--- a/src/plugins/aspell/weechat-aspell.c
+++ b/src/plugins/aspell/weechat-aspell.c
@@ -34,7 +34,7 @@
#include "weechat-aspell-speller.h"
-WEECHAT_PLUGIN_NAME(ASPELL_PLUGIN_NAME);
+WEECHAT_PLUGIN_NAME(SPELL_PLUGIN_NAME);
WEECHAT_PLUGIN_DESCRIPTION("Aspell plugin for WeeChat");
WEECHAT_PLUGIN_AUTHOR("FlashCode <flashcode at flashtux.org>");
WEECHAT_PLUGIN_VERSION(WEECHAT_VERSION);
@@ -45,6 +45,10 @@ struct t_weechat_plugin *weechat_aspell_plugin = NULL;
char *aspell_last_modifier_string = NULL; /* last str. received by modifier */
char *aspell_last_modifier_result = NULL; /* last str. built by modifier */
+#ifdef USE_ENCHANT
+EnchantBroker *broker;
+#endif
+
/* aspell supported langs (updated on of 2008-10-17) */
struct t_aspell_code langs_avail[] =
{
@@ -254,10 +258,10 @@ weechat_aspell_set_dict (struct t_gui_buffer *buffer, const char *value)
{
if (value && value[0])
weechat_printf (NULL, "%s: \"%s\" => %s",
- ASPELL_PLUGIN_NAME, name, value);
+ SPELL_PLUGIN_NAME, name, value);
else
weechat_printf (NULL, _("%s: \"%s\" removed"),
- ASPELL_PLUGIN_NAME, name);
+ SPELL_PLUGIN_NAME, name);
}
free (name);
@@ -396,6 +400,55 @@ weechat_aspell_iso_to_country (const char *code)
return strdup ("Unknown");
}
+#ifdef USE_ENCHANT
+void EnchantDictDescribe(const char * const lang_tag,
+ const char * const provider_name,
+ const char * const provider_desc,
+ const char * const provider_file,
+ void * user_data)
+{
+ char *country, *lang, *pos;
+ char buffer[192];
+ (void)provider_name;
+ (void)provider_desc;
+ (void)provider_file;
+ (void)user_data;
+
+ country = NULL;
+ pos = strchr (lang_tag, '_');
+ if (!pos)
+ pos = strchr (lang_tag, '-');
+
+ if (pos)
+ {
+ pos[0] = '\0';
+ lang = weechat_aspell_iso_to_lang ((char*)lang_tag);
+ pos[0] = '_';
+ country = weechat_aspell_iso_to_country (pos + 1);
+ }
+ else
+ lang = weechat_aspell_iso_to_lang ((char*)lang_tag);
+
+ if (pos)
+ {
+ snprintf (buffer, sizeof (buffer), "%-22s %s (%s)",
+ lang_tag, lang, country);
+ }
+ else
+ {
+ snprintf (buffer, sizeof (buffer), "%-22s %s",
+ lang_tag, lang);
+ }
+
+ weechat_printf (NULL, " %s", buffer);
+
+ if (lang)
+ free (lang);
+ if (country)
+ free (country);
+}
+#endif
+
/*
* weechat_aspell_speller_list_dicts: list all aspell dict installed on system
* and display them
@@ -404,6 +457,7 @@ weechat_aspell_iso_to_country (const char *code)
void
weechat_aspell_speller_list_dicts ()
{
+#ifndef USE_ENCHANT
char *country, *lang, *pos;
char buffer[192];
struct AspellConfig *config;
@@ -414,13 +468,18 @@ weechat_aspell_speller_list_dicts ()
config = new_aspell_config();
list = get_aspell_dict_info_list (config);
el = aspell_dict_info_list_elements (list);
-
+
+#endif
+
weechat_printf (NULL, "");
weechat_printf (NULL,
- /* TRANSLATORS: %s is "aspell" */
+ /* TRANSLATORS: %s is "spell" */
_( "%s dictionaries list:"),
- ASPELL_PLUGIN_NAME);
-
+ SPELL_PLUGIN_NAME);
+
+#ifdef USE_ENCHANT
+ enchant_broker_list_dicts(broker, EnchantDictDescribe, NULL);
+#else
while ((dict = aspell_dict_info_enumeration_next (el)))
{
country = NULL;
@@ -473,6 +532,7 @@ weechat_aspell_speller_list_dicts ()
delete_aspell_dict_info_enumeration (el);
delete_aspell_config (config);
+#endif
}
/*
@@ -493,7 +553,7 @@ weechat_aspell_add_word (const char *lang, const char *word)
weechat_printf (NULL,
_("%s: error: dictionary \"%s\" is not "
"available on your system"),
- ASPELL_PLUGIN_NAME, lang);
+ SPELL_PLUGIN_NAME, lang);
return;
}
new_speller = weechat_aspell_speller_new (lang);
@@ -502,21 +562,25 @@ weechat_aspell_add_word (const char *lang, const char *word)
ptr_speller = new_speller;
}
+#ifdef USE_ENCHANT
+ enchant_dict_add(ptr_speller->speller, word, strlen(word));
+#else
if (aspell_speller_add_to_personal (ptr_speller->speller,
word,
strlen (word)) == 1)
{
weechat_printf (NULL,
_("%s: word \"%s\" added to personal dictionary"),
- ASPELL_PLUGIN_NAME, word);
+ SPELL_PLUGIN_NAME, word);
}
else
{
weechat_printf (NULL,
_("%s%s: failed to add word to personal "
"dictionary"),
- weechat_prefix ("error"), ASPELL_PLUGIN_NAME);
+ weechat_prefix ("error"), SPELL_PLUGIN_NAME);
}
+#endif
if (new_speller)
weechat_aspell_speller_free (new_speller);
@@ -647,7 +711,11 @@ weechat_aspell_check_word (struct t_gui_buffer *buffer, const char *word)
for (ptr_speller = weechat_aspell_spellers; ptr_speller;
ptr_speller = ptr_speller->next_speller)
{
+#ifdef USE_ENCHANT
+ if (enchant_dict_check(ptr_speller->speller, word, strlen(word)) == 0)
+#else
if (aspell_speller_check (ptr_speller->speller, word, -1) == 1)
+#endif
{
rc = 1;
break;
@@ -876,7 +944,7 @@ weechat_aspell_command_cb (void *data, struct t_gui_buffer *buffer,
_("%s%s: no dictionary on this buffer for "
"adding word"),
weechat_prefix ("error"),
- ASPELL_PLUGIN_NAME);
+ SPELL_PLUGIN_NAME);
}
else if (weechat_aspell_spellers->next_speller)
{
@@ -884,7 +952,7 @@ weechat_aspell_command_cb (void *data, struct t_gui_buffer *buffer,
_("%s%s: many dictionaries are defined for "
"this buffer, please specify dictionary"),
weechat_prefix ("error"),
- ASPELL_PLUGIN_NAME);
+ SPELL_PLUGIN_NAME);
}
else
weechat_aspell_add_word (weechat_aspell_spellers->lang,
@@ -951,6 +1019,13 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[])
(void) argv;
weechat_plugin = plugin;
+
+#ifdef USE_ENCHANT
+ /* acquire enchant broker */
+ broker = enchant_broker_init();
+ if (!broker)
+ return WEECHAT_RC_ERROR;
+#endif
if (!weechat_aspell_config_init ())
return WEECHAT_RC_ERROR;
@@ -958,26 +1033,26 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[])
if (weechat_aspell_config_read () < 0)
return WEECHAT_RC_ERROR;
- /* command /aspell */
- weechat_hook_command ("aspell",
- N_("aspell plugin configuration"),
+ /* command /spell */
+ weechat_hook_command ("spell",
+ N_("spell plugin configuration"),
N_("dictlist | enable lang | disable | "
"addword [lang] word"),
N_("dictlist: show installed dictionaries\n"
- " enable: enable aspell on current buffer\n"
- " disable: disable aspell on current buffer\n"
- " addword: add a word in your personal aspell "
+ " enable: enable spell on current buffer\n"
+ " disable: disable spell on current buffer\n"
+ " addword: add a word in your personal spell "
"dictionary\n"
"\n"
"Input line beginning with a '/' is not checked, "
"except for some commands."),
"dictlist"
- " || enable %(aspell_langs)"
+ " || enable %(spell_langs)"
" || disable"
" || addword",
&weechat_aspell_command_cb, NULL);
- weechat_hook_completion ("aspell_langs",
- N_("list of supported langs for aspell"),
+ weechat_hook_completion ("spell_langs",
+ N_("list of supported langs for spell"),
&weechat_aspell_completion_langs_cb, NULL);
/* callback for buffer_switch */
@@ -987,7 +1062,8 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[])
/* callback for spell checking input text */
weechat_hook_modifier ("input_text_display",
&weechat_aspell_modifier_cb, NULL);
-
+
+
weechat_aspell_create_spellers (weechat_current_buffer ());
return WEECHAT_RC_OK;
@@ -1013,6 +1089,11 @@ weechat_plugin_end (struct t_weechat_plugin *plugin)
free (aspell_last_modifier_result);
weechat_aspell_config_free ();
+
+#ifdef USE_ENCHANT
+ /* release enchant broker */
+ enchant_broker_free (broker);
+#endif
return WEECHAT_RC_OK;
}
diff --git a/src/plugins/aspell/weechat-aspell.h b/src/plugins/aspell/weechat-aspell.h
index 27018b9..b676926 100644
--- a/src/plugins/aspell/weechat-aspell.h
+++ b/src/plugins/aspell/weechat-aspell.h
@@ -20,10 +20,14 @@
#ifndef __WEECHAT_ASPELL_H
#define __WEECHAT_ASPELL_H 1
-#include <aspell.h>
+#ifdef USE_ENCHANT
+# include <enchant.h>
+#else
+# include <aspell.h>
+#endif
#define weechat_plugin weechat_aspell_plugin
-#define ASPELL_PLUGIN_NAME "aspell"
+#define SPELL_PLUGIN_NAME "spell"
struct t_aspell_code
{
Index: .cvsignore
===================================================================
RCS file: /cvs/pkgs/rpms/weechat/devel/.cvsignore,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -p -r1.9 -r1.10
--- .cvsignore 10 Sep 2009 22:55:20 -0000 1.9
+++ .cvsignore 7 May 2010 09:24:12 -0000 1.10
@@ -1 +1 @@
-weechat-0.3.0.tar.bz2
+weechat-0.3.2.tar.bz2
Index: sources
===================================================================
RCS file: /cvs/pkgs/rpms/weechat/devel/sources,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -p -r1.9 -r1.10
--- sources 10 Sep 2009 22:55:20 -0000 1.9
+++ sources 7 May 2010 09:24:12 -0000 1.10
@@ -1 +1 @@
-c31cfc229e964ff9257cc9c7f9e6c9bc weechat-0.3.0.tar.bz2
+b0b00b321203dd5746a25248a9adaa92 weechat-0.3.2.tar.bz2
Index: weechat.spec
===================================================================
RCS file: /cvs/pkgs/rpms/weechat/devel/weechat.spec,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -p -r1.16 -r1.17
--- weechat.spec 7 Dec 2009 00:33:56 -0000 1.16
+++ weechat.spec 7 May 2010 09:24:12 -0000 1.17
@@ -1,10 +1,10 @@
Name: weechat
Summary: Portable, fast, light and extensible IRC client
-Version: 0.3.0
-Release: 3%{?dist}
+Version: 0.3.2
+Release: 1%{?dist}
Source: http://weechat.org/files/src/%{name}-%{version}.tar.bz2
-Patch0: weechat-0.3.0-cmake-paths.patch
-Patch1: weechat-0.3.0-cmake-pie.patch
+Patch0: weechat-0.3.2-cmake-paths.patch
+Patch1: weechat-0.3.2-cmake-pie.patch
Patch2: weechat-gitHEAD.enchant.patch
URL: http://weechat.org
Group: Applications/Communications
@@ -70,6 +70,9 @@ rm -rf $RPM_BUILD_ROOT
%{_libdir}/pkgconfig/*.pc
%changelog
+* Thu May 6 2010 Paul P. Komkoff Jr <i at stingr.net> - 0.3.2-1
+- new upstream version
+
* Mon Dec 7 2009 Stepan Kasal <skasal at redhat.com> - 0.3.0-3
- rebuild against perl 5.10.1
--- weechat-0.3.0-cmake-paths.patch DELETED ---
--- weechat-0.3.0-cmake-pie.patch DELETED ---
--- weechat-gitHEAD.enchant.patch DELETED ---
More information about the scm-commits
mailing list