summaryrefslogtreecommitdiff
path: root/external
diff options
context:
space:
mode:
authorKhaled Hosny <khaledhosny@eglug.org>2013-10-17 20:00:40 +0200
committerDavid Tardon <dtardon@redhat.com>2013-10-18 06:58:44 +0000
commit0ba2b78a07e1111208eef45813e14c33c95cef6d (patch)
tree4f033ed3a0a1654f2da8f92b3849de82d6da704b /external
parent64b6499371fa22d52648523e65a28c041dd6579f (diff)
fdo#70393: move hyphen to a subdir of external
Change-Id: I5a112b6f588a704e682e7b50d5399d3da77fbacf Reviewed-on: https://gerrit.libreoffice.org/6308 Tested-by: LibreOffice gerrit bot <gerrit@libreoffice.org> Reviewed-by: David Tardon <dtardon@redhat.com> Tested-by: David Tardon <dtardon@redhat.com>
Diffstat (limited to 'external')
-rw-r--r--external/Module_external.mk1
-rw-r--r--external/hyphen/ExternalPackage_hyphen.mk20
-rw-r--r--external/hyphen/ExternalProject_hyphen.mk28
-rw-r--r--external/hyphen/Makefile7
-rw-r--r--external/hyphen/Module_hyphen.mk32
-rw-r--r--external/hyphen/README1
-rw-r--r--external/hyphen/StaticLibrary_hyphen.mk22
-rw-r--r--external/hyphen/UnpackedTarball_hyphen.mk22
-rw-r--r--external/hyphen/hyphen-android.patch20
-rw-r--r--external/hyphen/hyphen-build.patch38
-rw-r--r--external/hyphen/hyphen-fdo43931.patch15
-rw-r--r--external/hyphen/hyphen-lenwaswrong.patch11
-rw-r--r--external/hyphen/hyphen-rhmin.patch27
13 files changed, 244 insertions, 0 deletions
diff --git a/external/Module_external.mk b/external/Module_external.mk
index 46bceafc5d23..dac8d0af3150 100644
--- a/external/Module_external.mk
+++ b/external/Module_external.mk
@@ -36,6 +36,7 @@ $(eval $(call gb_Module_add_moduledirs,external,\
$(call gb_Helper_optional,HARFBUZZ,harfbuzz) \
$(call gb_Helper_optional,HSQLDB,hsqldb) \
$(call gb_Helper_optional,HUNSPELL,hunspell) \
+ $(call gb_Helper_optional,HYPHEN,hyphen) \
$(call gb_Helper_optional,LIBATOMIC_OPS,libatomic_ops) \
$(call gb_Helper_optional,LIBPNG,libpng) \
))
diff --git a/external/hyphen/ExternalPackage_hyphen.mk b/external/hyphen/ExternalPackage_hyphen.mk
new file mode 100644
index 000000000000..13303cc7c903
--- /dev/null
+++ b/external/hyphen/ExternalPackage_hyphen.mk
@@ -0,0 +1,20 @@
+# -*- 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_ExternalPackage_ExternalPackage,hyphen,hyphen))
+
+ifeq ($(WITH_MYSPELL_DICTS),YES)
+
+$(eval $(call gb_ExternalPackage_add_unpacked_files,hyphen,bin,\
+ hyph_en_US.dic \
+))
+
+endif
+
+# vim: set noet sw=4 ts=4:
diff --git a/external/hyphen/ExternalProject_hyphen.mk b/external/hyphen/ExternalProject_hyphen.mk
new file mode 100644
index 000000000000..e7d36730fd70
--- /dev/null
+++ b/external/hyphen/ExternalProject_hyphen.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_ExternalProject_ExternalProject,hyphen))
+
+$(eval $(call gb_ExternalProject_use_external,hyphen,hunspell))
+
+$(eval $(call gb_ExternalProject_register_targets,hyphen,\
+ build \
+))
+
+$(call gb_ExternalProject_get_state_target,hyphen,build):
+ $(call gb_ExternalProject_run,build,\
+ ./configure --disable-shared \
+ $(if $(filter-out IOS,$(OS)),--with-pic) \
+ $(if $(filter YES,$(CROSS_COMPILING)),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM) gio_can_sniff=no) \
+ $(if $(filter C52U,$(COM)$(CPU)),CFLAGS="-m64") \
+ && $(MAKE) \
+ $(if $(filter YESYES,$(SYSTEM_HYPH)$(WITH_MYSPELL_DICTS)),hyph_en_US.dic) \
+ )
+
+# vim: set noet sw=4 ts=4:
diff --git a/external/hyphen/Makefile b/external/hyphen/Makefile
new file mode 100644
index 000000000000..ccb1c85a04da
--- /dev/null
+++ b/external/hyphen/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/hyphen/Module_hyphen.mk b/external/hyphen/Module_hyphen.mk
new file mode 100644
index 000000000000..2ab3245d17a3
--- /dev/null
+++ b/external/hyphen/Module_hyphen.mk
@@ -0,0 +1,32 @@
+# -*- 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,hyphen))
+
+ifneq ($(or $(filter NO,$(SYSTEM_HYPH)),$(filter TRUE,$(WITH_MYSPELL_DICTS))),)
+$(eval $(call gb_Module_add_targets,hyphen,\
+ UnpackedTarball_hyphen \
+ ExternalPackage_hyphen \
+))
+ifeq ($(COM),MSC)
+
+ifeq ($(SYSTEM_HYPH),NO)
+$(eval $(call gb_Module_add_targets,hyphen,\
+ StaticLibrary_hyphen \
+))
+endif
+
+else
+$(eval $(call gb_Module_add_targets,hyphen,\
+ ExternalProject_hyphen \
+))
+endif
+endif
+
+# vim: set noet sw=4 ts=4:
diff --git a/external/hyphen/README b/external/hyphen/README
new file mode 100644
index 000000000000..327b5b6e8954
--- /dev/null
+++ b/external/hyphen/README
@@ -0,0 +1 @@
+Hyphenator library from [http://hunspell.sourceforge.net]
diff --git a/external/hyphen/StaticLibrary_hyphen.mk b/external/hyphen/StaticLibrary_hyphen.mk
new file mode 100644
index 000000000000..81eddf17d850
--- /dev/null
+++ b/external/hyphen/StaticLibrary_hyphen.mk
@@ -0,0 +1,22 @@
+# -*- 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,hyphen))
+
+$(eval $(call gb_StaticLibrary_use_unpacked,hyphen,hyphen))
+
+$(eval $(call gb_StaticLibrary_set_warnings_not_errors,hyphen))
+
+$(eval $(call gb_StaticLibrary_add_generated_cobjects,hyphen,\
+ UnpackedTarball/hyphen/hyphen \
+ UnpackedTarball/hyphen/hnjalloc \
+))
+
+
+# vim: set noet sw=4 ts=4:
diff --git a/external/hyphen/UnpackedTarball_hyphen.mk b/external/hyphen/UnpackedTarball_hyphen.mk
new file mode 100644
index 000000000000..5cd0af80bd22
--- /dev/null
+++ b/external/hyphen/UnpackedTarball_hyphen.mk
@@ -0,0 +1,22 @@
+# -*- 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,hyphen))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,hyphen,$(HYPHEN_TARBALL)))
+
+$(eval $(call gb_UnpackedTarball_add_patches,hyphen,\
+ external/hyphen/hyphen-lenwaswrong.patch \
+ external/hyphen/hyphen-fdo43931.patch \
+ external/hyphen/hyphen-android.patch \
+ external/hyphen/hyphen-rhmin.patch \
+ external/hyphen/hyphen-build.patch \
+))
+
+# vim: set noet sw=4 ts=4:
diff --git a/external/hyphen/hyphen-android.patch b/external/hyphen/hyphen-android.patch
new file mode 100644
index 000000000000..d092d786f6f0
--- /dev/null
+++ b/external/hyphen/hyphen-android.patch
@@ -0,0 +1,20 @@
+--- misc/hyphen-2.8.4/config.sub
++++ misc/build/hyphen-2.8.4/config.sub
+@@ -120,7 +120,7 @@
+ # Here we must recognize all the valid KERNEL-OS combinations.
+ maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
+ case $maybe_os in
+- nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
++ nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
+ uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
+ storm-chaos* | os2-emx* | rtmk-nova*)
+ os=-$maybe_os
+@@ -1215,7 +1215,7 @@
+ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
+ | -chorusos* | -chorusrdb* \
+ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+- | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
++ | -mingw32* | -linux-gnu* | -linux-androideabi* | -linux-newlib* | -linux-uclibc* \
+ | -uxpv* | -beos* | -mpeix* | -udk* \
+ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
+ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
diff --git a/external/hyphen/hyphen-build.patch b/external/hyphen/hyphen-build.patch
new file mode 100644
index 000000000000..6df2bb680cdb
--- /dev/null
+++ b/external/hyphen/hyphen-build.patch
@@ -0,0 +1,38 @@
+--- misc/hyphen-2.8.4/Makefile.am 2010-07-19 11:23:17.000000000 +0200
++++ misc/build/hyphen-2.8.4/Makefile.am 2010-12-02 10:15:44.390625000 +0100
+@@ -25,13 +25,13 @@
+
+ hyphen.us3:
+ cp -f $(srcdir)/hyphen.tex hyphen.us
+- patch < $(srcdir)/hyphen.patch
++ $(GNUPATCH) < $(srcdir)/hyphen.patch
+ $(srcdir)/tbhyphext.sh <$(srcdir)/tbhyphext.tex >hyphen.us2
+ cat hyphen.us hyphen.us2 | $(AWK) -f $(srcdir)/lig.awk >hyphen.us3
+ cat $(srcdir)/ligpatch.txt >>hyphen.us3
+
+-hyph_en_US.dic: hyphen.us3
+- perl $(srcdir)/substrings.pl hyphen.us3 hyph_en_US.dic UTF-8 2 3 >/dev/null
++hyph_en_US.dic:
++ @echo "hyph_en_US.txt distributed with Hyphen library"
+
+ clean-local:
+ rm -rf hyphen.us* hyph_en_US.dic
+--- misc/hyphen-2.8.4/Makefile.in 2010-12-01 02:31:29.000000000 +0100
++++ misc/build/hyphen-2.8.4/Makefile.in 2010-12-02 10:17:16.546875000 +0100
+@@ -940,13 +940,13 @@
+
+ hyphen.us3:
+ cp -f $(srcdir)/hyphen.tex hyphen.us
+- patch < $(srcdir)/hyphen.patch
++ $(GNUPATCH) < $(srcdir)/hyphen.patch
+ $(srcdir)/tbhyphext.sh <$(srcdir)/tbhyphext.tex >hyphen.us2
+ cat hyphen.us hyphen.us2 | $(AWK) -f $(srcdir)/lig.awk >hyphen.us3
+ cat $(srcdir)/ligpatch.txt >>hyphen.us3
+
+-hyph_en_US.dic: hyphen.us3
+- perl $(srcdir)/substrings.pl hyphen.us3 hyph_en_US.dic UTF-8 2 3 >/dev/null
++hyph_en_US.dic:
++ @echo "hyph_en_US.txt distributed with Hyphen library"
+
+ clean-local:
+ rm -rf hyphen.us* hyph_en_US.dic
diff --git a/external/hyphen/hyphen-fdo43931.patch b/external/hyphen/hyphen-fdo43931.patch
new file mode 100644
index 000000000000..0a1f0b9cbdee
--- /dev/null
+++ b/external/hyphen/hyphen-fdo43931.patch
@@ -0,0 +1,15 @@
+--- misc//hyphen-2.8.4/hyphen.c 2011-10-10 15:49:33.000000000 +0200
++++ misc/build/hyphen-2.8.4/hyphen.c 2011-12-27 13:49:07.568283812 +0100
+@@ -436,9 +436,9 @@
+ }
+ } else if (k == 1) {
+ /* default first level: hyphen and ASCII apostrophe */
+- if (!dict[0]->utf8) hnj_hyphen_load_line("NOHYPHEN '\n", dict[k], hashtab);
+- else hnj_hyphen_load_line("NOHYPHEN ',\xe2\x80\x93,\xe2\x80\x99\n", dict[k], hashtab);
+- strncpy(buf, "1-1/=,1,1\n", MAX_CHARS-1); // buf rewritten by hnj_hyphen_load here
++ if (!dict[0]->utf8) hnj_hyphen_load_line("NOHYPHEN ',-\n", dict[k], hashtab);
++ else hnj_hyphen_load_line("NOHYPHEN ',\xe2\x80\x93,\xe2\x80\x99,-\n", dict[k], hashtab);
++ strncpy(buf, "1-1\n", MAX_CHARS-1); // buf rewritten by hnj_hyphen_load here
+ buf[MAX_CHARS-1] = '\0';
+ hnj_hyphen_load_line(buf, dict[k], hashtab); /* remove hyphen */
+ hnj_hyphen_load_line("1'1\n", dict[k], hashtab); /* ASCII apostrophe */
diff --git a/external/hyphen/hyphen-lenwaswrong.patch b/external/hyphen/hyphen-lenwaswrong.patch
new file mode 100644
index 000000000000..f42694ff1aae
--- /dev/null
+++ b/external/hyphen/hyphen-lenwaswrong.patch
@@ -0,0 +1,11 @@
+--- misc/hyphen-2.8.4/hyphen.c 29 Jun 2012 10:02:24 -0000 1.6
++++ misc/build/hyphen-2.8.4/hyphen.c 12 Jul 2012 15:19:16 -0000
+@@ -951,7 +951,7 @@
+ rep2 = hnj_malloc (word_size * sizeof(char *));
+ pos2 = hnj_malloc (word_size * sizeof(int));
+ cut2 = hnj_malloc (word_size * sizeof(int));
+- hyphens2 = hnj_malloc (word_size);
++ hyphens2 = hnj_malloc (word_size + 3);
+ for (i = 0; i < word_size; i++) rep2[i] = NULL;
+ for (i = 0; i < word_size; i++) if
+ (hyphens[i]&1 || (begin > 0 && i + 1 == word_size)) {
diff --git a/external/hyphen/hyphen-rhmin.patch b/external/hyphen/hyphen-rhmin.patch
new file mode 100644
index 000000000000..12fff19f4466
--- /dev/null
+++ b/external/hyphen/hyphen-rhmin.patch
@@ -0,0 +1,27 @@
+--- misc//hyphen-2.8.4/hyphen.c
++++ misc/build/hyphen-2.8.4/hyphen.c
+@@ -734,13 +734,13 @@
+ int hnj_hyphen_rhmin(int utf8, const char *word, int word_size, char * hyphens,
+ char *** rep, int ** pos, int ** cut, int rhmin)
+ {
+- int i = 1;
++ int i = 0;
+ int j;
+
+ // ignore numbers
+ for (j = word_size - 1; j > 0 && word[j] <= '9' && word[j] >= '0'; j--) i--;
+
+- for (j = word_size - 2; i < rhmin && j > 0; j--) {
++ for (j = word_size - 1; i < rhmin && j > 0; j--) {
+ // check length of the non-standard part
+ if (*rep && *pos && *cut && (*rep)[j]) {
+ char * rh = strchr((*rep)[j], '=');
+@@ -753,7 +753,7 @@
+ } else {
+ hyphens[j] = '0';
+ }
+- if (!utf8 || (word[j] & 0xc0) != 0xc0) i++;
++ if (!utf8 || (word[j] & 0xc0) == 0xc0 || (word[j] & 0x80) != 0x80) i++;
+ }
+ return 0;
+ }