svn commit: r429618 - in head/chinese/pyzy: . files
Kurt Jaeger
pi at FreeBSD.org
Tue Dec 27 14:25:41 UTC 2016
Author: pi
Date: Tue Dec 27 14:25:39 2016
New Revision: 429618
URL: https://svnweb.freebsd.org/changeset/ports/429618
Log:
chinese/pyzy: unbreak by moving upstream to github
- Removes the openphrase database
It is only hosted on Google Code. Remove this option until it's
provided on github.
- Fix build with OpenCC
OpenCC changed its interface and removed the old APIs. This patch
fixes the problem. The upstream is almost dead, and there is a
similar pull request waiting.
- use pathfix instead of sed call
- fixed indention
PR: 212735
Submitted by: shun.fbsd.pr.ml at dropcut.net, henry.hu.sh at gmail.com (maintainer)
Added:
head/chinese/pyzy/files/
head/chinese/pyzy/files/patch-src_SimpTradConverter.cc (contents, props changed)
Modified:
head/chinese/pyzy/Makefile
head/chinese/pyzy/distinfo
head/chinese/pyzy/pkg-descr
head/chinese/pyzy/pkg-plist
Modified: head/chinese/pyzy/Makefile
==============================================================================
--- head/chinese/pyzy/Makefile Tue Dec 27 14:18:49 2016 (r429617)
+++ head/chinese/pyzy/Makefile Tue Dec 27 14:25:39 2016 (r429618)
@@ -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 at 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
Modified: head/chinese/pyzy/distinfo
==============================================================================
--- head/chinese/pyzy/distinfo Tue Dec 27 14:18:49 2016 (r429617)
+++ head/chinese/pyzy/distinfo Tue Dec 27 14:25:39 2016 (r429618)
@@ -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
Added: head/chinese/pyzy/files/patch-src_SimpTradConverter.cc
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/chinese/pyzy/files/patch-src_SimpTradConverter.cc Tue Dec 27 14:25:39 2016 (r429618)
@@ -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
Modified: head/chinese/pyzy/pkg-descr
==============================================================================
--- head/chinese/pyzy/pkg-descr Tue Dec 27 14:18:49 2016 (r429617)
+++ head/chinese/pyzy/pkg-descr Tue Dec 27 14:25:39 2016 (r429618)
@@ -3,4 +3,4 @@ The Chinese PinYin and Bopomofo conversi
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
Modified: head/chinese/pyzy/pkg-plist
==============================================================================
--- head/chinese/pyzy/pkg-plist Tue Dec 27 14:18:49 2016 (r429617)
+++ head/chinese/pyzy/pkg-plist Tue Dec 27 14:25:39 2016 (r429618)
@@ -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
More information about the svn-ports-head
mailing list