public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/ibus] autotool: Resolves: #2413790 - Load EN compose file in pt-BR locale
@ 2026-05-31  2:09 Takao Fujiwara
  0 siblings, 0 replies; only message in thread
From: Takao Fujiwara @ 2026-05-31  2:09 UTC (permalink / raw)
  To: git-commits

            A new commit has been pushed.

            Repo   : rpms/ibus
            Branch : autotool
            Commit : 22dbdb3c2881c6326d36cb6be5e7f805c5be741c
            Author : Takao Fujiwara <tfujiwar@redhat.com>
            Date   : 2025-11-18T13:30:12+09:00
            Stats  : +426/-1 in 2 file(s)
            URL    : https://src.fedoraproject.org/rpms/ibus/c/22dbdb3c2881c6326d36cb6be5e7f805c5be741c?branch=autotool

            Log:
            Resolves: #2413790 - Load EN compose file in pt-BR locale

- Update simple.xml with xkeyboard-config 2.46

---
diff --git a/ibus-HEAD.patch b/ibus-HEAD.patch
index 6767a68..e7cb596 100644
--- a/ibus-HEAD.patch
+++ b/ibus-HEAD.patch
@@ -247,3 +247,423 @@ index a9396d7e..fc32398c 100644
 -- 
 2.51.0
 
