diff --git a/.fmf/version b/.fmf/version deleted file mode 100644 index d00491f..0000000 --- a/.fmf/version +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/.gitignore b/.gitignore index 68fd01d..b51f22e 100644 --- a/.gitignore +++ b/.gitignore @@ -27,4 +27,3 @@ ibus-anthy.png /ibus-anthy-1.5.14.tar.gz /ibus-anthy-1.5.15.tar.gz /ibus-anthy-1.5.16.tar.gz -/ibus-anthy-1.5.17.tar.gz diff --git a/ibus-anthy-HEAD.patch b/ibus-anthy-HEAD.patch index c8c77b8..e3f6c91 100644 --- a/ibus-anthy-HEAD.patch +++ b/ibus-anthy-HEAD.patch @@ -1,1367 +1,101 @@ -From 7f3101f60abc0c615ec2dcf82729b554373cddcc Mon Sep 17 00:00:00 2001 +From 9ae92d7b8085e869d37a068a1a94815c78de6110 Mon Sep 17 00:00:00 2001 From: fujiwarat -Date: Sat, 7 Jun 2025 15:33:17 +0900 -Subject: [PATCH] configure: Drop Python 2 support +Date: Tue, 12 Mar 2024 18:25:39 +0900 +Subject: [PATCH] engine: Ignore Super modifier key +Super-l is a shortcut key to launch a lock screen in GNOME desktop +session and now it can be sent to the engine prior to the window +manager. --- - configure.ac | 26 +++++++++----------------- - engine/Makefile.am | 8 ++------ - setup/Makefile.am | 8 ++------ - 3 files changed, 13 insertions(+), 29 deletions(-) + engine/python2/engine.py | 6 ++++-- + engine/python3/engine.py | 6 ++++-- + 2 files changed, 8 insertions(+), 4 deletions(-) -diff --git a/configure.ac b/configure.ac -index 8bb6733..e4090c3 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -117,12 +117,12 @@ AC_SUBST(ENV_IBUS_TEST) - dnl - define python version - AC_ARG_WITH(python, - AS_HELP_STRING([--with-python[=PATH]], -- [Select python2 or python3]), -+ [Select python3. python2 is no longer supported.]), - [PYTHON=$with_python], [] - ) - - dnl export $pyexecdir using existent $PYTHON --AM_PATH_PYTHON([2.5]) -+AM_PATH_PYTHON([3.0]) - - dnl Decided to separate python3 directory from python2 directory here - dnl because engine/table.py includes unicode array so it's better to -@@ -142,15 +142,12 @@ dnl return gettext(a) - case "$PYTHON_VERSION" in - 3.*) - enable_python3=yes -- enable_python2=no - ;; - *) -- enable_python3=no -- enable_python2=yes -+ AC_MSG_ERROR([Not support PYTHON $PYTHON]) - ;; - esac - --AM_CONDITIONAL([ENABLE_PYTHON2], [test x"$enable_python2" = x"yes"]) - AM_CONDITIONAL([ENABLE_PYTHON3], [test x"$enable_python3" = x"yes"]) - - dnl - check the supported ibus version -@@ -192,15 +189,14 @@ fi - AC_SUBST(ENV_IBUS_ENGINE) - - dnl - check pygtk2 --AC_MSG_CHECKING([whether you enable pygtk2 anthy]) -+AC_MSG_NOTICE([pygtk2 does not work because python2 is no longer supported.]) - AC_ARG_ENABLE(pygtk2-anthy, - AS_HELP_STRING([--enable-pygtk2-anthy=no/yes], -- [Install pygtk2 anthy default=no]), -- [], -- enable_pygtk2_anthy=no) --AC_MSG_RESULT($enable_pygtk2_anthy) -+ [pygtk2 is no longer supported.]), -+ enable_pygtk2=no, -+ enable_pygtk2=no) - --if test x"$enable_pygtk2_anthy" = xyes; then -+if test x"$enable_pygtk2" = xyes; then - AM_CONDITIONAL(HAVE_PYGTK2_ANTHY, true) - - dnl - check swig -@@ -447,14 +443,10 @@ ibus-anthy.spec - data/Makefile - gir/Makefile - engine/Makefile --engine/python2/Makefile --engine/python2/anthy.inputMethod.xml.in --engine/python2/default.inputMethod.xml.in - engine/python3/Makefile - engine/python3/anthy.inputMethod.xml.in - engine/python3/default.inputMethod.xml.in - setup/Makefile --setup/python2/Makefile - setup/python3/Makefile - tests/Makefile - icons/Makefile -@@ -475,7 +467,7 @@ ANTHY_GOBJECT_GIRDIR $ANTHY_GOBJECT_GIRDIR - ANTHY_GOBJECT_TYPELIBSDIR $ANTHY_GOBJECT_TYPELIBSDIR - LT_VERSION_INFO $LT_VERSION_INFO - ENV_IBUS_ENGINE $ENV_IBUS_ENGINE --HAVE_PYGTK2_ANTHY $enable_pygtk2_anthy -+HAVE_PYGTK2_ANTHY $enable_pygtk2 - python $PYTHON - Enable python2 $enable_python2 - Enable python3 $enable_python3 -diff --git a/engine/Makefile.am b/engine/Makefile.am -index 3c64425..991d7e3 100644 ---- a/engine/Makefile.am -+++ b/engine/Makefile.am -@@ -2,8 +2,8 @@ - # - # ibus-anthy - The Anthy engine for IBus - # --# Copyright (c) 2014 Takao Fujiwara --# Copyright (c) 2014 Red Hat, Inc. -+# Copyright (c) 2014-2025 Takao Fujiwara -+# Copyright (c) 2014-2025 Red Hat, Inc. - # - # This program is free software; you can redistribute it and/or modify - # it under the terms of the GNU General Public License as published by -@@ -21,10 +21,6 @@ - - SUBDIRS = - --if ENABLE_PYTHON2 --SUBDIRS += python2 --endif -- - if ENABLE_PYTHON3 - SUBDIRS += python3 - endif -diff --git a/setup/Makefile.am b/setup/Makefile.am -index 3c64425..991d7e3 100644 ---- a/setup/Makefile.am -+++ b/setup/Makefile.am -@@ -2,8 +2,8 @@ - # - # ibus-anthy - The Anthy engine for IBus - # --# Copyright (c) 2014 Takao Fujiwara --# Copyright (c) 2014 Red Hat, Inc. -+# Copyright (c) 2014-2025 Takao Fujiwara -+# Copyright (c) 2014-2025 Red Hat, Inc. - # - # This program is free software; you can redistribute it and/or modify - # it under the terms of the GNU General Public License as published by -@@ -21,10 +21,6 @@ - - SUBDIRS = - --if ENABLE_PYTHON2 --SUBDIRS += python2 --endif -- - if ENABLE_PYTHON3 - SUBDIRS += python3 - endif --- -2.49.0 - -From 7dd0db48e69306d28cb033336e0e7429b2920fb1 Mon Sep 17 00:00:00 2001 -From: fujiwarat -Date: Sat, 7 Jun 2025 15:34:18 +0900 -Subject: [PATCH] engine: Enable compose error notification - -IBusEngimeSimple now can use focus-id feature to warn the messages -for GNOME and Wayland specific and the parent class needs to connect -the 'focus-in/out-id' signals instead overriding the class methods -to access ibus_engine_simple_focus_in_id(). - -Also define the name of GType of the Python classes. - -BUG=https://github.com/ibus/ibus/pull/2763 ---- - engine/python3/engine.py | 26 ++++++++++++++++---------- - engine/python3/factory.py | 3 ++- - 2 files changed, 18 insertions(+), 11 deletions(-) - -diff --git a/engine/python3/engine.py b/engine/python3/engine.py -index 0858614..5678d18 100644 ---- a/engine/python3/engine.py -+++ b/engine/python3/engine.py +diff --git a/engine/python2/engine.py b/engine/python2/engine.py +index 42d4dc1..c7ccd3f 100644 +--- a/engine/python2/engine.py ++++ b/engine/python2/engine.py @@ -4,7 +4,7 @@ # ibus-anthy - The Anthy engine for IBus # # Copyright (c) 2007-2008 Peng Huang --# Copyright (c) 2010-2024 Takao Fujiwara -+# Copyright (c) 2010-2025 Takao Fujiwara +-# Copyright (c) 2010-2023 Takao Fujiwara ++# Copyright (c) 2010-2024 Takao Fujiwara # Copyright (c) 2007-2018 Red Hat, Inc. # # This program is free software; you can redistribute it and/or modify -@@ -116,6 +116,7 @@ for k, v in zip(['KEY_KP_Add', 'KEY_KP_Decimal', 'KEY_KP_Divide', 'KEY_KP_Enter' - KP_Table[getattr(IBus, k)] = getattr(IBus, v) +@@ -1976,7 +1976,9 @@ class Engine(IBus.EngineSimple): + state & hex_mod_mask == hex_mod_mask: + return True - class Engine(IBus.EngineSimple): -+ __gtype_name__ = 'IBusEngineAnthy' - __input_mode = None - __typing_mode = None - __segment_mode = None -@@ -129,12 +130,12 @@ class Engine(IBus.EngineSimple): +- if state & (IBus.ModifierType.CONTROL_MASK | IBus.ModifierType.MOD1_MASK): ++ if state & (IBus.ModifierType.CONTROL_MASK | \ ++ IBus.ModifierType.MOD1_MASK | \ ++ IBus.ModifierType.MOD4_MASK): + return False - def __init__(self, bus, object_path): - if hasattr(IBus.Engine.props, 'has_focus_id'): -- super(Engine, self).__init__(engine_name="anthy", -+ super(Engine, self).__init__(engine_name='anthy', - connection=bus.get_connection(), - object_path=object_path, - has_focus_id=True) - else: -- super(Engine, self).__init__(engine_name="anthy", -+ super(Engine, self).__init__(engine_name='anthy', - connection=bus.get_connection(), - object_path=object_path) - -@@ -186,6 +187,11 @@ class Engine(IBus.EngineSimple): - # loop infinitely if this class overrides it. - # self.process_key_event is not accessible too. - self.connect('process-key-event', self.__process_key_event) -+ self.connect('focus-in', self.__focus_in) -+ # flashing compose sequence in GNOME instead of system bell -+ self.connect('focus-in-id', self.__focus_in_id) -+ self.connect('focus-out', self.__focus_out) -+ self.connect('focus-out-id', self.__focus_out_id) - self.connect('destroy', self.__destroy) - self.connect('page-down', self.__page_down) - self.connect('page-up', self.__page_up) -@@ -1059,13 +1065,10 @@ class Engine(IBus.EngineSimple): - def __rgb(self, r, g, b): - return self.__argb(255, r, g, b) - -- def do_focus_in(self): -- self.do_focus_in_id(None, None) -+ def __focus_in(self, obj): -+ self.__focus_in_id(obj, None, None) - -- def do_focus_out(self): -- self.do_focus_out_id(None) -- -- def do_focus_in_id(self, object_path, client): -+ def __focus_in_id(self, obj, object_path, client): - self.register_properties(self.__prop_list) - self.__refresh_typing_mode_property() - mode = self.__prefs.get_value('common', 'behavior-on-focus-out') -@@ -1077,7 +1080,10 @@ class Engine(IBus.EngineSimple): - if size != self.__lookup_table.get_page_size(): - self.__lookup_table.set_page_size(size) - -- def do_focus_out_id(self, object_path): -+ def __focus_out(self, obj): -+ self.__focus_out_id(obj, None) -+ -+ def __focus_out_id(self, obj, object_path): - if self.__has_input_purpose: - self.__input_purpose = 0 - mode = self.__prefs.get_value('common', 'behavior-on-focus-out') -diff --git a/engine/python3/factory.py b/engine/python3/factory.py -index b7b1e89..ea1d364 100644 ---- a/engine/python3/factory.py -+++ b/engine/python3/factory.py + if (IBus.KEY_exclam <= keyval <= IBus.KEY_asciitilde or +diff --git a/engine/python3/engine.py b/engine/python3/engine.py +index 4b50a01..0858614 100644 +--- a/engine/python3/engine.py ++++ b/engine/python3/engine.py @@ -4,7 +4,7 @@ # ibus-anthy - The Anthy engine for IBus # # Copyright (c) 2007-2008 Peng Huang --# Copyright (c) 2010-2017 Takao Fujiwara -+# Copyright (c) 2010-2025 Takao Fujiwara - # Copyright (c) 2007-2017 Red Hat, Inc. +-# Copyright (c) 2010-2023 Takao Fujiwara ++# Copyright (c) 2010-2024 Takao Fujiwara + # Copyright (c) 2007-2018 Red Hat, Inc. # # This program is free software; you can redistribute it and/or modify -@@ -34,6 +34,7 @@ import engine +@@ -1971,7 +1971,9 @@ class Engine(IBus.EngineSimple): + state & hex_mod_mask == hex_mod_mask: + return True +- if state & (IBus.ModifierType.CONTROL_MASK | IBus.ModifierType.MOD1_MASK): ++ if state & (IBus.ModifierType.CONTROL_MASK | \ ++ IBus.ModifierType.MOD1_MASK | \ ++ IBus.ModifierType.MOD4_MASK): + return False - class EngineFactory(IBus.Factory): -+ __gtype_name__ = 'IBusFactoryAnthy' - FACTORY_PATH = '/com/redhat/IBus/engines/Anthy/Factory' - ENGINE_PATH = '/com/redhat/IBus/engines/Anthy/Engine' - NAME = 'Anthy' + if (IBus.KEY_exclam <= keyval <= IBus.KEY_asciitilde or -- -2.49.0 +2.43.0 -From 7e345f89b574b746fa9e33df3504831ff7553ec9 Mon Sep 17 00:00:00 2001 +From c89a60350b2a949306bf75d64e06a0cde3a7846c Mon Sep 17 00:00:00 2001 From: fujiwarat -Date: Wed, 3 Sep 2025 13:38:15 +0900 -Subject: [PATCH] engine/engine: Use preedit semantic API +Date: Sun, 12 May 2024 13:01:50 +0900 +Subject: [PATCH] tests: Fix CI freeze -ibus_attr_hint_new() API is provided and other ibus_attr_underline_new(), -ibus_attr_foreground_new() and ibus_attr_foreground_new() are deprecated -so that IBus panel or the Wayland panels decide the actual preedit colors -with the current desktop theme. - -BUG=https://github.com/ibus/ibus/pull/2790 +Seems infinit calling g_resources_register_unlocked() happens +in register_lazy_static_resources_unlocked() from +g_resources_lookup_data() when ibus_init() is called after +gtk_init() or gdk_display_open() is called. +It's good to delete ibus_init() here since IBus GTK IM module already +calls it. --- - engine/python3/engine.py | 52 ++++++++++++++++++++++++++++------------ - 1 file changed, 37 insertions(+), 15 deletions(-) + tests/anthytest.py | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) -diff --git a/engine/python3/engine.py b/engine/python3/engine.py -index 5678d18..a0bbc38 100644 ---- a/engine/python3/engine.py -+++ b/engine/python3/engine.py -@@ -152,6 +152,7 @@ class Engine(IBus.EngineSimple): - self.__prop_dict = {} - self.__input_purpose = 0 - self.__has_input_purpose = False -+ self.__has_preedit_format_hint = False - # OSK mode is designed for OSK on gnome-shell, which always shows - # IBus lookup window prior to the preedit and selecting a candidate - # causes the commmit instead of the selection. -@@ -169,6 +170,8 @@ class Engine(IBus.EngineSimple): - except ValueError as e: - printerr('Disable update_preedit_text_with_mode(): %s' % str(e)) - self.__has_update_preedit_text_with_mode = False -+ if hasattr(IBus, 'attr_hint_new'): -+ self.__has_preedit_format_hint = True +diff --git a/tests/anthytest.py b/tests/anthytest.py +index 1d18d19..cf2d6bc 100755 +--- a/tests/anthytest.py ++++ b/tests/anthytest.py +@@ -77,7 +77,13 @@ class AnthyTest(unittest.TestCase): - # self.__lookup_table = ibus.LookupTable.new(page_size=9, - # cursor_pos=0, -@@ -1241,9 +1244,14 @@ class Engine(IBus.EngineSimple): - def __update_input_chars(self): - text, cursor = self.__get_preedit() - attrs = IBus.AttrList() -- attrs.append(IBus.attr_underline_new( -- IBus.AttrUnderline.SINGLE, 0, -- len(text))) -+ if self.__has_preedit_format_hint: -+ attrs.append(IBus.attr_hint_new( -+ IBus.AttrPreedit.WHOLE, 0, -+ len(text))) -+ else: -+ attrs.append(IBus.attr_underline_new( -+ IBus.AttrUnderline.SINGLE, 0, -+ len(text))) - - self.update_preedit(text, - attrs, cursor, not self.__preedit_ja_string.is_empty()) -@@ -1293,12 +1301,18 @@ class Engine(IBus.EngineSimple): - text = text.capitalize() - self.__convert_chars = text - attrs = IBus.AttrList() -- attrs.append(IBus.attr_underline_new( -- IBus.AttrUnderline.SINGLE, 0, len(text))) -- attrs.append(IBus.attr_background_new(self.__rgb(200, 200, 240), -- 0, len(text))) -- attrs.append(IBus.attr_foreground_new(self.__rgb(0, 0, 0), -- 0, len(text))) -+ if self.__has_preedit_format_hint: -+ attrs.append(IBus.attr_hint_new( -+ IBus.AttrPreedit.WHOLE, 0, len(text))) -+ attrs.append(IBus.attr_hint_new( -+ IBus.AttrPreedit.SELECTION, 0, len(text))) -+ else: -+ attrs.append(IBus.attr_underline_new( -+ IBus.AttrUnderline.SINGLE, 0, len(text))) -+ attrs.append(IBus.attr_background_new(self.__rgb(200, 200, 240), -+ 0, len(text))) -+ attrs.append(IBus.attr_foreground_new(self.__rgb(0, 0, 0), -+ 0, len(text))) - self.update_preedit(text, attrs, len(text), True) - - self.update_aux_string('', -@@ -1314,12 +1328,20 @@ class Engine(IBus.EngineSimple): - if i < self.__cursor_pos: - pos += len(text) - attrs = IBus.AttrList() -- attrs.append(IBus.attr_underline_new( -- IBus.AttrUnderline.SINGLE, 0, len(self.__convert_chars))) -- attrs.append(IBus.attr_background_new(self.__rgb(200, 200, 240), -- pos, pos + len(self.__segments[self.__cursor_pos][1]))) -- attrs.append(IBus.attr_foreground_new(self.__rgb(0, 0, 0), -- pos, pos + len(self.__segments[self.__cursor_pos][1]))) -+ if self.__has_preedit_format_hint: -+ attrs.append(IBus.attr_hint_new( -+ IBus.AttrPreedit.WHOLE, 0, len(self.__convert_chars))) -+ attrs.append(IBus.attr_hint_new( -+ IBus.AttrPreedit.SELECTION, -+ pos, -+ pos + len(self.__segments[self.__cursor_pos][1]))) -+ else: -+ attrs.append(IBus.attr_underline_new( -+ IBus.AttrUnderline.SINGLE, 0, len(self.__convert_chars))) -+ attrs.append(IBus.attr_background_new(self.__rgb(200, 200, 240), -+ pos, pos + len(self.__segments[self.__cursor_pos][1]))) -+ attrs.append(IBus.attr_foreground_new(self.__rgb(0, 0, 0), -+ pos, pos + len(self.__segments[self.__cursor_pos][1]))) - self.update_preedit(self.__convert_chars, attrs, pos, True) - aux_string = '( %d / %d )' % (self.__lookup_table.get_cursor_pos() + 1, self.__lookup_table.get_number_of_candidates()) - self.update_aux_string(aux_string, --- -2.50.1 - -From 646ea5d63852477bd902a971952cac777019da09 Mon Sep 17 00:00:00 2001 -From: fujiwarat -Date: Tue, 16 Dec 2025 17:41:21 +0900 -Subject: [PATCH] engine: Fix double IBus.init() - -Calling IBus.init() twice causes a big memory leaks in OpenIndiana -2025.10 which uses IBus 1.5.29. -I have no idea to check the parent Python stack and use inspect module -to fix the double IBus.init(). -Also move ibus_check_version() from engin.py to main.py - -BUG=https://github.com/ibus/ibus-anthy/issues/44 -Fixes: https://github.com/ibus/ibus-anthy/commit/14b2759 ---- - engine/python2/engine.py | 12 ++---------- - engine/python2/main.py | 24 +++++++++++++++++++++++- - engine/python3/engine.py | 12 ++---------- - engine/python3/main.py | 24 +++++++++++++++++++++++- - 4 files changed, 50 insertions(+), 22 deletions(-) - -diff --git a/engine/python2/engine.py b/engine/python2/engine.py -index c7ccd3f..942dd33 100644 ---- a/engine/python2/engine.py -+++ b/engine/python2/engine.py -@@ -28,7 +28,7 @@ import signal - import sys - from gettext import dgettext - --from main import get_userhome -+from main import get_userhome, ibus_check_version - - try: - from locale import getpreferredencoding -@@ -163,7 +163,7 @@ class Engine(IBus.EngineSimple): - self.__is_utf8 = False - self.__has_update_preedit_text_with_mode = True - try: -- self.__ibus_check_version('1.3') -+ ibus_check_version('1.3') - except ValueError as e: - printerr('Disable update_preedit_text_with_mode(): %s' % str(e)) - self.__has_update_preedit_text_with_mode = False -@@ -195,14 +195,6 @@ class Engine(IBus.EngineSimple): - self.__reset() - - -- def __ibus_check_version(self, v): -- major = IBus.MAJOR_VERSION -- minor = IBus.MINOR_VERSION -- micro = IBus.MICRO_VERSION -- if (major, minor, micro) < tuple(map(int, (v.split('.')))): -- raise ValueError('Required ibus %s but version of ibus is ' \ -- '%d.%d.%d' % (v, major, minor, micro)) -- - # http://en.sourceforge.jp/ticket/browse.php?group_id=14&tid=33075 - def __verify_anthy_journal_file(self): - journal = ANTHY_CONFIG_PATH + '/last-record2_default.utf8' -diff --git a/engine/python2/main.py b/engine/python2/main.py -index c1e6a2f..bae2058 100644 ---- a/engine/python2/main.py -+++ b/engine/python2/main.py -@@ -42,11 +42,33 @@ from gi.repository import IBus - - import _config as config - -+ -+def ibus_check_version(v): -+ major = IBus.MAJOR_VERSION -+ minor = IBus.MINOR_VERSION -+ micro = IBus.MICRO_VERSION -+ if (major, minor, micro) < tuple(map(int, (v.split('.')))): -+ raise ValueError('Required ibus %s but version of ibus is ' \ -+ '%d.%d.%d' % (v, major, minor, micro)) -+ -+ - # Need to call IBus.init() before IBus.EngineSimple() is loaded. - # factory -> engine -> IBus.EngineSimple --IBus.init() -+try: -+ # IBus.init() has not been needed here since IBus 1.5.32 -+ ibus_check_version("1.5.32") -+except ValueError: -+ import inspect -+ parent_frame = inspect.currentframe().f_back -+ # Call IBus.init() again from "from main import get_userhome" in engin.py. -+ # The twice IBus.init() issue has been fixed since IBus 1.5.31 by -+ # https://github.com/ibus/ibus/commit/9f50b46 -+ if parent_frame == None: -+ IBus.init() -+ - import factory - -+ - class IMApp: - def __init__(self, exec_by_ibus): - command_line = config.LIBEXECDIR + '/ibus-engine-anthy --ibus' -diff --git a/engine/python3/engine.py b/engine/python3/engine.py -index a0bbc38..4781d42 100644 ---- a/engine/python3/engine.py -+++ b/engine/python3/engine.py -@@ -29,7 +29,7 @@ import signal - import sys - from gettext import dgettext - --from main import get_userhome -+from main import get_userhome, ibus_check_version - - try: - from locale import getpreferredencoding -@@ -166,7 +166,7 @@ class Engine(IBus.EngineSimple): - self.__is_utf8 = False - self.__has_update_preedit_text_with_mode = True - try: -- self.__ibus_check_version('1.3') -+ ibus_check_version('1.3') - except ValueError as e: - printerr('Disable update_preedit_text_with_mode(): %s' % str(e)) - self.__has_update_preedit_text_with_mode = False -@@ -205,14 +205,6 @@ class Engine(IBus.EngineSimple): - self.__reset() - - -- def __ibus_check_version(self, v): -- major = IBus.MAJOR_VERSION -- minor = IBus.MINOR_VERSION -- micro = IBus.MICRO_VERSION -- if (major, minor, micro) < tuple(map(int, (v.split('.')))): -- raise ValueError('Required ibus %s but version of ibus is ' \ -- '%d.%d.%d' % (v, major, minor, micro)) -- - # http://en.sourceforge.jp/ticket/browse.php?group_id=14&tid=33075 - def __verify_anthy_journal_file(self): - journal = ANTHY_CONFIG_PATH + '/last-record2_default.utf8' -diff --git a/engine/python3/main.py b/engine/python3/main.py -index 05836a6..3ab99b2 100644 ---- a/engine/python3/main.py -+++ b/engine/python3/main.py -@@ -42,11 +42,33 @@ from gi.repository import IBus - - import _config as config - -+ -+def ibus_check_version(v): -+ major = IBus.MAJOR_VERSION -+ minor = IBus.MINOR_VERSION -+ micro = IBus.MICRO_VERSION -+ if (major, minor, micro) < tuple(map(int, (v.split('.')))): -+ raise ValueError('Required ibus %s but version of ibus is ' \ -+ '%d.%d.%d' % (v, major, minor, micro)) -+ -+ - # Need to call IBus.init() before IBus.EngineSimple() is loaded. - # factory -> engine -> IBus.EngineSimple --IBus.init() -+try: -+ # IBus.init() has not been needed here since IBus 1.5.32 -+ ibus_check_version("1.5.32") -+except ValueError: -+ import inspect -+ parent_frame = inspect.currentframe().f_back -+ # Call IBus.init() again from "from main import get_userhome" in engin.py. -+ # The twice IBus.init() issue has been fixed since IBus 1.5.31 by -+ # https://github.com/ibus/ibus/commit/9f50b46 -+ if parent_frame == None: -+ IBus.init() -+ - import factory - -+ - class IMApp: - def __init__(self, exec_by_ibus): - command_line = config.LIBEXECDIR + '/ibus-engine-anthy --ibus' --- -2.52.0 - -From 296cd6b8e4e79964b4956953707b315c3dc010da Mon Sep 17 00:00:00 2001 -From: fujiwarat -Date: Mon, 12 Jan 2026 09:49:48 +0900 -Subject: [PATCH] data: Update era.t with 2026 - -Added era.py to update the Era automatically. ---- - data/Makefile.am | 33 +++- - data/era.py | 196 +++++++++++++++++++ - data/era.t | 5 +- - data/era.t.in | 491 +++++++++++++++++++++++++++++++++++++++++++++++ - 4 files changed, 716 insertions(+), 9 deletions(-) - create mode 100755 data/era.py - create mode 100644 data/era.t.in - -diff --git a/data/Makefile.am b/data/Makefile.am -index d76f17a..c13d273 100644 ---- a/data/Makefile.am -+++ b/data/Makefile.am -@@ -2,7 +2,7 @@ - # - # ibus-anthy - The Anthy engine for IBus - # --# Copyright (c) 2010-2021 Takao Fujiwara -+# Copyright (c) 2010-2026 Takao Fujiwara - # Copyright (c) 2010-2018 Red Hat, Inc. - # - # This program is free software; you can redistribute it and/or modify -@@ -19,6 +19,8 @@ - # with this program; if not, write to the Free Software Foundation, Inc., - # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -+noinst_DATA = era.stamp -+ - dicts_DATA = \ - emoji.t \ - era.t \ -@@ -43,6 +45,7 @@ CLEANFILES = \ - $(metainfo_DATA) \ - $(schemas_DATA) \ - emoji.t \ -+ era.stamp \ - $(NULL) - - $(metainfo_DATA): $(metainfo_in_files) Makefile -@@ -79,14 +82,26 @@ zipcode.t: $(ANTHY_ZIPCODE_FILE) - CLEANFILES += zipcode.t - endif - -+era.t: era.stamp -+ -+era.stamp: -+ if test -f $(srcdir)/era.t ; then \ -+ if ! $(srcdir)/era.py --check $(srcdir)/era.t ; then \ -+ rm $(srcdir)/era.t; \ -+ $(srcdir)/era.py $(srcdir)/era.t.in \ -+ --output $(builddir)/era.t; \ -+ echo "Generate era.t"; \ -+ fi; \ -+ fi; \ -+ touch era.stampT; \ -+ mv era.stampT era.stamp; -+ - check: -- S_YEAR=`date '+%Y'`; \ -- M_YEAR=`echo $$S_YEAR | sed 'y/0123456789/0123456789/'`; \ -- grep -q $$M_YEAR $(srcdir)/era.t; \ -- if test $$? -ne 0 ; then \ -- echo "This year $$M_YEAR is not included in era.y"; \ -- exit 1; \ -- fi; -+ if test -f $(srcdir)/era.t ; then \ -+ $(srcdir)/era.py --check $(srcdir)/era.t; \ -+ else \ -+ $(srcdir)/era.py --check $(builddir)/era.t; \ -+ fi - - install-data-hook: - if test -z "$(DESTDIR)"; then \ -@@ -106,6 +121,8 @@ EXTRA_DIST = \ - emoji-each.t \ - emoji-emoji.t \ - era.t \ -+ era.t.in \ -+ era.py \ - oldchar.t \ - symbol.t \ - zipcode-textdic.py \ -diff --git a/data/era.py b/data/era.py -new file mode 100755 -index 0000000..85eb55b ---- /dev/null -+++ b/data/era.py -@@ -0,0 +1,196 @@ -+#!/usr/bin/python3 -+# vim:set et sts=4 sw=4: -+# -*- coding: utf-8 -*- -+# -+# ibus-anthy - The Anthy engine for IBus -+# -+# Copyright (c) 2026 Takao Fujiwara -+# -+# This program is free software; you can redistribute it and/or modify -+# it under the terms of the GNU General Public License as published by -+# the Free Software Foundation; either version 2 of the License, or -+# (at your option) any later version. -+# -+# This program is distributed in the hope that it will be useful, -+# but WITHOUT ANY WARRANTY; without even the implied warranty of -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+# GNU General Public License for more details. -+# -+# You should have received a copy of the GNU General Public License along -+# with this program; if not, write to the Free Software Foundation, Inc., -+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -+ -+from datetime import date -+from os import path -+import getopt -+import locale -+import re -+import sys -+ -+ -+_prgname = "" -+ -+class JapaneseEra(object): -+ VERSION = 1 -+ ERA_FIRST = 2019 -+ HIRAGANA_ERA = 'れいわ' -+ KANJI_ERA = '令和' -+ KANJI_ERA_PREV = '平成' -+ __S_YEAR = 0 -+ __M_YEAR = '' -+ __narrow_to_wide_map = None -+ _check = False -+ _output_file = None -+ _parse_file = None -+ _parse_contents = None -+ -+ def __init__(self): -+ if self._parse_file == None: -+ print("%s.parse_args() should be called before the instance " -+ "is generated." % str(self), file=sys.stderr) -+ sys.exit(1) -+ self.__narrow_to_wide_map = str.maketrans('0123456789', -+ '0123456789') -+ self.__S_YEAR = date.today().year -+ self.__M_YEAR = str(self.__S_YEAR).translate(self.__narrow_to_wide_map) -+ parse_file = open(self._parse_file) -+ self._parse_contents = parse_file.read() -+ parse_file.close() -+ -+ -+ -+ @classmethod -+ def parse_args(cls)->None: -+ -+ shortopt = 'cho:v' -+ longopt = ['check', 'help', 'output=', 'version'] -+ -+ try: -+ opts, args = getopt.gnu_getopt(sys.argv[1:], shortopt, longopt) -+ except getopt.GetoptError as err: -+ cls.print_help(sys.stderr, 1) -+ -+ for o, a in opts: -+ if o in ('-h', '--help'): -+ cls.print_help(sys.stdout) -+ elif o in ('-c', '--check'): -+ cls._check = True -+ elif o in ('-o', '--output'): -+ cls._output_file = a -+ elif o in ('-v', '--version'): -+ print("%s Version %d" % (_prgname, cls.VERSION)) -+ sys.exit(0) -+ else: -+ print('Unknown argument: %s' % o, file=sys.stderr) -+ cls.print_help(sys.stderr, 1) -+ -+ if len(args) == 0: -+ cls.print_help(sys.stderr, 1) -+ cls._parse_file = args[0] -+ -+ -+ @staticmethod -+ def print_help(out, v=0)->None: -+ print("%s [OPTIONS...] ERA_FILE" % _prgname, file=out) -+ print("This replaces @HIRAGANA_TO_LATEST_ERA@ with latest Japanese Era " -+ "in ERA_FILE", -+ file=out) -+ print('OPTIONS', file=out) -+ print('-c, --check Check if the latest Japanese Era in ERA_FILE.', -+ file=out) -+ print('-h, --help Show this message.', file=out) -+ print('-v, --version Show version.', file=out) -+ sys.exit(v) -+ -+ -+ def run(self)->None: -+ if self._check: -+ self.check() -+ else: -+ self.update_file_with_keywords() -+ -+ -+ def check(self)->None: -+ if self._parse_contents == None: -+ assert() -+ pat = r'{}.*'.format(self.__M_YEAR) -+ res = re.findall(pat, self._parse_contents, re.MULTILINE) -+ if res: -+ print(res) -+ else: -+ print("This year {0} is not included in {1}".format( -+ self.__M_YEAR, self._parse_file), file=sys.stderr) -+ sys.exit(1) -+ -+ def update_file_with_keywords(self)->None: -+ if self._parse_contents == None: -+ assert() -+ HIRAGANA_TO_LATEST_ERA = '' -+ YEAR_TO_LATEST_ERA = '' -+ s_n = 1 -+ s_y = self.ERA_FIRST -+ while(s_y <= self.__S_YEAR): -+ m_n = str(s_n).translate(self.__narrow_to_wide_map) -+ m_y = str(s_y).translate(self.__narrow_to_wide_map) -+ HIRAGANA_TO_LATEST_ERA = \ -+"""{0}{1}{2} #T35*500 {3}{4} -+{5}{6} #T35*500 {7} -+""".format(HIRAGANA_TO_LATEST_ERA, -+ self.HIRAGANA_ERA, m_n, -+ self.KANJI_ERA, s_n, -+ self.HIRAGANA_ERA, m_n, -+ s_y) -+ YEAR_TO_LATEST_ERA = \ -+"""{0}{1} #T35*500 {2}{3} -+""".format(YEAR_TO_LATEST_ERA, -+ m_y, -+ self.KANJI_ERA, s_n) -+ s_n = s_n + 1 -+ s_y = s_y + 1 -+ HIRAGANA_TO_LATEST_ERA = HIRAGANA_TO_LATEST_ERA.strip() -+ YEAR_TO_LATEST_ERA = YEAR_TO_LATEST_ERA.strip() -+ tmp = self._parse_contents.replace( -+ '@HIRAGANA_TO_REIWA@', -+ HIRAGANA_TO_LATEST_ERA).replace( -+ '@YEAR_TO_REIWA@', -+ YEAR_TO_LATEST_ERA) -+ s_y = self.ERA_FIRST -+ m_y = str(s_y).translate(self.__narrow_to_wide_map) -+ pat = r'({0} #T35\*500 {1}[0-9]+)\n({2} #T35\*500 {3}1)'.format( -+ m_y, self.KANJI_ERA_PREV, m_y, self.KANJI_ERA) -+ # The lest Era should be first. -+ res = re.sub(pat, r'\2\n\1', tmp) -+ if res: -+ if self._output_file: -+ f = open(self._output_file, mode='w') -+ f.write(res) -+ f.flush() -+ f.close() -+ else: -+ print(res) -+ else: -+ print('Failed to find %s in %s' % (pat, self._parse_file), -+ file=sys.stderr) -+ if self._output_file: -+ f = open(self._output_file, mode='w') -+ f.write(tmp) -+ f.flush() -+ f.close() -+ else: -+ print(tmp) -+ -+ -+def main()->None: -+ try: -+ locale.setlocale(locale.LC_ALL, '') -+ except: + @classmethod + def setUpClass(cls): +- IBus.init() ++ # Already called in ibus/client/gtk3/ibusim.c:im_module_init(). ++ # Otherwise infinit g_resources_register_unlocked() happens in ++ # register_lazy_static_resources_unlocked() ++ # from g_resources_lookup_data() ++ # or IBus.init() could be called before Gdk.Display.open('') is called. ++ #IBus.init() + pass -+ global _prgname -+ _prgname = path.basename(sys.argv[0]) -+ JapaneseEra.parse_args() -+ era = JapaneseEra() -+ era.run() -+ -+ -+if __name__ == '__main__': -+ main() -diff --git a/data/era.t b/data/era.t -index 76a374c..1c07e58 100644 ---- a/data/era.t -+++ b/data/era.t -@@ -2,7 +2,7 @@ - # - # ibus-anthy - The Anthy engine for IBus - # --# Copyright (c) 2010-2025 Takao Fujiwara -+# Copyright (c) 2010-2026 Takao Fujiwara - # Copyright (c) 2010-2013 Red Hat, Inc. - # - # This program is free software; you can redistribute it and/or modify -@@ -346,6 +346,8 @@ - れいわ6 #T35*500 2024 - れいわ7 #T35*500 令和7 - れいわ7 #T35*500 2025 -+れいわ8 #T35*500 令和8 -+れいわ8 #T35*500 2026 - 1868 #T35*500 明治1 - 1869 #T35*500 明治2 - 1870 #T35*500 明治3 -@@ -508,3 +510,4 @@ - 2023 #T35*500 令和5 - 2024 #T35*500 令和6 - 2025 #T35*500 令和7 -+2026 #T35*500 令和8 -diff --git a/data/era.t.in b/data/era.t.in -new file mode 100644 -index 0000000..4881ec2 ---- /dev/null -+++ b/data/era.t.in -@@ -0,0 +1,491 @@ -+# vim:set noet ts=4: -+# -+# ibus-anthy - The Anthy engine for IBus -+# -+# Copyright (c) 2010-2026 Takao Fujiwara -+# Copyright (c) 2010-2013 Red Hat, Inc. -+# -+# This program is free software; you can redistribute it and/or modify -+# it under the terms of the GNU General Public License as published by -+# the Free Software Foundation; either version 2 of the License, or -+# (at your option) any later version. -+# -+# This program is distributed in the hope that it will be useful, -+# but WITHOUT ANY WARRANTY; without even the implied warranty of -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+# GNU General Public License for more details. -+# -+# You should have received a copy of the GNU General Public License along -+# with this program; if not, write to the Free Software Foundation, Inc., -+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -+# -+# This file was imported from im-dict-ja -+# im-dict-ja - Japanese word dictionary set for input method -+# http://github.com/fujiwarat/im-dict-ja -+しょうわ1 #T35*500 昭和1 -+しょうわ1 #T35*500 1926 -+しょうわ10 #T35*500 昭和10 -+しょうわ10 #T35*500 1935 -+しょうわ11 #T35*500 昭和11 -+しょうわ11 #T35*500 1936 -+しょうわ12 #T35*500 昭和12 -+しょうわ12 #T35*500 1937 -+しょうわ13 #T35*500 昭和13 -+しょうわ13 #T35*500 1938 -+しょうわ14 #T35*500 昭和14 -+しょうわ14 #T35*500 1939 -+しょうわ15 #T35*500 昭和15 -+しょうわ15 #T35*500 1940 -+しょうわ16 #T35*500 昭和16 -+しょうわ16 #T35*500 1941 -+しょうわ17 #T35*500 昭和17 -+しょうわ17 #T35*500 1942 -+しょうわ18 #T35*500 昭和18 -+しょうわ18 #T35*500 1943 -+しょうわ19 #T35*500 昭和19 -+しょうわ19 #T35*500 1944 -+しょうわ2 #T35*500 昭和2 -+しょうわ2 #T35*500 1927 -+しょうわ20 #T35*500 昭和20 -+しょうわ20 #T35*500 1945 -+しょうわ21 #T35*500 昭和21 -+しょうわ21 #T35*500 1946 -+しょうわ22 #T35*500 昭和22 -+しょうわ22 #T35*500 1947 -+しょうわ23 #T35*500 昭和23 -+しょうわ23 #T35*500 1948 -+しょうわ24 #T35*500 昭和24 -+しょうわ24 #T35*500 1949 -+しょうわ25 #T35*500 昭和25 -+しょうわ25 #T35*500 1950 -+しょうわ26 #T35*500 昭和26 -+しょうわ26 #T35*500 1951 -+しょうわ27 #T35*500 昭和27 -+しょうわ27 #T35*500 1952 -+しょうわ28 #T35*500 昭和28 -+しょうわ28 #T35*500 1953 -+しょうわ29 #T35*500 昭和29 -+しょうわ29 #T35*500 1954 -+しょうわ3 #T35*500 昭和3 -+しょうわ3 #T35*500 1928 -+しょうわ30 #T35*500 昭和30 -+しょうわ30 #T35*500 1955 -+しょうわ31 #T35*500 昭和31 -+しょうわ31 #T35*500 1956 -+しょうわ32 #T35*500 昭和32 -+しょうわ32 #T35*500 1957 -+しょうわ33 #T35*500 昭和33 -+しょうわ33 #T35*500 1958 -+しょうわ34 #T35*500 昭和34 -+しょうわ34 #T35*500 1959 -+しょうわ35 #T35*500 昭和35 -+しょうわ35 #T35*500 1960 -+しょうわ36 #T35*500 昭和36 -+しょうわ36 #T35*500 1961 -+しょうわ37 #T35*500 昭和37 -+しょうわ37 #T35*500 1962 -+しょうわ38 #T35*500 昭和38 -+しょうわ38 #T35*500 1963 -+しょうわ39 #T35*500 昭和39 -+しょうわ39 #T35*500 1964 -+しょうわ4 #T35*500 昭和4 -+しょうわ4 #T35*500 1929 -+しょうわ40 #T35*500 昭和40 -+しょうわ40 #T35*500 1965 -+しょうわ41 #T35*500 昭和41 -+しょうわ41 #T35*500 1966 -+しょうわ42 #T35*500 昭和42 -+しょうわ42 #T35*500 1967 -+しょうわ43 #T35*500 昭和43 -+しょうわ43 #T35*500 1968 -+しょうわ44 #T35*500 昭和44 -+しょうわ44 #T35*500 1969 -+しょうわ45 #T35*500 昭和45 -+しょうわ45 #T35*500 1970 -+しょうわ46 #T35*500 昭和46 -+しょうわ46 #T35*500 1971 -+しょうわ47 #T35*500 昭和47 -+しょうわ47 #T35*500 1972 -+しょうわ48 #T35*500 昭和48 -+しょうわ48 #T35*500 1973 -+しょうわ49 #T35*500 昭和49 -+しょうわ49 #T35*500 1974 -+しょうわ5 #T35*500 昭和5 -+しょうわ5 #T35*500 1930 -+しょうわ50 #T35*500 昭和50 -+しょうわ50 #T35*500 1975 -+しょうわ51 #T35*500 昭和51 -+しょうわ51 #T35*500 1976 -+しょうわ52 #T35*500 昭和52 -+しょうわ52 #T35*500 1977 -+しょうわ53 #T35*500 昭和53 -+しょうわ53 #T35*500 1978 -+しょうわ54 #T35*500 昭和54 -+しょうわ54 #T35*500 1979 -+しょうわ55 #T35*500 昭和55 -+しょうわ55 #T35*500 1980 -+しょうわ56 #T35*500 昭和56 -+しょうわ56 #T35*500 1981 -+しょうわ57 #T35*500 昭和57 -+しょうわ57 #T35*500 1982 -+しょうわ58 #T35*500 昭和58 -+しょうわ58 #T35*500 1983 -+しょうわ59 #T35*500 昭和59 -+しょうわ59 #T35*500 1984 -+しょうわ6 #T35*500 昭和6 -+しょうわ6 #T35*500 1931 -+しょうわ60 #T35*500 昭和60 -+しょうわ60 #T35*500 1985 -+しょうわ61 #T35*500 昭和61 -+しょうわ61 #T35*500 1986 -+しょうわ62 #T35*500 昭和62 -+しょうわ62 #T35*500 1987 -+しょうわ63 #T35*500 昭和63 -+しょうわ63 #T35*500 1988 -+しょうわ64 #T35*500 昭和64 -+しょうわ64 #T35*500 1989 -+しょうわ7 #T35*500 昭和7 -+しょうわ7 #T35*500 1932 -+しょうわ8 #T35*500 昭和8 -+しょうわ8 #T35*500 1933 -+しょうわ9 #T35*500 昭和9 -+しょうわ9 #T35*500 1934 -+たいしょう1 #T35*500 大正1 -+たいしょう1 #T35*500 1912 -+たいしょう10 #T35*500 大正10 -+たいしょう10 #T35*500 1921 -+たいしょう11 #T35*500 大正11 -+たいしょう11 #T35*500 1922 -+たいしょう12 #T35*500 大正12 -+たいしょう12 #T35*500 1923 -+たいしょう13 #T35*500 大正13 -+たいしょう13 #T35*500 1924 -+たいしょう14 #T35*500 大正14 -+たいしょう14 #T35*500 1925 -+たいしょう15 #T35*500 大正15 -+たいしょう15 #T35*500 1926 -+たいしょう2 #T35*500 大正2 -+たいしょう2 #T35*500 1913 -+たいしょう3 #T35*500 大正3 -+たいしょう3 #T35*500 1914 -+たいしょう4 #T35*500 大正4 -+たいしょう4 #T35*500 1915 -+たいしょう5 #T35*500 大正5 -+たいしょう5 #T35*500 1916 -+たいしょう6 #T35*500 大正6 -+たいしょう6 #T35*500 1917 -+たいしょう7 #T35*500 大正7 -+たいしょう7 #T35*500 1918 -+たいしょう8 #T35*500 大正8 -+たいしょう8 #T35*500 1919 -+たいしょう9 #T35*500 大正9 -+たいしょう9 #T35*500 1920 -+へいせい1 #T35*500 平成1 -+へいせい1 #T35*500 1989 -+へいせい10 #T35*500 平成10 -+へいせい10 #T35*500 1998 -+へいせい11 #T35*500 平成11 -+へいせい11 #T35*500 1999 -+へいせい12 #T35*500 平成12 -+へいせい12 #T35*500 2000 -+へいせい13 #T35*500 平成13 -+へいせい13 #T35*500 2001 -+へいせい14 #T35*500 平成14 -+へいせい14 #T35*500 2002 -+へいせい15 #T35*500 平成15 -+へいせい15 #T35*500 2003 -+へいせい16 #T35*500 平成16 -+へいせい16 #T35*500 2004 -+へいせい17 #T35*500 平成17 -+へいせい17 #T35*500 2005 -+へいせい18 #T35*500 平成18 -+へいせい18 #T35*500 2006 -+へいせい19 #T35*500 平成19 -+へいせい19 #T35*500 2007 -+へいせい2 #T35*500 平成2 -+へいせい2 #T35*500 1990 -+へいせい20 #T35*500 平成20 -+へいせい20 #T35*500 2008 -+へいせい21 #T35*500 平成21 -+へいせい21 #T35*500 2009 -+へいせい22 #T35*500 平成22 -+へいせい22 #T35*500 2010 -+へいせい23 #T35*500 平成23 -+へいせい23 #T35*500 2011 -+へいせい24 #T35*500 平成24 -+へいせい24 #T35*500 2012 -+へいせい25 #T35*500 平成25 -+へいせい25 #T35*500 2013 -+へいせい26 #T35*500 平成26 -+へいせい26 #T35*500 2014 -+へいせい27 #T35*500 平成27 -+へいせい27 #T35*500 2015 -+へいせい28 #T35*500 平成28 -+へいせい28 #T35*500 2016 -+へいせい29 #T35*500 平成29 -+へいせい29 #T35*500 2017 -+へいせい3 #T35*500 平成3 -+へいせい3 #T35*500 1991 -+へいせい30 #T35*500 平成30 -+へいせい30 #T35*500 2018 -+へいせい31 #T35*500 平成31 -+へいせい31 #T35*500 2019 -+へいせい4 #T35*500 平成4 -+へいせい4 #T35*500 1992 -+へいせい5 #T35*500 平成5 -+へいせい5 #T35*500 1993 -+へいせい6 #T35*500 平成6 -+へいせい6 #T35*500 1994 -+へいせい7 #T35*500 平成7 -+へいせい7 #T35*500 1995 -+へいせい8 #T35*500 平成8 -+へいせい8 #T35*500 1996 -+へいせい9 #T35*500 平成9 -+へいせい9 #T35*500 1997 -+めいじ1 #T35*500 明治1 -+めいじ1 #T35*500 1868 -+めいじ10 #T35*500 明治10 -+めいじ10 #T35*500 1877 -+めいじ11 #T35*500 明治11 -+めいじ11 #T35*500 1878 -+めいじ12 #T35*500 明治12 -+めいじ12 #T35*500 1879 -+めいじ13 #T35*500 明治13 -+めいじ13 #T35*500 1880 -+めいじ14 #T35*500 明治14 -+めいじ14 #T35*500 1881 -+めいじ15 #T35*500 明治15 -+めいじ15 #T35*500 1882 -+めいじ16 #T35*500 明治16 -+めいじ16 #T35*500 1883 -+めいじ17 #T35*500 明治17 -+めいじ17 #T35*500 1884 -+めいじ18 #T35*500 明治18 -+めいじ18 #T35*500 1885 -+めいじ19 #T35*500 明治19 -+めいじ19 #T35*500 1886 -+めいじ2 #T35*500 明治2 -+めいじ2 #T35*500 1869 -+めいじ20 #T35*500 明治20 -+めいじ20 #T35*500 1887 -+めいじ21 #T35*500 明治21 -+めいじ21 #T35*500 1888 -+めいじ22 #T35*500 明治22 -+めいじ22 #T35*500 1889 -+めいじ23 #T35*500 明治23 -+めいじ23 #T35*500 1890 -+めいじ24 #T35*500 明治24 -+めいじ24 #T35*500 1891 -+めいじ25 #T35*500 明治25 -+めいじ25 #T35*500 1892 -+めいじ26 #T35*500 明治26 -+めいじ26 #T35*500 1893 -+めいじ27 #T35*500 明治27 -+めいじ27 #T35*500 1894 -+めいじ28 #T35*500 明治28 -+めいじ28 #T35*500 1895 -+めいじ29 #T35*500 明治29 -+めいじ29 #T35*500 1896 -+めいじ3 #T35*500 明治3 -+めいじ3 #T35*500 1870 -+めいじ30 #T35*500 明治30 -+めいじ30 #T35*500 1897 -+めいじ31 #T35*500 明治31 -+めいじ31 #T35*500 1898 -+めいじ32 #T35*500 明治32 -+めいじ32 #T35*500 1899 -+めいじ33 #T35*500 明治33 -+めいじ33 #T35*500 1900 -+めいじ34 #T35*500 明治34 -+めいじ34 #T35*500 1901 -+めいじ35 #T35*500 明治35 -+めいじ35 #T35*500 1902 -+めいじ36 #T35*500 明治36 -+めいじ36 #T35*500 1903 -+めいじ37 #T35*500 明治37 -+めいじ37 #T35*500 1904 -+めいじ38 #T35*500 明治38 -+めいじ38 #T35*500 1905 -+めいじ39 #T35*500 明治39 -+めいじ39 #T35*500 1906 -+めいじ4 #T35*500 明治4 -+めいじ4 #T35*500 1871 -+めいじ40 #T35*500 明治40 -+めいじ40 #T35*500 1907 -+めいじ41 #T35*500 明治41 -+めいじ41 #T35*500 1908 -+めいじ42 #T35*500 明治42 -+めいじ42 #T35*500 1909 -+めいじ43 #T35*500 明治43 -+めいじ43 #T35*500 1910 -+めいじ44 #T35*500 明治44 -+めいじ44 #T35*500 1911 -+めいじ45 #T35*500 明治45 -+めいじ45 #T35*500 1912 -+めいじ5 #T35*500 明治5 -+めいじ5 #T35*500 1872 -+めいじ6 #T35*500 明治6 -+めいじ6 #T35*500 1873 -+めいじ7 #T35*500 明治7 -+めいじ7 #T35*500 1874 -+めいじ8 #T35*500 明治8 -+めいじ8 #T35*500 1875 -+めいじ9 #T35*500 明治9 -+めいじ9 #T35*500 1876 -+@HIRAGANA_TO_REIWA@ -+1868 #T35*500 明治1 -+1869 #T35*500 明治2 -+1870 #T35*500 明治3 -+1871 #T35*500 明治4 -+1872 #T35*500 明治5 -+1873 #T35*500 明治6 -+1874 #T35*500 明治7 -+1875 #T35*500 明治8 -+1876 #T35*500 明治9 -+1877 #T35*500 明治10 -+1878 #T35*500 明治11 -+1879 #T35*500 明治12 -+1880 #T35*500 明治13 -+1881 #T35*500 明治14 -+1882 #T35*500 明治15 -+1883 #T35*500 明治16 -+1884 #T35*500 明治17 -+1885 #T35*500 明治18 -+1886 #T35*500 明治19 -+1887 #T35*500 明治20 -+1888 #T35*500 明治21 -+1889 #T35*500 明治22 -+1890 #T35*500 明治23 -+1891 #T35*500 明治24 -+1892 #T35*500 明治25 -+1893 #T35*500 明治26 -+1894 #T35*500 明治27 -+1895 #T35*500 明治28 -+1896 #T35*500 明治29 -+1897 #T35*500 明治30 -+1898 #T35*500 明治31 -+1899 #T35*500 明治32 -+1900 #T35*500 明治33 -+1901 #T35*500 明治34 -+1902 #T35*500 明治35 -+1903 #T35*500 明治36 -+1904 #T35*500 明治37 -+1905 #T35*500 明治38 -+1906 #T35*500 明治39 -+1907 #T35*500 明治40 -+1908 #T35*500 明治41 -+1909 #T35*500 明治42 -+1910 #T35*500 明治43 -+1911 #T35*500 明治44 -+1912 #T35*500 大正1 -+1912 #T35*500 明治45 -+1913 #T35*500 大正2 -+1914 #T35*500 大正3 -+1915 #T35*500 大正4 -+1916 #T35*500 大正5 -+1917 #T35*500 大正6 -+1918 #T35*500 大正7 -+1919 #T35*500 大正8 -+1920 #T35*500 大正9 -+1921 #T35*500 大正10 -+1922 #T35*500 大正11 -+1923 #T35*500 大正12 -+1924 #T35*500 大正13 -+1925 #T35*500 大正14 -+1926 #T35*500 昭和1 -+1926 #T35*500 大正15 -+1927 #T35*500 昭和2 -+1928 #T35*500 昭和3 -+1929 #T35*500 昭和4 -+1930 #T35*500 昭和5 -+1931 #T35*500 昭和6 -+1932 #T35*500 昭和7 -+1933 #T35*500 昭和8 -+1934 #T35*500 昭和9 -+1935 #T35*500 昭和10 -+1936 #T35*500 昭和11 -+1937 #T35*500 昭和12 -+1938 #T35*500 昭和13 -+1939 #T35*500 昭和14 -+1940 #T35*500 昭和15 -+1941 #T35*500 昭和16 -+1942 #T35*500 昭和17 -+1943 #T35*500 昭和18 -+1944 #T35*500 昭和19 -+1945 #T35*500 昭和20 -+1946 #T35*500 昭和21 -+1947 #T35*500 昭和22 -+1948 #T35*500 昭和23 -+1949 #T35*500 昭和24 -+1950 #T35*500 昭和25 -+1951 #T35*500 昭和26 -+1952 #T35*500 昭和27 -+1953 #T35*500 昭和28 -+1954 #T35*500 昭和29 -+1955 #T35*500 昭和30 -+1956 #T35*500 昭和31 -+1957 #T35*500 昭和32 -+1958 #T35*500 昭和33 -+1959 #T35*500 昭和34 -+1960 #T35*500 昭和35 -+1961 #T35*500 昭和36 -+1962 #T35*500 昭和37 -+1963 #T35*500 昭和38 -+1964 #T35*500 昭和39 -+1965 #T35*500 昭和40 -+1966 #T35*500 昭和41 -+1967 #T35*500 昭和42 -+1968 #T35*500 昭和43 -+1969 #T35*500 昭和44 -+1970 #T35*500 昭和45 -+1971 #T35*500 昭和46 -+1972 #T35*500 昭和47 -+1973 #T35*500 昭和48 -+1974 #T35*500 昭和49 -+1975 #T35*500 昭和50 -+1976 #T35*500 昭和51 -+1977 #T35*500 昭和52 -+1978 #T35*500 昭和53 -+1979 #T35*500 昭和54 -+1980 #T35*500 昭和55 -+1981 #T35*500 昭和56 -+1982 #T35*500 昭和57 -+1983 #T35*500 昭和58 -+1984 #T35*500 昭和59 -+1985 #T35*500 昭和60 -+1986 #T35*500 昭和61 -+1987 #T35*500 昭和62 -+1988 #T35*500 昭和63 -+1989 #T35*500 平成1 -+1989 #T35*500 昭和64 -+1990 #T35*500 平成2 -+1991 #T35*500 平成3 -+1992 #T35*500 平成4 -+1993 #T35*500 平成5 -+1994 #T35*500 平成6 -+1995 #T35*500 平成7 -+1996 #T35*500 平成8 -+1997 #T35*500 平成9 -+1998 #T35*500 平成10 -+1999 #T35*500 平成11 -+2000 #T35*500 平成12 -+2001 #T35*500 平成13 -+2002 #T35*500 平成14 -+2003 #T35*500 平成15 -+2004 #T35*500 平成16 -+2005 #T35*500 平成17 -+2006 #T35*500 平成18 -+2007 #T35*500 平成19 -+2008 #T35*500 平成20 -+2009 #T35*500 平成21 -+2010 #T35*500 平成22 -+2011 #T35*500 平成23 -+2012 #T35*500 平成24 -+2013 #T35*500 平成25 -+2014 #T35*500 平成26 -+2015 #T35*500 平成27 -+2016 #T35*500 平成28 -+2017 #T35*500 平成29 -+2018 #T35*500 平成30 -+2019 #T35*500 平成31 -+@YEAR_TO_REIWA@ + + def setUp(self): + self.__id = 0 -- -2.52.0 +2.45.0 diff --git a/ibus-anthy.spec b/ibus-anthy.spec index f9255d7..22eee58 100644 --- a/ibus-anthy.spec +++ b/ibus-anthy.spec @@ -17,13 +17,12 @@ %endif Name: ibus-anthy -Version: 1.5.17 +Version: 1.5.16 Release: %autorelease Summary: The Anthy engine for IBus input platform License: GPL-2.0-or-later URL: https://github.com/ibus/ibus/wiki -Source0: https://github.com/ibus/%{name}/releases/download/%{version}/%{name}-%{version}.tar.gz -Source1: https://github.com/ibus/%{name}/releases/download/%{version}/%{name}-%{version}.tar.gz.sum#/%{name}.tar.gz.sum +Source0: https://github.com/ibus/ibus-anthy/releases/download/%{version}/%{name}-%{version}.tar.gz # Upstreamed patches. # Patch0: %%{name}-HEAD.patch @@ -89,16 +88,10 @@ the functionality of the installed %{name} package. %prep -SAVED_SUM=$(grep sha512sum %SOURCE1 | awk '{print $2}') -MY_SUM=$(sha512sum %SOURCE0 | awk '{print $1}') -if test x"$SAVED_SUM" != x"$MY_SUM" ; then - abort -fi %autosetup -S git %build #autoreconf -f -i -v -autoreconf -f -i -v %configure \ %if %have_default_layout --with-layout='default' \ @@ -110,6 +103,7 @@ autoreconf -f -i -v --with-kasumi-exec=/usr/bin/kasumi-unicode \ %endif --with-on-off-keys="'Zenkaku_Hankaku', 'Ctrl+space', 'Ctrl+J'" \ + --with-python=python3 \ --enable-installed-tests \ --disable-static # make -C po update-gmo diff --git a/ibus-anthy.tar.gz.sum b/ibus-anthy.tar.gz.sum deleted file mode 100644 index cc21697..0000000 --- a/ibus-anthy.tar.gz.sum +++ /dev/null @@ -1,4 +0,0 @@ -cksum 1682900558 914700 ibus-anthy-1.5.17.tar.gz -sha1sum 7935a5abc2a1cb4dd59ff9295d3582bdb1f0cc83 ibus-anthy-1.5.17.tar.gz -sha256sum 9e1d28ad7da2be5e0d9c0eb0d8fb7557fc89770aa2237272debe197bd61abd40 ibus-anthy-1.5.17.tar.gz -sha512sum 34775879ea4891d2f83c5f9aa341a59bac928332ad60ec4ba8d1475783b0c50c721229e48c7671f050066da3d4053531792c3fa5e5640db2c2e8bd1bc46105a1 ibus-anthy-1.5.17.tar.gz diff --git a/plans/test.fmf b/plans/test.fmf deleted file mode 100644 index c1627f9..0000000 --- a/plans/test.fmf +++ /dev/null @@ -1,5 +0,0 @@ -summary: Basic smoke test -discover: - how: fmf -execute: - how: tmt diff --git a/sources b/sources index 6c6f368..012042b 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (ibus-anthy-1.5.17.tar.gz) = 34775879ea4891d2f83c5f9aa341a59bac928332ad60ec4ba8d1475783b0c50c721229e48c7671f050066da3d4053531792c3fa5e5640db2c2e8bd1bc46105a1 +SHA512 (ibus-anthy-1.5.16.tar.gz) = d1a7b9da402d85af955f96fd8618189fb2e682763f57b5d6b54e7bcf052138ba300f4ba8130a4ac0e8e1e8821319e9b6360e57568c84c1f9845438174e51a959 diff --git a/tests/ibus-desktop-testing/install1-common/main.fmf b/tests/ibus-desktop-testing/install1-common/main.fmf deleted file mode 100644 index b920b02..0000000 --- a/tests/ibus-desktop-testing/install1-common/main.fmf +++ /dev/null @@ -1,90 +0,0 @@ -summary: Install common GNOME desktop components -description: - The listed packages are installed commonly between Fedora and - RHEL GNOME desktop components. -require: - # IBus CI sets - - ibus - - ibus-desktop-testing - - dbus-x11 - # https://pagure.io/fedora-comps/blob/main/f/comps-f41.xml.in - # dnf group info GNOME - # base-graphical mandatory - - mesa-dri-drivers - - mesa-vulkan-drivers - - plymouth-system-theme - # fonts default - - default-fonts-cjk-mono - - default-fonts-cjk-sans - - default-fonts-cjk-serif - - default-fonts-core-emoji - - default-fonts-core-math - - default-fonts-core-mono - - default-fonts-core-sans - - default-fonts-core-serif - - default-fonts-other-mono - - default-fonts-other-sans - - default-fonts-other-serif - # gnome-desktop mandatory - - dconf - - gdm - - gnome-connections - - gnome-control-center - - gnome-initial-setup - - gnome-session-wayland-session - - gnome-settings-daemon - - gnome-shell - - gnome-software - - gnome-text-editor - - nautilus - - polkit - - ptyxis - # gnome-desktop default - - avahi - - baobab - # Sometimes version mismatch with gnome-shell in rawhide - #- chrome-gnome-shell - - fprintd-pam - - glib-networking - - gnome-bluetooth - - gnome-browser-connector - - gnome-calculator - - gnome-calendar - - gnome-characters - - gnome-classic-session - - gnome-clocks - - gnome-color-manager - - gnome-disk-utility - - gnome-epub-thumbnailer - - gnome-font-viewer - - gnome-remote-desktop - - gnome-system-monitor - - gnome-user-docs - - gvfs-goa - - gvfs-mtp - - librsvg2 - - libsane-hpaio - - loupe - - mesa-dri-drivers - - mesa-libEGL - - ModemManager - - NetworkManager-adsl - - NetworkManager-ppp - - NetworkManager-wwan - - PackageKit-command-not-found - - PackageKit-gtk3-module - - sane-backends-drivers-scanners - - snapshot - # Move systemd-oomd-defaults to Post-Installing section - - tracker - - tracker-miners - - xdg-desktop-portal - - xdg-desktop-portal-gnome - - xdg-desktop-portal-gtk - - xdg-user-dirs-gtk - # desktop-accessibility default - - at-spi2-atk - - at-spi2-core - - brltty - - orca - - speech-dispatcher diff --git a/tests/ibus-desktop-testing/install2-fedora/main.fmf b/tests/ibus-desktop-testing/install2-fedora/main.fmf deleted file mode 100644 index 9bf4560..0000000 --- a/tests/ibus-desktop-testing/install2-fedora/main.fmf +++ /dev/null @@ -1,39 +0,0 @@ -summary: Install Fedora specific GNOME desktop components -description: - The listed packages are available in Fedora only. -enabled: false -adjust: - when: distro == fedora - enabled: true -require: - - adobe-source-code-pro-fonts - - gnome-screenshot - - gnome-boxes - - yelp - - cheese - - eog - - evince - - evince-djvu - - gnome-backgrounds - - gnome-contacts - - gnome-logs - - gnome-maps - - gnome-photos - - gnome-themes-extra - - gnome-user-share - - gnome-weather - - gvfs-afc - - gvfs-afp - - gvfs-archive - - gvfs-fuse - - gvfs-gphoto2 - - gvfs-smb - - NetworkManager-openconnect-gnome - - NetworkManager-openvpn-gnome - - NetworkManager-pptp-gnome - - NetworkManager-ssh-gnome - - NetworkManager-vpnc-gnome - - rygel - - simple-scan - - sushi - - totem diff --git a/tests/ibus-desktop-testing/install3-rhel/main.fmf b/tests/ibus-desktop-testing/install3-rhel/main.fmf deleted file mode 100644 index 342507c..0000000 --- a/tests/ibus-desktop-testing/install3-rhel/main.fmf +++ /dev/null @@ -1,7 +0,0 @@ -summary: Install RHEL specific GNOME desktop components -description: - Currently no specific packages for RHEL. -enabled: false -adjust: - when: distro != fedora - enabled: true diff --git a/tests/ibus-desktop-testing/install4-g-d-t/main.fmf b/tests/ibus-desktop-testing/install4-g-d-t/main.fmf deleted file mode 100644 index cfd4fd7..0000000 --- a/tests/ibus-desktop-testing/install4-g-d-t/main.fmf +++ /dev/null @@ -1,6 +0,0 @@ -summary: Install GNOME installed-tests testing harness -description: - gnome-desktop-testing package is required by IBus CI(ibus-desktop-testing) - and it's available in Fedora only at present. -require: - - gnome-desktop-testing diff --git a/tests/ibus-desktop-testing/install5-tmt/main.fmf b/tests/ibus-desktop-testing/install5-tmt/main.fmf deleted file mode 100644 index 332864f..0000000 --- a/tests/ibus-desktop-testing/install5-tmt/main.fmf +++ /dev/null @@ -1,5 +0,0 @@ -summary: Install TMT packages -description: - The test script is calling the beakerlib script. -require: - - beakerlib diff --git a/tests/ibus-desktop-testing/install6-ibus-anthy/main.fmf b/tests/ibus-desktop-testing/install6-ibus-anthy/main.fmf deleted file mode 100644 index 0443fd1..0000000 --- a/tests/ibus-desktop-testing/install6-ibus-anthy/main.fmf +++ /dev/null @@ -1,6 +0,0 @@ -summary: Install ibus-anthy specific packages -description: - The listed packages are required by CI of ibus-anthy. -require: - - ibus-anthy-tests - - glibc-langpack-ja diff --git a/tests/ibus-desktop-testing/main.fmf b/tests/ibus-desktop-testing/main.fmf deleted file mode 100644 index b4d0642..0000000 --- a/tests/ibus-desktop-testing/main.fmf +++ /dev/null @@ -1,3 +0,0 @@ -summary: gnome-desktop-testing tests -# common test for sub tests -test: env diff --git a/tests/ibus-desktop-testing/run/main.fmf b/tests/ibus-desktop-testing/run/main.fmf deleted file mode 100644 index d2434b1..0000000 --- a/tests/ibus-desktop-testing/run/main.fmf +++ /dev/null @@ -1,5 +0,0 @@ -summary: Run tests -description: - Run CI with ibus-desktop-testing-runner in GNOME Wayland. -duration: 15m -test: ./test.sh diff --git a/tests/ibus-desktop-testing/run/test.sh b/tests/ibus-desktop-testing/run/test.sh deleted file mode 100755 index d53faf5..0000000 --- a/tests/ibus-desktop-testing/run/test.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash -# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k -. /usr/share/beakerlib/beakerlib.sh || exit 1 - -rlJournalStart - rlPhaseStartTest - rlRun -t "/usr/bin/ibus-desktop-testing-runner --runner gnome --tests ibus-anthy --no-graphics --lang ja_JP.UTF-8" - rlPhaseEnd - rlPhaseStartCleanup - rlRun "echo test-suite.log" - rlRun "cat test-suite.log" - rlRun "echo /export/home/itestuser/test-autostart.log" - rlRun "cat /export/home/itestuser/test-autostart.log" - rlPhaseEnd -rlJournalEnd diff --git a/tests/main.fmt b/tests/main.fmt deleted file mode 100644 index e89cb45..0000000 --- a/tests/main.fmt +++ /dev/null @@ -1 +0,0 @@ -contact: Takao Fujiwara diff --git a/tests/roles/ibus-desktop-testing-role/defaults/main.yml b/tests/roles/ibus-desktop-testing-role/defaults/main.yml new file mode 100644 index 0000000..8ff7991 --- /dev/null +++ b/tests/roles/ibus-desktop-testing-role/defaults/main.yml @@ -0,0 +1,3 @@ +role_pkgs_req: + - rsync + - xorg-x11-server-Xvfb diff --git a/tests/roles/ibus-desktop-testing-role/files/check-results.sh b/tests/roles/ibus-desktop-testing-role/files/check-results.sh new file mode 100755 index 0000000..8a46118 --- /dev/null +++ b/tests/roles/ibus-desktop-testing-role/files/check-results.sh @@ -0,0 +1,69 @@ +#!/bin/bash + +TEST_LOG="test.log" +TEST_RUN_IN_RAWHIDE=1 + +declare -i TEST_RUN_IN_RAWHIDE + +if [ $# -gt 0 ] ; then + TEST_LOG="$1" + TEST_RUN_IN_RAWHIDE=$2 +fi + +gen_results() +{ + TEST_RUNTIME="$1" + TEST_STATUS="$2" + TEST_STATUS_UPPER="$(echo "$TEST_STATUS" | tr '[:lower:]' '[:upper:]')" + cat > results.xml << _EOF +results: +- test: results + result: $TEST_STATUS + runtime: $TEST_RUNTIME + logs: + - ${TEST_STATUS_UPPER}-str_results.log + +_EOF + + DIR=$(dirname "$TEST_LOG") + if [ x"$TEST_LOG" != x ] ; then + cp "$TEST_LOG" "$DIR/${TEST_STATUS_UPPER}-str_results.log" + else + touch "$DIR/${TEST_STATUS_UPPER}-str_results.log" + fi + if [ x"$DIR" != x. ] ; then + mv results.xml "$DIR" + fi +} + +if [ $TEST_RUN_IN_RAWHIDE -eq 0 ] ; then + IS_RAWHIDE="$(grep -i rawhide /etc/fedora-release)" + if [ x"$IS_RAWHIDE" != x ] ; then + gen_results "0" "pass" + echo -n PASS + exit 0 + fi +fi +if [ ! -f $TEST_LOG ] ; then + gen_results "0" "fail" + echo -n ERROR +else + FAIL="$(grep "^FAIL: " $TEST_LOG | grep -v 'FAIL: 0$')" + RUNTIME_FAIL="$(grep -v 'frame' $TEST_LOG | grep "^FAIL: " | sed -e "s/FAIL: //")" + RUNTIME_PASS="$(grep -v 'frame' $TEST_LOG | grep "^PASS: " | sed -e "s/PASS: //")" + if [ x"$RUNTIME_FAIL" = x ] ; then + RUNTIME_FAIL="0" + fi + if [ x"$RUNTIME_PASS" = x ] ; then + RUNTIME_PASS="0" + fi + RUNTIME="$(expr $RUNTIME_FAIL + $RUNTIME_PASS)" + if [ x"$FAIL" != x ] ; then + gen_results "$RUNTIME" "fail" + echo -n ERROR + else + gen_results "$RUNTIME" "pass" + echo -n PASS + fi +fi + diff --git a/tests/roles/ibus-desktop-testing-role/meta/main.yml b/tests/roles/ibus-desktop-testing-role/meta/main.yml new file mode 100644 index 0000000..6626402 --- /dev/null +++ b/tests/roles/ibus-desktop-testing-role/meta/main.yml @@ -0,0 +1,4 @@ +--- + +dependencies: + - role: str-common-init diff --git a/tests/roles/ibus-desktop-testing-role/tasks/main.yml b/tests/roles/ibus-desktop-testing-role/tasks/main.yml new file mode 100644 index 0000000..753384d --- /dev/null +++ b/tests/roles/ibus-desktop-testing-role/tasks/main.yml @@ -0,0 +1,221 @@ +--- +- name: Check if Fedora desktop + register: fedora_desktop + stat: + path: "/etc/fedora-release" + +- name: Build and install GNOME installed-tests testing harness + block: + - name: Installing common GNOME desktop components + package: + name: + # IBus CI sets + - xorg-x11-server-Xvfb + - ibus + - ibus-desktop-testing + - dbus-x11 + # https://pagure.io/fedora-comps/blob/main/f/comps-f38.xml.in + # dnf group info GNOME + # mandatory + - dconf + - gdm + - gnome-connections + - gnome-control-center + - gnome-initial-setup + - gnome-session-wayland-session + - gnome-session-xsession + - gnome-settings-daemon + - gnome-shell + - gnome-software + - gnome-terminal + - gnome-text-editor + - nautilus + - polkit + # default + - adobe-source-code-pro-fonts + - at-spi2-atk + - at-spi2-core + - avahi + - baobab + # Sometimes version mismatch with gnome-shell in rawhide + #- chrome-gnome-shell + - evince + - fprintd-pam + - glib-networking + - gnome-bluetooth + - gnome-calculator + - gnome-characters + - gnome-classic-session + - gnome-clocks + - gnome-color-manager + - gnome-disk-utility + - gnome-font-viewer + - gnome-logs + - gnome-remote-desktop + - gnome-system-monitor + - gnome-terminal-nautilus + - gnome-user-docs + - gvfs-fuse + - gvfs-goa + - gvfs-gphoto2 + - gvfs-mtp + - gvfs-smb + - libcanberra-gtk3 + - libproxy-duktape + - librsvg2 + - libsane-hpaio + - mesa-dri-drivers + - mesa-libEGL + - ModemManager + - NetworkManager-adsl + - NetworkManager-ppp + - NetworkManager-wwan + - orca + - PackageKit-command-not-found + - PackageKit-gtk3-module + - sane-backends-drivers-scanners + - systemd-oomd-defaults + - tracker + - tracker-miners + - xdg-desktop-portal + - xdg-desktop-portal-gnome + - xdg-desktop-portal-gtk + - xdg-user-dirs-gtk + - name: Installing Fedora specific GNOME desktop components + when: fedora_desktop.stat.exists == true + package: + name: + - gnome-screenshot + - gnome-boxes + - yelp + - cheese + - eog + - evince-djvu + - gnome-backgrounds + - gnome-contacts + - gnome-maps + - gnome-photos + - gnome-themes-extra + - gnome-user-share + - gnome-weather + - gvfs-afc + - gvfs-afp + - gvfs-archive + - NetworkManager-openconnect-gnome + - NetworkManager-openvpn-gnome + - NetworkManager-pptp-gnome + - NetworkManager-ssh-gnome + - NetworkManager-vpnc-gnome + - rygel + - simple-scan + - sushi + - totem + - name: Installing GNOME installed-tests testing harness + when: fedora_desktop.stat.exists == true + package: + name: + - gnome-desktop-testing + - name: Installing build environment + when: fedora_desktop.stat.exists == false + package: + name: + - autoconf + - automake + - make + - gcc + - git + - libtool + + - name: Fetching GNOME installed-tests testing harness source from remote repository + when: fedora_desktop.stat.exists == false + git: + repo: 'https://gitlab.gnome.org/GNOME/gnome-desktop-testing.git' + dest: gnome-desktop-testing + force: yes + + - name: Checkout v2021.1 tag in GNOME installed-tests testing harness + when: fedora_desktop.stat.exists == false + command: git checkout -b v2021.1 refs/tags/v2021.1 + args: + chdir: gnome-desktop-testing + + - name: Configure GNOME installed-tests testing harness build + when: fedora_desktop.stat.exists == false + command: ./autogen.sh --prefix=/usr --sysconfdir=/etc --localstatedir=/var + args: + chdir: gnome-desktop-testing + + - name: Build GNOME installed-tests testing harness + when: fedora_desktop.stat.exists == false + command: make + args: + chdir: gnome-desktop-testing + + - name: Install GNOME installed-tests testing harness + when: fedora_desktop.stat.exists == false + command: make install + args: + chdir: gnome-desktop-testing + +- name: Start IBus installed-tests testing harness + environment: + ANSIBLE: 1 + TMPDIR: '{{ remote_artifacts }}' + G_MESSAGES_DEBUG: 'all' + LANG: 'C.UTF-8' + block: + - name: Execute IBus tests + shell: | + set -e + # Delete LC_CTYPE=C.UTF-8 + export -n LC_CTYPE + status="FAIL: frame" + if [ -f $HOME/.config/anthy/last-record2_default.utf8 ] ; then \ + rm $HOME/.config/anthy/last-record2_default.utf8 + fi + if [ -f $HOME/.anthy/last-record2_default.utf8 ] ; then \ + rm $HOME/.anthy/last-record2_default.utf8 + fi + ibus-desktop-testing-runner \ + --no-graphics \ + --runner=gnome \ + --timeout=1200 \ + --tests='{{ installed_test_name }}' \ + --output='{{ remote_artifacts }}/{{ installed_test_name }}.log' \ + --result='{{ remote_artifacts }}/test.log' \ + null + if [ $? -eq 0 ]; then + status="PASS: frame" + fi + if [ -f /var/tmp/ibus-ci-autostart.log ] ; then + echo "#### /var/tmp/ibus-ci-autostart.log" + cat /var/tmp/ibus-ci-autostart.log + rm /var/tmp/ibus-ci-autostart.log + echo "#" + fi + echo "${status}" >> {{ remote_artifacts }}/test.log + echo "#### {{ remote_artifacts }}/{{ installed_test_name }}.log" + if [ -f {{ remote_artifacts }}/{{ installed_test_name }}.log ] ; then + cat {{ remote_artifacts }}/{{ installed_test_name }}.log + fi + echo "#" + echo "#### {{ remote_artifacts }}/test.log" + if [ -f {{ remote_artifacts }}/test.log ] ; then + cat {{ remote_artifacts }}/test.log + fi + echo "#" + + - name: Check the results + script: check-results.sh "{{ remote_artifacts }}/test.log" "0" + register: test_fails + failed_when: '"ERROR" in test_fails.stdout' + + - name: Set role result + set_fact: + role_result: "{{ test_fails.stdout }}" + role_result_failed: "{{ (test_fails.stdout|d|length > 0) or (test_fails.stderr|d|length > 0) }}" + role_result_msg: "{{ test_fails.stdout|d('tests failed.') }}" + + - include_role: + name: str-common-final + diff --git a/tests/tests.yml b/tests/tests.yml new file mode 100644 index 0000000..94551ce --- /dev/null +++ b/tests/tests.yml @@ -0,0 +1,10 @@ +- hosts: localhost + roles: + - role: ibus-desktop-testing-role + installed_test_name: ibus-anthy + tags: + - classic + - gating + required_packages: + - ibus-anthy-tests +