Fix a build issue

This commit is contained in:
Takao Fujiwara 2009-09-07 15:28:16 +00:00
parent 4fd61f320d
commit 979d0a79d7
2 changed files with 220 additions and 4 deletions

View File

@ -1 +1,214 @@
diff -urNp ibus-anthy-1.2.0.20090907-old/ChangeLog ibus-anthy-1.2.0.20090907/ChangeLog
--- ibus-anthy-1.2.0.20090907-old/ChangeLog 2009-09-07 11:41:22.000000000 +0900
+++ ibus-anthy-1.2.0.20090907/ChangeLog 2009-09-07 23:24:51.000000000 +0900
@@ -1,3 +1,11 @@
+commit 4a9511c2691b83fc7f7e02e693e44ff9c80f9c34
+Author: fujiwarat <takao.fujiwara1@gmail.com>
+Date: 2009-09-07 23:19:54 +0900
+
+ Fix 507 No module named thumb
+
+M engine/Makefile.am
+
commit 627a6346eeebea547adb547e6254983cea6bc429
Author: fujiwarat <takao.fujiwara1@gmail.com>
Date: 2009-09-07 11:37:46 +0900
diff -urNp ibus-anthy-1.2.0.20090907-old/engine/Makefile.am ibus-anthy-1.2.0.20090907/engine/Makefile.am
--- ibus-anthy-1.2.0.20090907-old/engine/Makefile.am 2009-09-07 11:40:46.000000000 +0900
+++ ibus-anthy-1.2.0.20090907/engine/Makefile.am 2009-09-07 23:23:58.000000000 +0900
@@ -21,12 +21,13 @@
engine_anthy_PYTHON = \
engine.py \
factory.py \
- main.py \
- tables.py \
jastring.py \
- segment.py \
- romaji.py \
kana.py \
+ main.py \
+ romaji.py \
+ segment.py \
+ tables.py \
+ thumb.py \
$(NULL)
engine_anthydir = $(pkgdatadir)/engine
diff -urNp ibus-anthy-1.2.0.20090907-old/engine/Makefile.in ibus-anthy-1.2.0.20090907/engine/Makefile.in
--- ibus-anthy-1.2.0.20090907-old/engine/Makefile.in 2009-09-07 11:41:04.000000000 +0900
+++ ibus-anthy-1.2.0.20090907/engine/Makefile.in 2009-09-07 23:24:34.000000000 +0900
@@ -273,12 +273,13 @@ top_srcdir = @top_srcdir@
engine_anthy_PYTHON = \
engine.py \
factory.py \
- main.py \
- tables.py \
jastring.py \
- segment.py \
- romaji.py \
kana.py \
+ main.py \
+ romaji.py \
+ segment.py \
+ tables.py \
+ thumb.py \
$(NULL)
engine_anthydir = $(pkgdatadir)/engine
diff -urNp ibus-anthy-1.2.0.20090907-old/engine/thumb.py ibus-anthy-1.2.0.20090907/engine/thumb.py
--- ibus-anthy-1.2.0.20090907-old/engine/thumb.py 1970-01-01 09:00:00.000000000 +0900
+++ ibus-anthy-1.2.0.20090907/engine/thumb.py 2009-09-07 23:23:58.000000000 +0900
@@ -0,0 +1,153 @@
+# -*- coding: utf-8 -*-
+
+import gtk
+import gobject
+import time
+
+import segment
+
+
+_table = {
+ 'q': [u'。', u'', u'ぁ'],
+ 'w': [u'か', u'が', u'え'],
+ 'e': [u'た', u'だ', u'り'],
+ 'r': [u'こ', u'ご', u'ゃ'],
+ 't': [u'さ', u'ざ', u'れ'],
+
+ 'y': [u'ら', u'よ', u'ぱ'],
+ 'u': [u'ち', u'に', u'ぢ'],
+ 'i': [u'く', u'る', u'ぐ'],
+ 'o': [u'つ', u'ま', u'づ'],
+ 'p': [u',', u'ぇ', u'ぴ'],
+ '@': [u'、', u'', u''],
+ '[': [u'゛', u'゜', u''],
+
+ 'a': [u'う', u'', u'を'],
+ 's': [u'し', u'じ', u'あ'],
+ 'd': [u'て', u'で', u'な'],
+ 'f': [u'け', u'げ', u'ゅ'],
+ 'g': [u'せ', u'ぜ', u'も'],
+
+ 'h': [u'は', u'み', u'ば'],
+ 'j': [u'と', u'お', u'ど'],
+ 'k': [u'き', u'の', u'ぎ'],
+ 'l': [u'い', u'ょ', u'ぽ'],
+ ';': [u'ん', u'っ', u''],
+
+ 'z': [u'.', u'', u'ぅ'],
+ 'x': [u'ひ', u'び', u'ー'],
+ 'c': [u'す', u'ず', u'ろ'],
+ 'v': [u'ふ', u'ぶ', u'や'],
+ 'b': [u'へ', u'べ', u'ぃ'],
+
+ 'n': [u'め', u'ぬ', u'ぷ'],
+ 'm': [u'そ', u'ゆ', u'ぞ'],
+ ',': [u'ね', u'む', u'ぺ'],
+ '.': [u'ほ', u'わ', u'ぼ'],
+ '/': [u'・', u'ぉ', u''],
+
+ '1': [u'1', u'', u'?'],
+ '2': [u'2', u'', u'/'],
+ '4': [u'4', u'', u'「'],
+ '5': [u'5', u'', u'」'],
+
+ '6': [u'6', u'[', u''],
+ '7': [u'7', u']', u''],
+ '8': [u'8', u'(', u''],
+ '9': [u'9', u')', u''],
+}
+
+_shift_table = {
+ 'H': u'ぱ',
+ 'X': u'ぴ',
+ 'V': u'ぷ',
+ 'B': u'ぺ',
+ '>': u'ぽ',
+}
+
+table = {}
+shift_table = {}
+r_table = {}
+
+for k in _table.keys():
+ table[ord(k)] = _table[k]
+ for c in _table[k]:
+ r_table[c] = k
+
+for k in _shift_table.keys():
+ shift_table[ord(k)] = _shift_table[k]
+ r_table[_shift_table[k]] = k
+
+kana_voiced_consonant_rule = {
+ u"か゛" : u"が",
+ u"き゛" : u"ぎ",
+ u"く゛" : u"ぐ",
+ u"け゛" : u"げ",
+ u"こ゛" : u"ご",
+ u"さ゛" : u"ざ",
+ u"し゛" : u"じ",
+ u"す゛" : u"ず",
+ u"せ゛" : u"ぜ",
+ u"そ゛" : u"ぞ",
+ u"た゛" : u"だ",
+ u"ち゛" : u"ぢ",
+ u"つ゛" : u"づ",
+ u"て゛" : u"で",
+ u"と゛" : u"ど",
+ u"は゛" : u"ば",
+ u"ひ゛" : u"び",
+ u"ふ゛" : u"ぶ",
+ u"へ゛" : u"べ",
+ u"ほ゛" : u"ぼ",
+ u"は゜" : u"ぱ",
+ u"ひ゜" : u"ぴ",
+ u"ふ゜" : u"ぷ",
+ u"へ゜" : u"ぺ",
+ u"ほ゜" : u"ぽ",
+}
+
+_UNFINISHED_HIRAGANA = set(u"かきくけこさしすせそたちつてとはひふへほ")
+
+class ThumbShiftSegment(segment.Segment):
+
+ def __init__(self, enchars=u"", jachars=u""):
+ if not jachars:
+ if u'!' <= enchars <= u'~':
+ jachars = segment.unichar_half_to_full(enchars)
+ else:
+ jachars = enchars
+ enchars = r_table.get(jachars, u'')
+ super(ThumbShiftSegment, self).__init__(enchars, jachars)
+
+ def is_finished(self):
+ return not (self._jachars in _UNFINISHED_HIRAGANA)
+
+ def append(self, enchar):
+ if enchar == u"\0" or enchar == u"":
+ return []
+ text = self._jachars + enchar
+ jachars = kana_voiced_consonant_rule.get(text, None)
+ if jachars:
+ self._enchars = self._enchars + r_table.get(enchar, u'')
+ self._jachars = jachars
+ return []
+ return [ThumbShiftSegment(enchar)]
+
+ def prepend(self, enchar):
+ if enchar == u"\0" or enchar == u"":
+ return []
+ if self._jachars == u"":
+ if 0x21 <= enchars <= 0x7e:
+ self._enchars = enchar
+ self._jachars = segment.unichar_half_to_full(enchars)
+ else:
+ self._enchars = r_table.get(enchar, u'')
+ self._jachars = enchar
+ return []
+ return [ThumbShiftSegment(enchar)]
+
+ def pop(self, index=-1):
+ self._enchars = u''
+ self._jachars = u''
+ return
+

