x-unikey-1.0.4-r2.ebuild 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. # Copyright 1999-2015 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. inherit autotools eutils multilib gnome2-utils
  5. DESCRIPTION="Vietnamese X Input Method"
  6. HOMEPAGE="http://www.unikey.org/"
  7. SRC_URI="mirror://sourceforge/unikey/${P}.tar.bz2"
  8. LICENSE="GPL-2"
  9. SLOT="0"
  10. KEYWORDS="~amd64 ~ppc x86"
  11. IUSE="nls gtk"
  12. RDEPEND="x11-libs/libX11
  13. x11-libs/libSM
  14. x11-libs/libICE
  15. gtk? ( >=x11-libs/gtk+-2.2:2 )
  16. nls? ( virtual/libintl )"
  17. DEPEND="${RDEPEND}
  18. dev-libs/glib
  19. virtual/pkgconfig
  20. nls? ( sys-devel/gettext )"
  21. pkg_setup() {
  22. # An arch specific config directory is used on multilib systems
  23. has_multilib_profile && GTK2_CONFDIR="/etc/gtk-2.0/${CHOST}"
  24. GTK2_CONFDIR=${GTK2_CONFDIR:=/etc/gtk-2.0/}
  25. }
  26. src_prepare() {
  27. epatch "${FILESDIR}"/${P}-gcc43.patch \
  28. "${FILESDIR}"/${P}-gcc44.patch \
  29. "${FILESDIR}"/${P}-gentoo.patch
  30. eautoreconf
  31. }
  32. src_configure() {
  33. local myconf
  34. # --with-gtk-sysconfdir to prevent sandbox violation only
  35. use gtk && myconf="--with-unikey-gtk --with-gtk-sysconfdir=${GTK2_CONFDIR}"
  36. econf ${myconf}
  37. }
  38. src_install() {
  39. if use gtk;then
  40. dodir "${GTK2_CONFDIR}"
  41. # emake DESTDIR="${D}" install -C src/unikey-gtk || die
  42. fi
  43. # dobin src/xim/ukxim src/gui/unikey
  44. emake DESTDIR="${D}" install
  45. doenvd "${FILESDIR}/01x-unikey"
  46. dodoc AUTHORS CREDITS ChangeLog NEWS README TODO
  47. cd doc
  48. dodoc README1ST keymap-syntax manual options ukmacro \
  49. unikey-manual-0.9.pdf unikey.png unikeyrc
  50. }
  51. pkg_postinst() {
  52. elog
  53. elog "Go to /etc/env.d/01x-unikey and uncomment appropriate lines"
  54. elog "to enable x-unikey"
  55. elog
  56. if use gtk; then
  57. gnome2_query_immodules_gtk2
  58. elog "If you want to use x-unikey as the default gtk+ input method,"
  59. elog "change GTK_IM_MODULE in /etc/env.d/01x-unikey to \"unikey\""
  60. elog
  61. fi
  62. }
  63. pkg_postrm() {
  64. use gtk && gnome2_query_immodules_gtk2
  65. }