Skip to content

Commit

Permalink
Update to libhunspell 1.7.2-r1 (#2175)
Browse files Browse the repository at this point in the history
  • Loading branch information
RyeMutt committed Aug 2, 2024
1 parent 05fd13f commit f08b3f2
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 39 deletions.
16 changes: 8 additions & 8 deletions autobuild.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1112,11 +1112,11 @@
<key>archive</key>
<map>
<key>hash</key>
<string>d5757ab84d934fa358f299ab91e2e297beaa3dac</string>
<string>e71ae7a645603fe967a69aa5beb5b3009185e177</string>
<key>hash_algorithm</key>
<string>sha1</string>
<key>url</key>
<string>https://github.com/secondlife/3p-libhunspell/releases/download/v1.3.2.650fb94/libhunspell-1.3.2.650fb94-darwin64-650fb94.tar.zst</string>
<string>https://github.com/secondlife/3p-libhunspell/releases/download/v1.7.2-r1/libhunspell-1.7.2.10207243663-darwin64-10207243663.tar.zst</string>
</map>
<key>name</key>
<string>darwin64</string>
Expand All @@ -1126,11 +1126,11 @@
<key>archive</key>
<map>
<key>hash</key>
<string>6413d3bd4cd50c2a6b7f949eb4bd6f0c94feb984</string>
<string>275ffb7f60064d8008aed8406f80f34229f651fc</string>
<key>hash_algorithm</key>
<string>sha1</string>
<key>url</key>
<string>https://github.com/secondlife/3p-libhunspell/releases/download/v1.3.2.650fb94/libhunspell-1.3.2.650fb94-linux64-650fb94.tar.zst</string>
<string>https://github.com/secondlife/3p-libhunspell/releases/download/v1.7.2-r1/libhunspell-1.7.2.10207243663-linux64-10207243663.tar.zst</string>
</map>
<key>name</key>
<string>linux64</string>
Expand All @@ -1140,11 +1140,11 @@
<key>archive</key>
<map>
<key>hash</key>
<string>c1be4a79b20435030b2e0e01b582c61b462c8376</string>
<string>89ff24e93eaeca7949ccdb5cc368f938f5b1f307</string>
<key>hash_algorithm</key>
<string>sha1</string>
<key>url</key>
<string>https://github.com/secondlife/3p-libhunspell/releases/download/v1.3.2.650fb94/libhunspell-1.3.2.650fb94-windows64-650fb94.tar.zst</string>
<string>https://github.com/secondlife/3p-libhunspell/releases/download/v1.7.2-r1/libhunspell-1.7.2.10207243663-windows64-10207243663.tar.zst</string>
</map>
<key>name</key>
<string>windows64</string>
Expand All @@ -1155,9 +1155,9 @@
<key>license_file</key>
<string>LICENSES/hunspell.txt</string>
<key>copyright</key>
<string>See hunspell.txt</string>
<string>LGPL 2.1</string>
<key>version</key>
<string>1.3.2.650fb94</string>
<string>1.7.2.10207243663</string>
<key>name</key>
<string>libhunspell</string>
<key>description</key>
Expand Down
3 changes: 0 additions & 3 deletions indra/cmake/Copy3rdPartyLibs.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ if(WINDOWS)
libapr-1.dll
libaprutil-1.dll
nghttp2.dll
libhunspell.dll
)

# OpenSSL
Expand Down Expand Up @@ -185,7 +184,6 @@ elseif(DARWIN)
libaprutil-1.0.dylib
libaprutil-1.dylib
${EXPAT_COPY}
libhunspell-1.3.0.dylib
libndofdev.dylib
libnghttp2.dylib
libnghttp2.14.dylib
Expand Down Expand Up @@ -231,7 +229,6 @@ elseif(LINUX)
libatk-1.0.so
libfreetype.so.6.6.2
libfreetype.so.6
libhunspell-1.3.so.0.0.0
libopenjp2.so
libuuid.so.16
libuuid.so.16.0.22
Expand Down
13 changes: 10 additions & 3 deletions indra/cmake/Hunspell.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- cmake -*-
include(Linking)
include(Prebuilt)

include_guard()
Expand All @@ -8,10 +9,16 @@ add_library( ll::hunspell INTERFACE IMPORTED )
use_system_binary(hunspell)
use_prebuilt_binary(libhunspell)
if (WINDOWS)
target_link_libraries( ll::hunspell INTERFACE libhunspell)
target_compile_definitions( ll::hunspell INTERFACE HUNSPELL_STATIC=1)
target_link_libraries( ll::hunspell INTERFACE
debug ${ARCH_PREBUILT_DIRS_DEBUG}/libhunspell.lib
optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libhunspell.lib
)
elseif(DARWIN)
target_link_libraries( ll::hunspell INTERFACE hunspell-1.3)
target_link_libraries( ll::hunspell INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/libhunspell-1.7.a
)
elseif(LINUX)
target_link_libraries( ll::hunspell INTERFACE hunspell-1.3)
target_link_libraries( ll::hunspell INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/libhunspell-1.7.a
)
endif()
target_include_directories( ll::hunspell SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include/hunspell)
26 changes: 7 additions & 19 deletions indra/llui/llspellcheck.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,7 @@
#include "llsdserialize.h"

