dev-python/numpydoc: arm64 keyworded (bug #721130)
[gentoo.git] / app-i18n / ibus / ibus-1.5.21-r1.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5 PYTHON_COMPAT=( python{2_7,3_6,3_7} )
6 VALA_MIN_API_VERSION="0.34"
7 VALA_USE_DEPEND="vapigen"
8
9 inherit autotools bash-completion-r1 gnome2-utils python-r1 vala virtualx xdg-utils
10
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"
14
15 LICENSE="LGPL-2.1"
16 SLOT="0"
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 )
21         gtk2? ( gtk )
22         kde? ( gtk )
23         python? (
24                 ${PYTHON_REQUIRED_USE}
25                 introspection
26         )
27         test? ( gtk )
28         vala? ( introspection )"
29
30 CDEPEND="app-text/iso-codes
31         dev-libs/glib:2
32         gnome-base/dconf
33         gnome-base/librsvg:2
34         sys-apps/dbus[X?]
35         X? (
36                 x11-libs/libX11
37                 !gtk? ( x11-libs/gtk+:2 )
38         )
39         gconf? ( gnome-base/gconf:2 )
40         gtk? (
41                 x11-libs/gtk+:3
42                 x11-libs/libX11
43                 x11-libs/libXi
44                 gtk2? ( x11-libs/gtk+:2 )
45         )
46         introspection? ( dev-libs/gobject-introspection )
47         kde? ( dev-qt/qtgui:5 )
48         nls? ( virtual/libintl )
49         python? (
50                 ${PYTHON_DEPS}
51                 dev-python/pygobject:3[${PYTHON_USEDEP}]
52         )
53         wayland? (
54                 dev-libs/wayland
55                 x11-libs/libxkbcommon
56         )"
57 RDEPEND="${CDEPEND}
58         python? (
59                 gtk? (
60                         x11-libs/gtk+:3[introspection]
61                 )
62         )"
63 DEPEND="${CDEPEND}
64         $(vala_depend)
65         dev-util/glib-utils
66         virtual/pkgconfig
67         emoji? (
68                 app-i18n/unicode-cldr
69                 app-i18n/unicode-emoji
70         )
71         nls? ( sys-devel/gettext )
72         unicode? ( app-i18n/unicode-data )"
73
74 PATCHES=( "${FILESDIR}"/${P}-fix-authorization.patch )
75 src_prepare() {
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
80         fi
81         if ! use emoji; then
82                 touch \
83                         tools/main.vala \
84                         ui/gtk3/panel.vala
85         fi
86         if ! use kde; then
87                 touch ui/gtk3/panel.vala
88         fi
89
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
96
97         sed -i "/^bash_completion/d" tools/Makefile.am
98
99         default
100         eautoreconf
101         xdg_environment_reset
102 }
103
104 src_configure() {
105         local unicodedir="${EPREFIX}"/usr/share/unicode
106         local python_conf=()
107         if use python; then
108                 python_setup
109                 python_conf+=(
110                         $(use_enable gtk setup)
111                         --with-python=${EPYTHON}
112                 )
113         else
114                 python_conf+=( --disable-setup )
115         fi
116
117         econf \
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) \
125                 $(use_enable gtk2) \
126                 $(use_enable introspection) \
127                 $(use_enable kde appindicator) \
128                 $(use_enable nls) \
129                 $(use_enable test tests) \
130                 $(use_enable unicode unicode-dict) \
131                 $(use_with unicode ucd-dir "${EPREFIX}/usr/share/unicode-data") \
132                 $(use_enable vala) \
133                 $(use_enable wayland) \
134                 "${python_conf[@]}"
135 }
136
137 src_test() {
138         unset DBUS_SESSION_BUS_ADDRESS
139         virtx emake -j1 check
140 }
141
142 src_install() {
143         default
144         find "${ED}" -name '*.la' -delete || die
145
146         if use python; then
147                 python_install() {
148                         emake -C bindings/pygobject \
149                                 pyoverridesdir="$(${EPYTHON} -c 'import gi; print(gi._overridesdir)')" \
150                                 DESTDIR="${D}" \
151                                 install
152                 }
153                 python_foreach_impl python_install
154         fi
155
156         keepdir /usr/share/ibus/engine
157
158         newbashcomp tools/${PN}.bash ${PN}
159
160         insinto /etc/X11/xinit/xinput.d
161         newins xinput-${PN} ${PN}.conf
162 }
163
164 pkg_preinst() {
165         use gconf && gnome2_gconf_savelist
166 }
167
168 pkg_postinst() {
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
174         dconf update
175 }
176
177 pkg_postrm() {
178         use gtk && gnome2_query_immodules_gtk3
179         use gtk2 && gnome2_query_immodules_gtk2
180         gnome2_icon_cache_update
181         gnome2_schemas_update
182 }