Skip to content

Commit

Permalink
FL-363: support boost and opencc flag in pyzy, with some bug fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
janzhou committed Jan 24, 2013
1 parent 89d43f8 commit ddb6d08
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 25 deletions.
2 changes: 0 additions & 2 deletions app-i18n/ibus-pinyin/ibus-pinyin-1.3.99.20110706.ebuild
@@ -1,6 +1,4 @@
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/app-i18n/ibus-pinyin/ibus-pinyin-1.3.99.20110706.ebuild,v 1.4 2012/05/03 19:24:26 jdhore Exp $

EAPI=4

Expand Down
2 changes: 0 additions & 2 deletions app-i18n/ibus-pinyin/ibus-pinyin-1.4.0.ebuild
@@ -1,6 +1,4 @@
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/app-i18n/ibus-pinyin/ibus-pinyin-1.4.0.ebuild,v 1.2 2012/05/03 19:24:26 jdhore Exp $

EAPI=4

Expand Down
17 changes: 4 additions & 13 deletions app-i18n/ibus-pinyin/ibus-pinyin-1.5.0.ebuild
@@ -1,6 +1,4 @@
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/app-i18n/ibus-pinyin/ibus-pinyin-1.4.0.ebuild,v 1.2 2012/05/03 19:24:26 jdhore Exp $

EAPI=4

Expand All @@ -12,8 +10,7 @@ inherit python
PYDB_TAR="pinyin-database-1.2.99.tar.bz2"
DESCRIPTION="Chinese PinYin IMEngine for IBus Framework"
HOMEPAGE="http://code.google.com/p/ibus/"
SRC_URI="http://ibus.googlecode.com/files/${P}.tar.gz
http://ibus.googlecode.com/files/${PYDB_TAR}"
SRC_URI="http://ibus.googlecode.com/files/${P}.tar.gz"

LICENSE="GPL-2"
SLOT="0"
Expand All @@ -29,28 +26,22 @@ RDEPEND=">=app-i18n/ibus-1.4
DEPEND="${RDEPEND}
virtual/pkgconfig
nls? ( >=sys-devel/gettext-0.16.1 )
>=dev-libs/pyzy-0.1.0"

DOCS="AUTHORS ChangeLog NEWS README"
boost? ( dev-libs/pyzy[boost] )
opencc? ( dev-libs/pyzy[opencc] )"

pkg_setup() {
python_set_active_version 2
python_pkg_setup
}

#src_prepare() {
# cp "${DISTDIR}"/${PYDB_TAR} data/db/open-phrase/ || die
# >py-compile
#}

src_configure() {
econf \
$(use_enable boost) \
$(use_enable lua lua-extension) \
$(use_enable nls) \
$(use_enable opencc) \
--enable-db-open-phrase
#--disable-db-android \
--disable-db-android \
#--disable-english-input-mode \
}

Expand Down
4 changes: 2 additions & 2 deletions dev-libs/pyzy/files/pyzy-dont-download-dictionary-file.patch
Expand Up @@ -5,7 +5,7 @@
$(DBTAR):
$(AM_V_GEN) \
- wget http://pyzy.googlecode.com/files/$(DBTAR) || \
+ ln -s ${PORTDIR}/distfiles/$(DBTAR) || \
+ ln -s ${DISTDIR}/$(DBTAR) || \
( $(RM) $@; exit 1)

stamp-db: $(DBTAR)
Expand All @@ -16,7 +16,7 @@
@PYZY_BUILD_DB_OPEN_PHRASE_TRUE@$(DBTAR):
@PYZY_BUILD_DB_OPEN_PHRASE_TRUE@ $(AM_V_GEN) \
-@PYZY_BUILD_DB_OPEN_PHRASE_TRUE@ wget http://pyzy.googlecode.com/files/$(DBTAR) || \
+@PYZY_BUILD_DB_OPEN_PHRASE_TRUE@ ln -s ${PORTDIR}/distfiles/$(DBTAR) || \
+@PYZY_BUILD_DB_OPEN_PHRASE_TRUE@ ln -s ${DISTDIR}/$(DBTAR) || \
@PYZY_BUILD_DB_OPEN_PHRASE_TRUE@ ( $(RM) $@; exit 1)

@PYZY_BUILD_DB_OPEN_PHRASE_TRUE@stamp-db: $(DBTAR)
13 changes: 13 additions & 0 deletions dev-libs/pyzy/metadata.xml
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<herd>cjk</herd>
<longdescription lang="en">
The Chinese PinYin and Bopomofo conversion library.
</longdescription>
<use>
<flag name="boost">Compile against <pkg>dev-libs/boost</pkg> libraries</flag>
<flag name="opencc">Enable support for <pkg>app-i18n/opencc</pkg></flag>
</use>
</pkgmetadata>

17 changes: 11 additions & 6 deletions dev-libs/pyzy/pyzy-0.1.0.ebuild
Expand Up @@ -5,21 +5,22 @@ inherit eutils

DESCRIPTION="The Chinese PinYin and Bopomofo conversion library."
HOMEPAGE="http://code.google.com/p/pyzy/"

SRC_URI="http://pyzy.googlecode.com/files/pyzy-${PV}.tar.gz
SRC_URI="http://pyzy.googlecode.com/files/${P}.tar.gz
http://pyzy.googlecode.com/files/pyzy-database-1.0.0.tar.bz2"
LICENSE="LGPL-2.1"
SLOT="0"
KEYWORDS="amd64 x86 arm"
IUSE=""
IUSE="boost opencc"
RDEPEND=">=dev-db/sqlite-3.6.18
>=dev-libs/glib-2.24"
>=dev-libs/glib-2.24
boost? ( >=dev-libs/boost-1.39 )
opencc? ( app-i18n/opencc )"
DEPEND="${RDEPEND}
virtual/pkgconfig
>=sys-devel/gettext-0.16.1"

src_unpack() {
unpack pyzy-${PV}.tar.gz
unpack ${P}.tar.gz
}

src_prepare() {
Expand All @@ -28,5 +29,9 @@ src_prepare() {
}

src_configure() {
econf --enable-db-open-phrase --disable-db-android || die "configure failed"
econf \
$(use_enable boost) \
$(use_enable opencc) \
--enable-db-open-phrase \
--disable-db-android || die "configure failed"
}

0 comments on commit ddb6d08

Please sign in to comment.