SHA256
1
0
forked from pool/sonnet
Wolfgang Bauer 2018-08-20 12:59:02 +00:00 committed by Git OBS Bridge
parent da57f95b06
commit f3b37efaae
5 changed files with 100 additions and 45 deletions

43
Fix_Leap_42_3_build.patch Normal file
View File

@ -0,0 +1,43 @@
commit 6b3204cbe16f23b16f856daeddc8d13e94e4290b
Author: Christophe Giboudeaux <christophe@krop.fr>
Date: Sun Aug 19 14:17:25 2018 +0200
Revert "Use the current hunspell API"
The new hunspell api is not available in leap 42.3.
This reverts commit 0a96acf251baa5c9dd042d093ab2bf8fcee10502.
diff --git a/src/plugins/hunspell/hunspelldict.cpp b/src/plugins/hunspell/hunspelldict.cpp
index 397bbbb..cc1dd9b 100644
--- a/src/plugins/hunspell/hunspelldict.cpp
+++ b/src/plugins/hunspell/hunspelldict.cpp
@@ -102,9 +102,9 @@ bool HunspellDict::isCorrect(const QString &word) const
if (!m_speller) {
return false;
}
- bool result = m_speller->spell(toDictEncoding(word).toStdString());
+ int result = m_speller->spell(toDictEncoding(word).constData());
qCDebug(SONNET_HUNSPELL) << " result :" << result;
- return result;
+ return result != 0;
}
QStringList HunspellDict::suggest(const QString &word) const
@@ -112,10 +112,13 @@ QStringList HunspellDict::suggest(const QString &word) const
if (!m_speller) {
return QStringList();
}
+ char **selection;
QStringList lst;
- const auto suggestions = m_speller->suggest(toDictEncoding(word).toStdString());
- for_each (suggestions.begin(), suggestions.end(), [this, &lst](const std::string &suggestion) {
- lst << m_codec->toUnicode(suggestion.c_str()); });
+ int nbWord = m_speller->suggest(&selection, toDictEncoding(word).constData());
+ for (int i = 0; i < nbWord; ++i) {
+ lst << m_codec->toUnicode(selection[i]);
+ }
+ m_speller->free_list(&selection, nbWord);
return lst;
}

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:04ebc3d6b912c09641771c8780d8124e23417e3ae0e639a9a50e67198c12f4d7
size 286072

3
sonnet-5.49.0.tar.xz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:63053a671a8dc7a2a97cd49fe915e02e4b37fe41a06f3cd8785a7218d4acb754
size 286104

View File

@ -1,3 +1,15 @@
-------------------------------------------------------------------
Sun Aug 19 09:19:38 UTC 2018 - christophe@krop.fr
- Update to 5.49.0
* New feature release
* For more details please see:
* https://www.kde.org/announcements/kde-frameworks-5.49.0.php
- Changes since 5.48.0:
* Sonnet: setLanguage should schedule a rehighlight if highlight is enabled
* Use the current hunspell API
- Add Fix_Leap_42_3_build.patch to use the old hunspell api in leap 42.3.
-------------------------------------------------------------------
Mon Jul 16 04:37:50 UTC 2018 - lbeltrame@kde.org

View File

