ibus-1.5.14.ebuild 4.5 KB

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