1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-12 14:14:48 +02:00

Bump required enchant to v2, use pkg_check_modules()

Bump the requirement to v2, which means we can remove the
HAVE_ENCHANT_GET_VERSION workaround.

It was released over 8 years ago, with 8 new feature releases since
then and dozens of bugfix releases throughout.

The oldest distributions we target Ubuntu 20.04 and Debian Bullseye,
have 2.2.8 and 2.2.15 respectively.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
This commit is contained in:
Emil Velikov
2025-08-23 13:06:19 +01:00
committed by Sébastien Helleu
parent c48485bc46
commit b2d9ad9e22
6 changed files with 3 additions and 70 deletions
-11
View File
@@ -1,11 +0,0 @@
Copyright (c) <year> <owner>.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-51
View File
@@ -1,51 +0,0 @@
# SPDX-FileCopyrightText: 2006 Zack Rusin <zack@kde.org>
#
# SPDX-License-Identifier: BSD-3-Clause
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
# - 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
if(ENCHANT_INCLUDE_DIR AND ENCHANT_LIBRARIES)
# in cache already
set(ENCHANT_FOUND TRUE)
else()
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()
find_path(ENCHANT_INCLUDE_DIR
NAMES enchant++.h
HINTS ${PC_ENCHANT_INCLUDEDIR} ${PC_ENCHANT_INCLUDE_DIRS}
PATH_SUFFIXES enchant-2 enchant
)
find_library(ENCHANT_LIBRARIES
NAMES enchant-2 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)
# check if function enchant_get_version() exists
set(CMAKE_REQUIRED_INCLUDES ${ENCHANT_INCLUDE_DIR})
set(CMAKE_REQUIRED_LIBRARIES ${ENCHANT_LIBRARIES})
check_symbol_exists(enchant_get_version "enchant.h" HAVE_ENCHANT_GET_VERSION)
set(CMAKE_REQUIRED_INCLUDES)
set(CMAKE_REQUIRED_LIBRARIES)
endif()
-1
View File
@@ -52,7 +52,6 @@ SPDX-License-Identifier: GPL-3.0-or-later
#cmakedefine HAVE_HTONLL #cmakedefine HAVE_HTONLL
#cmakedefine HAVE_EAT_NEWLINE_GLITCH #cmakedefine HAVE_EAT_NEWLINE_GLITCH
#cmakedefine HAVE_ASPELL_VERSION_STRING #cmakedefine HAVE_ASPELL_VERSION_STRING
#cmakedefine HAVE_ENCHANT_GET_VERSION
#cmakedefine HAVE_GUILE_GMP_MEMORY_FUNCTIONS #cmakedefine HAVE_GUILE_GMP_MEMORY_FUNCTIONS
#define CMAKE_BUILD_TYPE "@CMAKE_BUILD_TYPE@" #define CMAKE_BUILD_TYPE "@CMAKE_BUILD_TYPE@"
+1 -1
View File
@@ -206,7 +206,7 @@ endif()
if(ENABLE_SPELL) if(ENABLE_SPELL)
if(ENABLE_ENCHANT) if(ENABLE_ENCHANT)
find_package(ENCHANT) pkg_check_modules(ENCHANT enchant-2)
if(ENCHANT_FOUND) if(ENCHANT_FOUND)
add_subdirectory(spell) add_subdirectory(spell)
else() else()
+2 -2
View File
@@ -32,8 +32,8 @@ add_library(spell MODULE
set_target_properties(spell PROPERTIES PREFIX "") set_target_properties(spell PROPERTIES PREFIX "")
if(ENCHANT_FOUND) if(ENCHANT_FOUND)
include_directories(${ENCHANT_INCLUDE_DIR}) include_directories(${ENCHANT_INCLUDE_DIRS})
target_link_libraries(spell ${ENCHANT_LIBRARIES} coverage_config) target_link_libraries(spell ${ENCHANT_LDFLAGS} coverage_config)
add_definitions(-DUSE_ENCHANT) add_definitions(-DUSE_ENCHANT)
else() else()
if(ASPELL_FOUND) if(ASPELL_FOUND)
-4
View File
@@ -1123,12 +1123,8 @@ spell_debug_libs_cb (const void *pointer, void *data, const char *signal,
(void) signal_data; (void) signal_data;
#ifdef USE_ENCHANT #ifdef USE_ENCHANT
#ifdef HAVE_ENCHANT_GET_VERSION
weechat_printf (NULL, " %s: enchant %s", weechat_printf (NULL, " %s: enchant %s",
SPELL_PLUGIN_NAME, enchant_get_version ()); SPELL_PLUGIN_NAME, enchant_get_version ());
#else
weechat_printf (NULL, " %s: enchant (?)", SPELL_PLUGIN_NAME);
#endif /* HAVE_ENCHANT_GET_VERSION */
#else #else
#ifdef HAVE_ASPELL_VERSION_STRING #ifdef HAVE_ASPELL_VERSION_STRING
weechat_printf (NULL, " %s: aspell %s", weechat_printf (NULL, " %s: aspell %s",