1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
5 PYTHON_COMPAT=( python{2_7,3_6,3_7} )
6 VALA_MIN_API_VERSION="0.34"
7 VALA_USE_DEPEND="vapigen"
9 inherit autotools bash-completion-r1 gnome2-utils python-r1 vala virtualx xdg-utils
11 DESCRIPTION="Intelligent Input Bus for Linux / Unix OS"
12 HOMEPAGE="https://github.com/ibus/ibus/wiki"
13 SRC_URI="https://github.com/${PN}/${PN}/releases/download/${PV}/${P}.tar.gz"
17 KEYWORDS="~alpha amd64 arm arm64 ~ia64 ppc ppc64 sparc x86"
18 IUSE="+X +emoji gconf +gtk +gtk2 +introspection kde nls +python test +unicode vala wayland"
19 RESTRICT="!test? ( test )"
20 REQUIRED_USE="emoji? ( gtk )
24 ${PYTHON_REQUIRED_USE}
28 vala? ( introspection )"
30 CDEPEND="app-text/iso-codes
37 !gtk? ( x11-libs/gtk+:2 )
39 gconf? ( gnome-base/gconf:2 )
44 gtk2? ( x11-libs/gtk+:2 )
46 introspection? ( dev-libs/gobject-introspection )
47 kde? ( dev-qt/qtgui:5 )
48 nls? ( virtual/libintl )
51 dev-python/pygobject:3[${PYTHON_USEDEP}]
60 x11-libs/gtk+:3[introspection]
69 app-i18n/unicode-emoji
71 nls? ( sys-devel/gettext )
72 unicode? ( app-i18n/unicode-data )"
74 PATCHES=( "${FILESDIR}"/${P}-fix-authorization.patch )
76 vala_src_prepare --ignore-use
77 sed -i "/UCD_DIR=/s/\$with_emoji_annotation_dir/\$with_ucd_dir/" configure.ac
78 if ! has_version 'x11-libs/gtk+:3[wayland]'; then
79 touch ui/gtk3/panelbinding.vala
87 touch ui/gtk3/panel.vala
90 # for multiple Python implementations
91 sed -i "s/^\(PYGOBJECT_DIR =\).*/\1/" bindings/Makefile.am
92 # fix for parallel install
93 sed -i "/^if ENABLE_PYTHON2/,/^endif/d" bindings/pygobject/Makefile.am
94 # require user interaction
95 sed -i "/^TESTS += ibus-\(compose\|keypress\)/d" src/tests/Makefile.am
97 sed -i "/^bash_completion/d" tools/Makefile.am
101 xdg_environment_reset
105 local unicodedir="${EPREFIX}"/usr/share/unicode
110 $(use_enable gtk setup)
111 --with-python=${EPYTHON}
114 python_conf+=( --disable-setup )
118 $(use_enable X xim) \
119 $(use_enable emoji emoji-dict) \
120 $(use_with emoji unicode-emoji-dir "${unicodedir}"/emoji) \
121 $(use_with emoji emoji-annotation-dir "${unicodedir}"/cldr/common/annotations) \
122 $(use_enable gconf) \
123 $(use_enable gtk gtk3) \
124 $(use_enable gtk ui) \
126 $(use_enable introspection) \
127 $(use_enable kde appindicator) \
129 $(use_enable test tests) \
130 $(use_enable unicode unicode-dict) \
131 $(use_with unicode ucd-dir "${EPREFIX}/usr/share/unicode-data") \
133 $(use_enable wayland) \
138 unset DBUS_SESSION_BUS_ADDRESS
139 virtx emake -j1 check
144 find "${ED}" -name '*.la' -delete || die
148 emake -C bindings/pygobject \
149 pyoverridesdir="$(${EPYTHON} -c 'import gi; print(gi._overridesdir)')" \
153 python_foreach_impl python_install
156 keepdir /usr/share/ibus/engine
158 newbashcomp tools/${PN}.bash ${PN}
160 insinto /etc/X11/xinit/xinput.d
161 newins xinput-${PN} ${PN}.conf
165 use gconf && gnome2_gconf_savelist
169 use gconf && gnome2_gconf_install
170 use gtk && gnome2_query_immodules_gtk3
171 use gtk2 && gnome2_query_immodules_gtk2
172 gnome2_icon_cache_update
173 gnome2_schemas_update
178 use gtk && gnome2_query_immodules_gtk3
179 use gtk2 && gnome2_query_immodules_gtk2
180 gnome2_icon_cache_update
181 gnome2_schemas_update