From 32b2d5da4045b6e85a403029620b3fd69369c3dd Mon Sep 17 00:00:00 2001 From: Fredrik Fornwall Date: Tue, 3 May 2016 06:56:48 -0400 Subject: [PATCH] hunspell: Update from 1.3.3 to 1.4.1 --- packages/hunspell/build.sh | 7 ++- packages/hunspell/hunspell.cxx.patch | 55 ------------------- packages/hunspell/hzip.c.patch | 47 ---------------- .../hunspell/src-tools-hunspell.cxx.patch | 21 +++++++ 4 files changed, 25 insertions(+), 105 deletions(-) delete mode 100644 packages/hunspell/hunspell.cxx.patch delete mode 100644 packages/hunspell/hzip.c.patch create mode 100644 packages/hunspell/src-tools-hunspell.cxx.patch diff --git a/packages/hunspell/build.sh b/packages/hunspell/build.sh index 95dcaf278..8427fb0cc 100644 --- a/packages/hunspell/build.sh +++ b/packages/hunspell/build.sh @@ -1,7 +1,8 @@ TERMUX_PKG_HOMEPAGE=http://hunspell.sourceforge.net/ TERMUX_PKG_DESCRIPTION="Spell checker" -TERMUX_PKG_VERSION=1.3.3 -TERMUX_PKG_BUILD_REVISION=1 -TERMUX_PKG_SRCURL=http://downloads.sourceforge.net/project/hunspell/Hunspell/${TERMUX_PKG_VERSION}/hunspell-${TERMUX_PKG_VERSION}.tar.gz +TERMUX_PKG_VERSION=1.4.1 +TERMUX_PKG_SRCURL=https://github.com/hunspell/hunspell/archive/v${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--with-ui --with-readline" TERMUX_PKG_DEPENDS="ncurses, readline, hunspell-en-us" +TERMUX_PKG_FOLDERNAME=hunspell-${TERMUX_PKG_VERSION} +TERMUX_PKG_BUILD_IN_SRC=yes diff --git a/packages/hunspell/hunspell.cxx.patch b/packages/hunspell/hunspell.cxx.patch deleted file mode 100644 index 7d87a3da3..000000000 --- a/packages/hunspell/hunspell.cxx.patch +++ /dev/null @@ -1,55 +0,0 @@ -diff -u -r ../hunspell-1.3.3/src/tools/hunspell.cxx ./src/tools/hunspell.cxx ---- ../hunspell-1.3.3/src/tools/hunspell.cxx 2014-06-02 07:35:50.000000000 -0400 -+++ ./src/tools/hunspell.cxx 2016-03-06 02:28:02.031833160 -0500 -@@ -68,7 +68,7 @@ - #include "odfparser.hxx" - - #define LIBDIR \ -- "/usr/share/hunspell:" \ -+ "@TERMUX_PREFIX@/share/hunspell:" \ - "/usr/share/myspell:" \ - "/usr/share/myspell/dicts:" \ - "/Library/Spelling" -@@ -92,7 +92,7 @@ - "/usr/lib/openoffice.org2.0/share/dict/ooo" - #define HOME getenv("HOME") - #define DICBASENAME ".hunspell_" --#define LOGFILE "/tmp/hunspell.log" -+#define LOGFILE "@TERMUX_PREFIX@/tmp/hunspell.log" - #define DIRSEPCH '/' - #define DIRSEP "/" - #define PATHSEP ":" -@@ -1423,7 +1423,13 @@ - } - } - -+#ifdef __ANDROID__ -+ char tmpfile_template[] = "@TERMUX_PREFIX@/tmp/hunspell.XXXXXX"; -+ int tmpfile_fd = mkstemp(tmpfile_template); -+ FILE *tempfile = fdopen(tmpfile_fd, "w+"); -+#else - FILE *tempfile = tmpfile(); -+#endif - - if (!tempfile) - { -@@ -1443,6 +1449,9 @@ - clear(); - refresh(); - fclose(tempfile); //automatically deleted when closed -+#ifdef __ANDROID__ -+ unlink(tmpfile_template); -+#endif - if (is_zipped_odf(parser, extension)) { - sprintf(buf, "rm %s; rmdir %s", filename, odftempdir); - if (system(buf) != 0) -@@ -1493,6 +1502,9 @@ - - delete parser; - fclose(tempfile); //automatically deleted when closed -+#ifdef __ANDROID__ -+ unlink(tmpfile_template); -+#endif - } - - #endif diff --git a/packages/hunspell/hzip.c.patch b/packages/hunspell/hzip.c.patch deleted file mode 100644 index 1ea5c5a55..000000000 --- a/packages/hunspell/hzip.c.patch +++ /dev/null @@ -1,47 +0,0 @@ -diff -u -r ../hunspell-1.3.3/src/tools/hzip.c ./src/tools/hzip.c ---- ../hunspell-1.3.3/src/tools/hzip.c 2012-06-30 07:18:47.000000000 -0400 -+++ ./src/tools/hzip.c 2016-03-06 02:30:47.121570946 -0500 -@@ -272,7 +272,13 @@ - strcat(out, EXTENSION); - f = fopen(filename, "r"); - if (!f) return fail("hzip: %s: Permission denied\n", filename); -+#ifdef __ANDROID__ -+ char tmpfile_template[] = "@TERMUX_PREFIX@/tmp/hunspell.XXXXXX"; -+ int tmpfile_fd = mkstemp(tmpfile_template); -+ tempfile = fdopen(tmpfile_fd, "w+"); -+#else - tempfile = tmpfile(); -+#endif - if (!tempfile) { - fclose(f); - return fail("hzip: cannot create temporary file\n", NULL); -@@ -280,6 +286,9 @@ - f2 = fopen(out, "wb"); - if (!f2) { - fclose(tempfile); -+#ifdef __ANDROID__ -+ unlink(tmpfile_template); -+#endif - fclose(f); - return fail("hzip: %s: Permission denied\n", out); - } -@@ -287,6 +296,9 @@ - if (prefixcompress(f, tempfile) != 0) { - fclose(f2); - fclose(tempfile); -+#ifdef __ANDROID__ -+ unlink(tmpfile_template); -+#endif - fclose(f); - return fail("hzip: cannot write file\n", NULL); - } -@@ -297,6 +309,9 @@ - n = encode_file(table, n, tempfile, f2, termword, key); - fclose(f2); - fclose(tempfile); -+#ifdef __ANDROID__ -+ unlink(tmpfile_template); -+#endif - fclose(f); - if (n != 0) return fail("hzip: cannot write file\n", NULL); - return n; diff --git a/packages/hunspell/src-tools-hunspell.cxx.patch b/packages/hunspell/src-tools-hunspell.cxx.patch new file mode 100644 index 000000000..904846e41 --- /dev/null +++ b/packages/hunspell/src-tools-hunspell.cxx.patch @@ -0,0 +1,21 @@ +diff -u -r ../hunspell-1.4.1/src/tools/hunspell.cxx ./src/tools/hunspell.cxx +--- ../hunspell-1.4.1/src/tools/hunspell.cxx 2016-05-03 03:55:52.000000000 -0400 ++++ ./src/tools/hunspell.cxx 2016-05-03 06:49:59.025455094 -0400 +@@ -113,7 +113,7 @@ + #include "odfparser.hxx" + + #define LIBDIR \ +- "/usr/share/hunspell:" \ ++ "@TERMUX_PREFIX@/share/hunspell:" \ + "/usr/share/myspell:" \ + "/usr/share/myspell/dicts:" \ + "/Library/Spelling" +@@ -137,7 +137,7 @@ + "/usr/lib/openoffice.org2.0/share/dict/ooo" + #define HOME getenv("HOME") + #define DICBASENAME ".hunspell_" +-#define LOGFILE "/tmp/hunspell.log" ++#define LOGFILE "@TERMUX_PREFIX@/tmp/hunspell.log" + #define DIRSEPCH '/' + #define DIRSEP "/" + #define PATHSEP ":"