diff --git a/ibus-pinyin/Makefile b/ibus-pinyin/Makefile index 8dccd543fd..0ee8e57bf3 100644 --- a/ibus-pinyin/Makefile +++ b/ibus-pinyin/Makefile @@ -1,7 +1,7 @@ -# $NetBSD: Makefile,v 1.5 2010/01/13 13:13:45 obache Exp $ +# $NetBSD: Makefile,v 1.6 2010/04/06 11:55:22 obache Exp $ # -DISTNAME= ibus-pinyin-1.2.0.20090915 +DISTNAME= ibus-pinyin-1.3.1 CATEGORIES= inputmethod chinese MASTER_SITES= http://ibus.googlecode.com/files/ DISTFILES= ${DEFAULT_DISTFILES} ${DBTAR} @@ -13,28 +13,32 @@ LICENSE= gnu-gpl-v2 PKG_DESTDIR_SUPPORT= user-destdir -.include "../../lang/python/pyversion.mk" - -DEPENDS+= ${PYPKGPREFIX}-sqlite3-[0-9]*:../../databases/py-sqlite3 - GNU_CONFIGURE= yes USE_LIBTOOL= yes USE_PKGLOCALEDIR= yes -USE_LANGUAGES= c -USE_TOOLS+= pkg-config gmake msgfmt +USE_LANGUAGES= c c++ +USE_TOOLS+= pkg-config gmake intltool msgfmt -# taken from ${WRKSRC}/engine/Makefile.in -DBVER= 0.1.10.6 +# taken from ${WRKSRC}/data/db/open-phrase/Makefile.in +DBVER= 1.2.99 DBTAR= pinyin-database-${DBVER}.tar.bz2 post-extract: - mv ${WRKDIR}/py.db ${WRKSRC}/engine - touch -r ${WRKSRC}/engine/py.db ${WRKSRC}/engine/${DBTAR} + ${RUN} cd ${WRKSRC}/data/db/open-phrase; \ + mkdir -p db; \ + mv ${WRKDIR}/db/main.db db/open-phrase.db; \ + touch ${DBTAR} stamp-db SUBST_CLASSES+= epython SUBST_STAGE.epython= pre-configure -SUBST_FILES.epython= engine/ibus-engine-pinyin.in setup/ibus-setup-pinyin.in +SUBST_FILES.epython= setup/ibus-setup-pinyin.in SUBST_SED.epython= -e 's;exec python;exec ${PYTHONBIN};g' +CONFIGURE_ARGS+= --disable-db-android +CONFIGURE_ARGS+= --enable-db-open-phrase + +.include "../../databases/sqlite3/buildlink3.mk" +.include "../../devel/libsigc++/buildlink3.mk" +.include "../../lang/python/application.mk" .include "../../wip/ibus/buildlink3.mk" .include "../../mk/bsd.pkg.mk" diff --git a/ibus-pinyin/PLIST b/ibus-pinyin/PLIST index 42cbb028a7..0941e64fcf 100644 --- a/ibus-pinyin/PLIST +++ b/ibus-pinyin/PLIST @@ -1,50 +1,24 @@ -@comment $NetBSD: PLIST,v 1.1.1.1 2009/08/30 08:34:57 obache Exp $ +@comment $NetBSD: PLIST,v 1.2 2010/04/06 11:55:22 obache Exp $ libexec/ibus-engine-pinyin libexec/ibus-setup-pinyin -share/ibus-pinyin/engine/factory.py -share/ibus-pinyin/engine/factory.pyc -share/ibus-pinyin/engine/factory.pyo -share/ibus-pinyin/engine/main.py -share/ibus-pinyin/engine/main.pyc -share/ibus-pinyin/engine/main.pyo -share/ibus-pinyin/engine/pinyin.py -share/ibus-pinyin/engine/pinyin.pyc -share/ibus-pinyin/engine/pinyin.pyo -share/ibus-pinyin/engine/py.db -share/ibus-pinyin/engine/pydict.py -share/ibus-pinyin/engine/pydict.pyc -share/ibus-pinyin/engine/pydict.pyo -share/ibus-pinyin/engine/pyparser.py -share/ibus-pinyin/engine/pyparser.pyc -share/ibus-pinyin/engine/pyparser.pyo -share/ibus-pinyin/engine/pysqlitedb.py -share/ibus-pinyin/engine/pysqlitedb.pyc -share/ibus-pinyin/engine/pysqlitedb.pyo -share/ibus-pinyin/engine/pyutil.py -share/ibus-pinyin/engine/pyutil.pyc -share/ibus-pinyin/engine/pyutil.pyo -share/ibus-pinyin/engine/special_phrase -share/ibus-pinyin/engine/special_table -share/ibus-pinyin/engine/specialphrase.py -share/ibus-pinyin/engine/specialphrase.pyc -share/ibus-pinyin/engine/specialphrase.pyo -share/ibus-pinyin/engine/specialtable.py -share/ibus-pinyin/engine/specialtable.pyc -share/ibus-pinyin/engine/specialtable.pyo +share/ibus-pinyin/db/create_index.sql +share/ibus-pinyin/db/open-phrase.db share/ibus-pinyin/icons/chinese.svg share/ibus-pinyin/icons/english.svg -share/ibus-pinyin/icons/full-letter.svg share/ibus-pinyin/icons/full-punct.svg -share/ibus-pinyin/icons/half-letter.svg +share/ibus-pinyin/icons/full.svg share/ibus-pinyin/icons/half-punct.svg +share/ibus-pinyin/icons/half.svg share/ibus-pinyin/icons/ibus-pinyin.svg +share/ibus-pinyin/icons/simp-chinese.svg +share/ibus-pinyin/icons/trad-chinese.svg +share/ibus-pinyin/setup/ibus-pinyin-preferences.ui share/ibus-pinyin/setup/main.py share/ibus-pinyin/setup/main.pyc share/ibus-pinyin/setup/main.pyo -share/ibus-pinyin/setup/pydict.py -share/ibus-pinyin/setup/pydict.pyc -share/ibus-pinyin/setup/pydict.pyo -share/ibus-pinyin/setup/setup.glade +share/ibus-pinyin/setup/version.py +share/ibus-pinyin/setup/version.pyc +share/ibus-pinyin/setup/version.pyo share/ibus/component/pinyin.xml -share/locale/ja/LC_MESSAGES/ibus-pinyin.mo +share/locale/ru/LC_MESSAGES/ibus-pinyin.mo share/locale/zh_CN/LC_MESSAGES/ibus-pinyin.mo diff --git a/ibus-pinyin/distinfo b/ibus-pinyin/distinfo index feeb65cacd..3e5402d55c 100644 --- a/ibus-pinyin/distinfo +++ b/ibus-pinyin/distinfo @@ -1,8 +1,13 @@ -$NetBSD: distinfo,v 1.2 2009/11/01 08:48:40 obache Exp $ +$NetBSD: distinfo,v 1.3 2010/04/06 11:55:22 obache Exp $ -SHA1 (ibus-pinyin-1.2.0.20090915.tar.gz) = cf8ce69fa1b9ce7a934497d100306007e282b1a3 -RMD160 (ibus-pinyin-1.2.0.20090915.tar.gz) = 14921d01679012dbc33a668f7887ecf6a47929c9 -Size (ibus-pinyin-1.2.0.20090915.tar.gz) = 279759 bytes -SHA1 (pinyin-database-0.1.10.6.tar.bz2) = 84f505d46282cba1dabc058fe0c1e443d0a20e96 -RMD160 (pinyin-database-0.1.10.6.tar.bz2) = 2120f59575763848a0e77a829477ffb536fcfabc -Size (pinyin-database-0.1.10.6.tar.bz2) = 12008671 bytes +SHA1 (ibus-pinyin-1.3.1.tar.gz) = 03ebd6433781dbcc0af0b8b6ab902bf72b607868 +RMD160 (ibus-pinyin-1.3.1.tar.gz) = 95ab2d969ba087d94b3cccea299af57b3e5971a9 +Size (ibus-pinyin-1.3.1.tar.gz) = 1557876 bytes +SHA1 (pinyin-database-1.2.99.tar.bz2) = e38a148a772e9909facda66b2d579e17b94cccbe +RMD160 (pinyin-database-1.2.99.tar.bz2) = 1679567f31c20a235577f02175df38e16a05e7de +Size (pinyin-database-1.2.99.tar.bz2) = 9977983 bytes +SHA1 (patch-aa) = f7b337971942792662408aaad3bb730c92adad0f +SHA1 (patch-ab) = bdc9fe15d28c1f6e2a7f10efffe12c44e8056001 +SHA1 (patch-ac) = db06fe6e9cc5e50c9a535e795e0ceec756641625 +SHA1 (patch-ad) = 0b995f68696510fcd304b9cd27f1d6966d708f25 +SHA1 (patch-ae) = f57357f64b77ac1d41b3ea2c2b317efc85e7efdb diff --git a/ibus-pinyin/patches/patch-aa b/ibus-pinyin/patches/patch-aa new file mode 100644 index 0000000000..28eaed39b3 --- /dev/null +++ b/ibus-pinyin/patches/patch-aa @@ -0,0 +1,38 @@ +$NetBSD: patch-aa,v 1.1 2010/04/06 11:55:22 obache Exp $ + +--- config.h.in.orig 2010-04-05 09:27:31.000000000 +0000 ++++ config.h.in +@@ -42,15 +42,33 @@ + /* Define to 1 if you have the header file. */ + #undef HAVE_STRING_H + ++/* Define to 1 if you have the `strnlen' function. */ ++#undef HAVE_STRNLEN ++ + /* Define to 1 if you have the header file. */ + #undef HAVE_SYS_STAT_H + + /* Define to 1 if you have the header file. */ + #undef HAVE_SYS_TYPES_H + ++/* Define to 1 if you have the header file. */ ++#undef HAVE_SYS_UUID_H ++ + /* Define to 1 if you have the header file. */ + #undef HAVE_UNISTD_H + ++/* Define to 1 if you have the `uuid_create' function. */ ++#undef HAVE_UUID_CREATE ++ ++/* Define to 1 if you have the `uuid_generate' function. */ ++#undef HAVE_UUID_GENERATE ++ ++/* Define to 1 if you have the header file. */ ++#undef HAVE_UUID_H ++ ++/* Define to 1 if you have the header file. */ ++#undef HAVE_UUID_UUID_H ++ + /* Define to the sub-directory in which libtool stores uninstalled libraries. + */ + #undef LT_OBJDIR diff --git a/ibus-pinyin/patches/patch-ab b/ibus-pinyin/patches/patch-ab new file mode 100644 index 0000000000..75002709df --- /dev/null +++ b/ibus-pinyin/patches/patch-ab @@ -0,0 +1,29 @@ +$NetBSD: patch-ab,v 1.1 2010/04/06 11:55:22 obache Exp $ + +--- configure.ac.orig 2010-04-05 09:25:12.000000000 +0000 ++++ configure.ac +@@ -51,6 +51,8 @@ AC_HEADER_STDC + IT_PROG_INTLTOOL([0.35.0]) + AM_PROG_LIBTOOL + ++AC_CHECK_FUNCS([strnlen]) ++ + # check ibus + PKG_CHECK_MODULES(IBUS, [ + ibus-1.0 +@@ -62,9 +64,15 @@ PKG_CHECK_MODULES(SQLITE, [ + ]) + + # check uuid ++AC_CHECK_HEADERS(uuid.h uuid/uuid.h sys/uuid.h, break) ++AC_SEARCH_LIBS(uuid_create, uuid) ++AC_SEARCH_LIBS(uuid_generate, uuid) ++AC_CHECK_FUNCS(uuid_create uuid_generate) ++if test $ac_cv_func_uuid_generate = yes; then + PKG_CHECK_MODULES(UUID, [ + uuid + ]) ++fi + + # check uuid + PKG_CHECK_MODULES(SIGC, [ diff --git a/ibus-pinyin/patches/patch-ac b/ibus-pinyin/patches/patch-ac new file mode 100644 index 0000000000..c5bd60a227 --- /dev/null +++ b/ibus-pinyin/patches/patch-ac @@ -0,0 +1,178 @@ +$NetBSD: patch-ac,v 1.1 2010/04/06 11:55:22 obache Exp $ + +--- configure.orig 2010-04-05 09:27:15.000000000 +0000 ++++ configure +@@ -16088,6 +16088,18 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + ++for ac_func in strnlen ++do : ++ ac_fn_c_check_func "$LINENO" "strnlen" "ac_cv_func_strnlen" ++if test "x$ac_cv_func_strnlen" = x""yes; then : ++ cat >>confdefs.h <<_ACEOF ++#define HAVE_STRNLEN 1 ++_ACEOF ++ ++fi ++done ++ ++ + # check ibus + + +@@ -16417,6 +16429,146 @@ $as_echo "yes" >&6; } + fi + + # check uuid ++for ac_header in uuid.h uuid/uuid.h sys/uuid.h ++do : ++ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ++ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" ++eval as_val=\$$as_ac_Header ++ if test "x$as_val" = x""yes; then : ++ cat >>confdefs.h <<_ACEOF ++#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 ++_ACEOF ++ break ++fi ++ ++done ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing uuid_create" >&5 ++$as_echo_n "checking for library containing uuid_create... " >&6; } ++if test "${ac_cv_search_uuid_create+set}" = set; then : ++ $as_echo_n "(cached) " >&6 ++else ++ ac_func_search_save_LIBS=$LIBS ++cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++/* Override any GCC internal prototype to avoid an error. ++ Use char because int might match the return type of a GCC ++ builtin and then its argument prototype would still apply. */ ++#ifdef __cplusplus ++extern "C" ++#endif ++char uuid_create (); ++int ++main () ++{ ++return uuid_create (); ++ ; ++ return 0; ++} ++_ACEOF ++for ac_lib in '' uuid; do ++ if test -z "$ac_lib"; then ++ ac_res="none required" ++ else ++ ac_res=-l$ac_lib ++ LIBS="-l$ac_lib $ac_func_search_save_LIBS" ++ fi ++ if ac_fn_c_try_link "$LINENO"; then : ++ ac_cv_search_uuid_create=$ac_res ++fi ++rm -f core conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext ++ if test "${ac_cv_search_uuid_create+set}" = set; then : ++ break ++fi ++done ++if test "${ac_cv_search_uuid_create+set}" = set; then : ++ ++else ++ ac_cv_search_uuid_create=no ++fi ++rm conftest.$ac_ext ++LIBS=$ac_func_search_save_LIBS ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_uuid_create" >&5 ++$as_echo "$ac_cv_search_uuid_create" >&6; } ++ac_res=$ac_cv_search_uuid_create ++if test "$ac_res" != no; then : ++ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" ++ ++fi ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing uuid_generate" >&5 ++$as_echo_n "checking for library containing uuid_generate... " >&6; } ++if test "${ac_cv_search_uuid_generate+set}" = set; then : ++ $as_echo_n "(cached) " >&6 ++else ++ ac_func_search_save_LIBS=$LIBS ++cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++/* Override any GCC internal prototype to avoid an error. ++ Use char because int might match the return type of a GCC ++ builtin and then its argument prototype would still apply. */ ++#ifdef __cplusplus ++extern "C" ++#endif ++char uuid_generate (); ++int ++main () ++{ ++return uuid_generate (); ++ ; ++ return 0; ++} ++_ACEOF ++for ac_lib in '' uuid; do ++ if test -z "$ac_lib"; then ++ ac_res="none required" ++ else ++ ac_res=-l$ac_lib ++ LIBS="-l$ac_lib $ac_func_search_save_LIBS" ++ fi ++ if ac_fn_c_try_link "$LINENO"; then : ++ ac_cv_search_uuid_generate=$ac_res ++fi ++rm -f core conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext ++ if test "${ac_cv_search_uuid_generate+set}" = set; then : ++ break ++fi ++done ++if test "${ac_cv_search_uuid_generate+set}" = set; then : ++ ++else ++ ac_cv_search_uuid_generate=no ++fi ++rm conftest.$ac_ext ++LIBS=$ac_func_search_save_LIBS ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_uuid_generate" >&5 ++$as_echo "$ac_cv_search_uuid_generate" >&6; } ++ac_res=$ac_cv_search_uuid_generate ++if test "$ac_res" != no; then : ++ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" ++ ++fi ++ ++for ac_func in uuid_create uuid_generate ++do : ++ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ++ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" ++eval as_val=\$$as_ac_var ++ if test "x$as_val" = x""yes; then : ++ cat >>confdefs.h <<_ACEOF ++#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 ++_ACEOF ++ ++fi ++done ++ ++if test $ac_cv_func_uuid_generate = yes; then + + pkg_failed=no + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for UUID" >&5 +@@ -16521,6 +16673,7 @@ else + $as_echo "yes" >&6; } + : + fi ++fi + + # check uuid + diff --git a/ibus-pinyin/patches/patch-ad b/ibus-pinyin/patches/patch-ad new file mode 100644 index 0000000000..aaeb6f0d65 --- /dev/null +++ b/ibus-pinyin/patches/patch-ad @@ -0,0 +1,25 @@ +$NetBSD: patch-ad,v 1.1 2010/04/06 11:55:22 obache Exp $ + +--- src/PinyinParser.cc.orig 2010-01-18 08:29:30.000000000 +0000 ++++ src/PinyinParser.cc +@@ -1,4 +1,7 @@ + /* vim:set et sts=4: */ ++#ifdef HAVE_CONFIG_H ++#include "config.h" ++#endif + #include + #include + #include +@@ -59,7 +62,12 @@ is_pinyin (const gchar *p, + return NULL; + } + ++#ifdef HAVE_STRNLEN + len = strnlen (p, 6); ++#else ++ len = strlen (p); ++ if (len > 6) len = 6; ++#endif + len = MIN (len, end - p); + strncpy (buf, p, len); + diff --git a/ibus-pinyin/patches/patch-ae b/ibus-pinyin/patches/patch-ae new file mode 100644 index 0000000000..8507c4a472 --- /dev/null +++ b/ibus-pinyin/patches/patch-ae @@ -0,0 +1,39 @@ +$NetBSD: patch-ae,v 1.1 2010/04/06 11:55:22 obache Exp $ + +--- src/Util.h.orig 2010-01-01 11:20:05.000000000 +0000 ++++ src/Util.h +@@ -1,7 +1,17 @@ + #ifndef __PY_UTIL_H_ + #define __PY_UTIL_H_ + ++#ifdef HAVE_CONFIG_H ++#include "config.h" ++#endif ++ ++#if defined(HAVE_UUID_H) ++#include ++#elif defined(HAVE_UUID_UUID_H) + #include ++#elif defined(HAVE_SYS_UUID_H) ++#include ++#endif + #include + #include + #include "String.h" +@@ -12,8 +22,16 @@ class UUID { + public: + UUID (void) { + uuid_t u; ++#if defined(HAVE_UUID_CREATE) ++ char* l_uuid; ++ uuid_create (&u, 0); ++ uuid_to_string (&u, &l_uuid, 0); ++ strncpy (m_uuid, l_uuid, sizeof(m_uuid)); ++ free(l_uuid); ++#elif defined(HAVE_UUID_GENERATE) + uuid_generate (u); + uuid_unparse (u, m_uuid); ++#endif + } + + operator const gchar * (void) const {