Skip to content

Commit 1bb364a

Browse files
committed
app-i18n/ibus: fix emoji input broken issue
Closes: https://bugs.gentoo.org/907764 Signed-off-by: Yixun Lan <dlan@gentoo.org>
1 parent 3da1357 commit 1bb364a

File tree

2 files changed

+241
-0
lines changed

2 files changed

+241
-0
lines changed

app-i18n/ibus/Manifest

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
DIST ibus-1.5.26.tar.gz 3715263 BLAKE2B 80eb293b028d431b76c015c6d6d9fea92888554f6f34ec126853df189746d9976569ec2380146187d13337a011668b1f15fc57a95284658c8afc7824a67b5898 SHA512 923607c17114af673dcc36532fb44a278b61161ee1b7d4e01b2e0dcffc40c95eb91c6416acc9c0da0333e933863e15263e9a5ff1e467cfc02b71398d601b9714
22
DIST ibus-1.5.27.tar.gz 3779541 BLAKE2B e98f775cd62036ae02dafd984933343e99390a6a1e77b672feb4bc00dd1d423126227bded2d22b8bc9fa214e572ea906c407658de8ee20e036f8753836d68f46 SHA512 b5f3ae555d19eb780a416383e6351ed2cd8834fcc2bc4ebe4f4a194fc934dd055c5e782f9ec382fb21e1e2103c5409804174a79d192b5494a9018ce9081305e4
3+
DIST ibus-1.5.28-upstream-patches-0.tar.xz 23820 BLAKE2B 773736257e166170060458ad66b99889d2e54ef480504fe86ee65bc41364243ddcb5c7625aaa66a3e266c735d024c4f6c51d559484214d1f1c04a30479ccba62 SHA512 5555162bcb129f9e07c135c921c778de080aeaec81d56bedcf62d3b568cf39515e41662790c5a3d34241586d58785b887bbbaa7a75f486338968e3a496aa6433
34
DIST ibus-1.5.28.tar.gz 3871246 BLAKE2B 7117c09e708df8a08e6684cc1096f38873503eb2c7937e0e3b02aeff678c96b3e2fc59fa4dfc7a11275b2e1b3349ae136041f8f4730aadc66339914b77c577d3 SHA512 5bfb9158a5810d38af900775ed30406823872c431ef4772b476afa7b58c120ef508a51b961620ea6003549f1f49cf05484992beee8677b138f1162afc73ab247

app-i18n/ibus/ibus-1.5.28-r1.ebuild

