LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 812|回复: 4

ibus-9999 ebuild for gnome-shell

[复制链接]
发表于 2011-4-10 13:12:35 | 显示全部楼层 |阅读模式
由于 gnome shell 的底栏是隐藏的,不适合放置 ibus 的图标,因此便出现了一个可以将 ibus 图标放置于 gnome shell 顶栏的 patch,详见:http://desktopi18n.wordpress.com ... hell-for-gnome-3-0/

github 上有一个 ibus 的 fork 版本,打上了那个补丁,见 http://github.com/fujiwarat/ibus

我将  gentoo-china overlay 里的 ibus-9999.ebuild 修改了一下,现在可以装上那个打了补丁的 ibus,并开启了 gtk 3.0 的 im 支持。有需要的可以尝试一下,不过我只能保证这个 ebuild 可以在我的机器上工作
  1. # Copyright 1999-2010 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. # $Header: $
  4. EAPI="2"
  5. PYTHON_DEPEND="python? 2:2.7"
  6. inherit eutils gnome2-utils multilib python git autotools
  7. EGIT_REPO_URI="git://github.com/fujiwarat/${PN}.git"
  8. DESCRIPTION="Intelligent Input Bus for Linux / Unix OS"
  9. HOMEPAGE="http://code.google.com/p/ibus/"
  10. SRC_URI=""
  11. LICENSE="LGPL-2.1"
  12. SLOT="0"
  13. KEYWORDS=""
  14. IUSE="doc nls gtk +gconf +python vala"
  15. RDEPEND=">=dev-libs/glib-2.18
  16.         gconf? ( >=gnome-base/gconf-2.12.0 )
  17.         >=gnome-base/librsvg-2
  18.         app-text/iso-codes
  19.         dev-libs/dbus-glib
  20.         gtk? (
  21.                 x11-libs/libX11
  22.                 x11-libs/gtk+:2
  23.                 x11-libs/gtk+:3
  24.         )
  25.         python? (
  26.                 dev-python/notify-python
  27.                 >=dev-python/dbus-python-0.83
  28.         )
  29.         nls? ( virtual/libintl )
  30.         vala? ( dev-lang/vala )"
  31. DEPEND="${RDEPEND}
  32.         >=dev-lang/perl-5.8.1
  33.         dev-perl/XML-Parser
  34.         dev-util/pkgconfig
  35.         >=dev-util/gtk-doc-1.9
  36.         dev-vcs/cvs
  37.         >=dev-libs/gobject-introspection-0.6.8
  38.         nls? ( >=sys-devel/gettext-0.16.1 )"
  39. RDEPEND="${RDEPEND}
  40.         python? (
  41.                 dev-python/pygtk
  42.                 dev-python/pyxdg
  43.         )"
  44. RESTRICT="test"
  45. pkg_setup() {
  46.         python_set_active_version 2
  47. }
  48. src_prepare() {
  49.         echo "AM_GNU_GETTEXT_VERSION(0.16.1)" >> "${S}"/configure.ac
  50.         autopoint || die "autopoint failed"
  51.         intltoolize --copy --force || die "intltoolize failed"
  52.         gtkdocize --copy || die "gtkdocize failed"
  53.         eautoreconf
  54. }
  55. src_configure() {
  56.         econf \
  57.                 $(use_enable doc gtk-doc) \
  58.                 $(use_enable nls) \
  59.                 $(use_enable gconf) \
  60.                 $(use_enable gtk gtk2) \
  61.                 $(use_enable gtk gtk3) \
  62.                 $(use_enable gtk xim) \
  63.                 $(use_enable nls) \
  64.                 $(use_enable python) \
  65.                 $(use_enable vala) || die
  66. }
  67. src_install() {
  68.         emake DESTDIR="${D}" install || die
  69.         # bug 289547
  70.         keepdir /usr/share/ibus/{engine,icons}
  71.         dodoc AUTHORS NEWS README
  72.         rmdir "${S}"/usr/share/ibus/engine
  73. }
  74. update_gtk_immodules() {
  75.         if [ -x /usr/bin/gtk-query-immodules-2.0 ] ; then
  76.                 GTK2_CONFDIR="/etc/gtk-2.0"
  77.                 # An arch specific config directory is used on multilib systems
  78.                 has_multilib_profile && GTK2_CONFDIR="${GTK2_CONFDIR}/${CHOST}"
  79.                 mkdir -p "${ROOT}${GTK2_CONFDIR}"
  80.                 gtk-query-immodules-2.0 > "${ROOT}${GTK2_CONFDIR}/gtk.immodules"
  81.         fi
  82.         if [ -x /usr/bin/gtk-query-immodules-3.0 ] ; then
  83.                 GTK3_CONFDIR="/etc/gtk-3.0"
  84.                 # An arch specific config directory is used on multilib systems
  85.                 has_multilib_profile && GTK3_CONFDIR="${GTK3_CONFDIR}/${CHOST}"
  86.                 mkdir -p "${ROOT}${GTK3_CONFDIR}"
  87.                 gtk-query-immodules-3.0 > "${ROOT}${GTK3_CONFDIR}/gtk.immodules"
  88.         fi
  89. }
  90. pkg_postinst() {
  91.         ewarn "This package is very experimental, please report your bugs to"
  92.         ewarn "http://ibus.googlecode.com/issues/list"
  93.         elog "1. Setup ibus:"
  94.         elog
  95.         elog "   $ ibus-setup"
  96.         elog
  97.         elog "2. Set the following in your user startup scripts"
  98.         elog "   such as .xinitrc, .xsession or .xprofile:"
  99.         elog
  100.         elog "   export XMODIFIERS="@im=ibus""
  101.         elog "   export GTK_IM_MODULE="ibus""
  102.         elog "   export QT_IM_MODULE="xim""
  103.         elog "3. ibus-daemon -d -x"
  104.         use gtk && update_gtk_immodules
  105.         use python && python_mod_optimize /usr/share/${PN} "$(python_get_sitedir)"/${PN}
  106.         gnome2_icon_cache_update
  107. }
  108. pkg_postrm() {
  109.         use gtk && update_gtk_immodules
  110.         use python && python_mod_cleanup /usr/share/${PN} "$(python_get_sitedir)"/${PN}
  111.         gnome2_icon_cache_update
  112. }
复制代码

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x
发表于 2011-4-10 14:55:36 | 显示全部楼层
update gtk modules 不太对,我也写了一个。

http://pastebin.com/vgdRj7xb

添加gentoo-china overlay后,最简单不用自制 ebuild 的方法是用 portage 的 ECONF_EXTRA 变量,再手动更新 gtk3 的im模块信息,参考:

# layman -a gentoo-china
# autounmask  app-i18n/ibus-9999
# ECONF_EXTRA="--enable-gtk3" emerge -av1 ibus
# gtk-query-immodules-3.0  --update-cache
回复 支持 反对

使用道具 举报

 楼主| 发表于 2011-4-10 15:12:31 | 显示全部楼层
嗯,换成了你那个,tks。
回复 支持 反对

使用道具 举报

发表于 2011-4-10 15:19:49 | 显示全部楼层
Post by LiYanrui;2134383
嗯,换成了你那个,tks。


奇怪的是我直接用官方源编译(看pastebin的ebuild),没打什么补丁,而图标也在右上方。。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2011-4-10 15:41:01 | 显示全部楼层
昨天用 ibus 官方 git 仓库代码编译还没有。今天上午试了那个 fork 版本才出现。可能现在 ibus git 仓库已经合并了 gjs 代码。
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表