#include "llspellcheck.h"
#if LL_WINDOWS
#include <hunspell/hunspelldll.h>
#pragma comment(lib, "libhunspell.lib")
#else
#include <hunspell/hunspell.hxx>
#endif
#include <hunspell/hunspell.hxx>

static const std::string DICT_DIR = "dictionaries";
static const std::string DICT_FILE_CUSTOM = "user_custom.dic";
Expand Down Expand Up @@ -64,11 +59,11 @@ void LLSpellChecker::initSingleton()

bool LLSpellChecker::checkSpelling(const std::string& word) const
{
if ( (!mHunspell) || (word.length() < 3) || (0 != mHunspell->spell(word.c_str())) )
if ( (!mHunspell) || (word.length() < 3) || (0 != mHunspell->spell(word)) )
{
return true;
}
if (mIgnoreList.size() > 0)
if (!mIgnoreList.empty())
{
std::string word_lower(word);
LLStringUtil::toLower(word_lower);
Expand All @@ -85,15 +80,8 @@ S32 LLSpellChecker::getSuggestions(const std::string& word, std::vector<std::str
return 0;
}

char** suggestion_list; int suggestion_cnt = 0;
if ( (suggestion_cnt = mHunspell->suggest(&suggestion_list, word.c_str())) != 0 )
{
for (int suggestion_index = 0; suggestion_index < suggestion_cnt; suggestion_index++)
{
suggestions.push_back(suggestion_list[suggestion_index]);
}
mHunspell->free_list(&suggestion_list, suggestion_cnt);
}
suggestions = mHunspell->suggest(word);

return static_cast<S32>(suggestions.size());
}

Expand Down Expand Up @@ -194,7 +182,7 @@ void LLSpellChecker::addToCustomDictionary(const std::string& word)
{
if (mHunspell)
{
mHunspell->add(word.c_str());
mHunspell->add(word);
}
addToDictFile(getDictionaryUserPath() + DICT_FILE_CUSTOM, word);
sSettingsChangeSignal();
Expand Down Expand Up @@ -422,7 +410,7 @@ bool LLSpellChecker::canRemoveDictionary(const std::string& dict_language)
const LLSD dict_info = getDictionaryData(dict_language);
return
(dict_info["user_installed"].asBoolean()) &&
( (!getUseSpellCheck()) || (!LLSpellChecker::instance().isActiveDictionary(dict_language)) );
( (!getUseSpellCheck()) || (!isActiveDictionary(dict_language)) );
}

void LLSpellChecker::removeDictionary(const std::string& dict_language)
Expand Down
1 change: 0 additions & 1 deletion indra/newview/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1729,7 +1729,6 @@ if (WINDOWS)
${CMAKE_SOURCE_DIR}/../etc/message.xml
${CMAKE_SOURCE_DIR}/../scripts/messages/message_template.msg
${SHARED_LIB_STAGING_DIR}/openjp2.dll
${SHARED_LIB_STAGING_DIR}/libhunspell.dll
${SHARED_LIB_STAGING_DIR}/llwebrtc.dll
#${SHARED_LIB_STAGING_DIR}/${LL_INTDIR}/SLVoice.exe
#${SHARED_LIB_STAGING_DIR}/${LL_INTDIR}/libsndfile-1.dll
Expand Down
5 changes: 0 additions & 5 deletions indra/newview/viewer_manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -587,9 +587,6 @@ def construct(self):
# HTTP/2
self.path("nghttp2.dll")

# Hunspell
self.path("libhunspell.dll")

# BugSplat
if self.args.get('bugsplat'):
self.path("BsSndRpt64.exe")
Expand Down Expand Up @@ -930,7 +927,6 @@ def construct(self):

with self.prefix(src=relpkgdir, dst=""):
self.path("libndofdev.dylib")
self.path("libhunspell-*.dylib")

with self.prefix(src_dst="cursors_mac"):
self.path("*.tif")
Expand Down Expand Up @@ -1336,7 +1332,6 @@ def construct(self):
self.path("libdirectfb-1.4.so.5")
self.path("libfusion-1.4.so.5")
self.path("libdirect-1.4.so.5*")
self.path("libhunspell-1.3.so*")
self.path("libalut.so*")
self.path("libopenal.so*")
self.path("libopenal.so", "libvivoxoal.so.1") # vivox's sdk expects this soname
Expand Down

0 comments on commit f08b3f2

Please sign in to comment.