View File

@ -2,13 +2,13 @@
%define require_ibus_version 1.2.0.20090904 %define require_ibus_version 1.2.0.20090904
Name: ibus-anthy Name: ibus-anthy
Version: 1.2.0.20090907 Version: 1.2.0.20090907
Release: 1%{?dist} Release: 2%{?dist}
Summary: The Anthy engine for IBus input platform Summary: The Anthy engine for IBus input platform
License: GPLv2+ License: GPLv2+
Group: System Environment/Libraries Group: System Environment/Libraries
URL: http://code.google.com/p/ibus/ URL: http://code.google.com/p/ibus/
Source0: http://ibus.googlecode.com/files/%{name}-%{version}.tar.gz Source0: http://ibus.googlecode.com/files/%{name}-%{version}.tar.gz
# Patch0: ibus-anthy-HEAD.patch Patch0: ibus-anthy-HEAD.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@ -29,7 +29,7 @@ libanthy.
%prep %prep
%setup -q %setup -q
# %patch0 -p1 %patch0 -p1
%build %build
%configure --disable-static %configure --disable-static
@ -57,6 +57,9 @@ rm -rf $RPM_BUILD_ROOT
%{_datadir}/ibus/component/* %{_datadir}/ibus/component/*
%changelog %changelog
* Mon Sep 07 2009 Takao Fujiwara <takao.fujiwara1@gmail.com> - 1.2.0.20090907-2
- Fix a build issue
* Mon Sep 07 2009 Takao Fujiwara <takao.fujiwara1@gmail.com> - 1.2.0.20090907-1 * Mon Sep 07 2009 Takao Fujiwara <takao.fujiwara1@gmail.com> - 1.2.0.20090907-1
- Update to 1.2.0.20090907 - Update to 1.2.0.20090907
- Fix bug 510978 - "Typing Method" configuration doesn't work - Fix bug 510978 - "Typing Method" configuration doesn't work