Lines changed: 240 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,240 @@
1+
# Copyright 1999-2023 Gentoo Authors
2+
# Distributed under the terms of the GNU General Public License v2
3+
4+
EAPI=7
5+
6+
PYTHON_COMPAT=( python3_{9..11} )
7+
8+
inherit autotools bash-completion-r1 gnome2-utils python-r1 toolchain-funcs vala virtualx xdg-utils
9+
10+
UPSTREAM_VER=0
11+
GENTOO_VER=
12+
DESCRIPTION="Intelligent Input Bus for Linux / Unix OS"
13+
HOMEPAGE="https://github.com/ibus/ibus/wiki"
14+
15+
[[ -n ${UPSTREAM_VER} ]] && \
16+
UPSTREAM_PATCHSET_URI="https://dev.gentoo.org/~dlan/distfiles/${P}-upstream-patches-${UPSTREAM_VER}.tar.xz"
17+
[[ -n ${GENTOO_VER} ]] && \
18+
GENTOO_PATCHSET_URI="https://dev.gentoo.org/~dlan/distfiles/${P}-gentoo-patches-${GENTOO_VER}.tar.xz"
19+
SRC_URI="https://github.com/${PN}/${PN}/releases/download/${PV}/${P}.tar.gz
20+
${UPSTREAM_PATCHSET_URI} ${GENTOO_PATCHSET_URI}"
21+
22+
LICENSE="LGPL-2.1"
23+
SLOT="0"
24+
KEYWORDS="~amd64 ~arm ~arm64 ~ia64 ~loong ~ppc ~ppc64 ~riscv ~sparc ~x86"
25+
IUSE="X appindicator +emoji gtk2 +gtk3 +gtk4 +gui +introspection libnotify nls +python systemd test +unicode vala wayland"
26+
RESTRICT="!test? ( test )"
27+
REQUIRED_USE="
28+
appindicator? ( gtk3 )
29+
python? (
30+
${PYTHON_REQUIRED_USE}
31+
introspection
32+
)
33+
test? ( gtk3 )
34+
vala? ( introspection )
35+
X? ( gtk3 )
36+
"
37+
DEPEND="
38+
app-text/iso-codes
39+
>=dev-libs/glib-2.65.0:2
40+
gnome-base/dconf
41+
gnome-base/librsvg:2
42+
sys-apps/dbus[X?]
43+
X? (
44+
x11-libs/libX11
45+
>=x11-libs/libXfixes-6.0.0
46+
)
47+
gtk2? ( x11-libs/gtk+:2 )
48+
gtk3? ( x11-libs/gtk+:3 )
49+
gtk4? ( gui-libs/gtk:4 )
50+
gui? (
51+
x11-libs/libX11
52+
x11-libs/libXi
53+
)
54+
introspection? ( dev-libs/gobject-introspection )
55+
libnotify? ( x11-libs/libnotify )
56+
nls? ( virtual/libintl )
57+
python? (
58+
${PYTHON_DEPS}
59+
dev-python/pygobject:3[${PYTHON_USEDEP}]
60+
)
61+
wayland? (
62+
dev-libs/wayland
63+
x11-libs/libxkbcommon
64+
)"
65+
RDEPEND="${DEPEND}
66+
python? (
67+
gui? (
68+
x11-libs/gtk+:3[introspection]
69+
)
70+
)"
71+
BDEPEND="
72+
$(vala_depend)
73+
dev-libs/glib:2
74+
dev-util/glib-utils
75+
virtual/pkgconfig
76+
x11-misc/xkeyboard-config
77+
emoji? (
78+
app-i18n/unicode-cldr
79+
app-i18n/unicode-emoji
80+
)
81+
nls? ( sys-devel/gettext )
82+
test? ( x11-apps/setxkbmap )
83+
unicode? ( app-i18n/unicode-data )"
84+
85+
src_prepare() {
86+
vala_src_prepare --ignore-use
87+
if ! has_version 'x11-libs/gtk+:3[wayland]'; then
88+
touch ui/gtk3/panelbinding.vala \
89+
ui/gtk3/panel.vala \
90+
ui/gtk3/emojierapp.vala || die
91+
fi
92+
if ! use emoji; then
93+
touch \
94+
tools/main.vala \
95+
ui/gtk3/panel.vala || die
96+
fi
97+
if ! use appindicator; then
98+
touch ui/gtk3/panel.vala || die
99+
fi
100+
101+
if [[ -n ${UPSTREAM_VER} ]]; then
102+
einfo "Try to apply Upstream specific patch set"
103+
eapply "${WORKDIR}"/patches-upstream/*.patch
104+
fi
105+
106+
if [[ -n ${GENTOO_VER} ]]; then
107+
einfo "Try to apply Gentoo specific patch set"
108+
eapply "${WORKDIR}"/patches-gentoo/*.patch
109+
fi
110+
111+
# for multiple Python implementations
112+
sed -i "s/^\(PYGOBJECT_DIR =\).*/\1/" bindings/Makefile.am || die
113+
# fix for parallel install
114+
sed -i "/^if ENABLE_PYTHON2/,/^endif/d" bindings/pygobject/Makefile.am || die
115+
# require user interaction
116+
sed -i "/^TESTS_C += ibus-\(compose\|keypress\)/d" src/tests/Makefile.am || die
117+
118+
sed -i "/^bash_completion/d" tools/Makefile.am || die
119+
120+
default
121+
eautoreconf
122+
xdg_environment_reset
123+
}
124+
125+
src_configure() {
126+
local unicodedir="${EPREFIX}"/usr/share/unicode
127+
local python_conf=()
128+
if use python; then
129+
python_setup
130+
python_conf+=(
131+
$(use_enable gui setup)
132+
--with-python=${EPYTHON}
133+
)
134+
else
135+
python_conf+=( --disable-setup )
136+
fi
137+
138+
if tc-is-cross-compiler && { use emoji || use unicode; }; then
139+
mkdir -p "${S}-build"
140+
pushd "${S}-build" >/dev/null 2>&1 || die
141+
ECONF_SOURCE=${S} econf_build --enable-static \
142+
--disable-{dconf,gtk{2,3},python-library,shared,xim} \
143+
ISOCODES_{CFLAG,LIB}S=-DSKIP \
144+
$(use_enable emoji emoji-dict) \
145+
$(use_enable unicode unicode-dict) \
146+
$(use_with unicode ucd-dir "${EPREFIX}/usr/share/unicode-data")
147+
popd >/dev/null 2>&1 || die
148+
fi
149+
150+
local myconf=(
151+
$(use_enable X xim)
152+
$(use_enable appindicator)
153+
$(use_enable emoji emoji-dict)
154+
$(use_with emoji unicode-emoji-dir "${unicodedir}"/emoji)
155+
$(use_with emoji emoji-annotation-dir "${unicodedir}"/cldr/common/annotations)
156+
$(use_enable gtk2)
157+
$(use_enable gtk3)
158+
$(use_enable gtk4)
159+
$(use_enable gui ui)
160+
$(use_enable introspection)
161+
$(use_enable libnotify)
162+
$(use_enable nls)
163+
$(use_enable systemd systemd-services)
164+
$(use_enable test tests)
165+
$(use_enable unicode unicode-dict)
166+
$(use_with unicode ucd-dir "${EPREFIX}/usr/share/unicode-data")
167+
$(use_enable vala)
168+
$(use_enable wayland)
169+
"${python_conf[@]}"
170+
)
171+
econf "${myconf[@]}"
172+
}
173+
174+
src_compile() {
175+
if tc-is-cross-compiler && { use emoji || use unicode; }; then
176+
emake -C "${S}-build/src" \
177+
$(usex emoji emoji-parser '') \
178+
$(usex unicode unicode-parser '')
179+
emake -C src \
180+
$(usex emoji emoji-parser '') \
181+
$(usex unicode unicode-parser '')
182+
cp \
183+
$(usex emoji "${S}-build/src/emoji-parser" '') \
184+
$(usex unicode "${S}-build/src/unicode-parser" '') \
185+
src || die
186+
fi
187+
emake
188+
}
189+
190+
src_test() {
191+
unset DBUS_SESSION_BUS_ADDRESS
192+
virtx emake -j1 check
193+
}
194+
195+
src_install() {
196+
default
197+
# Remove la files
198+
find "${ED}" -name '*.la' -delete || die
199+
200+
# Remove stray python files generated by the build system
201+
find "${ED}" -name '*.pyc' -exec rm -f {} \; || die
202+
find "${ED}" -name '*.pyo' -exec rm -f {} \; || die
203+
204+
if use python; then
205+
python_install() {
206+
emake -C bindings/pygobject \
207+
pyoverridesdir="$(${EPYTHON} -c 'import gi; print(gi._overridesdir)')" \
208+
DESTDIR="${D}" \
209+
install
210+
211+
python_optimize
212+
}
213+
python_foreach_impl python_install
214+
fi
215+
216+
keepdir /usr/share/ibus/engine
217+
218+
newbashcomp tools/${PN}.bash ${PN}
219+
220+
insinto /etc/X11/xinit/xinput.d
221+
newins xinput-${PN} ${PN}.conf
222+
223+
# Undo compression of man page
224+
find "${ED}"/usr/share/man -type f -name '*.gz' -exec gzip -d {} \; || die
225+
}
226+
227+
pkg_postinst() {
228+
use gtk2 && gnome2_query_immodules_gtk2
229+
use gtk3 && gnome2_query_immodules_gtk3
230+
xdg_icon_cache_update
231+
gnome2_schemas_update
232+
dconf update
233+
}
234+
235+
pkg_postrm() {
236+
use gtk2 && gnome2_query_immodules_gtk2
237+
use gtk3 && gnome2_query_immodules_gtk3
238+
xdg_icon_cache_update
239+
gnome2_schemas_update
240+
}

0 commit comments

Comments
 (0)