+From 94c6ede4289666782d860ae964f9a09cbdc78554 Mon Sep 17 00:00:00 2001
+From: fujiwarat <takao.fujiwara1@gmail.com>
+Date: Thu, 13 Nov 2025 20:15:37 +0900
+Subject: [PATCH] engine: Update simple.xml with xkeyboard-config 2.46
+
+---
+ engine/gensimple.py  |  8 ++---
+ engine/simple.xml.in | 70 ++++++++++++++++++++++++++++++++++++++++----
+ 2 files changed, 69 insertions(+), 9 deletions(-)
+
+diff --git a/engine/gensimple.py b/engine/gensimple.py
+index de6d7ff5..4e331732 100755
+--- a/engine/gensimple.py
++++ b/engine/gensimple.py
+@@ -248,7 +248,7 @@ class GenerateEngineXML():
+                                   self._AUTHOR,
+                                   self.__first)
+         parser.setContentHandler(self.__handler)
+-        f = codecs.open(self.__path, 'r', encoding='utf-8')
++        f = open(self.__path, 'r', encoding='utf-8')
+         try:
+             parser.parse(f)
+         except SAXParseException:
+@@ -257,7 +257,7 @@ class GenerateEngineXML():
+             f.close()
+     def write(self, output=None):
+         if output != None:
+-            od = codecs.open(output, 'w', encoding='utf-8')
++            od = open(output, 'w', encoding='utf-8')
+         else:
+             if PY3K:
+                 od = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8')
+@@ -311,7 +311,7 @@ class ISO639XML(XMLFilterBase):
+ 
+ 
+ def parse_iso639(path):
+-    f = codecs.open(path, 'r', encoding='utf-8')
++    f = open(path, 'r', encoding='utf-8')
+     parser = sax_make_parser()
+     parser.setFeature(sax_feature_namespaces, 0)
+     handler = ISO639XML(parser)
+@@ -327,7 +327,7 @@ def parse_iso639(path):
+ 
+ def parse_denylist(denyfile):
+     denylist = []
+-    f = codecs.open(denyfile, 'r', encoding='utf-8')
++    f = open(denyfile, 'r', encoding='utf-8')
+     for line in f.readlines():
+         if line == '\n' or line[0] == '#':
+             continue
+diff --git a/engine/simple.xml.in b/engine/simple.xml.in
+index 92fea8a8..c39d4134 100644
+--- a/engine/simple.xml.in
++++ b/engine/simple.xml.in
+@@ -3,7 +3,7 @@
+     <name>org.freedesktop.IBus.Simple</name>
+     <description>A table based simple engine</description>
+     <exec>@libexecdir@/ibus-engine-simple</exec>
+-    <version>1.5.33-beta1.20250916</version>
++    <version>1.5.33.20251113</version>
+     <author>Peng Huang &lt;shawn.p.huang@gmail.com&gt;</author>
+     <license>GPL</license>
+     <homepage>https://github.com/ibus/ibus/wiki</homepage>
+@@ -2738,8 +2738,20 @@
+             <author>Peng Huang &lt;shawn.p.huang@gmail.com&gt;</author>
+             <layout>us</layout>
+             <layout_variant>mac</layout_variant>
+-            <longname>English (Macintosh)</longname>
+-            <description>English (Macintosh)</description>
++            <longname>English (Macintosh, ABC, ANSI)</longname>
++            <description>English (Macintosh, ABC, ANSI)</description>
++            <icon>ibus-keyboard</icon>
++            <rank>1</rank>
++        </engine>
++        <engine>
++            <name>xkb:us:mac-iso:eng</name>
++            <language>en</language>
++            <license>GPL</license>
++            <author>Peng Huang &lt;shawn.p.huang@gmail.com&gt;</author>
++            <layout>us</layout>
++            <layout_variant>mac-iso</layout_variant>
++            <longname>English (Macintosh, ABC, ISO)</longname>
++            <description>English (Macintosh, ABC, ISO)</description>
+             <icon>ibus-keyboard</icon>
+             <rank>1</rank>
+         </engine>
+@@ -2906,8 +2918,20 @@
+             <author>Peng Huang &lt;shawn.p.huang@gmail.com&gt;</author>
+             <layout>us</layout>
+             <layout_variant>dvorak-mac</layout_variant>
+-            <longname>English (Dvorak, Macintosh)</longname>
+-            <description>English (Dvorak, Macintosh)</description>
++            <longname>English (Dvorak, Macintosh, ANSI)</longname>
++            <description>English (Dvorak, Macintosh, ANSI)</description>
++            <icon>ibus-keyboard</icon>
++            <rank>1</rank>
++        </engine>
++        <engine>
++            <name>xkb:us:dvorak-mac-iso:eng</name>
++            <language>en</language>
++            <license>GPL</license>
++            <author>Peng Huang &lt;shawn.p.huang@gmail.com&gt;</author>
++            <layout>us</layout>
++            <layout_variant>dvorak-mac-iso</layout_variant>
++            <longname>English (Dvorak, Macintosh, ISO)</longname>
++            <description>English (Dvorak, Macintosh, ISO)</description>
+             <icon>ibus-keyboard</icon>
+             <rank>1</rank>
+         </engine>
+@@ -11041,6 +11065,18 @@
+             <icon>ibus-keyboard</icon>
+             <rank>1</rank>
+         </engine>
++        <engine>
++            <name>xkb:th:mnc:tha</name>
++            <language>th</language>
++            <license>GPL</license>
++            <author>Peng Huang &lt;shawn.p.huang@gmail.com&gt;</author>
++            <layout>th</layout>
++            <layout_variant>mnc</layout_variant>
++            <longname>Thai (Manoonchai)</longname>
++            <description>Thai (Manoonchai)</description>
++            <icon>ibus-keyboard</icon>
++            <rank>1</rank>
++        </engine>
+         <engine>
+             <name>xkb:bw::tsn</name>
+             <language>tn</language>
+@@ -11217,6 +11253,18 @@
+             <icon>ibus-keyboard</icon>
+             <rank>1</rank>
+         </engine>
++        <engine>
++            <name>xkb:ua:winkeysenhanced:ukr</name>
++            <language>uk</language>
++            <license>GPL</license>
++            <author>Peng Huang &lt;shawn.p.huang@gmail.com&gt;</author>
++            <layout>ua</layout>
++            <layout_variant>winkeysenhanced</layout_variant>
++            <longname>Ukrainian (Windows Enhanced)</longname>
++            <description>Ukrainian (Windows Enhanced)</description>
++            <icon>ibus-keyboard</icon>
++            <rank>1</rank>
++        </engine>
+         <engine>
+             <name>xkb:ua:macOS:ukr</name>
+             <language>uk</language>
+@@ -11324,6 +11372,18 @@
+             <icon>ibus-keyboard</icon>
+             <rank>1</rank>
+         </engine>
++        <engine>
++            <name>xkb:pk:pak_urdu_phonetic:urd</name>
++            <language>ur</language>
++            <license>GPL</license>
++            <author>Peng Huang &lt;shawn.p.huang@gmail.com&gt;</author>
++            <layout>pk</layout>
++            <layout_variant>pak_urdu_phonetic</layout_variant>
++            <longname>Urdu (Pak Urdu Phonetic)</longname>
++            <description>Urdu (Pak Urdu Phonetic)</description>
++            <icon>ibus-keyboard</icon>
++            <rank>1</rank>
++        </engine>
+         <engine>
+             <name>xkb:pk:ara:ara</name>
+             <language>ar</language>
+-- 
+2.51.0
+
+From 8720838d7f59de485e6769bb939b6eef0c985276 Mon Sep 17 00:00:00 2001
+From: fujiwarat <takao.fujiwara1@gmail.com>
+Date: Fri, 14 Nov 2025 02:39:56 +0900
+Subject: [PATCH] src: Load EN compose file in pt-BR locale
+
+- The EN compose table is enabled in case that language compose files,
+  el-GR, fi-FI, pt-BR languages, are loaded but the user has no
+  user compose file.
+- Output double dead keys with the well-known chars likes the EN compose
+  table in case that the user has a user compose file but not enable
+  the EN compose table.
+- Load language compose files in case the user compose file is loaded
+  with the 'include "%L"' keyword.
+
+Fixes: https://github.com/ibus/ibus/commit/7c2b32b4
+BUG=https://github.com/ibus/ibus/issues/2825
+---
+ src/ibuscomposetable.c | 32 ++++++++++++++--
+ src/ibuscomposetable.h |  1 +
+ src/ibusenginesimple.c | 85 +++++++++++++++++++++++++-----------------
+ 3 files changed, 81 insertions(+), 37 deletions(-)
+
+diff --git a/src/ibuscomposetable.c b/src/ibuscomposetable.c
+index e60ad091..8e1785ca 100644
+--- a/src/ibuscomposetable.c
++++ b/src/ibuscomposetable.c
+@@ -1576,6 +1576,20 @@ ibus_compose_table_new_with_list (GList   *compose_list,
+ }
+ 
+ 
++static gboolean
++_datafile_is_system (const gchar *compose_file)
++{
++    g_assert (compose_file);
++    if (!g_ascii_strncasecmp (compose_file, "/usr", 4) ||
++        !g_ascii_strncasecmp (compose_file, "/etc", 4) ||
++        !g_ascii_strncasecmp (compose_file, "/usr", 4) ||
++        !g_ascii_strncasecmp (compose_file, "/opt", 4)) {
++        return TRUE;
++    }
++    return FALSE;
++}
++
++
+ IBusComposeTableEx *
+ ibus_compose_table_new_with_file (const gchar *compose_file,
+                                   GSList      *compose_tables)
+@@ -1632,6 +1646,7 @@ ibus_compose_table_new_with_file (const gchar *compose_file,
+             } else {
+                 compose_table->id = g_str_hash (compose_file);
+                 compose_table->can_load_en_us = can_load_en_us;
++                compose_table->is_system = _datafile_is_system (compose_file);
+                 return compose_table;
+             }
+         }
+@@ -1647,8 +1662,10 @@ ibus_compose_table_new_with_file (const gchar *compose_file,
+             max_compose_len,
+             n_index_stride,
+             g_str_hash (compose_file));
+-    if (compose_table)
++    if (compose_table) {
+         compose_table->can_load_en_us = can_load_en_us;
++        compose_table->is_system = _datafile_is_system (compose_file);
++    }
+ 
+     g_list_free_full (compose_list,
+                       (GDestroyNotify) ibus_compose_list_element_free);
+@@ -1793,8 +1810,10 @@ ibus_compose_table_list_add_file (GSList      *compose_tables,
+ 
+     compose_table = ibus_compose_table_load_cache (compose_file,
+                                                    &saved_version);
+-    if (compose_table != NULL)
++    if (compose_table != NULL) {
++        compose_table->is_system = _datafile_is_system (compose_file);
+         return g_slist_prepend (compose_tables, compose_table);
++    }
+ 
+ parse:
+     if ((compose_table = ibus_compose_table_new_with_file (compose_file,
+@@ -2138,8 +2157,15 @@ ibus_check_algorithmically (const guint   *compose_buffer,
+ 
+     for (i = 0; i < n_compose && IS_DEAD_KEY (compose_buffer[i]); i++)
+         ;
+-    if (i == n_compose)
++    if (i == n_compose) {
++        /* If no EN compose, double dead keys should be output? */
++        if (i == 2 && compose_buffer[0] == compose_buffer[1]) {
++            *output_char = ibus_keysym_to_unicode (compose_buffer[0],
++                                                   FALSE,
++                                                   NULL);
++        }
+         return TRUE;
++    }
+ 
+     if (i > 0 && i == n_compose - 1) {
+         combination_buffer[0] = ibus_keyval_to_unicode (compose_buffer[i]);
+diff --git a/src/ibuscomposetable.h b/src/ibuscomposetable.h
+index 2068657d..ce4cdae1 100644
+--- a/src/ibuscomposetable.h
++++ b/src/ibuscomposetable.h
+@@ -65,6 +65,7 @@ struct _IBusComposeTableEx
+     guint32 id;
+     char *rawdata;
+     gboolean can_load_en_us;
++    gboolean is_system;
+ };
+ 
+ 
+diff --git a/src/ibusenginesimple.c b/src/ibusenginesimple.c
+index baef9508..ac7ffc41 100644
+--- a/src/ibusenginesimple.c
++++ b/src/ibusenginesimple.c
+@@ -173,7 +173,9 @@ ibus_engine_simple_class_init (IBusEngineSimpleClass *class)
+                                                        length,
+                                                        &saved_version);
+     g_bytes_unref (data);
+-    if (!en_compose_table && saved_version) {
++    if (en_compose_table) {
++        en_compose_table->is_system = TRUE;
++    } else if (!en_compose_table && saved_version) {
+         g_warning ("Failed to parse the builtin compose due to the different "
+                    "version %u. Please rebuild IBus resource files.",
+                    saved_version);
+@@ -1023,6 +1025,7 @@ ibus_engine_simple_check_all_compose_table (IBusEngineSimple *simple,
+     GString *output = g_string_new ("");
+     gboolean success = FALSE;
+     gboolean is_32bit = FALSE;
++    gboolean all_is_system = TRUE;
+     gboolean can_load_en_us = FALSE;
+     gunichar output_char = '\0';
+ 
+@@ -1034,18 +1037,27 @@ ibus_engine_simple_check_all_compose_table (IBusEngineSimple *simple,
+ 
+     G_LOCK (global_tables);
+     tmp_list = global_tables;
++    while (tmp_list) {
++        IBusComposeTableEx *compose_table = tmp_list->data;
++        if (!compose_table->is_system) {
++            all_is_system = FALSE;
++            break;
++        }
++        tmp_list = tmp_list->next;
++    }
++    tmp_list = global_tables;
+     while (tmp_list) {
+         IBusComposeTableEx *compose_table = tmp_list->data;
+         if (compose_table->can_load_en_us)
+             can_load_en_us = TRUE;
+-        /* If global_tables includes en_compose_table only, i.e. no user
+-         * or locale compose tables, en_compose_table is used.
+-         * If not, en_compose_table is used in case one of the other compose
+-         * tables has can_load_en_us = %TRUE, i.e. the table file has
+-         * the line of 'include "%L"'.
++        /* If global_tables includes system compose tables only, i.e. no user
++         * compose tables, en_compose_table is used.
++         * If user compose table is included in global_tables, en_compose_table
++         * is used in case that the user compose table has can_load_en_us =
++         * %TRUE, i.e. the compose file has the line of 'include "%L"'.
+          * en_compose_table is always appended to the last of global_tables.
+          */
+-        if ((compose_table == en_compose_table) && global_tables->next != NULL
++        if ((compose_table == en_compose_table) && !all_is_system
+             && !can_load_en_us) {
+             tmp_list = tmp_list->next;
+             continue;
+@@ -1102,7 +1114,12 @@ ibus_engine_simple_check_all_compose_table (IBusEngineSimple *simple,
+     g_string_free (output, TRUE);
+     output = NULL;
+ 
+-    if (ibus_check_algorithmically (priv->compose_buffer,
++    /* TODO: priv->tentative_match should not be used in case
++     * success == %TRUE? Now ibus_check_algorithmically() hits double dead
++     * keys.
++     */
++    if (!success &&
++        ibus_check_algorithmically (priv->compose_buffer,
+                                     n_compose,
+                                     &output_char)) {
+         priv->in_compose_sequence = TRUE;
+@@ -1689,42 +1706,42 @@ ibus_engine_simple_add_table_by_locale (IBusEngineSimple *simple,
+     if (locale == NULL) {
+         path = g_build_filename (g_get_user_config_dir (),
+                                  "ibus", "Compose", NULL);
+-        if (g_file_test (path, G_FILE_TEST_EXISTS)) {
++        if (g_file_test (path, G_FILE_TEST_EXISTS))
+             ibus_engine_simple_add_compose_file (simple, path);
+-            g_free (path);
+-            return retval;
+-        }
+         g_clear_pointer(&path, g_free);
+ 
+-        path = g_build_filename (g_get_user_config_dir (),
+-                                 "gtk-4.0", "Compose", NULL);
+-        if (g_file_test (path, G_FILE_TEST_EXISTS)) {
+-            ibus_engine_simple_add_compose_file (simple, path);
+-            g_free (path);
+-            return retval;
++        /* If user compose is not loaded except for en_compose_table */
++        if (global_tables && !global_tables->next) {
++            path = g_build_filename (g_get_user_config_dir (),
++                                     "gtk-4.0", "Compose", NULL);
++            if (g_file_test (path, G_FILE_TEST_EXISTS))
++                ibus_engine_simple_add_compose_file (simple, path);
++            g_clear_pointer(&path, g_free);
+         }
+-        g_clear_pointer(&path, g_free);
+ 
+-        path = g_build_filename (g_get_user_config_dir (),
+-                                 "gtk-3.0", "Compose", NULL);
+-        if (g_file_test (path, G_FILE_TEST_EXISTS)) {
+-            ibus_engine_simple_add_compose_file (simple, path);
+-            g_free (path);
+-            return retval;
++        if (global_tables && !global_tables->next) {
++            path = g_build_filename (g_get_user_config_dir (),
++                                     "gtk-3.0", "Compose", NULL);
++            if (g_file_test (path, G_FILE_TEST_EXISTS))
++                ibus_engine_simple_add_compose_file (simple, path);
++            g_clear_pointer(&path, g_free);
+         }
+-        g_clear_pointer(&path, g_free);
+ 
+         home = g_get_home_dir ();
+-        if (home == NULL)
+-            return retval;
+ 
+-        path = g_build_filename (home, ".XCompose", NULL);
+-        if (g_file_test (path, G_FILE_TEST_EXISTS)) {
+-            ibus_engine_simple_add_compose_file (simple, path);
+-            g_free (path);
+-            return retval;
++        if (home && global_tables && !global_tables->next) {
++            path = g_build_filename (home, ".XCompose", NULL);
++            if (g_file_test (path, G_FILE_TEST_EXISTS))
++                ibus_engine_simple_add_compose_file (simple, path);
++            g_clear_pointer(&path, g_free);
++        }
++
++        /* Decide if both user compose and locale compose is loaded. */
++        if (global_tables && global_tables->next) {
++            IBusComposeTableEx *compose_table = global_tables->data;
++            if (!compose_table->can_load_en_us)
++                return retval;
+         }
+-        g_clear_pointer(&path, g_free);
+ 
+ #if GLIB_CHECK_VERSION (2, 58, 0)
+         langs = g_get_language_names_with_category ("LC_CTYPE");
+-- 
+2.51.0
+

diff --git a/ibus.spec b/ibus.spec
index cd9420a..0e36201 100644
--- a/ibus.spec
+++ b/ibus.spec
@@ -63,7 +63,7 @@
 Name:           ibus
 Version:        1.5.33
 # https://github.com/fedora-infra/rpmautospec/issues/101
-Release:        1%{?dist}
+Release:        2%{?dist}
 Summary:        Intelligent Input Bus for Linux OS
 License:        LGPL-2.1-or-later
 URL:            https://github.com/ibus/%name/wiki
@@ -72,6 +72,7 @@ Source1:        https://github.com/ibus/%name/releases/download/%{source_version
 Source2:        %{name}-xinput
 Source3:        %{name}.conf.5
 # Patch0:         %%{name}-HEAD.patch
+Patch0:         %{name}-HEAD.patch
 # Under testing #1349148 #1385349 #1350291 #1406699 #1432252 #1601577
 Patch1:         %{name}-1385349-segv-bus-proxy.patch
 
@@ -638,6 +639,10 @@ dconf update || :
 %{_datadir}/installed-tests/ibus
 
 %changelog
+* Tue Nov 18 2025 Takao Fujiwara <tfujiwar@redhat.com> - 1.5.33-2
+- Resolves: #2413790 - Load EN compose file in pt-BR locale
+- Update simple.xml with xkeyboard-config 2.46
+
 * Wed Nov 12 2025 Takao Fujiwara <tfujiwar@redhat.com> - 1.5.33-1
 - Bump to 1.5.33
 

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-05-31  2:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-05-31  2:09 [rpms/ibus] autotool: Resolves: #2413790 - Load EN compose file in pt-BR locale Takao Fujiwara

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox