Skip to content

Commit

Permalink
aspell: add support of enchant library (patch #6858)
Browse files Browse the repository at this point in the history
Enchant is enabled only if the new option for cmake (or configure) is enabled:
- for cmake: cmake -DENABLE_ENCHANT=ON
- for configure: ./configure --enable-enchant
  • Loading branch information
flashcode committed Jun 7, 2013
1 parent 4080047 commit fb7edb3
Show file tree
Hide file tree
Showing 30 changed files with 596 additions and 167 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Expand Up @@ -69,6 +69,7 @@ OPTION(ENABLE_GNUTLS "Enable SSLv3/TLS support" ON)
OPTION(ENABLE_LARGEFILE "Enable Large File Support" ON)
OPTION(ENABLE_ALIAS "Enable Alias plugin" ON)
OPTION(ENABLE_ASPELL "Enable Aspell plugin" ON)
OPTION(ENABLE_ENCHANT "Enable Enchant lib for Aspell plugin" OFF)
OPTION(ENABLE_CHARSET "Enable Charset plugin" ON)
OPTION(ENABLE_DEMO "Enable Demo plugin" OFF)
OPTION(ENABLE_FIFO "Enable FIFO plugin" ON)
Expand Down
3 changes: 2 additions & 1 deletion ChangeLog
@@ -1,7 +1,7 @@
WeeChat ChangeLog
=================
Sébastien Helleu <flashcode@flashtux.org>
v0.4.2-dev, 2013-06-05
v0.4.2-dev, 2013-06-07


This document lists all changes for each version.
Expand All @@ -21,6 +21,7 @@ Version 0.4.2 (under dev!)
"layout_window"
* core: fix line alignment when option weechat.look.buffer_time_format is set
to empty string
* aspell: add support of enchant library (patch #6858)
* irc: add support of special variables $nick/$channel/$server in commands
/allchan and /allserv
* irc: add option irc.look.nick_color_hash: hash algorithm to find nick color
Expand Down
1 change: 1 addition & 0 deletions Makefile.am
Expand Up @@ -39,6 +39,7 @@ EXTRA_DIST = CMakeLists.txt \
cmake/CMakeParseArguments.cmake \
cmake/FindAsciidoc.cmake \
cmake/FindAspell.cmake \
cmake/FindENCHANT.cmake \
cmake/FindGCRYPT.cmake \
cmake/FindGettext.cmake \
cmake/FindGnuTLS.cmake \
Expand Down
44 changes: 44 additions & 0 deletions 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@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 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)
40 changes: 26 additions & 14 deletions configure.ac
Expand Up @@ -128,6 +128,7 @@ AC_ARG_ENABLE(gnutls, [ --disable-gnutls turn off gnutls support (
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(enchant, [ --enable-enchant turn on Enchant lib for Aspell plugin (default=off)],enable_enchant=$enableval,enable_enchant=no)
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)
Expand Down Expand Up @@ -275,24 +276,35 @@ fi
# ---------------------------------- aspell ------------------------------------

if test "x$enable_aspell" = "xyes" ; then
ASPELL_CFLAGS=""
ASPELL_LFLAGS=""
ac_found_enchant_lib="no"
if test "x$enable_enchant" = "xyes" ; then
#PKG_CHECK_MODULES(ENCHANT, [enchant], [CFLAGS="$CFLAGS -DUSE_ENCHANT"],
PKG_CHECK_MODULES(ENCHANT, [enchant], ac_found_enchant_lib="yes", ac_found_enchant_lib="no")
fi
if test "x$ac_found_enchant_lib" = "xyes" ; then
CFLAGS="$CFLAGS -DUSE_ENCHANT"
ASPELL_LIB_USED="enchant"
else
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_aspell="no"
not_found="$not_found aspell"
else
AC_MSG_RESULT(yes)
ASPELL_LFLAGS="$ASPELL_LFLAGS -laspell"
ASPELL_LIB_USED="aspell"
fi
fi
else
not_asked="$not_asked aspell"
Expand Down Expand Up @@ -1127,7 +1139,7 @@ if test "x$enable_alias" = "xyes"; then
listplugins="$listplugins alias"
fi
if test "x$enable_aspell" = "xyes"; then
listplugins="$listplugins aspell"
listplugins="$listplugins aspell($ASPELL_LIB_USED)"
fi
if test "x$enable_charset" = "xyes"; then
listplugins="$listplugins charset"
Expand Down
36 changes: 18 additions & 18 deletions doc/de/weechat_user.de.txt
Expand Up @@ -86,24 +86,24 @@ welche Pakete optional genutzt werden können.

[width="100%",cols="5,^3,^3,13",options="header"]
|========================================
| Paket ^(1)^ | Version | benötigt | Funktion
| cmake | | *ja* | zum kompilieren (autotools ist möglich. cmake wird aber empfohlen)
| libncursesw5-dev ^(2)^ | | *ja* | ncurses Oberfläche
| libcurl4-gnutls-dev | | *ja* | URL Transfer
| zlib1g-dev | | *ja* | Kompression für Pakete, die mittels Relay- (WeeChat Protokoll), Script-Erweiterung übertragen werden
| libgcrypt11-dev | | *ja* | IRC SASL Authentifikation (DH-BLOWFISH/DH-AES), Skript-Erweiterung
| libgnutls-dev | ≥ 2.2.0 | | SSL Verbindung zu einem IRC Server, Unterstützung von SSL in der Relay-Erweiterung
| gettext | | | Internationalisierung (Übersetzung der Mitteilungen; Hauptsprache ist englisch)
| ca-certificates | | | Zertifikate für SSL Verbindungen
| libaspell-dev | | | aspell Erweiterung
| python-dev | ≥ 2.5 ^(3)^ | | python Erweiterung
| libperl-dev | | | perl Erweiterung
| ruby1.9.1-dev | ≥ 1.8 | | ruby Erweiterung
| liblua5.1-0-dev | | | lua Erweiterung
| tcl-dev | ≥ 8.5 | | tcl Erweiterung
| guile-2.0-dev | ≥ 2.0 | | guile (scheme) Erweiterung
| asciidoc | ≥ 8.5.0 | | erstellt Dokumentation (HTML Dateien)
| source-highlight | | | Syntax Highlight für Quelltext in HTML Dokumentation
| Paket ^(1)^ | Version | benötigt | Funktion
| cmake | | *ja* | zum kompilieren (autotools ist möglich. cmake wird aber empfohlen)
| libncursesw5-dev ^(2)^ | | *ja* | ncurses Oberfläche
| libcurl4-gnutls-dev | | *ja* | URL Transfer
| zlib1g-dev | | *ja* | Kompression für Pakete, die mittels Relay- (WeeChat Protokoll), Script-Erweiterung übertragen werden
| libgcrypt11-dev | | *ja* | IRC SASL Authentifikation (DH-BLOWFISH/DH-AES), Skript-Erweiterung
| libgnutls-dev | ≥ 2.2.0 | | SSL Verbindung zu einem IRC Server, Unterstützung von SSL in der Relay-Erweiterung
| gettext | | | Internationalisierung (Übersetzung der Mitteilungen; Hauptsprache ist englisch)
| ca-certificates | | | Zertifikate für SSL Verbindungen
| libaspell-dev oder libenchant-dev | | | aspell Erweiterung
| python-dev | ≥ 2.5 ^(3)^ | | python Erweiterung
| libperl-dev | | | perl Erweiterung
| ruby1.9.1-dev | ≥ 1.8 | | ruby Erweiterung
| liblua5.1-0-dev | | | lua Erweiterung
| tcl-dev | ≥ 8.5 | | tcl Erweiterung
| guile-2.0-dev | ≥ 2.0 | | guile (scheme) Erweiterung
| asciidoc | ≥ 8.5.0 | | erstellt Dokumentation (HTML Dateien)
| source-highlight | | | Syntax Highlight für Quelltext in HTML Dokumentation
|========================================

[NOTE]
Expand Down
36 changes: 18 additions & 18 deletions doc/en/weechat_user.en.txt
Expand Up @@ -86,24 +86,24 @@ compile WeeChat.

[width="100%",cols="5,^3,^3,13",options="header"]
|========================================
| Package ^(1)^ | Version | Required | Feature
| cmake | | *yes* | build (autotools still possible, but cmake is recommended)
| libncursesw5-dev ^(2)^ | | *yes* | ncurses interface
| libcurl4-gnutls-dev | | *yes* | URL transfer
| zlib1g-dev | | *yes* | compression of packets in relay plugin (weechat protocol), script plugin
| libgcrypt11-dev | | *yes* | IRC SASL authentication (DH-BLOWFISH/DH-AES), script plugin
| libgnutls-dev | ≥ 2.2.0 | | SSL connection to IRC server, support of SSL in relay plugin
| gettext | | | internationalization (translation of messages; base language is English)
| ca-certificates | | | certificates for SSL connections
| libaspell-dev | | | aspell plugin
| python-dev | ≥ 2.5 ^(3)^ | | python plugin
| libperl-dev | | | perl plugin
| ruby1.9.1-dev | ≥ 1.8 | | ruby plugin
| liblua5.1-0-dev | | | lua plugin
| tcl-dev | ≥ 8.5 | | tcl plugin
| guile-2.0-dev | ≥ 2.0 | | guile (scheme) plugin
| asciidoc | ≥ 8.5.0 | | build documentation (HTML files)
| source-highlight | | | syntax highlight for sources in HTML documentation
| Package ^(1)^ | Version | Required | Feature
| cmake | | *yes* | build (autotools still possible, but cmake is recommended)
| libncursesw5-dev ^(2)^ | | *yes* | ncurses interface
| libcurl4-gnutls-dev | | *yes* | URL transfer
| zlib1g-dev | | *yes* | compression of packets in relay plugin (weechat protocol), script plugin
| libgcrypt11-dev | | *yes* | IRC SASL authentication (DH-BLOWFISH/DH-AES), script plugin
| libgnutls-dev | ≥ 2.2.0 | | SSL connection to IRC server, support of SSL in relay plugin
| gettext | | | internationalization (translation of messages; base language is English)
| ca-certificates | | | certificates for SSL connections
| libaspell-dev or libenchant-dev | | | aspell plugin
| python-dev | ≥ 2.5 ^(3)^ | | python plugin
| libperl-dev | | | perl plugin
| ruby1.9.1-dev | ≥ 1.8 | | ruby plugin
| liblua5.1-0-dev | | | lua plugin
| tcl-dev | ≥ 8.5 | | tcl plugin
| guile-2.0-dev | ≥ 2.0 | | guile (scheme) plugin
| asciidoc | ≥ 8.5.0 | | build documentation (HTML files)
| source-highlight | | | syntax highlight for sources in HTML documentation
|========================================

[NOTE]
Expand Down
36 changes: 18 additions & 18 deletions doc/fr/weechat_user.fr.txt
Expand Up @@ -88,24 +88,24 @@ compiler WeeChat.

[width="100%",cols="5,^3,^3,13",options="header"]
|========================================
| Paquet ^(1)^ | Version | Requis | Fonctionnalité
| cmake | | *oui* | construction (autotools toujours possible, mais cmake est recommandé)
| libncursesw5-dev ^(2)^ | | *oui* | interface ncurses
| libcurl4-gnutls-dev | | *oui* | transfert d'URL
| zlib1g-dev | | *oui* | compression des paquets dans l'extension relay (protocole weechat), extension script
| libgcrypt11-dev | | *oui* | authentification IRC SASL (DH-BLOWFISH/DH-AES), extension script
| libgnutls-dev | ≥ 2.2.0 | | connexion SSL au serveur IRC, support SSL dans l'extension relay
| gettext | | | internationalisation (traduction des messages; la langue de base est l'anglais)
| ca-certificates | | | certificats pour les connexions SSL
| libaspell-dev | | | extension aspell
| python-dev | ≥ 2.5 ^(3)^ | | extension python
| libperl-dev | | | extension perl
| ruby1.9.1-dev | ≥ 1.8 | | extension ruby
| liblua5.1-0-dev | | | extension lua
| tcl-dev | ≥ 8.5 | | extension tcl
| guile-2.0-dev | ≥ 2.0 | | extension guile (scheme)
| asciidoc | ≥ 8.5.0 | | construction de la documentation (fichiers HTML)
| source-highlight | | | coloration des sources dans la documentation HTML
| Paquet ^(1)^ | Version | Requis | Fonctionnalité
| cmake | | *oui* | construction (autotools toujours possible, mais cmake est recommandé)
| libncursesw5-dev ^(2)^ | | *oui* | interface ncurses
| libcurl4-gnutls-dev | | *oui* | transfert d'URL
| zlib1g-dev | | *oui* | compression des paquets dans l'extension relay (protocole weechat), extension script
| libgcrypt11-dev | | *oui* | authentification IRC SASL (DH-BLOWFISH/DH-AES), extension script
| libgnutls-dev | ≥ 2.2.0 | | connexion SSL au serveur IRC, support SSL dans l'extension relay
| gettext | | | internationalisation (traduction des messages; la langue de base est l'anglais)
| ca-certificates | | | certificats pour les connexions SSL
| libaspell-dev ou libenchant-dev | | | extension aspell
| python-dev | ≥ 2.5 ^(3)^ | | extension python
| libperl-dev | | | extension perl
| ruby1.9.1-dev | ≥ 1.8 | | extension ruby
| liblua5.1-0-dev | | | extension lua
| tcl-dev | ≥ 8.5 | | extension tcl
| guile-2.0-dev | ≥ 2.0 | | extension guile (scheme)
| asciidoc | ≥ 8.5.0 | | construction de la documentation (fichiers HTML)
| source-highlight | | | coloration des sources dans la documentation HTML
|========================================

[NOTE]
Expand Down

0 comments on commit fb7edb3

Please sign in to comment.