net-im/tencent-qq: rename version
[gentoo-zh.git] / app-i18n / gcin / gcin-2.9.0-r2.ebuild
blobd87bf6a56dade5b9c4d31e6b3efaedb7e956c040
1 # Copyright 1999-2021 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
4 EAPI=5
6 inherit eutils toolchain-funcs flag-o-matic
8 DESCRIPTION="Another Traditional Chinese IM."
9 HOMEPAGE="http://hyperrate.com/dir.php?eid=67"
10 SRC_URI="http://hyperrate.com/gcin-source/gcin-${PV}.tar.xz
11 chinese-sound? ( http://ftp.twaren.net/local-distfiles/gcin/ogg.tgz )"
13 LICENSE="LGPL-2.1"
14 SLOT="0"
15 KEYWORDS="~amd64 ~x86"
16 IUSE="filter-nobopomofo chinese-sound anthy chewing gtk3 qt5"
18 DEPEND=">=x11-libs/gtk+-2:*
19 anthy? ( >=app-i18n/anthy-9100 )
20 chewing? ( app-i18n/libchewing )
21 gtk3? ( x11-libs/gtk+:3 )
22 qt5? ( dev-qt/qtcore:5 dev-qt/qtgui )"
23 RDEPEND="${DEPEND}
24 chinese-sound? ( media-sound/vorbis-tools[ogg123] )"
25 DEPEND="${DEPEND}
26 virtual/pkgconfig
27 sys-devel/gettext"
29 RESTRICT="mirror"
30 S=${WORKDIR}/${P/_/.}
32 src_prepare() {
33 echo "${P}" > ${S}/VERSION.gcin
34 #epatch "${FILESDIR}/gcin-2.6.6_qtmoc_fix.patch"
37 src_configure() {
38 econf --use_i18n=Y \
39 --use_tsin=Y \
40 $(! use anthy && echo --use_anthy=N ) \
41 $(! use chewing && echo --use_chewing=N ) \
42 $(! use qt5 && echo --use_qt=N ) \
43 $(! use gtk3 && echo --use_gtk3=N )
46 src_compile() {
47 filter-ldflags "-Wl,--as-needed"
48 MAKEOPTS="${MAKEOPTS} -j1" emake CC="$(tc-getCC)" || die
51 src_install() {
52 emake DESTDIR="${D}" install || die
54 if use filter-nobopomofo ; then
55 insinto /usr/share/pixmaps/gcin
56 doins "${FILESDIR}"/nobopomofo/{SS1135_ST,SS1208_DT}.jpg || die
57 exeinto /usr/share/gcin/script
58 doexe "${FILESDIR}"/nobopomofo/gcin-filter-nobopomofo || die
59 doenvd "${FILESDIR}"/nobopomofo/99gcin-filter-nobopomofo || die
62 if use chinese-sound ; then
63 insinto /usr/share/${PN}
64 doins -r "${WORKDIR}"/ogg || die
68 update_gtk_immodules() {
69 local GTK2_CONFDIR="/etc/gtk-2.0"
70 # bug #366889
71 if has_version '>=x11-libs/gtk+-2.22.1-r1:2' || has_multilib_profile ; then
72 GTK2_CONFDIR="${GTK2_CONFDIR}/$(get_abi_CHOST)"
74 mkdir -p "${EPREFIX}${GTK2_CONFDIR}"
76 if [ -x "${EPREFIX}/usr/bin/gtk-query-immodules-2.0" ] ; then
77 "${EPREFIX}/usr/bin/gtk-query-immodules-2.0" > "${EPREFIX}${GTK2_CONFDIR}/gtk.immodules"
81 pkg_postinst() {
82 use gtk3 && update_gtk_immodules
83 xdg_icon_cache_update
87 pkg_postrm() {
88 use gtk3 && update_gtk_immodules
89 xdg_icon_cache_update