summaryrefslogtreecommitdiffstats
path: root/external/hunspell
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--external/hunspell/0001-invalid-read-memory-access-624.patch25
-rw-r--r--external/hunspell/ExternalProject_hunspell.mk39
-rw-r--r--external/hunspell/Makefile7
-rw-r--r--external/hunspell/Module_hunspell.mk25
-rw-r--r--external/hunspell/README4
-rw-r--r--external/hunspell/StaticLibrary_hunspell.mk41
-rw-r--r--external/hunspell/UnpackedTarball_hunspell.mk28
7 files changed, 169 insertions, 0 deletions
diff --git a/external/hunspell/0001-invalid-read-memory-access-624.patch b/external/hunspell/0001-invalid-read-memory-access-624.patch
new file mode 100644
index 000000000..66b55e755
--- /dev/null
+++ b/external/hunspell/0001-invalid-read-memory-access-624.patch
@@ -0,0 +1,25 @@
+From ac938e2ecb48ab4dd21298126c7921689d60571b Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
+Date: Tue, 12 Nov 2019 20:03:15 +0000
+Subject: [PATCH] invalid read memory access #624
+
+---
+ src/hunspell/suggestmgr.cxx | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/hunspell/suggestmgr.cxx b/src/hunspell/suggestmgr.cxx
+index dba084e..c23f165 100644
+--- a/src/hunspell/suggestmgr.cxx
++++ b/src/hunspell/suggestmgr.cxx
+@@ -2040,7 +2040,7 @@ int SuggestMgr::leftcommonsubstring(
+ int l2 = su2.size();
+ // decapitalize dictionary word
+ if (complexprefixes) {
+- if (su1[l1 - 1] == su2[l2 - 1])
++ if (l1 && l2 && su1[l1 - 1] == su2[l2 - 1])
+ return 1;
+ } else {
+ unsigned short idx = su2.empty() ? 0 : (su2[0].h << 8) + su2[0].l;
+--
+2.23.0
+
diff --git a/external/hunspell/ExternalProject_hunspell.mk b/external/hunspell/ExternalProject_hunspell.mk
new file mode 100644
index 000000000..c63498af7
--- /dev/null
+++ b/external/hunspell/ExternalProject_hunspell.mk
@@ -0,0 +1,39 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_ExternalProject_ExternalProject,hunspell))
+
+$(eval $(call gb_ExternalProject_register_targets,hunspell,\
+ build \
+))
+
+hunspell_CPPCLAGS=$(CPPFLAGS)
+
+hunspell_CPPFLAGS+=$(gb_COMPILERDEFS_STDLIB_DEBUG)
+
+hunspell_CXXFLAGS:=$(CXXFLAGS) $(gb_LTOFLAGS) \
+ $(gb_EMSCRIPTEN_CPPFLAGS) \
+ $(call gb_ExternalProject_get_build_flags,hunspell)
+
+hunspell_LDFLAGS:=$(gb_LTOFLAGS) $(call gb_ExternalProject_get_link_flags,hunspell)
+
+$(call gb_ExternalProject_get_state_target,hunspell,build):
+ $(call gb_Trace_StartRange,hunspell,EXTERNAL)
+ $(call gb_ExternalProject_run,build,\
+ $(gb_RUN_CONFIGURE) ./configure --disable-shared --disable-nls --with-pic \
+ $(gb_CONFIGURE_PLATFORMS) \
+ $(if $(filter AIX,$(OS)),CFLAGS="-D_LINUX_SOURCE_COMPAT") \
+ $(if $(hunspell_CPPFLAGS),CPPFLAGS='$(hunspell_CPPFLAGS)') \
+ $(if $(hunspell_CXXFLAGS),CXXFLAGS='$(hunspell_CXXFLAGS)') \
+ $(if $(hunspell_LDFLAGS),LDFLAGS='$(hunspell_LDFLAGS)') \
+ && cd src/hunspell && $(MAKE) \
+ )
+ $(call gb_Trace_EndRange,hunspell,EXTERNAL)
+
+# vim: set noet sw=4 ts=4:
diff --git a/external/hunspell/Makefile b/external/hunspell/Makefile
new file mode 100644
index 000000000..e4968cf85
--- /dev/null
+++ b/external/hunspell/Makefile
@@ -0,0 +1,7 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+
+module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
+
+include $(module_directory)/../../solenv/gbuild/partial_build.mk
+
+# vim: set noet sw=4 ts=4:
diff --git a/external/hunspell/Module_hunspell.mk b/external/hunspell/Module_hunspell.mk
new file mode 100644
index 000000000..505a9fb0c
--- /dev/null
+++ b/external/hunspell/Module_hunspell.mk
@@ -0,0 +1,25 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Module_Module,hunspell))
+
+$(eval $(call gb_Module_add_targets,hunspell,\
+ UnpackedTarball_hunspell \
+))
+ifeq ($(COM),MSC)
+$(eval $(call gb_Module_add_targets,hunspell,\
+ StaticLibrary_hunspell \
+))
+else
+$(eval $(call gb_Module_add_targets,hunspell,\
+ ExternalProject_hunspell \
+))
+endif
+
+# vim: set noet sw=4 ts=4:
diff --git a/external/hunspell/README b/external/hunspell/README
new file mode 100644
index 000000000..1221735ca
--- /dev/null
+++ b/external/hunspell/README
@@ -0,0 +1,4 @@
+Library for spell checking.
+
+From:
+[http://hunspell.sourceforge.net/].
diff --git a/external/hunspell/StaticLibrary_hunspell.mk b/external/hunspell/StaticLibrary_hunspell.mk
new file mode 100644
index 000000000..3a2eccafb
--- /dev/null
+++ b/external/hunspell/StaticLibrary_hunspell.mk
@@ -0,0 +1,41 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_StaticLibrary_StaticLibrary,hunspell))
+
+$(eval $(call gb_StaticLibrary_use_unpacked,hunspell,hunspell))
+
+$(eval $(call gb_StaticLibrary_use_external,hunspell,icu_headers))
+
+$(eval $(call gb_StaticLibrary_set_warnings_disabled,hunspell))
+
+$(eval $(call gb_StaticLibrary_add_defs,hunspell,\
+ -DHUNSPELL_STATIC \
+ -DOPENOFFICEORG \
+))
+
+ifneq ($(ENABLE_WASM_STRIP_HUNSPELL),TRUE)
+$(eval $(call gb_StaticLibrary_add_generated_exception_objects,hunspell,\
+ UnpackedTarball/hunspell/src/hunspell/hunspell \
+))
+endif
+
+$(eval $(call gb_StaticLibrary_add_generated_exception_objects,hunspell,\
+ UnpackedTarball/hunspell/src/hunspell/affentry \
+ UnpackedTarball/hunspell/src/hunspell/affixmgr \
+ UnpackedTarball/hunspell/src/hunspell/csutil \
+ UnpackedTarball/hunspell/src/hunspell/hashmgr \
+ UnpackedTarball/hunspell/src/hunspell/suggestmgr \
+ UnpackedTarball/hunspell/src/hunspell/phonet \
+ UnpackedTarball/hunspell/src/hunspell/hunzip \
+ UnpackedTarball/hunspell/src/hunspell/filemgr \
+ UnpackedTarball/hunspell/src/hunspell/replist \
+))
+
+# vim: set noet sw=4 ts=4:
diff --git a/external/hunspell/UnpackedTarball_hunspell.mk b/external/hunspell/UnpackedTarball_hunspell.mk
new file mode 100644
index 000000000..1cd24e225
--- /dev/null
+++ b/external/hunspell/UnpackedTarball_hunspell.mk
@@ -0,0 +1,28 @@
+ -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,hunspell))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,hunspell,$(HUNSPELL_TARBALL)))
+
+$(eval $(call gb_UnpackedTarball_update_autoconf_configs,hunspell))
+
+ifeq ($(COM),MSC)
+$(eval $(call gb_UnpackedTarball_set_post_action,hunspell,\
+ touch src/hunspell/config.h \
+))
+endif
+
+$(eval $(call gb_UnpackedTarball_set_patchlevel,hunspell,1))
+
+$(eval $(call gb_UnpackedTarball_add_patches,hunspell, \
+ external/hunspell/0001-invalid-read-memory-access-624.patch \
+))
+
+# vim: set noet sw=4 ts=4: