From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 9C95F138283 for ; Fri, 27 May 2016 10:22:25 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 7D0BB1419F; Fri, 27 May 2016 10:22:23 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 8C42422404E for ; Fri, 27 May 2016 10:22:22 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 420E9340D8A for ; Fri, 27 May 2016 10:22:21 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 0E40716C4 for ; Fri, 27 May 2016 10:22:17 +0000 (UTC) From: "Yixun Lan" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Yixun Lan" Message-ID: <1464344430.c128d1b74954557d0e6d9df085b0a822450bb6e3.dlan@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: app-i18n/pyzy/files/, app-i18n/pyzy/ X-VCS-Repository: repo/gentoo X-VCS-Files: app-i18n/pyzy/files/pyzy-support-opencc-1.0.0.patch app-i18n/pyzy/pyzy-0.1.0-r2.ebuild X-VCS-Directories: app-i18n/pyzy/ app-i18n/pyzy/files/ X-VCS-Committer: dlan X-VCS-Committer-Name: Yixun Lan X-VCS-Revision: c128d1b74954557d0e6d9df085b0a822450bb6e3 X-VCS-Branch: master Date: Fri, 27 May 2016 10:22:17 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 56216abc-664e-4421-b85d-89a915423e43 X-Archives-Hash: 987c2cf1fdfc72fdaead840b83a5fd08 commit: c128d1b74954557d0e6d9df085b0a822450bb6e3 Author: Yixun Lan gentoo org> AuthorDate: Fri May 27 10:00:33 2016 +0000 Commit: Yixun Lan gentoo org> CommitDate: Fri May 27 10:20:30 2016 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c128d1b7 app-i18n/pyzy: support opencc-1.0.4 Gentoo-Bug: 580782 Package-Manager: portage-2.2.28 .../pyzy/files/pyzy-support-opencc-1.0.0.patch | 49 ++++++++++++++++++++ app-i18n/pyzy/pyzy-0.1.0-r2.ebuild | 54 ++++++++++++++++++++++ 2 files changed, 103 insertions(+) diff --git a/app-i18n/pyzy/files/pyzy-support-opencc-1.0.0.patch b/app-i18n/pyzy/files/pyzy-support-opencc-1.0.0.patch new file mode 100644 index 0000000..055aad1 --- /dev/null +++ b/app-i18n/pyzy/files/pyzy-support-opencc-1.0.0.patch @@ -0,0 +1,49 @@ +commit 344872231b95ce7c2808288101cc563dcd011940 +Author: Hillwood Yang +Date: Thu Feb 26 11:04:29 2015 +0800 + +diff -urN a/src/SimpTradConverter.cc b/src/SimpTradConverter.cc +--- a/src/SimpTradConverter.cc ++++ b/src/SimpTradConverter.cc +@@ -40,7 +41,6 @@ namespace PyZy { + #ifdef HAVE_OPENCC + + class opencc { +- static const int BUFFER_SIZE = 64; + public: + opencc (void) + { +@@ -55,29 +55,13 @@ 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); ++ g_assert (converted != NULL); ++ out = converted; ++ opencc_convert_utf8_free (converted); + } + private: + opencc_t m_od; +- unichar m_buffer[BUFFER_SIZE + 1]; + }; + + void diff --git a/app-i18n/pyzy/pyzy-0.1.0-r2.ebuild b/app-i18n/pyzy/pyzy-0.1.0-r2.ebuild new file mode 100644 index 0000000..22cbf96 --- /dev/null +++ b/app-i18n/pyzy/pyzy-0.1.0-r2.ebuild @@ -0,0 +1,54 @@ +# Copyright 1999-2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +EAPI=5 + +PYTHON_COMPAT=( python2_7 ) +inherit eutils python-any-r1 autotools + +PY_DATABASE=${PN}-database-1.0.0 +DESCRIPTION="The Chinese PinYin and Bopomofo conversion library" +HOMEPAGE="https://github.com/pyzy/pyzy" +SRC_URI="https://pyzy.googlecode.com/files/${P}.tar.gz + https://pyzy.googlecode.com/files/${PY_DATABASE}.tar.bz2" + +LICENSE="LGPL-2.1" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="boost doc opencc test" + +RDEPEND="dev-libs/glib:2 + dev-db/sqlite:3 + sys-apps/util-linux + boost? ( dev-libs/boost ) + opencc? ( app-i18n/opencc )" + +DEPEND="${RDEPEND} + ${PYTHON_DEPS} + doc? ( app-doc/doxygen )" + +# Currently it fails to build test code +RESTRICT="test" + +src_prepare() { + epatch "${FILESDIR}"/${PN}-dont-download-dictionary-file.patch + epatch "${FILESDIR}"/${PN}-support-opencc-1.0.0.patch + + mv ../db ./data/db/open-phrase/ || die + eautoreconf +} + +src_configure() { + econf \ + --enable-db-open-phrase \ + --enable-db-android \ + $(use_enable boost) \ + $(use_enable opencc) \ + $(use_enable test tests) +} + +src_install() { + default + use doc && dohtml -r docs/html/* +}