app-i18n/fcitx-gtk: add 5.0.20, drop 5.0.18
[gentoo-zh.git] / app-i18n / fcitx-gtk / fcitx-gtk-5.0.20.ebuild
blob69c684181063d5530bf5941a84b360f945946569
1 # Copyright 1999-2022 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
4 EAPI=8
6 inherit cmake gnome2-utils xdg
8 if [[ "${PV}" == 9999 ]]; then
9 inherit git-r3
10 EGIT_REPO_URI="https://github.com/fcitx/fcitx5-gtk.git"
11 else
12 MY_PN="fcitx5-gtk"
13 S="${WORKDIR}/${MY_PN}-${PV}"
14 SRC_URI="https://github.com/fcitx/fcitx5-gtk/archive/refs/tags/${PV}.tar.gz -> ${P}.tar.gz"
15 KEYWORDS="~amd64 ~loong ~x86"
18 DESCRIPTION="Gtk im module for fcitx5 and glib based dbus client library"
19 HOMEPAGE="https://github.com/fcitx/fcitx5-gtk"
21 LICENSE="BSD-1 GPL-2+ LGPL-2+ MIT"
22 SLOT="5"
23 IUSE="gtk2 +gtk3 +gtk4 +introspection +snooper onlyplugin wayland"
24 REQUIRED_USE="|| ( gtk2 gtk3 gtk4 )"
26 RDEPEND="app-i18n/fcitx:5
27 gtk2? ( x11-libs/gtk+:2 )
28 gtk3? ( x11-libs/gtk+:3[wayland?] )
29 gtk4? ( gui-libs/gtk:4[wayland?] )
30 introspection? ( dev-libs/gobject-introspection )
31 kde-frameworks/extra-cmake-modules
32 dev-libs/glib:2
33 x11-libs/gdk-pixbuf:2
34 x11-libs/libX11
35 x11-libs/libxkbcommon
37 DEPEND="${RDEPEND}
38 virtual/pkgconfig"
40 src_prepare() {
41 cmake_src_prepare
44 src_configure() {
45 local mycmakeargs=(
46 -DCMAKE_INSTALL_LIBDIR="${EPREFIX}/usr/$(get_libdir)"
47 -DCMAKE_INSTALL_SYSCONFDIR="${EPREFIX}/etc"
48 -DCMAKE_BUILD_TYPE=Release
49 -DENABLE_GTK2_IM_MODULE=$(usex gtk2)
50 -DENABLE_GTK3_IM_MODULE=$(usex gtk3)
51 -DENABLE_GTK4_IM_MODULE=$(usex gtk4)
52 -DENABLE_SNOOPER=$(usex snooper)
53 -DENABLE_GIR=$(usex introspection)
54 -DBUILD_ONLY_PLUGIN=$(usex onlyplugin)
56 cmake_src_configure
59 pkg_postinst() {
60 xdg_pkg_postinst
61 use gtk2 && gnome2_query_immodules_gtk2
62 use gtk3 && gnome2_query_immodules_gtk3
65 pkg_postrm() {
66 xdg_pkg_postrm
67 use gtk2 && gnome2_query_immodules_gtk2
68 use gtk3 && gnome2_query_immodules_gtk3