1 |
commit: 003bcb4ae9e303c8c491dac0e60ca8be2188e1c3 |
2 |
Author: Yixun Lan <dlan <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Nov 24 09:31:55 2021 +0000 |
4 |
Commit: Yixun Lan <dlan <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Nov 24 09:33:36 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=003bcb4a |
7 |
|
8 |
app-i18n/ibus: fix wrong candidate window position issue |
9 |
|
10 |
Closes: https://bugs.gentoo.org/824494 |
11 |
Package-Manager: Portage-3.0.28, Repoman-3.0.3 |
12 |
Signed-off-by: Yixun Lan <dlan <AT> gentoo.org> |
13 |
|
14 |
.../ibus/files/ibus-1.5.25-ibusimcontext.patch | 35 ++++ |
15 |
app-i18n/ibus/ibus-1.5.25-r1.ebuild | 194 +++++++++++++++++++++ |
16 |
2 files changed, 229 insertions(+) |
17 |
|
18 |
diff --git a/app-i18n/ibus/files/ibus-1.5.25-ibusimcontext.patch b/app-i18n/ibus/files/ibus-1.5.25-ibusimcontext.patch |
19 |
new file mode 100644 |
20 |
index 000000000000..6187ff77fbac |
21 |
--- /dev/null |
22 |
+++ b/app-i18n/ibus/files/ibus-1.5.25-ibusimcontext.patch |
23 |
@@ -0,0 +1,35 @@ |
24 |
+https://github.com/ibus/ibus/issues/2337 |
25 |
+https://bugs.gentoo.org/824494 |
26 |
+--- |
27 |
+diff --git a/client/gtk2/ibusimcontext.c b/client/gtk2/ibusimcontext.c |
28 |
+index da9a402..b1ccede 100644 |
29 |
+--- a/client/gtk2/ibusimcontext.c |
30 |
++++ b/client/gtk2/ibusimcontext.c |
31 |
+@@ -1497,7 +1497,10 @@ _set_cursor_location_internal (IBusIMContext *ibusimcontext) |
32 |
+ |
33 |
+ #if GTK_CHECK_VERSION (3, 98, 4) |
34 |
+ #elif GTK_CHECK_VERSION (2, 91, 0) |
35 |
+- area.y += gdk_window_get_height (ibusimcontext->client_window); |
36 |
++ if (area.x == -1 && area.y == -1 && area.width == 0 && area.height == 0) { |
37 |
++ area.x = 0; |
38 |
++ area.y += gdk_window_get_height (ibusimcontext->client_window); |
39 |
++ } |
40 |
+ #else |
41 |
+ if (area.x == -1 && area.y == -1 && area.width == 0 && area.height == 0) { |
42 |
+ gint w, h; |
43 |
+diff --git a/client/gtk3/ibusimcontext.c b/client/gtk3/ibusimcontext.c |
44 |
+index da9a402..b1ccede 100644 |
45 |
+--- a/client/gtk3/ibusimcontext.c |
46 |
++++ b/client/gtk3/ibusimcontext.c |
47 |
+@@ -1497,7 +1497,10 @@ _set_cursor_location_internal (IBusIMContext *ibusimcontext) |
48 |
+ |
49 |
+ #if GTK_CHECK_VERSION (3, 98, 4) |
50 |
+ #elif GTK_CHECK_VERSION (2, 91, 0) |
51 |
+- area.y += gdk_window_get_height (ibusimcontext->client_window); |
52 |
++ if (area.x == -1 && area.y == -1 && area.width == 0 && area.height == 0) { |
53 |
++ area.x = 0; |
54 |
++ area.y += gdk_window_get_height (ibusimcontext->client_window); |
55 |
++ } |
56 |
+ #else |
57 |
+ if (area.x == -1 && area.y == -1 && area.width == 0 && area.height == 0) { |
58 |
+ gint w, h; |
59 |
|
60 |
diff --git a/app-i18n/ibus/ibus-1.5.25-r1.ebuild b/app-i18n/ibus/ibus-1.5.25-r1.ebuild |
61 |
new file mode 100644 |
62 |
index 000000000000..e4d24fa2a59a |
63 |
--- /dev/null |
64 |
+++ b/app-i18n/ibus/ibus-1.5.25-r1.ebuild |
65 |
@@ -0,0 +1,194 @@ |
66 |
+# Copyright 1999-2021 Gentoo Authors |
67 |
+# Distributed under the terms of the GNU General Public License v2 |
68 |
+ |
69 |
+EAPI=7 |
70 |
+ |
71 |
+PYTHON_COMPAT=( python3_{8..10} ) |
72 |
+VALA_MIN_API_VERSION="0.34" |
73 |
+VALA_MAX_API_VERSION="0.50" |
74 |
+VALA_USE_DEPEND="vapigen" |
75 |
+ |
76 |
+inherit autotools bash-completion-r1 gnome2-utils python-r1 vala virtualx xdg-utils |
77 |
+ |
78 |
+GENTOO_VER= |
79 |
+DESCRIPTION="Intelligent Input Bus for Linux / Unix OS" |
80 |
+HOMEPAGE="https://github.com/ibus/ibus/wiki" |
81 |
+ |
82 |
+[[ -n ${GENTOO_VER} ]] && \ |
83 |
+ GENTOO_PATCHSET_URI="https://dev.gentoo.org/~dlan/distfiles/${P}-gentoo-patches-${GENTOO_VER}.tar.xz" |
84 |
+SRC_URI="https://github.com/${PN}/${PN}/releases/download/${PV}/${P}.tar.gz |
85 |
+ ${GENTOO_PATCHSET_URI}" |
86 |
+ |
87 |
+LICENSE="LGPL-2.1" |
88 |
+SLOT="0" |
89 |
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~ia64 ~ppc ~ppc64 ~riscv ~sparc ~x86" |
90 |
+IUSE="+X +emoji +gtk +gtk2 +introspection kde nls +python test +unicode vala wayland" |
91 |
+RESTRICT="!test? ( test )" |
92 |
+REQUIRED_USE="emoji? ( gtk ) |
93 |
+ gtk2? ( gtk ) |
94 |
+ kde? ( gtk ) |
95 |
+ python? ( |
96 |
+ ${PYTHON_REQUIRED_USE} |
97 |
+ introspection |
98 |
+ ) |
99 |
+ test? ( gtk ) |
100 |
+ vala? ( introspection )" |
101 |
+ |
102 |
+CDEPEND="app-text/iso-codes |
103 |
+ dev-libs/glib:2 |
104 |
+ gnome-base/dconf |
105 |
+ gnome-base/librsvg:2 |
106 |
+ sys-apps/dbus[X?] |
107 |
+ X? ( |
108 |
+ x11-libs/libX11 |
109 |
+ >=x11-libs/libXfixes-6.0.0 |
110 |
+ !gtk? ( x11-libs/gtk+:2 ) |
111 |
+ ) |
112 |
+ gtk? ( |
113 |
+ x11-libs/gtk+:3 |
114 |
+ x11-libs/libX11 |
115 |
+ x11-libs/libXi |
116 |
+ gtk2? ( x11-libs/gtk+:2 ) |
117 |
+ ) |
118 |
+ introspection? ( dev-libs/gobject-introspection ) |
119 |
+ kde? ( dev-qt/qtgui:5 ) |
120 |
+ nls? ( virtual/libintl ) |
121 |
+ python? ( |
122 |
+ ${PYTHON_DEPS} |
123 |
+ dev-python/pygobject:3[${PYTHON_USEDEP}] |
124 |
+ ) |
125 |
+ wayland? ( |
126 |
+ dev-libs/wayland |
127 |
+ x11-libs/libxkbcommon |
128 |
+ )" |
129 |
+RDEPEND="${CDEPEND} |
130 |
+ python? ( |
131 |
+ gtk? ( |
132 |
+ x11-libs/gtk+:3[introspection] |
133 |
+ ) |
134 |
+ )" |
135 |
+DEPEND="${CDEPEND} |
136 |
+ $(vala_depend) |
137 |
+ dev-util/glib-utils |
138 |
+ virtual/pkgconfig |
139 |
+ x11-misc/xkeyboard-config |
140 |
+ emoji? ( |
141 |
+ app-i18n/unicode-cldr |
142 |
+ app-i18n/unicode-emoji |
143 |
+ ) |
144 |
+ nls? ( sys-devel/gettext ) |
145 |
+ unicode? ( app-i18n/unicode-data )" |
146 |
+ |
147 |
+PATCHES=( "${FILESDIR}"/${P}-ibusimcontext.patch ) |
148 |
+ |
149 |
+src_prepare() { |
150 |
+ vala_src_prepare --ignore-use |
151 |
+ sed -i "/UCD_DIR=/s/\$with_emoji_annotation_dir/\$with_ucd_dir/" configure.ac |
152 |
+ if ! has_version 'x11-libs/gtk+:3[wayland]'; then |
153 |
+ touch ui/gtk3/panelbinding.vala |
154 |
+ fi |
155 |
+ if ! use emoji; then |
156 |
+ touch \ |
157 |
+ tools/main.vala \ |
158 |
+ ui/gtk3/panel.vala |
159 |
+ fi |
160 |
+ if ! use kde; then |
161 |
+ touch ui/gtk3/panel.vala |
162 |
+ fi |
163 |
+ if [[ -n ${GENTOO_VER} ]]; then |
164 |
+ einfo "Try to apply Gentoo specific patch set" |
165 |
+ eapply "${WORKDIR}"/patches-gentoo/*.patch |
166 |
+ fi |
167 |
+ |
168 |
+ # for multiple Python implementations |
169 |
+ sed -i "s/^\(PYGOBJECT_DIR =\).*/\1/" bindings/Makefile.am |
170 |
+ # fix for parallel install |
171 |
+ sed -i "/^if ENABLE_PYTHON2/,/^endif/d" bindings/pygobject/Makefile.am |
172 |
+ # require user interaction |
173 |
+ sed -i "/^TESTS += ibus-\(compose\|keypress\)/d" src/tests/Makefile.am |
174 |
+ |
175 |
+ sed -i "/^bash_completion/d" tools/Makefile.am |
176 |
+ |
177 |
+ default |
178 |
+ eautoreconf |
179 |
+ xdg_environment_reset |
180 |
+} |
181 |
+ |
182 |
+src_configure() { |
183 |
+ local unicodedir="${EPREFIX}"/usr/share/unicode |
184 |
+ local python_conf=() |
185 |
+ if use python; then |
186 |
+ python_setup |
187 |
+ python_conf+=( |
188 |
+ $(use_enable gtk setup) |
189 |
+ --with-python=${EPYTHON} |
190 |
+ ) |
191 |
+ else |
192 |
+ python_conf+=( --disable-setup ) |
193 |
+ fi |
194 |
+ |
195 |
+ econf \ |
196 |
+ $(use_enable X xim) \ |
197 |
+ $(use_enable emoji emoji-dict) \ |
198 |
+ $(use_with emoji unicode-emoji-dir "${unicodedir}"/emoji) \ |
199 |
+ $(use_with emoji emoji-annotation-dir "${unicodedir}"/cldr/common/annotations) \ |
200 |
+ $(use_enable gtk gtk3) \ |
201 |
+ $(use_enable gtk ui) \ |
202 |
+ $(use_enable gtk2) \ |
203 |
+ $(use_enable introspection) \ |
204 |
+ $(use_enable kde appindicator) \ |
205 |
+ $(use_enable nls) \ |
206 |
+ $(use_enable test tests) \ |
207 |
+ $(use_enable unicode unicode-dict) \ |
208 |
+ $(use_with unicode ucd-dir "${EPREFIX}/usr/share/unicode-data") \ |
209 |
+ $(use_enable vala) \ |
210 |
+ $(use_enable wayland) \ |
211 |
+ "${python_conf[@]}" |
212 |
+} |
213 |
+ |
214 |
+src_test() { |
215 |
+ unset DBUS_SESSION_BUS_ADDRESS |
216 |
+ virtx emake -j1 check |
217 |
+} |
218 |
+ |
219 |
+src_install() { |
220 |
+ default |
221 |
+ find "${ED}" -name '*.la' -delete || die |
222 |
+ |
223 |
+ if use python; then |
224 |
+ python_install() { |
225 |
+ emake -C bindings/pygobject \ |
226 |
+ pyoverridesdir="$(${EPYTHON} -c 'import gi; print(gi._overridesdir)')" \ |
227 |
+ DESTDIR="${D}" \ |
228 |
+ install |
229 |
+ |
230 |
+ python_optimize |
231 |
+ } |
232 |
+ python_foreach_impl python_install |
233 |
+ fi |
234 |
+ |
235 |
+ keepdir /usr/share/ibus/engine |
236 |
+ |
237 |
+ newbashcomp tools/${PN}.bash ${PN} |
238 |
+ |
239 |
+ insinto /etc/X11/xinit/xinput.d |
240 |
+ newins xinput-${PN} ${PN}.conf |
241 |
+ |
242 |
+ # Undo compression of man page |
243 |
+ find "${ED}"/usr/share/man -type f -name '*.gz' -exec gzip -d {} \; || die |
244 |
+} |
245 |
+ |
246 |
+pkg_postinst() { |
247 |
+ use gtk && gnome2_query_immodules_gtk3 |
248 |
+ use gtk2 && gnome2_query_immodules_gtk2 |
249 |
+ xdg_icon_cache_update |
250 |
+ gnome2_schemas_update |
251 |
+ dconf update |
252 |
+} |
253 |
+ |
254 |
+pkg_postrm() { |
255 |
+ use gtk && gnome2_query_immodules_gtk3 |
256 |
+ use gtk2 && gnome2_query_immodules_gtk2 |
257 |
+ xdg_icon_cache_update |
258 |
+ gnome2_schemas_update |
259 |
+} |