Gentoo Archives: gentoo-commits

From: Mike Gilbert <floppym@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-i18n/ibus-sunpinyin/files/, app-i18n/ibus-sunpinyin/
Date: Sat, 05 Sep 2020 02:04:35
Message-Id: 1599271358.8db33aa98fdfe4b898c2a07f19aba69c1832d977.floppym@gentoo
1 commit: 8db33aa98fdfe4b898c2a07f19aba69c1832d977
2 Author: Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
3 AuthorDate: Fri Sep 4 00:00:00 2020 +0000
4 Commit: Mike Gilbert <floppym <AT> gentoo <DOT> org>
5 CommitDate: Sat Sep 5 02:02:38 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8db33aa9
7
8 app-i18n/ibus-sunpinyin: Version bump (2.0.4_pre20200306162733).
9
10 Bug: https://bugs.gentoo.org/695010
11 Bug: https://bugs.gentoo.org/695022
12 Signed-off-by: Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache.Org>
13 Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>
14
15 app-i18n/ibus-sunpinyin/Manifest | 1 +
16 ...unpinyin-2.0.4_pre20200306162733-python-3.patch | 85 +++++++++++++++++++++
17 .../ibus-sunpinyin-2.0.4_pre20200306162733.ebuild | 89 ++++++++++++++++++++++
18 app-i18n/ibus-sunpinyin/metadata.xml | 3 +
19 4 files changed, 178 insertions(+)
20
21 diff --git a/app-i18n/ibus-sunpinyin/Manifest b/app-i18n/ibus-sunpinyin/Manifest
22 index 016fef2a715..91033393128 100644
23 --- a/app-i18n/ibus-sunpinyin/Manifest
24 +++ b/app-i18n/ibus-sunpinyin/Manifest
25 @@ -1 +1,2 @@
26 +DIST sunpinyin-2.0.4_pre20200306162733.tar.gz 547519 BLAKE2B 6e0e4457217d7b85221cab15173f588a5c7c039208a8f6cd48ed5fb21c5b5eae2f4616d6fddbf6eff8a006193097de26c866d5385d4602f41059ee8d7e52a2d5 SHA512 e8cf73aeca8dcbc7dd6f51f034a9a0363201bc14a814800e071c987933935b0e8039aa84178a6bd1cba1c7dee4b25b2d5546e78ea683e68e8981afea48fdab33
27 DIST sunpinyin-3.0.0_rc1.tar.gz 547138 BLAKE2B 682e733241d690d1fef8ce452c497a894c5ab61bf5298c1f292ce3a25a681d594744db43ebd51b3e59274cce0e47a1bce15a793f2c20e2998915c3432f2a7c32 SHA512 c9d4936de5835a7f02e52c5b32bf1a42d76bf7588449aaa813f3df7ab2d72f3ca0f4e18f74a60be4860f0724b5e05cbe567c67e6f3150b0e71b23b3a9002fc5e
28
29 diff --git a/app-i18n/ibus-sunpinyin/files/ibus-sunpinyin-2.0.4_pre20200306162733-python-3.patch b/app-i18n/ibus-sunpinyin/files/ibus-sunpinyin-2.0.4_pre20200306162733-python-3.patch
30 new file mode 100644
31 index 00000000000..25b11f0a800
32 --- /dev/null
33 +++ b/app-i18n/ibus-sunpinyin/files/ibus-sunpinyin-2.0.4_pre20200306162733-python-3.patch
34 @@ -0,0 +1,85 @@
35 +https://github.com/sunpinyin/sunpinyin/issues/111
36 +
37 +--- /wrapper/ibus/setup/main.py
38 ++++ /wrapper/ibus/setup/main.py
39 +@@ -63,7 +63,7 @@
40 + class Logger:
41 + @staticmethod
42 + def pr(message):
43 +- print >> sys.stderr, message
44 ++ print(message, file=sys.stderr)
45 +
46 +
47 + class Option(object):
48 +@@ -73,10 +73,10 @@
49 + """
50 + config = ibus.Bus().get_config()
51 + __wrappers = {
52 +- type(True): glib.Variant.new_boolean,
53 +- type(1): glib.Variant.new_int32,
54 +- type('str'): glib.Variant.new_string,
55 +- type([]): glib.Variant.new_strv,
56 ++ bool: glib.Variant.new_boolean,
57 ++ int: glib.Variant.new_int32,
58 ++ str: glib.Variant.new_string,
59 ++ list: glib.Variant.new_strv,
60 + }
61 +
62 + def __init__(self, name, default):
63 +@@ -258,7 +258,7 @@
64 + def read_config(self):
65 + if not self.saved_pairs:
66 + self.saved_pairs = self.read()
67 +- keys = set([pair.split(':')[0] for pair in self.saved_pairs])
68 ++ keys = {pair.split(':')[0] for pair in self.saved_pairs}
69 + for opt in self.options:
70 + opt.is_enabled = (opt.key() in keys)
71 + # throw away unknown pair
72 +@@ -445,28 +445,28 @@
73 + # TODO: the UI should looks like a virtual keyboard,
74 + # user are allowed to choose the mappings to all punctuation keys.
75 + def __init__(self):
76 +- mappings = [MappingInfo('togglebutton1', [('`',None), ('~',u'~')]),
77 ++ mappings = [MappingInfo('togglebutton1', [('`', None), ('~', '~')]),
78 + MappingInfo('togglebutton2', []),
79 +- MappingInfo('togglebutton3', [('2',None), ('@',u'@')]),
80 +- MappingInfo('togglebutton4', [('3',None), ('#',u'#')]),
81 +- MappingInfo('togglebutton5', [('4',None), ('$',u'¥' )]),
82 +- MappingInfo('togglebutton6', [('5',None), ('%',u'%')]),
83 +- MappingInfo('togglebutton7', [('6',None), ('^',u'…')]),
84 +- MappingInfo('togglebutton8', [('7',None), ('&',u'&')]),
85 +- MappingInfo('togglebutton9', [('8',None), ('*',u'*')]),
86 +- MappingInfo('togglebutton10', [('9',None), ('*',u'(')]),
87 +- MappingInfo('togglebutton11', [('0',None), ('*',u')')]),
88 +- MappingInfo('togglebutton12', [('-',u'-'), ('_',u'——')]),
89 +- MappingInfo('togglebutton13', [('=',u'='), ('+',u'+')]),
90 +- MappingInfo('togglebutton14', [('\\',None), ('|',u'‖')]),
91 +- MappingInfo('togglebutton27', [('[',u'〔'), ('{',u'{')]),
92 +- MappingInfo('togglebutton28', [(']',u'〕'), ('}',u'}')]),
93 ++ MappingInfo('togglebutton3', [('2', None), ('@', '@')]),
94 ++ MappingInfo('togglebutton4', [('3', None), ('#', '#')]),
95 ++ MappingInfo('togglebutton5', [('4', None), ('$', '¥' )]),
96 ++ MappingInfo('togglebutton6', [('5', None), ('%', '%')]),
97 ++ MappingInfo('togglebutton7', [('6', None), ('^', '…')]),
98 ++ MappingInfo('togglebutton8', [('7', None), ('&', '&')]),
99 ++ MappingInfo('togglebutton9', [('8', None), ('*', '*')]),
100 ++ MappingInfo('togglebutton10', [('9', None), ('*', '(')]),
101 ++ MappingInfo('togglebutton11', [('0', None), ('*', ')')]),
102 ++ MappingInfo('togglebutton12', [('-', '-'), ('_', '——')]),
103 ++ MappingInfo('togglebutton13', [('=', '='), ('+', '+')]),
104 ++ MappingInfo('togglebutton14', [('\\', None), ('|', '‖')]),
105 ++ MappingInfo('togglebutton27', [('[', '〔'), ('{', '{')]),
106 ++ MappingInfo('togglebutton28', [(']', '〕'), ('}', '}')]),
107 + MappingInfo('togglebutton39', []),
108 + MappingInfo('togglebutton40', []),
109 +- MappingInfo('togglebutton50', [(',',None), ('<',u'〈')]),
110 +- MappingInfo('togglebutton51', [('.',u'·'), ('>',u'〉')]),
111 +- MappingInfo('togglebutton52', [('/',u'/'), ('?',None)])]
112 +- #'\'',(u'‘',u'’'),
113 ++ MappingInfo('togglebutton50', [(',', None), ('<', '〈')]),
114 ++ MappingInfo('togglebutton51', [('.', '·'), ('>', '〉')]),
115 ++ MappingInfo('togglebutton52', [('/', '/'), ('?', None)])]
116 ++ #'\'', ('‘', '’'),
117 + MultiCheckDialog.__init__(self, ui_name="punctmapping",
118 + config_name="General/PunctMapping/Mappings",
119 + mappings=mappings,
120
121 diff --git a/app-i18n/ibus-sunpinyin/ibus-sunpinyin-2.0.4_pre20200306162733.ebuild b/app-i18n/ibus-sunpinyin/ibus-sunpinyin-2.0.4_pre20200306162733.ebuild
122 new file mode 100644
123 index 00000000000..a73dd516a5c
124 --- /dev/null
125 +++ b/app-i18n/ibus-sunpinyin/ibus-sunpinyin-2.0.4_pre20200306162733.ebuild
126 @@ -0,0 +1,89 @@
127 +# Copyright 2009-2020 Gentoo Authors
128 +# Distributed under the terms of the GNU General Public License v2
129 +
130 +EAPI="7"
131 +PYTHON_COMPAT=(python{3_6,3_7,3_8})
132 +
133 +inherit python-single-r1 scons-utils toolchain-funcs
134 +
135 +MY_PN="sunpinyin"
136 +MY_P="${MY_PN}-${PV}"
137 +
138 +if [[ "${PV}" == "9999" ]]; then
139 + inherit git-r3
140 +
141 + EGIT_REPO_URI="https://github.com/sunpinyin/sunpinyin"
142 +elif [[ "${PV}" == *_pre* ]]; then
143 + SUNPINYIN_GIT_REVISION="f39c195db08661e894017507842991a1ef70bedf"
144 +fi
145 +
146 +DESCRIPTION="Chinese SunPinyin engine for IBus"
147 +HOMEPAGE="https://github.com/sunpinyin/sunpinyin"
148 +if [[ "${PV}" == "9999" ]]; then
149 + SRC_URI=""
150 +elif [[ "${PV}" == *_pre* ]]; then
151 + SRC_URI="https://github.com/sunpinyin/${MY_PN}/archive/${SUNPINYIN_GIT_REVISION}.tar.gz -> ${MY_P}.tar.gz"
152 +else
153 + SRC_URI="https://github.com/sunpinyin/${MY_PN}/archive/v${PV/_/-}.tar.gz -> ${MY_P}.tar.gz"
154 +fi
155 +
156 +LICENSE="|| ( CDDL LGPL-2.1 )"
157 +SLOT="0"
158 +KEYWORDS="~amd64 ~x86"
159 +IUSE="+gui"
160 +REQUIRED_USE="${PYTHON_REQUIRED_USE}"
161 +
162 +BDEPEND="sys-devel/gettext
163 + virtual/pkgconfig"
164 +DEPEND="app-i18n/ibus
165 + ~app-i18n/sunpinyin-${PV}
166 + dev-libs/glib:2
167 + virtual/libintl"
168 +RDEPEND="${DEPEND}
169 + app-i18n/sunpinyin-data
170 + gui? (
171 + ${PYTHON_DEPS}
172 + $(python_gen_cond_dep '
173 + app-i18n/ibus[introspection,python,${PYTHON_MULTI_USEDEP}]
174 + dev-python/pygobject[${PYTHON_MULTI_USEDEP}]
175 + ')
176 + x11-libs/gtk+:3[introspection]
177 + )"
178 +
179 +if [[ "${PV}" == *_pre* ]]; then
180 + S="${WORKDIR}/${MY_PN}-${SUNPINYIN_GIT_REVISION}"
181 +elif [[ "${PV}" != "9999" ]]; then
182 + S="${WORKDIR}/${MY_PN}-${PV/_/-}"
183 +fi
184 +
185 +PATCHES=(
186 + "${FILESDIR}/${PN}-2.0.4_pre20200306162733-python-3.patch"
187 +)
188 +
189 +src_prepare() {
190 + default
191 + sed -e "/^exec python /s/python/${EPYTHON}/" -i wrapper/ibus/setup/ibus-setup-sunpinyin.in || die
192 +
193 + if ! use gui; then
194 + sed \
195 + -e "s:'setup/ibus-setup-sunpinyin'::" \
196 + -e "/env\.Alias('install-libexec'/s:, setup_target::" \
197 + -i wrapper/ibus/SConstruct || die
198 + fi
199 +}
200 +
201 +src_configure() {
202 + tc-export CXX
203 +}
204 +
205 +src_compile() {
206 + escons -C wrapper/ibus \
207 + --prefix="${EPREFIX}/usr" \
208 + --libdir="${EPREFIX}/usr/$(get_libdir)" \
209 + --libexecdir="${EPREFIX}/usr/libexec" \
210 + --datadir="${EPREFIX}/usr/share"
211 +}
212 +
213 +src_install() {
214 + escons -C wrapper/ibus --install-sandbox="${D}" install
215 +}
216
217 diff --git a/app-i18n/ibus-sunpinyin/metadata.xml b/app-i18n/ibus-sunpinyin/metadata.xml
218 index 271ef4abaa8..db1b8135a9f 100644
219 --- a/app-i18n/ibus-sunpinyin/metadata.xml
220 +++ b/app-i18n/ibus-sunpinyin/metadata.xml
221 @@ -5,6 +5,9 @@
222 <email>cjk@g.o</email>
223 <name>Cjk</name>
224 </maintainer>
225 + <use>
226 + <flag name="gui">Install graphical user interface tool (ibus-setup-sunpinyin)</flag>
227 + </use>
228 <upstream>
229 <remote-id type="github">sunpinyin/sunpinyin</remote-id>
230 </upstream>