!27 [sync] PR-26: fix ibus setup startup failure

From: @openeuler-sync-bot 
Reviewed-by: @leeffo 
Signed-off-by: @leeffo
This commit is contained in:
openeuler-ci-bot 2023-09-22 02:04:46 +00:00 committed by Gitee
commit 47c24f4e65
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 44 additions and 1 deletions

View File

@ -0,0 +1,39 @@
From ff13b86247701950d525a3949c31dc94885f63eb Mon Sep 17 00:00:00 2001
From: yangxianzhao <yangxianzhao@uniontech.com>
Date: Fri, 15 Sep 2023 10:45:17 +0800
Subject: [PATCH] Fix ibus setup startup failure
---
setup/i18n.py | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/setup/i18n.py b/setup/i18n.py
index 976d1ae..182022b 100644
--- a/setup/i18n.py
+++ b/setup/i18n.py
@@ -23,9 +23,11 @@
import locale
import gettext
import os
+import sys
DOMAINNAME = "ibus10"
+PY3K = sys.version_info >= (3, 0)
_ = lambda a: gettext.dgettext(DOMAINNAME, a)
N_ = lambda a: a
@@ -42,7 +44,9 @@ def init_textdomain(domainname):
except AttributeError:
pass
gettext.bindtextdomain(domainname, LOCALEDIR)
- gettext.bind_textdomain_codeset(domainname, 'UTF-8')
+ # https://docs.python.org/3/library/gettext.html#gettext.lgettext
+ if not PY3K:
+ gettext.bind_textdomain_codeset(domainname, 'UTF-8')
def gettext_engine_longname(engine):
name = engine.get_name()
--
2.41.0

View File

@ -6,7 +6,7 @@
Name: ibus
Version: 1.5.23
Release: 2
Release: 3
Summary: Intelligent Input Bus for Linux OS
License: LGPLv2+
URL: https://github.com/ibus/%name/wiki
@ -17,6 +17,7 @@ Source2: %{name}.conf.5
Patch0: %{name}-HEAD.patch
Patch1: %{name}-1385349-segv-bus-proxy.patch
Patch2: 30a3641e19c541924959a5770dd784b4424288d4.patch
Patch3: 0001-Fix-ibus-setup-startup-failure.patch
BuildRequires: gettext-devel libtool glib2-doc gtk2-devel gtk3-devel dbus-glib-devel gtk-doc dconf-devel dbus-x11 python3-devel
BuildRequires: dbus-python-devel >= %{dbus_python_version} desktop-file-utils python3-gobject vala vala-devel vala-tools
@ -177,6 +178,9 @@ dconf update || :
%{_datadir}/gtk-doc/html/*
%changelog
* Fri Sep 15 2023 yangxianzhao <yangxianzhao@uniontech.com> - 1.5.23-3
- fix ibus setup failure
* Mon Apr 18 2022 Jun Yang <jun.yang@suse.com> - 1.5.23-2
- remove self-dependency