@ -16,16 +16,24 @@
#
%bcond_without lang
%define sonum 5
%define _tar_path 5.48
%define _tar_path 5.49
# Full KF5 version (e.g. 5.33.0)
%{!?_kf5_version: %global _kf5_version %{version}}
# Last major and minor KF5 version (e.g. 5.33)
%{!?_kf5_bugfix_version: %define _kf5_bugfix_version %(echo %{_kf5_version} | awk -F. '{print $1"."$2}')}
%bcond_without lang
Name: sonnet
Version: 5.48.0
Version: 5.49.0
Release: 0
Summary: KDE spell checking library
License: LGPL-2.1-or-later
Group: System/GUI/KDE
URL: http://www.kde.org
Source: http://download.kde.org/stable/frameworks/%{_tar_path}/%{name}-%{version}.tar.xz
Source1: baselibs.conf
# PATCH-FIX-OPENSUSE
Patch0: Fix_Leap_42_3_build.patch
#BuildRequires: aspell-devel
BuildRequires: cmake >= 3.0
# Enchant plugin is currently disabled upstream
@ -33,50 +41,44 @@ BuildRequires: cmake >= 3.0
BuildRequires: extra-cmake-modules >= %{_kf5_bugfix_version}
BuildRequires: fdupes
BuildRequires: kf5-filesystem
%if %{with lang}
BuildRequires: cmake(Qt5LinguistTools) >= 5.6.0
%endif
BuildRequires: myspell-dictionaries
BuildRequires: pkgconfig
BuildRequires: cmake(Qt5Core) >= 5.6.0
BuildRequires: cmake(Qt5Test) >= 5.6.0
BuildRequires: cmake(Qt5Widgets) >= 5.6.0
BuildRequires: pkgconfig(hunspell)
Summary: KDE spell checking library
License: LGPL-2.1-or-later
Group: System/GUI/KDE
Url: http://www.kde.org
Source: http://download.kde.org/stable/frameworks/%{_tar_path}/%{name}-%{version}.tar.xz
Source1: baselibs.conf
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%if %{with lang}
BuildRequires: cmake(Qt5LinguistTools) >= 5.6.0
%endif
%description
Sonnet is a plugin-based spell checking library for Qt-based
applications. It supports several different plugins, including
HSpell, Enchant, ASpell and HUNSPELL.
%package -n libKF5SonnetCore%sonum
%package -n libKF5SonnetCore%{sonum}
Summary: KDE spell checking library
Group: System/GUI/KDE
Requires: %{name} >= %{_kf5_bugfix_version}
%requires_ge libQt5Core5
Obsoletes: libKF5SonnetCore4
%if %{with lang}
Recommends: libKF5SonnetCore%sonum-lang = %{version}
Recommends: libKF5SonnetCore%{sonum}-lang = %{version}
%endif
%requires_ge libQt5Core5
%description -n libKF5SonnetCore%sonum
%description -n libKF5SonnetCore%{sonum}
Sonnet is a plugin-based spell checking library for Qt-based
applications. It supports several different plugins, including
HSpell, Enchant, ASpell and HUNSPELL.
%package -n libKF5SonnetUi%sonum
%package -n libKF5SonnetUi%{sonum}
Summary: KDE spell checking library
Group: System/GUI/KDE
%requires_ge libQt5Gui5
%requires_ge libQt5Widgets5
%requires_ge libKF5SonnetCore5
%requires_ge libKF5SonnetCore5
%requires_ge libQt5Gui5
%requires_ge libQt5Widgets5
%description -n libKF5SonnetUi%sonum
%description -n libKF5SonnetUi%{sonum}
Sonnet is a plugin-based spell checking library for Qt-based
applications. It supports several different plugins, including
HSpell, Enchant, ASpell and HUNSPELL.
@ -85,8 +87,8 @@ HSpell, Enchant, ASpell and HUNSPELL.
Summary: KDE spell checking library: Build Environment
Group: Development/Libraries/KDE
Requires: extra-cmake-modules
Requires: libKF5SonnetCore%sonum = %{version}
Requires: libKF5SonnetUi%sonum = %{version}
Requires: libKF5SonnetCore%{sonum} = %{version}
Requires: libKF5SonnetUi%{sonum} = %{version}
Requires: cmake(Qt5Core) >= 5.6.0
%description devel
@ -94,9 +96,13 @@ Sonnet is a plugin-based spell checking library for Qt-based
applications. It supports several different plugins, including
HSpell, Enchant, ASpell and HUNSPELL. Development files.
%lang_package -n libKF5SonnetCore%sonum
%lang_package -n libKF5SonnetCore%{sonum}
%prep
%setup -q
%if 0%{?suse_version} <= 1315
%patch0 -p1
%endif
%build
%cmake_kf5 -d build -- -Dlconvert_executable=%{_kf5_libdir}/qt5/bin/lconvert
@ -110,37 +116,31 @@ HSpell, Enchant, ASpell and HUNSPELL. Development files.
%find_lang %{name}5 --with-qt --without-mo
%endif
%post -n libKF5SonnetCore%sonum -p /sbin/ldconfig
%postun -n libKF5SonnetCore%sonum -p /sbin/ldconfig
%post -n libKF5SonnetUi%sonum -p /sbin/ldconfig
%postun -n libKF5SonnetUi%sonum -p /sbin/ldconfig
%post -n libKF5SonnetCore%{sonum} -p /sbin/ldconfig
%postun -n libKF5SonnetCore%{sonum} -p /sbin/ldconfig
%post -n libKF5SonnetUi%{sonum} -p /sbin/ldconfig
%postun -n libKF5SonnetUi%{sonum} -p /sbin/ldconfig
%if %{with lang}
%files -n libKF5SonnetCore%sonum-lang -f %{name}5.lang
%files -n libKF5SonnetCore%{sonum}-lang -f %{name}5.lang
%endif
%files
%defattr(-,root,root)
%doc COPYING* README*
%license COPYING*
%doc README*
%{_kf5_debugdir}/sonnet.categories
%{_kf5_plugindir}/
%{_kf5_datadir}/sonnet/
%files -n libKF5SonnetCore%sonum
%defattr(-,root,root)
%doc COPYING*
%files -n libKF5SonnetCore%{sonum}
%license COPYING*
%{_kf5_libdir}/libKF5SonnetCore.so.*
%files -n libKF5SonnetUi%sonum
%defattr(-,root,root)
%doc COPYING*
%files -n libKF5SonnetUi%{sonum}
%license COPYING*
%{_kf5_libdir}/libKF5SonnetUi.so.*
%files devel
%defattr(-,root,root)
%{_kf5_bindir}/parsetrigrams
%{_kf5_bindir}/gentrigrams
%{_kf5_libdir}/libKF5SonnetCore.so