From 57aab5b85e77118a3c48b362b9e3918eaa611870 Mon Sep 17 00:00:00 2001 From: Daiki Ueno Date: Thu, 7 Jul 2011 14:37:21 +0900 Subject: [PATCH] Update to 1.3.2-6; migrate to quilt. --- ibus-m17n-HEAD.patch | 52 +++-- ibus-m17n-iok.patch | 35 +-- ibus-m17n-stscap.patch | 38 ---- ibus-m17n-stsreq.patch | 33 --- ibus-m17n-xkb-options.patch | 386 +++++++++++++++++++++++++++++++++ ibus-m17n-xx-icon-symbol.patch | 130 +++++++++++ ibus-m17n.spec | 49 +++-- series | 4 + 8 files changed, 603 insertions(+), 124 deletions(-) delete mode 100644 ibus-m17n-stscap.patch delete mode 100644 ibus-m17n-stsreq.patch create mode 100644 ibus-m17n-xkb-options.patch create mode 100644 ibus-m17n-xx-icon-symbol.patch create mode 100644 series diff --git a/ibus-m17n-HEAD.patch b/ibus-m17n-HEAD.patch index 9b98dea..9c3f6bd 100644 --- a/ibus-m17n-HEAD.patch +++ b/ibus-m17n-HEAD.patch @@ -1,7 +1,8 @@ -diff --git a/Makefile.am b/Makefile.am -index eac3b9d..14a674d 100644 ---- a/Makefile.am -+++ b/Makefile.am +Patch to synch with the git master 65cc1bc1. +Index: ibus-m17n-1.3.2/Makefile.am +=================================================================== +--- ibus-m17n-1.3.2.orig/Makefile.am ++++ ibus-m17n-1.3.2/Makefile.am @@ -69,7 +69,7 @@ debian/changelog: version=@VERSION@; \ serie=$(serie); \ @@ -11,10 +12,10 @@ index eac3b9d..14a674d 100644 fi; \ if test -z "$$release"; then \ release=1; \ -diff --git a/configure.ac b/configure.ac -index 17077f2..4df68b6 100644 ---- a/configure.ac -+++ b/configure.ac +Index: ibus-m17n-1.3.2/configure.ac +=================================================================== +--- ibus-m17n-1.3.2.orig/configure.ac ++++ ibus-m17n-1.3.2/configure.ac @@ -89,7 +89,22 @@ fi AM_CONDITIONAL([HAVE_GTK],[test x$with_gtk != xno]) @@ -38,10 +39,10 @@ index 17077f2..4df68b6 100644 # define GETTEXT_* variables GETTEXT_PACKAGE=ibus-m17n -diff --git a/src/engine.c b/src/engine.c -index 62359c1..60816b0 100644 ---- a/src/engine.c -+++ b/src/engine.c +Index: ibus-m17n-1.3.2/src/engine.c +=================================================================== +--- ibus-m17n-1.3.2.orig/src/engine.c ++++ ibus-m17n-1.3.2/src/engine.c @@ -1,4 +1,7 @@ /* vim:set et sts=4: */ +#ifdef HAVE_CONFIG_H @@ -85,7 +86,7 @@ index 62359c1..60816b0 100644 static void ibus_m17n_config_value_changed (IBusConfig *config, const gchar *section, const gchar *name, -@@ -119,7 +102,6 @@ static void ibus_m17n_engine_update_lookup_table +@@ -119,7 +102,6 @@ static void ibus_m17n_engine_update_look static IBusEngineClass *parent_class = NULL; static IBusConfig *config = NULL; @@ -149,7 +150,7 @@ index 62359c1..60816b0 100644 } static gboolean -@@ -239,14 +172,14 @@ ibus_m17n_engine_get_type_for_name (const gchar *engine_name) +@@ -239,14 +172,14 @@ ibus_m17n_engine_get_type_for_name (cons GTypeInfo type_info = { sizeof (IBusM17NEngineClass), @@ -169,7 +170,7 @@ index 62359c1..60816b0 100644 }; if (!ibus_m17n_scan_engine_name (engine_name, &lang, &name)) { -@@ -264,11 +197,10 @@ ibus_m17n_engine_get_type_for_name (const gchar *engine_name) +@@ -264,11 +197,10 @@ ibus_m17n_engine_get_type_for_name (cons g_assert (type == 0 || g_type_is_a (type, IBUS_TYPE_ENGINE)); if (type == 0) { @@ -185,7 +186,7 @@ index 62359c1..60816b0 100644 } g_free (type_name); -@@ -408,14 +340,6 @@ ibus_m17n_config_value_changed (IBusConfig *config, +@@ -408,14 +340,6 @@ ibus_m17n_config_value_changed (IBusConf } static void @@ -200,7 +201,24 @@ index 62359c1..60816b0 100644 ibus_m17n_engine_init (IBusM17NEngine *m17n) { IBusText* label; -@@ -986,8 +910,57 @@ ibus_m17n_engine_callback (MInputContext *context, +@@ -773,6 +697,16 @@ ibus_m17n_engine_enable (IBusEngine *eng + IBusM17NEngine *m17n = (IBusM17NEngine *) engine; + + parent_class->enable (engine); ++ ++#ifdef HAVE_IBUS_ENGINE_GET_SURROUNDING_TEXT ++ /* Issue a dummy ibus_engine_get_surrounding_text() call to tell ++ input context that we will use surrounding-text. */ ++ IBusText *text; ++ guint cursor_pos; ++ ++ ibus_engine_get_surrounding_text (engine, &text, &cursor_pos); ++ g_object_unref (text); ++#endif /* HAVE_IBUS_ENGINE_GET_SURROUNDING_TEXT */ + } + + static void +@@ -986,8 +920,57 @@ ibus_m17n_engine_callback (MInputContext } else if (command == Minput_reset) { } diff --git a/ibus-m17n-iok.patch b/ibus-m17n-iok.patch index df6ef43..e73124f 100644 --- a/ibus-m17n-iok.patch +++ b/ibus-m17n-iok.patch @@ -1,17 +1,9 @@ -From c27a0917c26624f1741efeebe20cd5cfb8647a67 Mon Sep 17 00:00:00 2001 -From: Daiki Ueno -Date: Mon, 7 Mar 2011 14:57:32 +0900 -Subject: [PATCH] Apply iok patch from Fedora. - ---- - src/engine.c | 46 ++++++++++++++++++++++++++++++++++++++++++++++ - 1 files changed, 46 insertions(+), 0 deletions(-) - -diff --git a/src/engine.c b/src/engine.c -index 62359c1..362d347 100644 ---- a/src/engine.c -+++ b/src/engine.c -@@ -37,6 +37,7 @@ struct _IBusM17NEngine { +Patch to support iok (Indic Onscreen Keyboard). +Index: ibus-m17n-1.3.2/src/engine.c +=================================================================== +--- ibus-m17n-1.3.2.orig/src/engine.c ++++ ibus-m17n-1.3.2/src/engine.c +@@ -23,6 +23,7 @@ struct _IBusM17NEngine { IBusProperty *setup_prop; #endif /* HAVE_SETUP */ IBusPropList *prop_list; @@ -19,7 +11,7 @@ index 62359c1..362d347 100644 }; struct _IBusM17NEngineClass { -@@ -48,6 +49,7 @@ struct _IBusM17NEngineClass { +@@ -34,6 +35,7 @@ struct _IBusM17NEngineClass { guint preedit_background; gint preedit_underline; gint lookup_table_orientation; @@ -27,7 +19,7 @@ index 62359c1..362d347 100644 MInputMethod *im; }; -@@ -316,6 +318,9 @@ ibus_m17n_engine_class_init (IBusM17NEngineClass *klass) +@@ -248,6 +250,9 @@ ibus_m17n_engine_class_init (IBusM17NEng } engine_name = g_strdup_printf ("m17n:%s:%s", lang, name); klass->config_section = g_strdup_printf ("engine/M17N/%s/%s", lang, name); @@ -37,7 +29,7 @@ index 62359c1..362d347 100644 g_free (lang); g_free (name); -@@ -420,6 +425,7 @@ ibus_m17n_engine_init (IBusM17NEngine *m17n) +@@ -344,6 +349,7 @@ ibus_m17n_engine_init (IBusM17NEngine *m { IBusText* label; IBusText* tooltip; @@ -45,7 +37,7 @@ index 62359c1..362d347 100644 m17n->prop_list = ibus_prop_list_new (); g_object_ref_sink (m17n->prop_list); -@@ -452,6 +458,23 @@ ibus_m17n_engine_init (IBusM17NEngine *m17n) +@@ -376,6 +382,23 @@ ibus_m17n_engine_init (IBusM17NEngine *m ibus_prop_list_append (m17n->prop_list, m17n->setup_prop); #endif /* HAVE_SETUP */ @@ -69,7 +61,7 @@ index 62359c1..362d347 100644 m17n->table = ibus_lookup_table_new (9, 0, TRUE, TRUE); g_object_ref_sink (m17n->table); m17n->context = NULL; -@@ -537,6 +560,11 @@ ibus_m17n_engine_destroy (IBusM17NEngine *m17n) +@@ -461,6 +484,11 @@ ibus_m17n_engine_destroy (IBusM17NEngine } #endif /* HAVE_SETUP */ @@ -81,7 +73,7 @@ index 62359c1..362d347 100644 if (m17n->table) { g_object_unref (m17n->table); m17n->table = NULL; -@@ -844,6 +872,24 @@ ibus_m17n_engine_property_activate (IBusEngine *engine, +@@ -778,6 +806,24 @@ ibus_m17n_engine_property_activate (IBus } #endif /* HAVE_SETUP */ @@ -106,6 +98,3 @@ index 62359c1..362d347 100644 parent_class->property_activate (engine, prop_name, prop_state); } --- -1.7.4 - diff --git a/ibus-m17n-stscap.patch b/ibus-m17n-stscap.patch deleted file mode 100644 index 2109c3e..0000000 --- a/ibus-m17n-stscap.patch +++ /dev/null @@ -1,38 +0,0 @@ -From f85e79001e7669e3b1b45b1c6ad14dedc5e0752f Mon Sep 17 00:00:00 2001 -From: Daiki Ueno -Date: Tue, 7 Jun 2011 12:54:53 +0900 -Subject: [PATCH] Request IBUS_CAP_SURROUNDING_TEXT. - ---- - src/m17nutil.c | 8 ++++++++ - 1 files changed, 8 insertions(+), 0 deletions(-) - -diff --git a/src/m17nutil.c b/src/m17nutil.c -index 1150cc4..db99686 100644 ---- a/src/m17nutil.c -+++ b/src/m17nutil.c -@@ -91,6 +91,13 @@ ibus_m17n_parse_color (const gchar *hex) - return color; - } - -+#define DEFAULT_REQUIRES (IBUS_CAP_PREEDIT_TEXT | \ -+ IBUS_CAP_AUXILIARY_TEXT | \ -+ IBUS_CAP_LOOKUP_TABLE | \ -+ IBUS_CAP_FOCUS | \ -+ IBUS_CAP_PROPERTY | \ -+ IBUS_CAP_SURROUNDING_TEXT) -+ - static IBusEngineDesc * - ibus_m17n_engine_new (MSymbol lang, - MSymbol name, -@@ -122,6 +129,7 @@ ibus_m17n_engine_new (MSymbol lang, - "icon", engine_icon ? engine_icon : "", - "layout", "us", - "rank", config->rank, -+ "requires", DEFAULT_REQUIRES, - NULL); - #else - engine = ibus_engine_desc_new (engine_name, --- -1.7.5.2 - diff --git a/ibus-m17n-stsreq.patch b/ibus-m17n-stsreq.patch deleted file mode 100644 index 6c2f6f8..0000000 --- a/ibus-m17n-stsreq.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 02e72cdd3673c65d4217ea19fab7aa2fdfd449f6 Mon Sep 17 00:00:00 2001 -From: Daiki Ueno -Date: Tue, 14 Jun 2011 16:10:23 +0900 -Subject: [PATCH] Proclaim we will use surrounding-text, in enable(). - ---- - src/engine.c | 10 ++++++++++ - 1 files changed, 10 insertions(+), 0 deletions(-) - -diff --git a/src/engine.c b/src/engine.c -index 60816b0..b68b13e 100644 ---- a/src/engine.c -+++ b/src/engine.c -@@ -697,6 +697,16 @@ ibus_m17n_engine_enable (IBusEngine *engine) - IBusM17NEngine *m17n = (IBusM17NEngine *) engine; - - parent_class->enable (engine); -+ -+#ifdef HAVE_IBUS_ENGINE_GET_SURROUNDING_TEXT -+ /* Issue a dummy ibus_engine_get_surrounding_text() call to tell -+ input context that we will use surrounding-text. */ -+ IBusText *text; -+ guint cursor_pos; -+ -+ ibus_engine_get_surrounding_text (engine, &text, &cursor_pos); -+ g_object_unref (text); -+#endif /* HAVE_IBUS_ENGINE_GET_SURROUNDING_TEXT */ - } - - static void --- -1.7.5.2 - diff --git a/ibus-m17n-xkb-options.patch b/ibus-m17n-xkb-options.patch new file mode 100644 index 0000000..551f1c8 --- /dev/null +++ b/ibus-m17n-xkb-options.patch @@ -0,0 +1,386 @@ +Patch to set certain XKB options when an m17n IME is set. +Index: ibus-m17n-1.3.2/configure.ac +=================================================================== +--- ibus-m17n-1.3.2.orig/configure.ac ++++ ibus-m17n-1.3.2/configure.ac +@@ -106,6 +106,14 @@ AC_CHECK_FUNCS([ibus_engine_get_surround + CFLAGS="$save_CFLAGS" + LIBS="$save_LIBS" + ++# check libxklavier ++have_libxklavier=no ++PKG_CHECK_MODULES([LIBXKLAVIER], [libxklavier gdk-3.0 x11], ++ have_libxklavier=yes) ++if test x$have_libxklavier != xno; then ++ AC_DEFINE([HAVE_LIBXKLAVIER], [1], [Define if libxklavier is found]) ++fi ++ + # define GETTEXT_* variables + GETTEXT_PACKAGE=ibus-m17n + AC_SUBST(GETTEXT_PACKAGE) +Index: ibus-m17n-1.3.2/src/Makefile.am +=================================================================== +--- ibus-m17n-1.3.2.orig/src/Makefile.am ++++ ibus-m17n-1.3.2/src/Makefile.am +@@ -66,10 +66,15 @@ ibus_engine_m17n_SOURCES = \ + engine.c \ + engine.h \ + $(NULL) ++ibus_engine_m17n_CFLAGS = \ ++ @LIBXKLAVIER_CFLAGS@ \ ++ $(AM_CFLAGS) \ ++ $(NULL) + ibus_engine_m17n_LDADD = \ + libm17ncommon.a \ + @IBUS_LIBS@ \ + @M17N_LIBS@ \ ++ @LIBXKLAVIER_LIBS@ \ + $(NULL) + + if HAVE_GTK +Index: ibus-m17n-1.3.2/src/default.xml.in.in +=================================================================== +--- ibus-m17n-1.3.2.orig/src/default.xml.in.in ++++ ibus-m17n-1.3.2/src/default.xml.in.in +@@ -12,19 +12,22 @@ + FALSE + + +- m17n:bn:inscript ++ m17n:bn:inscript* + 2 + FALSE ++ lv3:ralt_switch + + +- m17n:gu:inscript ++ m17n:gu:inscript* + 2 + FALSE ++ lv3:ralt_switch + + +- m17n:hi:inscript ++ m17n:hi:inscript* + 2 + FALSE ++ lv3:ralt_switch + + + m17n:kn:kgp +@@ -37,19 +40,22 @@ + FALSE + + +- m17n:mai:inscript ++ m17n:mai:inscript* + 2 + FALSE ++ lv3:ralt_switch + + +- m17n:ml:inscript ++ m17n:ml:inscript* + 2 + FALSE ++ lv3:ralt_switch + + +- m17n:mr:inscript ++ m17n:mr:inscript* + 2 + FALSE ++ lv3:ralt_switch + + + m17n:ne:rom +@@ -57,14 +63,16 @@ + FALSE + + +- m17n:or:inscript ++ m17n:or:inscript* + 2 + FALSE ++ lv3:ralt_switch + + +- m17n:pa:inscript ++ m17n:pa:inscript* + 2 + FALSE ++ lv3:ralt_switch + + + m17n:sa:harvard-kyoto +@@ -72,14 +80,16 @@ + FALSE + + +- m17n:sd:inscript ++ m17n:sd:inscript* + 2 + FALSE ++ lv3:ralt_switch + + + m17n:si:wijesekera + 2 + FALSE ++ lv3:ralt_switch + + + m17n:ta:tamil99 +@@ -87,9 +97,10 @@ + FALSE + + +- m17n:te:inscript ++ m17n:te:inscript* + 2 + FALSE ++ lv3:ralt_switch + + " ++ elif test x$with_hotkeys = xyes -o x$with_hotkeys = x; then ++ IBUS_HOTKEYS="$IBUS_HOTKEYS_DEFAULT" ++ IBUS_HOTKEYS_XML="${IBUS_HOTKEYS}" ++ else ++ IBUS_HOTKEYS="$with_hotkeys" ++ IBUS_HOTKEYS_XML="${IBUS_HOTKEYS}" ++ fi ++ if test x$IBUS_HOTKEYS != x; then ++ AC_DEFINE_UNQUOTED(IBUS_IBUS_HOTKEYS, ["$IBUS_HOTKEYS"], ++ [IME specific hotkeys for IBus]) ++ AC_SUBST(IBUS_HOTKEYS) ++ fi ++ AC_SUBST(IBUS_HOTKEYS_XML) ++]) ++ ++# IBUS_SET_SYMBOL(SYMBOL) ++AC_DEFUN([IBUS_SET_SYMBOL], [ ++ IBUS_SYMBOL="$1" ++ if test x$PYTHON = x; then ++ AM_PATH_PYTHON([2.5]) ++ fi ++ AC_MSG_CHECKING([if ibus supports icon symbol]) ++ $PYTHON <<_IBUS_SYMBOL_TEST ++import ibus ++engine = ibus.EngineDesc('test') ++exit(not hasattr(engine, 'symbol')) ++_IBUS_SYMBOL_TEST ++ if test $? -eq 0; then ++ IBUS_SYMBOL_XML="${IBUS_SYMBOL}" ++ AC_MSG_RESULT([yes]) ++ else ++ IBUS_SYMBOL_XML="" ++ IBUS_SYMBOL= ++ AC_MSG_RESULT([no]) ++ fi ++ if test x$IBUS_SYMBOL != x; then ++ AC_DEFINE_UNQUOTED([IBUS_SYMBOL], ["$IBUS_SYMBOL"], ++ [Icon symbol string for IBus]) ++ AC_SUBST(IBUS_SYMBOL) ++ fi ++ AC_SUBST(IBUS_SYMBOL_XML) ++]) +Index: ibus-m17n-1.3.2/src/default.xml.in.in +=================================================================== +--- ibus-m17n-1.3.2.orig/src/default.xml.in.in ++++ ibus-m17n-1.3.2/src/default.xml.in.in +@@ -254,5 +254,7 @@ + m17n:* + 0 + FALSE ++ @IBUS_HOTKEYS_XML@ ++ @IBUS_SYMBOL_XML@ + + +Index: ibus-m17n-1.3.2/src/m17nutil.c +=================================================================== +--- ibus-m17n-1.3.2.orig/src/m17nutil.c ++++ ibus-m17n-1.3.2/src/m17nutil.c +@@ -122,6 +122,8 @@ ibus_m17n_engine_new (MSymbol lang, + "icon", engine_icon ? engine_icon : "", + "layout", "us", + "rank", config->rank, ++ "hotkeys", config->hotkeys ? config->hotkeys : "", ++ "symbol", config->symbol ? config->symbol : "", + NULL); + #else + engine = ibus_engine_desc_new (engine_name, +@@ -282,6 +284,14 @@ ibus_m17n_engine_config_parse_xml_node ( + cnode->config.rank = atoi (sub_node->text); + continue; + } ++ if (g_strcmp0 (sub_node->name , "hotkeys") == 0) { ++ cnode->config.hotkeys = g_strdup (sub_node->text); ++ continue; ++ } ++ if (g_strcmp0 (sub_node->name , "symbol") == 0) { ++ cnode->config.symbol = g_strdup (sub_node->text); ++ continue; ++ } + if (g_strcmp0 (sub_node->name , "preedit-highlight") == 0) { + if (g_ascii_strcasecmp ("TRUE", sub_node->text) == 0) + cnode->config.preedit_highlight = TRUE; +Index: ibus-m17n-1.3.2/src/m17nutil.h +=================================================================== +--- ibus-m17n-1.3.2.orig/src/m17nutil.h ++++ ibus-m17n-1.3.2/src/m17nutil.h +@@ -14,6 +14,12 @@ struct _IBusM17NEngineConfig { + /* engine rank */ + gint rank; + ++ /* hotkeys */ ++ gchar *hotkeys; ++ ++ /* symbol */ ++ gchar *symbol; ++ + /* whether to highlight preedit */ + gboolean preedit_highlight; + diff --git a/ibus-m17n.spec b/ibus-m17n.spec index 89ed649..e4d3100 100644 --- a/ibus-m17n.spec +++ b/ibus-m17n.spec @@ -1,20 +1,31 @@ -%define require_ibus_version 1.3.0 +%global require_ibus_version 1.3.0 +%global have_bridge_hotkey 1 + +%if (0%{?fedora} > 14) +%global _with_gtk --with-gtk=3.0 +%else +%global _with_gtk --with-gtk=2.0 +%endif + +%if %have_bridge_hotkey +%global _with_hotkeys --with-hotkeys +%endif Name: ibus-m17n Version: 1.3.2 -Release: 5%{?dist} +Release: 6%{?dist} Summary: The M17N engine for IBus platform License: GPLv2+ Group: System Environment/Libraries URL: http://code.google.com/p/ibus/ Source0: http://ibus.googlecode.com/files/%{name}-%{version}.tar.gz -Patch0: ibus-m17n-iok.patch -Patch1: ibus-m17n-HEAD.patch -# Surrounding-text support fixes. Hopefully Patch2 won't be needed -# with future IBus versions. -Patch2: ibus-m17n-stscap.patch -Patch3: ibus-m17n-stsreq.patch +Patch0: ibus-m17n-HEAD.patch +Patch1: ibus-m17n-iok.patch +Patch2: ibus-m17n-xkb-options.patch +%if %have_bridge_hotkey +Patch3: ibus-m17n-xx-icon-symbol.patch +%endif # The following BR is for autogen and not necessary when packging # released tarballs. @@ -23,7 +34,12 @@ BuildRequires: libtool BuildRequires: pkgconfig BuildRequires: gnome-common BuildRequires: m17n-lib-devel +%if (0%{?fedora} > 14) BuildRequires: gtk3-devel +%else +BuildRequires: gtk2-devel +%endif +BuildRequires: libxklavier-devel BuildRequires: ibus-devel >= %{require_ibus_version} Requires: ibus >= %{require_ibus_version} @@ -36,14 +52,16 @@ the input table maps from m17n-db. %prep %setup -q -%patch0 -p1 -b .iok -%patch1 -p1 -b .HEAD -%patch2 -p1 -b .stscap -%patch3 -p1 -b .stsreq +%patch0 -p1 -b .HEAD +%patch1 -p1 -b .iok +%patch2 -p1 -b .xkb-options +%if %have_bridge_hotkey +%patch3 -p1 -b .xx-icon-symbol +%endif NOCONFIGURE=1 ./autogen.sh %build -%configure --disable-static --with-gtk=3.0 +%configure --disable-static %{?_with_gtk} %{?_with_hotkeys} # make -C po update-gmo make %{?_smp_mflags} @@ -61,6 +79,11 @@ make DESTDIR=${RPM_BUILD_ROOT} install %{_datadir}/ibus/component/* %changelog +* Mon Jul 4 2011 Daiki Ueno - 1.3.2-6 +- Add ibus-m17n-xkb-options.patch. +- Add ibus-m17n-xx-icon-symbol.patch. +- Drop surrounding-text patches since they are included in the HEAD patch. + * Wed Jun 15 2011 Daiki Ueno - 1.3.2-5 - Add ibus-m17n-stsreq.patch. - Fix bug 711126 - ibus: surrounding text support fails for the first diff --git a/series b/series new file mode 100644 index 0000000..d44fc01 --- /dev/null +++ b/series @@ -0,0 +1,4 @@ +ibus-m17n-HEAD.patch +ibus-m17n-iok.patch +ibus-m17n-xkb-options.patch +ibus-m17n-xx-icon-symbol.patch