diff options
-rw-r--r-- | libraries/libchewing/README | 3 | ||||
-rw-r--r-- | libraries/libchewing/libchewing-rev1048.patch | 235 | ||||
-rw-r--r-- | libraries/libchewing/libchewing.SlackBuild | 7 | ||||
-rw-r--r-- | libraries/libchewing/libchewing.info | 8 |
4 files changed, 7 insertions, 246 deletions
diff --git a/libraries/libchewing/README b/libraries/libchewing/README index fa4340f6cdc6..9765869752c4 100644 --- a/libraries/libchewing/README +++ b/libraries/libchewing/README @@ -1,5 +1,2 @@ libchewing is a library required by New Chewing Input Method, which is a good Traditional Chinese intelligent phonetic input method. - -This SlackBuild script provides a patch to patch source to rev1048. It is -required by ibus-chewing. diff --git a/libraries/libchewing/libchewing-rev1048.patch b/libraries/libchewing/libchewing-rev1048.patch deleted file mode 100644 index 1a2b10bdf1e2..000000000000 --- a/libraries/libchewing/libchewing-rev1048.patch +++ /dev/null @@ -1,235 +0,0 @@ -Index: test/randkeystroke.c -=================================================================== ---- test/randkeystroke.c (revision 1038) -+++ test/randkeystroke.c (revision 1048) -@@ -46,6 +46,7 @@ - printf( "usage: randkeystroke [-r] [-n num] [-h]\n" \ - "\t -r - total random\n" \ - "\t -n num - generate num keystrokes\n" -+ "\t -s seed - random seed\n" - "\t -h - help\n" ); - } - -@@ -63,6 +64,9 @@ - nk = atoi( argv[i] ); - } else if ( ! strcmp( argv[i], "-r" ) ) { - total_random = 1; -+ } else if ( ! strcmp( argv[i], "-s" ) ) { -+ if ( ++i < argc ) -+ srand( atoi( argv[i] ) ); - } else if ( ! strcmp( argv[i], "-h" ) ) { - usage(); - return 0; -@@ -71,7 +75,7 @@ - if (total_random) { - for ( i = 0; i < nk; i++ ) { - n = rand() % (n_nkeys + n_okeys); -- if ( n > n_nkeys ) -+ if ( n >= n_nkeys ) - printf( "%s", other_keys[n - n_nkeys] ); - else - printf( "%c", normal_keys[n] ); -@@ -97,4 +101,5 @@ - return 0; - } - --/* vim: noet */ -+/* vim: noet -+ */ -Index: python/chewing.py -=================================================================== ---- python/chewing.py (revision 1038) -+++ python/chewing.py (revision 1048) -@@ -2,9 +2,11 @@ - from functools import partial - - _libchewing = CDLL('libchewing.so.3') --_libchewing.chewing_handle_Default.argtypes = [c_void_p, c_char] - _libchewing.chewing_commit_String.restype = c_char_p - _libchewing.chewing_buffer_String.restype = c_char_p -+_libchewing.chewing_cand_String.restype = c_char_p -+_libchewing.chewing_zuin_String.restype = c_char_p -+_libchewing.chewing_aux_String.restype = c_char_p - - def Init(datadir, userdir): - return _libchewing.chewing_Init(datadir, userdir) -Index: src/tree.c -=================================================================== ---- src/tree.c (revision 1038) -+++ src/tree.c (revision 1048) -@@ -285,25 +285,16 @@ - for ( i = begin; i <= end; i++ ) { - for ( - child = tree[ tree_p ].child_begin; -- child <= tree[ tree_p ].child_end; -+ child != -1 && child <= tree[ tree_p ].child_end; - child++ ) { --#ifdef USE_BINARY_DATA -- /** -- * This is a workaround to prevent access violation. -- * -- * Sometimes, child < 0 and tree[ child ] refer to an invalid -- * address for unknown reason.This could be a bug of libchewing. -- * This serious bug was discovered by seamxr. -- */ -- if ( child < 0 || child * sizeof(TreeType) > tree_size ) -- return -1; --#endif - -+ assert(0 <= child && child * sizeof(TreeType) < tree_size); -+ - if ( tree[ child ].phone_id == phoneSeq[ i ] ) - break; - } - /* if not found any word then fail. */ -- if ( child > tree[ tree_p ].child_end ) -+ if ( child == -1 || child > tree[ tree_p ].child_end ) - return -1; - else { - tree_p = child; -Index: src/mod_aux.c -=================================================================== ---- src/mod_aux.c (revision 1038) -+++ src/mod_aux.c (revision 1048) -@@ -90,7 +90,7 @@ - if ( ctx->output->zuinBuf[ i ].s[ 0 ] != '\0' ) { - strcat( s, (char *) (ctx->output->zuinBuf[ i ].s) ); - if ( zuin_count ) -- *zuin_count++; -+ (*zuin_count)++; - } - } - return s; -Index: scripts/gen-tabe-diff.sh -=================================================================== ---- scripts/gen-tabe-diff.sh (revision 1038) -+++ scripts/gen-tabe-diff.sh (revision 1048) -@@ -1,19 +0,0 @@ --#!/bin/sh -- --if [ ! -f scripts/gen-tabe-diff.sh ]; then -- echo -e "\033[44;37m You *MUST* run this script in top dir. \033[m" -- exit --fi -- --if [ ! -f data/tabe-tsi.src ]; then -- echo -e "\033[44;37m tabe-tsi.src not found. Try to generate. \033[m" -- sh ./scripts/cvsup-tsi-src.sh --fi -- --# compare --sort data/tsi.src | cut --delimiter=' ' -f1 > /tmp/orig-tsi --sort data/tabe-tsi.src | cut --delimiter=' ' -f1 > /tmp/tabe-tsi --diff -u /tmp/orig-tsi /tmp/tabe-tsi > tabe-tsi.diff --rm -f /tmp/orig-tsi /tmp/tabe-tsi -- --echo -e "\033[44;37m Please check out tabe-tsi.diff \033[m" -Index: scripts/tsi-chewing.diff -=================================================================== ---- scripts/tsi-chewing.diff (revision 1038) -+++ scripts/tsi-chewing.diff (revision 1048) -@@ -1,51 +0,0 @@ ----- tsidump.c 2004-05-12 23:30:19.000000000 +0800 --+++ tsidump-chewing.c 2004-05-12 23:29:12.000000000 +0800 --@@ -65,32 +65,23 @@ -- } -- i++; -- len = strlen((char *)tsi->tsi)/2; --- fprintf(fp, "%s", tsi->tsi); --- if (ref) { --- fprintf(fp, " %ld", tsi->refcount); --- } -- if (tsiyin) { -- ZuYinSymbolSequence zs = NULL; --- int begin = 0; -- --- fprintf(fp, " "); -- for (j = 0; j < tsi->yinnum; j++) { --+ if (len > 7) --+ continue; --+ fprintf(fp, "%s %ld\t", tsi->tsi, tsi->refcount); -- for (k = 0; k < len; k++) { -- zs = tabeYinToZuYinSymbolSequence(tsi->yindata[j*len+k]); -- if (zs) { --- if (begin) { --- fprintf(fp, "¡@"); --- } --- else { --- begin = 1; --- } --- fprintf(fp, "%s", zs); --+ fprintf(fp, "%s ", zs); -- free(zs); -- } -- } --+ fprintf(fp, "\n"); -- } -- } --- fprintf(fp, "\n"); -- } -- -- db->Close(db); --@@ -109,8 +100,8 @@ -- char *db_name, *op_name; -- -- db_name = op_name = (char *)NULL; --- ref = 0; --- tsiyin = 0; --+ ref = 1; --+ tsiyin = 1; -- -- while ((ch = getopt(argc, argv, "d:f:ry")) != -1) { -- switch(ch) { -Index: scripts/cvsup-tsi-src.sh -=================================================================== ---- scripts/cvsup-tsi-src.sh (revision 1038) -+++ scripts/cvsup-tsi-src.sh (revision 1048) -@@ -1,48 +0,0 @@ --#!/bin/sh -- --TOP=`pwd` --TABE_TSI=$TOP/data/tabe-tsi.src -- --if [ ! -f scripts/cvsup-tsi-src.sh ]; then -- echo -e "\033[44;37m You *MUST* run this script in top dir. \033[m" -- exit --fi --if [ -f $TABE_TSI ]; then -- echo -e "\033[44;37m tabe-tsi.src done. \033[m" -- exit --fi -- --if [ ! -d libtabe ]; then -- echo -e "\033[44;37m No libtabe found. cvs check from libtabe \033[m" -- cvs -z9 -d :pserver:xcin@xcin.linux.org.tw:/home/service/cvsroot/xcin \ -- checkout libtabe --fi -- --if [ ! -d libtabe ]; then -- echo -e "\033[44;37m There were some problems while checking out. \033[m" -- exit --fi -- --pushd libtabe --./configure --if [ -f Makefile ]; then -- make clean all -- -- # patch tsidump to adapt Chewing -- pushd util -- if [ ! -f PATCHED ]; then -- patch -p0 < $TOP/scripts/tsi-chewing.diff -- touch PATCHED -- fi -- make -- -- # generation -- if [ -f tsidump ]; then -- ./tsidump -d ../tsi-src/tsi.db > $TABE_TSI -- fi -- popd --fi --popd -- --rm -rf libtabe -- diff --git a/libraries/libchewing/libchewing.SlackBuild b/libraries/libchewing/libchewing.SlackBuild index 9dc3a2a63b06..adb75d2a1240 100644 --- a/libraries/libchewing/libchewing.SlackBuild +++ b/libraries/libchewing/libchewing.SlackBuild @@ -2,7 +2,7 @@ # Slackware build script for libchewing -# Copyright 2010 Guan-Zhong Huang, Taiwan <imprazaguy@gmail.com> +# Copyright 2010,2011 Guan-Zhong Huang, Taiwan <imprazaguy@gmail.com> # All rights reserved. # # Redistribution and use of this script, with or without modification, is @@ -23,8 +23,8 @@ # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. PRGNAM=libchewing -VERSION=${VERSION:-0.3.2} -BUILD=${BUILD:-2} +VERSION=${VERSION:-0.3.3} +BUILD=${BUILD:-1} TAG=${TAG:-_SBo} if [ -z "$ARCH" ]; then @@ -63,7 +63,6 @@ cd $TMP rm -rf $PRGNAM-$VERSION tar xvf $CWD/$PRGNAM-$VERSION.tar.bz2 cd $PRGNAM-$VERSION -patch -p0 < $CWD/libchewing-rev1048.patch chown -R root:root . find . \ \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \ diff --git a/libraries/libchewing/libchewing.info b/libraries/libchewing/libchewing.info index c472604f8bc4..8a923b348345 100644 --- a/libraries/libchewing/libchewing.info +++ b/libraries/libchewing/libchewing.info @@ -1,10 +1,10 @@ PRGNAM="libchewing" -VERSION="0.3.2" +VERSION="0.3.3" HOMEPAGE="http://chewing.csie.net" -DOWNLOAD="http://chewing.csie.net/download/libchewing/libchewing-0.3.2.tar.bz2" -MD5SUM="ef70745ffdf199aa17e533427c63499f" +DOWNLOAD="http://chewing.csie.net/download/libchewing/libchewing-0.3.3.tar.bz2" +MD5SUM="8f1ff6ccdc17c36a5ce6c6864f30f3c2" DOWNLOAD_x86_64="" MD5SUM_x86_64="" MAINTAINER="Guan-Zhong Huang" EMAIL="imprazaguy@gmail.com" -APPROVED="dsomero" +APPROVED="Erik Hanson" |