aboutsummaryrefslogtreecommitdiff
path: root/chinese
diff options
context:
space:
mode:
authorKurt Jaeger <pi@FreeBSD.org>2016-12-27 14:25:39 +0000
committerKurt Jaeger <pi@FreeBSD.org>2016-12-27 14:25:39 +0000
commitce964f26a2611ec53e3cde47fe9f6f9a51f176f1 (patch)
treefb94e5be9c1c5d0fd19ca5ca63680ac84ce7cbbb /chinese
parent69dd94d394bea27953169cbb24bf04023b74a8c2 (diff)
downloadports-ce964f26a2611ec53e3cde47fe9f6f9a51f176f1.tar.gz
ports-ce964f26a2611ec53e3cde47fe9f6f9a51f176f1.zip
Notes
Diffstat (limited to 'chinese')
-rw-r--r--chinese/pyzy/Makefile33
-rw-r--r--chinese/pyzy/distinfo7
-rw-r--r--chinese/pyzy/files/patch-src_SimpTradConverter.cc43
-rw-r--r--chinese/pyzy/pkg-descr2
-rw-r--r--chinese/pyzy/pkg-plist3
5 files changed, 57 insertions, 31 deletions
diff --git a/chinese/pyzy/Makefile b/chinese/pyzy/Makefile
index 19315c741f30..9de6098cf5c4 100644
--- a/chinese/pyzy/Makefile
+++ b/chinese/pyzy/Makefile
@@ -3,22 +3,20 @@
PORTNAME= pyzy
PORTVERSION= 0.1.0
-PORTREVISION= 2
+PORTREVISION= 3
CATEGORIES= chinese
-MASTER_SITES= GOOGLE_CODE
-DISTFILES= ${DISTNAME}${EXTRACT_SUFX}
-EXTRACT_ONLY= ${DISTNAME}${EXTRACT_SUFX}
MAINTAINER= henry.hu.sh@gmail.com
-COMMENT= The Chinese PinYin and Bopomofo conversion library
+COMMENT= Chinese PinYin and Bopomofo conversion library
LICENSE= LGPL21
-BROKEN= Unfetchable (google code has gone away)
-
LIB_DEPENDS= libsqlite3.so:databases/sqlite3
-USES= compiler:c++11-lib gettext-runtime gmake libtool pathfix pkgconfig python:build shebangfix
+USE_GITHUB= yes
+GH_TAGNAME= 6d9c3cd
+
+USES= compiler:c++11-lib gmake libtool pkgconfig python:build shebangfix autoreconf gettext-runtime pathfix
SHEBANG_FILES= data/db/android/create_db.py
USE_GNOME= glib20
USE_LDCONFIG= yes
@@ -26,27 +24,14 @@ USE_LDCONFIG= yes
GNU_CONFIGURE= yes
CONFIGURE_ARGS= --disable-dependency-tracking --disable-boost
-OPTIONS_DEFINE= ANDROID_DB OPENPHRASE_DB OPENCC
-OPTIONS_DEFAULT= ANDROID_DB
+OPTIONS_DEFINE= OPENCC
+OPTIONS_DEFAULT=
OPTIONS_SUB= yes
-ANDROID_DB_DESC= Build Android DB
-OPENPHRASE_DB_DESC= Build Open Phrase DB
-OPENCC_DESC= Use opencc for simplified and traditional Chinese conversion
-
-ANDROID_DB_CONFIGURE_ENABLE= db-android
-
-OPENPHRASE_DBVER= 1.0.0
-OPENPHRASE_DBFILE= pyzy-database-${OPENPHRASE_DBVER}.tar.bz2
-
-OPENPHRASE_DB_CONFIGURE_ENABLE= db-open-phrase
-OPENPHRASE_DB_DISTFILES= ${OPENPHRASE_DBFILE}
+OPENCC_DESC= Use opencc for simplified and traditional Chinese conversion
OPENCC_CONFIGURE_ENABLE= opencc
OPENCC_LIB_DEPENDS= libopencc.so:chinese/opencc
-post-extract-OPENPHRASE_DB-on:
- @${CP} ${DISTDIR}/${OPENPHRASE_DBFILE} ${WRKSRC}/data/db/open-phrase
-
post-install:
@${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/lib${PORTNAME}-1.0.so
diff --git a/chinese/pyzy/distinfo b/chinese/pyzy/distinfo
index 803c4ba5ad33..439e4937fbf6 100644
--- a/chinese/pyzy/distinfo
+++ b/chinese/pyzy/distinfo
@@ -1,4 +1,3 @@
-SHA256 (pyzy-0.1.0.tar.gz) = fe468a4372473d85a56f05d55b14f0e0201fde6f9336a1a2322cf79421c84d9a
-SIZE (pyzy-0.1.0.tar.gz) = 1571946
-SHA256 (pyzy-database-1.0.0.tar.bz2) = 32c7d07b9f41e1dfc0f9008f54eca8e6cb367e7f2b19ac94c49754442694c321
-SIZE (pyzy-database-1.0.0.tar.bz2) = 9977983
+TIMESTAMP = 1480281906
+SHA256 (pyzy-pyzy-0.1.0-6d9c3cd_GH0.tar.gz) = 20c6306c3e0f507f3279a97f7117856d1733140422ea02b19aa551e113b6b859
+SIZE (pyzy-pyzy-0.1.0-6d9c3cd_GH0.tar.gz) = 1320154
diff --git a/chinese/pyzy/files/patch-src_SimpTradConverter.cc b/chinese/pyzy/files/patch-src_SimpTradConverter.cc
new file mode 100644
index 000000000000..3c21fcbe0e6e
--- /dev/null
+++ b/chinese/pyzy/files/patch-src_SimpTradConverter.cc
@@ -0,0 +1,43 @@
+--- src/SimpTradConverter.cc.orig 2012-12-17 04:00:47 UTC
++++ src/SimpTradConverter.cc
+@@ -40,7 +40,6 @@ namespace PyZy {
+ #ifdef HAVE_OPENCC
+
+ class opencc {
+- static const int BUFFER_SIZE = 64;
+ public:
+ opencc (void)
+ {
+@@ -55,29 +54,12 @@ public:
+
+ void convert (const char *in, String &out)
+ {
+- long n_char;
+- unichar *in_ucs4 = g_utf8_to_ucs4_fast (in, -1, &n_char);
+-
+- ucs4_t *pinbuf = (ucs4_t *)in_ucs4;
+- size_t inbuf_left = n_char;
+- while (inbuf_left != 0) {
+- ucs4_t *poutbuf = (ucs4_t *)m_buffer;
+- size_t outbuf_left = BUFFER_SIZE;
+- size_t retval = opencc_convert(m_od, &pinbuf, &inbuf_left, &poutbuf, &outbuf_left);
+- if (retval == (size_t) -1) {
+- /* append left chars in pinbuf */
+- g_warning ("opencc_convert return failed");
+- out << (unichar *) pinbuf;
+- break;
+- }
+- *poutbuf = L'\0';
+- out << m_buffer;
+- }
+- g_free (in_ucs4);
++ char *converted = opencc_convert_utf8(m_od, in, -1);
++ out = converted;
++ opencc_convert_utf8_free(converted);
+ }
+ private:
+ opencc_t m_od;
+- unichar m_buffer[BUFFER_SIZE + 1];
+ };
+
+ void
diff --git a/chinese/pyzy/pkg-descr b/chinese/pyzy/pkg-descr
index 2d8cc1b69d32..e74c190abf71 100644
--- a/chinese/pyzy/pkg-descr
+++ b/chinese/pyzy/pkg-descr
@@ -3,4 +3,4 @@ The Chinese PinYin and Bopomofo conversion library
This is the Chinese PinYin / Bopomofo conversion library.
You can easily write an application which handles the Chinese with it.
-WWW: http://code.google.com/p/pyzy
+WWW: http://github.com/pyzy/pyzy
diff --git a/chinese/pyzy/pkg-plist b/chinese/pyzy/pkg-plist
index 863bb2e29339..8a6f0cec7fed 100644
--- a/chinese/pyzy/pkg-plist
+++ b/chinese/pyzy/pkg-plist
@@ -5,7 +5,6 @@ lib/libpyzy-1.0.so
lib/libpyzy-1.0.so.0
lib/libpyzy-1.0.so.0.100.0
libdata/pkgconfig/pyzy-1.0.pc
-%%ANDROID_DB%%%%DATADIR%%/db/android.db
-%%OPENPHRASE_DB%%%%DATADIR%%/db/open-phrase.db
+%%DATADIR%%/db/android.db
%%DATADIR%%/db/create_index.sql
%%DATADIR%%/phrases.txt