1 # Copyright 1999-2021 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
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 )"
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 )"
24 chinese-sound? ( media-sound/vorbis-tools[ogg123] )"
33 echo "${P}" > ${S}/VERSION.gcin
34 #epatch "${FILESDIR}/gcin-2.6.6_qtmoc_fix.patch"
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
)
47 filter-ldflags
"-Wl,--as-needed"
48 MAKEOPTS
="${MAKEOPTS} -j1" emake CC
="$(tc-getCC)" || die
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"
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"
82 use gtk3
&& update_gtk_immodules
88 use gtk3
&& update_gtk_immodules