]> git.pld-linux.org Git - packages/ibus-hangul.git/commitdiff
- initial revision
authorJan Rękorajski <baggins@pld-linux.org>
Wed, 20 Jul 2011 10:44:59 +0000 (10:44 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    ibus-hangul-ibus-1.4.patch -> 1.1
    ibus-hangul-xx-icon-symbol.patch -> 1.1
    ibus-hangul.spec -> 1.1

ibus-hangul-ibus-1.4.patch [new file with mode: 0644]
ibus-hangul-xx-icon-symbol.patch [new file with mode: 0644]
ibus-hangul.spec [new file with mode: 0644]

diff --git a/ibus-hangul-ibus-1.4.patch b/ibus-hangul-ibus-1.4.patch
new file mode 100644 (file)
index 0000000..3005672
--- /dev/null
@@ -0,0 +1,142 @@
+Patch to follow ibus 1.4 config API change.
+Index: ibus-hangul-1.3.1/src/engine.c
+===================================================================
+--- ibus-hangul-1.3.1.orig/src/engine.c
++++ ibus-hangul-1.3.1/src/engine.c
+@@ -111,7 +111,11 @@ static void ibus_hangul_engine_update_lo
+ static void ibus_config_value_changed       (IBusConfig             *config,
+                                              const gchar            *section,
+                                              const gchar            *name,
++#if IBUS_CHECK_VERSION(1,3,99)
++                                             GVariant               *value,
++#else
+                                              GValue                 *value,
++#endif  /* !IBUS_CHECK_VERSION(1,3,99) */
+                                              gpointer                user_data);
+ static void        lookup_table_set_visible (IBusLookupTable        *table,
+@@ -136,6 +140,11 @@ static gboolean hanja_key_list_match    
+ static gboolean hanja_key_list_has_modifier (HanjaKeyList           *list,
+                                              guint                   keyval);
++static gboolean config_get_string           (IBusConfig             *config,
++                                             const gchar            *section,
++                                             const gchar            *name,
++                                             gchar                 **result);
++
+ static IBusEngineClass *parent_class = NULL;
+ static HanjaTable *hanja_table = NULL;
+ static HanjaTable *symbol_table = NULL;
+@@ -176,7 +185,7 @@ void
+ ibus_hangul_init (IBusBus *bus)
+ {
+     gboolean res;
+-    GValue value = { 0, };
++    gchar *str;
+     hanja_table = hanja_table_load (NULL);
+@@ -187,22 +196,20 @@ ibus_hangul_init (IBusBus *bus)
+         g_object_ref_sink (config);
+     hangul_keyboard = g_string_new_len ("2", 8);
+-    res = ibus_config_get_value (config, "engine/Hangul",
+-                                         "HangulKeyboard", &value);
++    str = NULL;
++    res = config_get_string (config, "engine/Hangul", "HangulKeyboard", &str);
+     if (res) {
+-        const gchar* str = g_value_get_string (&value);
+         g_string_assign (hangul_keyboard, str);
+-        g_value_unset(&value);
++        g_free (str);
+     }
+     hanja_key_list_init(&hanja_keys);
+-    res = ibus_config_get_value (config, "engine/Hangul",
+-                                         "HanjaKeys", &value);
++    str = NULL;
++    res = config_get_string (config, "engine/Hangul", "HanjaKeys", &str);
+     if (res) {
+-        const gchar* str = g_value_get_string (&value);
+         hanja_key_list_set_from_string(&hanja_keys, str);
+-        g_value_unset(&value);
++        g_free (str);
+     } else {
+       hanja_key_list_append(&hanja_keys, IBUS_Hangul_Hanja, 0);
+       hanja_key_list_append(&hanja_keys, IBUS_F9, 0);
+@@ -963,27 +970,71 @@ ibus_hangul_engine_property_activate (IB
+     }
+ }
++static gboolean
++config_get_string (IBusConfig  *config,
++                   const gchar *section,
++                   const gchar *name,
++                   gchar      **result)
++{
++#if IBUS_CHECK_VERSION(1,3,99)
++    GVariant *value = NULL;
++
++    g_return_val_if_fail (result != NULL, FALSE);
++
++    value = ibus_config_get_value (config, section, name);
++    if (value) {
++        *result = g_strdup (g_variant_get_string (value, NULL));
++        g_variant_unref (value);
++        return TRUE;
++    }
++    return FALSE;
++#else
++    GValue value = { 0 };
++
++    g_return_val_if_fail (result != NULL, FALSE);
++
++    if (ibus_config_get_value (config, section, name, &value)) {
++        *result = g_strdup (g_value_get_string (&value));
++        g_value_unset (&value);
++        return TRUE;
++    }
++    return FALSE;
++#endif  /* !IBUS_CHECK_VERSION(1,3,99) */
++}
++
++#if IBUS_CHECK_VERSION(1,3,99)
++#define _g_variant_get_string g_variant_get_string
++#define _g_variant_get_int32 g_variant_get_int32
++#else
++#define _g_variant_get_string(value, length) g_value_get_string(value)
++#define _g_variant_get_int32 g_value_get_int
++#endif  /* !IBUS_CHECK_VERSION(1,3,99) */
++
+ static void
+ ibus_config_value_changed (IBusConfig   *config,
+                            const gchar  *section,
+                            const gchar  *name,
++#if IBUS_CHECK_VERSION(1,3,99)
++                           GVariant     *value,
++#else
+                            GValue       *value,
++#endif  /* !IBUS_CHECK_VERSION(1,3,99) */
+                            gpointer      user_data)
+ {
+     IBusHangulEngine *hangul = (IBusHangulEngine *) user_data;
+     if (strcmp(section, "engine/Hangul") == 0) {
+         if (strcmp(name, "HangulKeyboard") == 0) {
+-            const gchar *str = g_value_get_string (value);
++            const gchar *str = _g_variant_get_string (value, NULL);
+             g_string_assign (hangul_keyboard, str);
+             hangul_ic_select_keyboard (hangul->context, hangul_keyboard->str);
+         } else if (strcmp(name, "HanjaKeys") == 0) {
+-            const gchar* str = g_value_get_string (value);
++            const gchar* str = _g_variant_get_string (value, NULL);
+           hanja_key_list_set_from_string(&hanja_keys, str);
+         }
+     } else if (strcmp(section, "panel") == 0) {
+         if (strcmp(name, "lookup_table_orientation") == 0) {
+-            lookup_table_orientation = g_value_get_int (value);
++            lookup_table_orientation = _g_variant_get_int32 (value);
+         }
+     }
+ }
diff --git a/ibus-hangul-xx-icon-symbol.patch b/ibus-hangul-xx-icon-symbol.patch
new file mode 100644 (file)
index 0000000..0484ce7
--- /dev/null
@@ -0,0 +1,86 @@
+Patch to embed hotkeys and symbol property in component XML.
+Index: ibus-hangul-1.3.1/configure.ac
+===================================================================
+--- ibus-hangul-1.3.1.orig/configure.ac
++++ ibus-hangul-1.3.1/configure.ac
+@@ -75,6 +75,10 @@ AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GET
+ AM_GNU_GETTEXT([external])
+ AM_GNU_GETTEXT_VERSION([0.17])
++# hotkeys and symbol properties in component xml
++IBUS_WITH_HOTKEYS([Control+space,Hangul])
++IBUS_SET_SYMBOL([&#xD55C;])
++
+ # OUTPUT files
+ AC_CONFIG_FILES([ po/Makefile.in
+Index: ibus-hangul-1.3.1/m4/ibus.m4
+===================================================================
+--- /dev/null
++++ ibus-hangul-1.3.1/m4/ibus.m4
+@@ -0,0 +1,52 @@
++# IBUS_WITH_HOTKEYS([DEFAULT])
++AC_DEFUN([IBUS_WITH_HOTKEYS], [
++  IBUS_HOTKEYS_DEFAULT=m4_default([$1], [Control+space,Zenkaku_Hankaku])
++  AC_ARG_WITH(hotkeys,
++    [AC_HELP_STRING([--with-hotkeys=HOTKEYS],
++    [Use hotkeys for ibus bridge mode. (available value: yes/no/keys)])],
++    [with_hotkeys="$withval"],
++    [with_hotkeys="no"])
++  if test x$with_hotkeys = xno; then
++    IBUS_HOTKEYS_XML="<!-- <hotkeys>${IBUS_HOTKEYS_DEFAULT}</hotkeys> -->"
++  elif test x$with_hotkeys = xyes -o x$with_hotkeys = x; then
++    IBUS_HOTKEYS="$IBUS_HOTKEYS_DEFAULT"
++    IBUS_HOTKEYS_XML="<hotkeys>${IBUS_HOTKEYS}</hotkeys>"
++  else
++    IBUS_HOTKEYS="$with_hotkeys"
++    IBUS_HOTKEYS_XML="<hotkeys>${IBUS_HOTKEYS}</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="<symbol>${IBUS_SYMBOL}</symbol>"
++    AC_MSG_RESULT([yes])
++  else
++    IBUS_SYMBOL_XML="<!-- <symbol>${IBUS_SYMBOL}</symbol> -->"
++    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-hangul-1.3.1/src/hangul.xml.in.in
+===================================================================
+--- ibus-hangul-1.3.1.orig/src/hangul.xml.in.in
++++ ibus-hangul-1.3.1/src/hangul.xml.in.in
+@@ -21,6 +21,8 @@
+                       <longname>Korean</longname>
+                       <description>Korean Input Method</description>
+                       <rank>99</rank>
++                      @IBUS_HOTKEYS_XML@
++                      @IBUS_SYMBOL_XML@
+               </engine>
+       </engines>
diff --git a/ibus-hangul.spec b/ibus-hangul.spec
new file mode 100644 (file)
index 0000000..659ac31
--- /dev/null
@@ -0,0 +1,59 @@
+#
+# Conditional build:
+%bcond_with    bridge_hotkey           # enable the engine hotkeys
+#
+Summary:       The Hangul engine for IBus input platform
+Name:          ibus-hangul
+Version:       1.3.1
+Release:       0.1
+License:       GPL v2+
+Group:         Libraries
+Source0:       http://ibus.googlecode.com/files/%{name}-%{version}.tar.gz
+# Source0-md5: b71565bba3a1439a47212611b774ecf7
+Patch0:                %{name}-ibus-1.4.patch
+Patch1:                %{name}-xx-icon-symbol.patch
+URL:           http://code.google.com/p/ibus/
+BuildRequires: gettext-devel
+BuildRequires:  ibus
+BuildRequires: ibus-devel >= 1.3.0
+BuildRequires: intltool
+BuildRequires: libhangul-devel >= 0.0.10
+BuildRequires: libtool
+BuildRequires: pkgconfig
+Requires:      ibus >= 1.3.0
+Requires:      libhangul >= 0.0.10
+
+%define                _libexecdir     %{_libdir}/ibus
+
+%description
+The Hangul engine for IBus platform. It provides Korean input method
+from libhangul.
+
+%prep
+%setup -q
+%patch0 -p1
+%patch1 -p1
+
+%build
+%{__aclocal} -I m4
+%{__autoconf}
+%configure \
+       %{?with_bridge_hotkey:--with-hotkeys}
+
+%{__make}
+
+%install
+rm -rf $RPM_BUILD_ROOT
+
+%{__make} install \
+       DESTDIR=$RPM_BUILD_ROOT
+
+%find_lang %{name}
+
+%files -f %{name}.lang
+%defattr(644,root,root,755)
+%doc AUTHORS ChangeLog NEWS README
+%{_libexecdir}/ibus-engine-hangul
+%{_libexecdir}/ibus-setup-hangul
+%{_datadir}/ibus-hangul
+%{_datadir}/ibus/component/*
This page took 0.058454 seconds and 4 git commands to generate.