nuspell: bump version

This commit is contained in:
Jerome Duval
2021-03-10 18:27:33 +01:00
parent 565d1ba6ce
commit 345a8c4bb3
2 changed files with 28 additions and 73 deletions

View File

@@ -19,16 +19,24 @@ COPYRIGHT="2016-2019 Dimitrij Mijoski, Sander van Geloven
2002-2008 László Németh (Hunspell)
2001-2002 Kevin Hendricks (MySpell)"
LICENSE="GNU LGPL v3"
REVISION="2"
REVISION="1"
SOURCE_URI="https://github.com/nuspell/nuspell/archive/v$portVersion.tar.gz"
CHECKSUM_SHA256="9ce86d5463723cc7dceba9d1dd046e1022ed5e3004ac6d12f2daaf5b090a6066"
CHECKSUM_SHA256="01804d490bec517748ee49fa2f1249f4c99380c26335e32082cdaa02b5b2b4dc"
SOURCE_FILENAME="nuspell-$portVersion.tar.gz"
PATCHES="nuspell-$portVersion.patchset"
ARCHITECTURES="!x86_gcc2 x86_64"
SECONDARY_ARCHITECTURES="x86"
libVersion="$portVersion compat >= 3"
# On x86_gcc2 we don't want to install the commands in bin/<arch>/, but in bin/.
commandSuffix=$secondaryArchSuffix
commandBinDir=$binDir
if [ "$targetArchitecture" = x86_gcc2 ]; then
commandSuffix=
commandBinDir=$prefix/bin
fi
libVersion="$portVersion compat >= 4"
PROVIDES="
$portName = $portVersion
@@ -37,7 +45,6 @@ PROVIDES="
"
REQUIRES="
haiku$secondaryArchSuffix
lib:libboost_locale$secondaryArchSuffix
lib:libicudata$secondaryArchSuffix
lib:libicuuc$secondaryArchSuffix
"
@@ -52,7 +59,6 @@ REQUIRES_devel="
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
devel:libboost_locale$secondaryArchSuffix >= 1.69.0
devel:libicudata$secondaryArchSuffix >= 66
devel:libicuuc$secondaryArchSuffix >= 66
"
@@ -70,6 +76,7 @@ BUILD()
mkdir -p build
cd build
cmake $cmakeDirArgs .. \
-DCMAKE_INSTALL_BINDIR=$commandBinDir \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS=ON
make $jobArgs

View File

@@ -1,22 +1,16 @@
From ad55c8ad61aa93ad5eb4005cd6b87e22c45d3318 Mon Sep 17 00:00:00 2001
From 618ae4a0453576454b52924b74a30dd793d16379 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= <revol@free.fr>
Date: Tue, 4 Feb 2020 12:47:12 +0100
Subject: [PATCH 1/2] Fix build on Haiku
Subject: Fix build on Haiku
We don't have locale_t yet.
Some things should probably be tested by CMake instead of hardcoding ifdefs.
Some tests crash though.
---
src/nuspell/finder.cxx | 3 ++-
src/nuspell/main.cxx | 2 +-
src/nuspell/utils.hxx | 5 +++--
tests/verify.cxx | 2 +-
4 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/src/nuspell/finder.cxx b/src/nuspell/finder.cxx
index 59173ff..a374f5e 100644
index 3cb8c85..ca84697 100644
--- a/src/nuspell/finder.cxx
+++ b/src/nuspell/finder.cxx
@@ -28,7 +28,8 @@
@@ -30,11 +24,11 @@ index 59173ff..a374f5e 100644
#ifdef _POSIX_VERSION
#include <dirent.h>
diff --git a/src/nuspell/main.cxx b/src/nuspell/main.cxx
index f4fc5ad..ff049ee 100644
index 17084cd..f9fb564 100644
--- a/src/nuspell/main.cxx
+++ b/src/nuspell/main.cxx
@@ -33,7 +33,7 @@
#define PACKAGE_STRING "nuspell " PROJECT_VERSION
@@ -27,7 +27,7 @@
#include <unicode/ucnv.h>
#if defined(__MINGW32__) || defined(__unix__) || defined(__unix) || \
- (defined(__APPLE__) && defined(__MACH__))
@@ -43,11 +37,11 @@ index f4fc5ad..ff049ee 100644
#include <unistd.h>
#endif
diff --git a/src/nuspell/utils.hxx b/src/nuspell/utils.hxx
index 968053d..722c4d7 100644
index a401a7c..7d12bca 100644
--- a/src/nuspell/utils.hxx
+++ b/src/nuspell/utils.hxx
@@ -30,7 +30,8 @@
#include <clocale>
@@ -28,7 +28,8 @@
#include <vector>
#if !defined(_WIN32) && (defined(__unix__) || defined(__unix) || \
- (defined(__APPLE__) && defined(__MACH__)))
@@ -56,21 +50,21 @@ index 968053d..722c4d7 100644
#include <unistd.h>
#endif
@@ -125,7 +126,7 @@ class Encoding_Converter {
@@ -152,7 +153,7 @@ class Encoding_Converter {
};
//#if _POSIX_VERSION >= 200809L
-#ifdef _POSIX_VERSION
+#if defined(_POSIX_VERSION) && !defined(__HAIKU__)
-#if defined(_POSIX_VERSION) && !defined(__NetBSD__)
+#if defined(_POSIX_VERSION) && !defined(__NetBSD__) && !defined(__HAIKU__)
class Setlocale_To_C_In_Scope {
locale_t old_loc = nullptr;
diff --git a/tests/verify.cxx b/tests/verify.cxx
index 453ed43..417e64a 100644
index db8c8e4..2d361e0 100644
--- a/tests/verify.cxx
+++ b/tests/verify.cxx
@@ -34,7 +34,7 @@
#define PACKAGE_STRING "nuspell " PROJECT_VERSION
@@ -27,7 +27,7 @@
#include <unicode/ucnv.h>
#if defined(__MINGW32__) || defined(__unix__) || defined(__unix) || \
- (defined(__APPLE__) && defined(__MACH__))
@@ -79,51 +73,5 @@ index 453ed43..417e64a 100644
#include <unistd.h>
#endif
--
2.24.1
From 1dc3b857df8ade706b2113adb5008e0acf825423 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= <revol@free.fr>
Date: Tue, 4 Feb 2020 13:06:07 +0100
Subject: [PATCH 2/2] Use native API on Haiku to find dictionary paths
---
src/nuspell/finder.cxx | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/src/nuspell/finder.cxx b/src/nuspell/finder.cxx
index a374f5e..b0b5e76 100644
--- a/src/nuspell/finder.cxx
+++ b/src/nuspell/finder.cxx
@@ -37,6 +37,9 @@
#include <sys/stat.h>
#include <sys/types.h>
#endif
+#if defined(__HAIKU__)
+#include <FindDirectory.h>
+#endif
#elif defined(_WIN32)
@@ -80,7 +83,17 @@ auto get_default_search_paths(OutIt out) -> OutIt
if (dicpath) {
out = split(string(dicpath), PATHSEP, out);
}
-#ifdef _POSIX_VERSION
+#if defined(__HAIKU__)
+ char **paths;
+ size_t pathsCount;
+ if (find_paths(B_FIND_PATH_DATA_DIRECTORY, "hunspell",
+ &paths, &pathsCount) == B_OK) {
+ for (int i = 0; i < pathsCount; i++) {
+ *out++ = string(paths[i]);
+ }
+ free(paths);
+ }
+#elif defined(_POSIX_VERSION)
auto home = getenv("HOME");
if (home) {
*out++ = home + string("/.local/share/hunspell");
--
2.24.1
2.30.0