Use https by default
[gentoo.git] / app-i18n / ibus / ibus-1.5.10.ebuild
1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 EAPI=5
6
7 PYTHON_COMPAT=( python2_7 )
8 VALA_MIN_API_VERSION="0.20"
9 VALA_USE_DEPEND="vapigen"
10 # Vapigen is needed for the vala binding
11 # Valac is needed when building from git for the engine
12 UPSTREAM_VER=
13
14 inherit autotools bash-completion-r1 eutils gnome2-utils multilib python-single-r1 readme.gentoo vala virtualx
15
16 DESCRIPTION="Intelligent Input Bus for Linux / Unix OS"
17 HOMEPAGE="http://code.google.com/p/ibus/"
18
19 LICENSE="LGPL-2.1"
20 SLOT="0"
21 KEYWORDS="~alpha amd64 arm ~ia64 ppc ~ppc64 ~sparc x86 ~x86-fbsd"
22 IUSE="deprecated gconf gtk +gtk3 +introspection nls +python test vala wayland +X"
23 REQUIRED_USE="
24         || ( gtk gtk3 X )
25         deprecated? ( python )
26         vala? ( introspection )
27         python? (
28                 ${PYTHON_REQUIRED_USE}
29                 || ( deprecated ( gtk3 introspection ) ) )" #342903
30
31 [[ -n ${UPSTREAM_VER} ]] && \
32         UPSTRAM_PATCHSET_URI="https://dev.gentoo.org/~dlan/distfiles/${P}-upstream-patches-${UPSTREAM_VER}.tar.xz"
33
34 SRC_URI="https://github.com/ibus/ibus/releases/download/${PV}/${P}.tar.gz
35         ${UPSTRAM_PATCHSET_URI}"
36
37 COMMON_DEPEND="
38         >=dev-libs/glib-2.26:2
39         gnome-base/librsvg:2
40         sys-apps/dbus[X?]
41         app-text/iso-codes
42         >=gnome-base/dconf-0.13.4
43         x11-libs/libnotify
44         gconf? ( >=gnome-base/gconf-2.12:2 )
45         gtk? ( x11-libs/gtk+:2 )
46         gtk3? ( x11-libs/gtk+:3 )
47         python? ( ${PYTHON_DEPS} )
48         X? (
49                 x11-libs/libX11
50                 x11-libs/gtk+:2 )
51         introspection? ( >=dev-libs/gobject-introspection-0.6.8 )
52         nls? ( virtual/libintl )
53         wayland? ( dev-libs/wayland )"
54 RDEPEND="${COMMON_DEPEND}
55         x11-apps/setxkbmap
56         python? (
57                 dev-python/pyxdg
58                 deprecated? (
59                         >=dev-python/dbus-python-0.83
60                         dev-python/pygobject:2
61                         dev-python/pygtk:2 )
62                 gtk3? (
63                         dev-python/pygobject:3
64                         x11-libs/gdk-pixbuf:2[introspection]
65                         x11-libs/pango[introspection]
66                         x11-libs/gtk+:3[introspection] )
67         )"
68 DEPEND="${COMMON_DEPEND}
69         >=dev-lang/perl-5.8.1
70         dev-util/gtk-doc-am
71         dev-util/intltool
72         virtual/pkgconfig
73         nls? ( >=sys-devel/gettext-0.16.1 )
74         vala? ( $(vala_depend) )"
75
76 # stress test in bus/ fails
77 # IBUS-CRITICAL **: bus_test_client_init: assertion `ibus_bus_is_connected (_bus)' failed
78 RESTRICT="test"
79
80 DOCS="AUTHORS ChangeLog NEWS README"
81
82 DISABLE_AUTOFORMATTING="yes"
83 DOC_CONTENTS="To use ibus, you should:
84 1. Get input engines from sunrise overlay.
85 Run \"emerge -s ibus-\" in your favorite terminal
86 for a list of packages we already have.
87
88 2. Setup ibus:
89 $ ibus-setup
90
91 3. Set the following in your user startup scripts
92 such as .xinitrc, .xsession or .xprofile:
93
94 export XMODIFIERS=\"@im=ibus\"
95 export GTK_IM_MODULE=\"ibus\"
96 export QT_IM_MODULE=\"xim\"
97 ibus-daemon -d -x
98 "
99
100 pkg_setup() {
101         use python && python-single-r1_pkg_setup
102 }
103
104 src_prepare() {
105         # Upstream's patchset
106         if [[ -n ${UPSTREAM_VER} ]]; then
107                 EPATCH_SUFFIX="patch" \
108                 EPATCH_FORCE="yes" \
109                 EPATCH_OPTS="-p1" \
110                         epatch "${WORKDIR}"/patches-upstream
111         fi
112
113         # We run "dconf update" in pkg_postinst/postrm to avoid sandbox violations
114         sed -e 's/dconf update/:/' \
115                 -i data/dconf/Makefile.{am,in} || die
116         use vala && vala_src_prepare
117
118         eautoreconf
119 }
120
121 src_configure() {
122         local python_conf
123         if use python; then
124                 python_conf="PYTHON=${PYTHON}
125                         $(use_enable deprecated python-library)
126                         $(use_enable gtk3 setup)"
127         else
128                 python_conf="--disable-python-library --disable-setup"
129         fi
130         econf \
131                 --enable-dconf \
132                 $(use_enable introspection) \
133                 $(use_enable gconf) \
134                 $(use_enable gtk gtk2) \
135                 $(use_enable gtk xim) \
136                 $(use_enable gtk3) \
137                 $(use_enable gtk3 ui) \
138                 $(use_enable nls) \
139                 $(use_enable test tests) \
140                 $(use_enable X xim) \
141                 $(use_enable vala) \
142                 $(use_enable wayland) \
143                 ${python_conf}
144 }
145
146 src_test() {
147         unset DBUS_SESSION_BUS_ADDRESS
148         Xemake check || die
149 }
150
151 src_install() {
152         default
153
154         prune_libtool_files --all
155
156         mv "${ED}"/usr/share/bash-completion/completions/ibus.bash "${T}"
157         rm -rf "${ED}"/usr/share/bash-completion || die
158         newbashcomp "${T}"/ibus.bash ${PN}
159         insinto /etc/X11/xinit/xinput.d
160         newins xinput-ibus ibus.conf
161
162         keepdir /usr/share/ibus/{engine,icons} #289547
163
164         use deprecated && python_optimize
165         use python && use gtk3 && python_optimize
166
167         readme.gentoo_create_doc
168 }
169
170 pkg_preinst() {
171         use gconf && gnome2_gconf_savelist
172         gnome2_schemas_savelist
173         gnome2_icon_savelist
174 }
175
176 pkg_postinst() {
177         use gconf && gnome2_gconf_install
178         use gtk && gnome2_query_immodules_gtk2
179         use gtk3 && gnome2_query_immodules_gtk3
180         gnome2_schemas_update
181         gnome2_icon_cache_update
182         readme.gentoo_print_elog
183 }
184
185 pkg_postrm() {
186         use gtk && gnome2_query_immodules_gtk2
187         use gtk3 && gnome2_query_immodules_gtk3
188         use gconf && gnome2_schemas_update
189         gnome2_schemas_savelist
190         gnome2_icon_cache_update
191 }