diff --git a/bypy/linux/__main__.py b/bypy/linux/__main__.py index 1a5b07b60a..f4e928dc87 100644 --- a/bypy/linux/__main__.py +++ b/bypy/linux/__main__.py @@ -41,7 +41,7 @@ def binary_includes(): ] + list(map( get_dll_path, ('usb-1.0 mtp expat sqlite3 ffi z openjp2 poppler dbus-1 iconv xml2 xslt jpeg png16' - ' webp webpmux webpdemux exslt ncursesw readline chm hunspell-1.7' + ' webp webpmux webpdemux exslt ncursesw readline chm hunspell-1.7 hyphen' ' icudata icui18n icuuc icuio gcrypt gpg-error' ' gobject-2.0 glib-2.0 gthread-2.0 gmodule-2.0 gio-2.0 dbus-glib-1').split() )) + [ diff --git a/bypy/macos/__main__.py b/bypy/macos/__main__.py index 8bf6980c42..fa2792a4b8 100644 --- a/bypy/macos/__main__.py +++ b/bypy/macos/__main__.py @@ -502,7 +502,7 @@ class Freeze(object): def add_misc_libraries(self): for x in ( 'usb-1.0.0', 'mtp.9', 'chm.0', 'sqlite3.0', 'hunspell-1.7.0', - 'icudata.64', 'icui18n.64', 'icuio.64', 'icuuc.64', + 'icudata.64', 'icui18n.64', 'icuio.64', 'icuuc.64', 'hyphen.0', 'xslt.1', 'exslt.0', 'xml2.2', 'z.1', 'unrar', 'crypto.1.0.0', 'ssl.1.0.0', 'iconv.2', # 'ltdl.7' ): diff --git a/bypy/sources.json b/bypy/sources.json index f8a1a56912..ddcd9e810c 100644 --- a/bypy/sources.json +++ b/bypy/sources.json @@ -115,6 +115,14 @@ } }, + { + "name": "hyphen", + "unix": { + "filename": "hyphen-2.8.8.tar.gz", + "hash": "sha1:0556c392beb59433e577e3517575801212201df6", + "urls": ["https://downloads.sourceforge.net/hunspell/{filename}"] + } + }, { "name": "openssl", diff --git a/setup/build_environment.py b/setup/build_environment.py index f0a57b3ff3..7a06f3181a 100644 --- a/setup/build_environment.py +++ b/setup/build_environment.py @@ -128,6 +128,8 @@ zlib_inc_dirs = [] zlib_lib_dirs = [] hunspell_inc_dirs = [] hunspell_lib_dirs = [] +hyphen_inc_dirs = [] +hyphen_lib_dirs = [] openssl_inc_dirs, openssl_lib_dirs = [], [] ICU = sw = '' @@ -137,6 +139,8 @@ if iswindows: sw_lib_dir = os.path.join(prefix, 'lib') icu_inc_dirs = [sw_inc_dir] icu_lib_dirs = [sw_lib_dir] + hyphen_inc_dirs = [sw_inc_dir] + hyphen_lib_dirs = [sw_lib_dir] openssl_inc_dirs = [sw_inc_dir] openssl_lib_dirs = [sw_lib_dir] sqlite_inc_dirs = [sw_inc_dir] diff --git a/setup/extensions.json b/setup/extensions.json index 7c5717f015..58308b5025 100644 --- a/setup/extensions.json +++ b/setup/extensions.json @@ -18,6 +18,8 @@ "name": "hyphen", "sources": "calibre/utils/hyphenation/hyphen.c", "libraries": "hyphen", + "inc_dirs": "!hyphen_inc_dirs", + "lib_dirs": "!hyphen_lib_dirs", "needs_c99": true }, { diff --git a/src/calibre/utils/hyphenation/hyphen.c b/src/calibre/utils/hyphenation/hyphen.c index 9154e42335..6c48cd9812 100644 --- a/src/calibre/utils/hyphenation/hyphen.c +++ b/src/calibre/utils/hyphenation/hyphen.c @@ -63,7 +63,7 @@ simple_hyphenate(PyObject *self, PyObject *args) { // we use the simple (old) algorithm since we dont handle replacements // anyway - if (hnj_hyphen_hyphenate(dict, word_str, wd_size, hyphens)) { + if (hnj_hyphen_hyphenate(dict, word_str, (int)wd_size, hyphens)) { PyErr_Format(PyExc_ValueError, "Cannot hyphenate word: %s", word_str); } else { for (size_t i = 0; i < wd_size; i++) {