ibus-1.5.5.ebuild 4.2 KB

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