From 3fd87cbee192a2204e7824716ef8a10647f4117cdbd49893134b772cd8d6bfe6 Mon Sep 17 00:00:00 2001 From: Fuminobu Takeyama Date: Fri, 4 Mar 2016 15:49:11 +0000 Subject: [PATCH] Accepting request 365739 from home:qzhao:branches:M17N porting SLE ibus patch to M17N project. OBS-URL: https://build.opensuse.org/request/show/365739 OBS-URL: https://build.opensuse.org/package/show/M17N/ibus?expand=0&rev=148 --- hide-setup-menu.patch | 11 +++++++ ibus-adapt-new-vala.patch | 12 +++++++ ibus.changes | 35 +++++++++++++++++++- ibus.spec | 19 +++++++++++ setup-switch-im.patch | 67 +++++++++++++++++++++++++++++++++++++++ 5 files changed, 143 insertions(+), 1 deletion(-) create mode 100644 hide-setup-menu.patch create mode 100644 ibus-adapt-new-vala.patch create mode 100644 setup-switch-im.patch diff --git a/hide-setup-menu.patch b/hide-setup-menu.patch new file mode 100644 index 0000000..6a93fb9 --- /dev/null +++ b/hide-setup-menu.patch @@ -0,0 +1,11 @@ +diff -Nura ibus-1.5.8_old/setup/ibus-setup.desktop.in ibus-1.5.8_new/setup/ibus-setup.desktop.in +--- ibus-1.5.8_old/setup/ibus-setup.desktop.in 2014-07-24 12:24:25.000000000 +0800 ++++ ibus-1.5.8_new/setup/ibus-setup.desktop.in 2015-10-15 19:12:16.476328652 +0800 +@@ -4,6 +4,7 @@ + Exec=ibus-setup + Icon=ibus-setup + Terminal=false ++NoDisplay=true + Type=Application + StartupNotify=true + Categories=Settings; diff --git a/ibus-adapt-new-vala.patch b/ibus-adapt-new-vala.patch new file mode 100644 index 0000000..6ffffe5 --- /dev/null +++ b/ibus-adapt-new-vala.patch @@ -0,0 +1,12 @@ +diff -Nura ibus-1.5.11/ui/gtk3/indicator.vala ibus-1.5.11_new/ui/gtk3/indicator.vala +--- ibus-1.5.11/ui/gtk3/indicator.vala 2015-07-16 07:08:03.000000000 +0000 ++++ ibus-1.5.11_new/ui/gtk3/indicator.vala 2016-03-02 10:29:19.360124574 +0000 +@@ -304,7 +304,7 @@ + method_name); + } + +- public override GLib.Variant? service_get_property(GLib.DBusConnection ++ public override GLib.Variant service_get_property(GLib.DBusConnection + connection, + string sender, + string object_path, diff --git a/ibus.changes b/ibus.changes index 90f9ec9..28f16c9 100644 --- a/ibus.changes +++ b/ibus.changes @@ -1,5 +1,38 @@ +-------------------------------------------------------------------- +Mon Feb 28 17:59:28 CET 2016 - qzhao@suse.com + +- Add ibus-adapt-new-vala.patch: Fix ibus compile error under + new vala compiler, for SLE Desktop 12 SP2. This patch is only + for SLED. + +-------------------------------------------------------------------- +Mon Feb 28 15:57:01 CET 2016 - qzhao@suse.com + +- Add conflict to fcitx to fulfill FATE#319095 + deprecate fcitx chinese input method in favor of ibus + (dummy bsc#933411). This modification is only for SLED. + ------------------------------------------------------------------- -Wed Feb 24 19:01:08 CET 2016 - tiwai@suse.de +Mon Feb 28 14:57:01 CET 2016 - sbrabec@suse.com + +- Add support for translation-update-upstream (dummy bsc#933411). + +------------------------------------------------------------------- +Mon Feb 28 12:20:10 CET 2016 - qzhao@suse.com + +- Add setup-switch-im.patch. Switch to ibus when ibus not + running.(bnc#899259). This patch is only for SLED. + +------------------------------------------------------------------- +Mon Feb 28 10:30:20 CET 2016 - qzhao@suse.com + +- Add hide-setup-menu.patch + Make ibus-setup launch from indicator field.(bnc#899259) + Remove ibus-setup.desktop from main menu. This patch is only + for SLED. + +------------------------------------------------------------------- +Wed Feb 24 11:01:08 CET 2016 - tiwai@suse.de - Fix the invocation of ibus service for KDE, etc (boo#968486): for DEs known to support autostart (KDE, XFCE and LXCE), ibus is diff --git a/ibus.spec b/ibus.spec index 1bf4e90..765bce1 100644 --- a/ibus.spec +++ b/ibus.spec @@ -69,6 +69,15 @@ Patch7: ibus-python3-migration.patch Patch8: im-engines-precede-xkb.patch # PATCH-FIX-UPSTREAM ftake@geeko.jp Patch9: ibus-fix-check-abs-icon-path-support.patch +# PATCH-FIX-SLE hide-setup-menu.patch bnc#899259 qzhao@suse.com +# ibus-setup should not launch from main menu. +Patch10: hide-setup-menu.patch +# PATCH-FIX-SLE setup-switch-im.patch bnc#899259 qzhao@suse.com +# switch to ibus when ibus not running. +Patch11: setup-switch-im.patch +# PATCH-FEATURE-SLE ibus-adapt-new-vala.patch qzhao@suse.com +# fix ibus compile error under new vala, for SLE Desktop 12 SP2. +Patch12: ibus-adapt-new-vala.patch BuildRequires: dbus-1-glib-devel BuildRequires: dbus-1-python-devel >= 0.83.0 BuildRequires: dconf-devel >= 0.7.5 @@ -118,6 +127,10 @@ Requires: libibus-1_0-5 = %{version} # versions to 3.0 only. Requires: typelib-1_0-Gtk-3_0 Recommends: %{name}-lang +# PATCH-FEATURE-SLE Add conflict with fcitx FATE #319095 qzhao@suse.com -- Solve the problem for the people update from SP0 to SP1 +%if !0%{?is_opensuse} +Conflicts: fcitx +%endif #Fix cursor following problem in KDE4 for libreoffice. %if 0%{?suse_version} != 1315 @@ -247,6 +260,12 @@ sed -i \ %patch8 -p1 %patch9 -p1 +%if !0%{?is_opensuse} +%patch10 -p1 +%patch11 -p1 +%patch12 -p1 +%endif + cp -r %{SOURCE2} . cp -r %{SOURCE3} . diff --git a/setup-switch-im.patch b/setup-switch-im.patch new file mode 100644 index 0000000..e089925 --- /dev/null +++ b/setup-switch-im.patch @@ -0,0 +1,67 @@ +diff -Nura ibus-1.5.8/setup/main.py ibus-1.5.8_new/setup/main.py +--- ibus-1.5.8/setup/main.py 2014-07-24 04:24:25.000000000 +0000 ++++ ibus-1.5.8_new/setup/main.py 2015-10-27 10:41:56.648379582 +0000 +@@ -361,11 +361,16 @@ + self.__engine_setup_exec_list[name] = os.spawnl(os.P_NOWAIT, *args) + + def __init_bus(self): ++ method_name="ibus" ++ filename=".i18n" ++ usr_home =os.path.expanduser('~') ++ + self.__bus = IBus.Bus() + if self.__bus.is_connected(): + return + +- message = _("The IBus daemon is not running. Do you wish to start it?") ++ message = _("Could not connect to IBus daemon.\n" ++ "Do you wish to switch to IBus on next login?") + dlg = Gtk.MessageDialog(message_type = Gtk.MessageType.QUESTION, + buttons = Gtk.ButtonsType.YES_NO, + text = message) +@@ -375,39 +380,12 @@ + if id != Gtk.ResponseType.YES: + sys.exit(0) + +- main_loop = GLib.MainLoop() +- +- timeout = 5 +- GLib.timeout_add_seconds(timeout, lambda *args: main_loop.quit()) +- self.__bus.connect("connected", lambda *args: main_loop.quit()) +- +- os.spawnlp(os.P_NOWAIT, "ibus-daemon", "ibus-daemon", "--xim") +- +- main_loop.run() +- +- if self.__bus.is_connected(): +- message = _("IBus has been started! " +- "If you cannot use IBus, add the following lines to your $HOME/.bashrc; then relog into your desktop.\n" +- " export GTK_IM_MODULE=ibus\n" +- " export XMODIFIERS=@im=ibus\n" +- " export QT_IM_MODULE=ibus" +- ) +- dlg = Gtk.MessageDialog(message_type = Gtk.MessageType.INFO, +- buttons = Gtk.ButtonsType.OK, +- text = message) +- id = dlg.run() +- dlg.destroy() +- self.__flush_gtk_events() +- else: +- # Translators: %d == 5 currently +- message = _("IBus daemon could not be started in %d seconds") +- dlg = Gtk.MessageDialog(message_type = Gtk.MessageType.INFO, +- buttons = Gtk.ButtonsType.OK, +- text = message % timeout) +- id = dlg.run() +- dlg.destroy() +- self.__flush_gtk_events() +- sys.exit(0) ++ filename = os.path.join(usr_home, filename) ++ f=file(filename,"w+") ++ cmd = 'export INPUT_METHOD=\"' + method_name + '\"' ++ f.writelines(cmd) ++ f.close() ++ sys.exit(0) + + def __shortcut_button_clicked_cb(self, button, name, section, _name, entry): + buttons = (_("_Cancel"), Gtk.ResponseType.CANCEL,