From 159641fbd0d20604b78ecbfed3e67530034e0a38 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Tue, 7 May 2019 07:39:18 -0400 Subject: [PATCH] import ibus-kkc-1.5.22-9.el8 --- .gitignore | 1 + .ibus-kkc.metadata | 1 + SOURCES/ibus-HEAD.patch | 195 +++++++++++++++++++++++++ SOURCES/ibus-kkc-content-type.patch | 86 +++++++++++ SPECS/ibus-kkc.spec | 212 ++++++++++++++++++++++++++++ 5 files changed, 495 insertions(+) create mode 100644 .gitignore create mode 100644 .ibus-kkc.metadata create mode 100644 SOURCES/ibus-HEAD.patch create mode 100644 SOURCES/ibus-kkc-content-type.patch create mode 100644 SPECS/ibus-kkc.spec diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b1c4ea3 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/ibus-kkc-1.5.22.tar.gz diff --git a/.ibus-kkc.metadata b/.ibus-kkc.metadata new file mode 100644 index 0000000..f022a3b --- /dev/null +++ b/.ibus-kkc.metadata @@ -0,0 +1 @@ +e48fcdfbb2d729a081e3a0aaa1fbdadce4546e35 SOURCES/ibus-kkc-1.5.22.tar.gz diff --git a/SOURCES/ibus-HEAD.patch b/SOURCES/ibus-HEAD.patch new file mode 100644 index 0000000..47a0e21 --- /dev/null +++ b/SOURCES/ibus-HEAD.patch @@ -0,0 +1,195 @@ +diff --git a/README b/README +index 6c6765a..5301247 100644 +--- a/README ++++ b/README +@@ -1 +1,28 @@ + ibus-kkc -- a Japanese Kana Kanji input engine for IBus ++======================================================= ++ ++ibus-kkc makes the Kana Kanji conversion library (libkkc[0]) usable ++through IBus. ++ ++ ++Custom dictionaries ++------------------- ++ ++ibus-kkc will look for a "dictionaries.json" file in a path consisting ++of the user's config directory concatenated with the package name (the ++default template for this file is at src/ibus-kkc-dictionaries.json[1]). By ++default the file will be searched in "$HOME/.config/ibus-kkc/". ++ ++The "dictionaries.json" file is in JSON format and contains a list of ++JSON objects describing dictionaries that can be downloaded from here[2] ++(this site is in Japanese). All custom dictionary files mentioned in ++"dictionaries.json" will be searched in "/usr/local/share/skk/". ++ ++The assumed default encoding of the dictionaries is "EUC-JP". If your ++dictionary uses a different encoding you can add an "encoding" field ++to the JSON object describing your dictionary. The value of that field ++should be the name of the encoding used in your custom dictionary file. ++ ++[0] https://github.com/ueno/libkkc ++[1] https://github.com/ueno/ibus-kkc/blob/master/src/ibus-kkc-dictionaries.json ++[2] http://openlab.ring.gr.jp/skk/wiki/wiki.cgi?page=SKK%BC%AD%BD%F1 +diff --git a/src/dictionary.vala b/src/dictionary.vala +index 34cc538..d693561 100644 +--- a/src/dictionary.vala ++++ b/src/dictionary.vala +@@ -125,6 +125,9 @@ public class DictionaryRegistry : Object { + file.get_path (), + e.message); + } ++ } else { ++ warning ("Dictionary file at %s could not be found. We will run without any custom dictionaries.", ++ file.get_path ()); + } + } + } +diff --git a/src/engine.vala b/src/engine.vala +index ebcf3b5..15bdd85 100644 +--- a/src/engine.vala ++++ b/src/engine.vala +@@ -201,7 +201,11 @@ class KkcEngine : IBus.Engine { + context.candidates.page_start); + update_lookup_table_fast (lookup_table, true); + var candidate = context.candidates.get (); +- if (show_annotation && candidate.annotation != null) { ++ if (show_annotation ++ && candidate.annotation != null ++ // SKK-JISYO.* has annotations marked as "?" for ++ // development purposes. ++ && candidate.annotation != "?") { + var text = new IBus.Text.from_string ( + candidate.annotation); + update_auxiliary_text (text, true); +@@ -280,27 +284,45 @@ class KkcEngine : IBus.Engine { + } + + void update_input_mode () { ++ bool changed; ++ + // Update the menu item + var iter = input_mode_props.map_iterator (); + while (iter.next ()) { + var input_mode = iter.get_key (); + var prop = iter.get_value (); +- if (input_mode == context.input_mode) +- prop.set_state (IBus.PropState.CHECKED); +- else +- prop.set_state (IBus.PropState.UNCHECKED); +- if (properties_registered) ++ ++ changed = false; ++ if (input_mode == context.input_mode) { ++ if (prop.get_state () == IBus.PropState.UNCHECKED) { ++ prop.set_state (IBus.PropState.CHECKED); ++ changed = true; ++ } ++ } else { ++ if (prop.get_state () == IBus.PropState.CHECKED) { ++ prop.set_state (IBus.PropState.UNCHECKED); ++ changed = true; ++ } ++ } ++ if (changed && properties_registered) + update_property (prop); + } + + // Update the menu ++ changed = false; + var symbol = new IBus.Text.from_string ( + input_mode_symbols.get (context.input_mode)); + var label = new IBus.Text.from_string ( + _("Input Mode (%s)").printf (symbol.text)); +- input_mode_prop.set_label (label); +- input_mode_prop.set_symbol (symbol); +- if (properties_registered) ++ if (input_mode_prop.get_symbol () != symbol) { ++ input_mode_prop.set_symbol (symbol); ++ changed = true; ++ } ++ if (input_mode_prop.get_label () != label) { ++ input_mode_prop.set_label (label); ++ changed = true; ++ } ++ if (changed && properties_registered) + update_property (input_mode_prop); + } + +@@ -413,8 +435,10 @@ class KkcEngine : IBus.Engine { + return prop; + } + +- string[] LOOKUP_TABLE_LABELS = {"1", "2", "3", "4", "5", "6", "7", +- "8", "9", "0", "a", "b", "c", "d", "e"}; ++ static const string[] LOOKUP_TABLE_LABELS = { ++ "1", "2", "3", "4", "5", "6", "7", "8", ++ "9", "0", "a", "b", "c", "d", "e", "f" ++ }; + + bool process_lookup_table_key_event (uint keyval, + uint keycode, +@@ -664,7 +688,7 @@ class KkcEngine : IBus.Engine { + "org.freedesktop.IBus.KKC", + N_("Kana Kanji"), Config.PACKAGE_VERSION, "GPL", + "Daiki Ueno ", +- "http://code.google.com/p/ibus/", ++ "https://github.com/ueno/ibus-kkc", + "", + "ibus-kkc"); + var engine = new IBus.EngineDesc ( +diff --git a/src/ibus-1.0.vapi b/src/ibus-1.0.vapi +index 6c200f9..58e96ae 100644 +--- a/src/ibus-1.0.vapi ++++ b/src/ibus-1.0.vapi +@@ -439,6 +439,7 @@ namespace IBus { + public unowned string get_icon (); + public unowned string get_key (); + public unowned IBus.Text get_label (); ++ public unowned IBus.Text get_symbol (); + public IBus.PropType get_prop_type (); + public bool get_sensitive (); + public IBus.PropState get_state (); +diff --git a/src/setup.vala b/src/setup.vala +index 0ccdd66..df9630b 100644 +--- a/src/setup.vala ++++ b/src/setup.vala +@@ -402,7 +402,11 @@ class SetupDialog : Gtk.Dialog { + } catch (Error e) { + warning ("can't write shortcut: %s", e.message); + } ++#if VALA_0_36 ++ model.remove (ref iter); ++#else + model.remove (iter); ++#endif + } + } + +@@ -439,7 +443,11 @@ class SetupDialog : Gtk.Dialog { + continue; + keymap.set (old_event, null); + } ++#if VALA_0_36 ++ ((Gtk.ListStore)model).remove (ref iter); ++#else + ((Gtk.ListStore)model).remove (iter); ++#endif + } + } + try { +@@ -524,8 +532,13 @@ class SetupDialog : Gtk.Dialog { + var rows = selection.get_selected_rows (out model); + foreach (var row in rows) { + Gtk.TreeIter iter; +- if (model.get_iter (out iter, row)) ++ if (model.get_iter (out iter, row)) { ++#if VALA_0_36 ++ ((Gtk.ListStore)model).remove (ref iter); ++#else + ((Gtk.ListStore)model).remove (iter); ++#endif ++ } + } + save_dictionaries ("system_dictionaries"); + } diff --git a/SOURCES/ibus-kkc-content-type.patch b/SOURCES/ibus-kkc-content-type.patch new file mode 100644 index 0000000..a7e6242 --- /dev/null +++ b/SOURCES/ibus-kkc-content-type.patch @@ -0,0 +1,86 @@ +From 8d9cfe6882f892ff936b20b986fab5d554715c96 Mon Sep 17 00:00:00 2001 +From: Daiki Ueno +Date: Wed, 14 Aug 2013 12:49:17 +0200 +Subject: [PATCH] Automatically set input mode depending on content-type + +--- + src/engine.vala | 17 +++++++++++++++++ + src/ibus-1.0.vapi | 27 +++++++++++++++++++++++++++ + 2 files changed, 44 insertions(+) + +diff --git a/src/engine.vala b/src/engine.vala +index ff7111b..7818cf5 100644 +--- a/src/engine.vala ++++ b/src/engine.vala +@@ -599,6 +599,23 @@ class KkcEngine : IBus.Engine { + context.candidates.page_down (); + } + ++ public override void set_content_type (uint purpose, uint hints) { ++ switch (purpose) { ++ case IBus.InputPurpose.PASSWORD: ++ case IBus.InputPurpose.PIN: ++ context.input_mode = Kkc.InputMode.DIRECT; ++ break; ++ case IBus.InputPurpose.ALPHA: ++ case IBus.InputPurpose.DIGITS: ++ case IBus.InputPurpose.NUMBER: ++ case IBus.InputPurpose.PHONE: ++ case IBus.InputPurpose.URL: ++ case IBus.InputPurpose.EMAIL: ++ context.input_mode = Kkc.InputMode.LATIN; ++ break; ++ } ++ } ++ + static bool ibus; + + const OptionEntry[] options = { +diff --git a/src/ibus-1.0.vapi b/src/ibus-1.0.vapi +index 6c200f9..3c1f6a3 100644 +--- a/src/ibus-1.0.vapi ++++ b/src/ibus-1.0.vapi +@@ -206,6 +206,7 @@ namespace IBus { + public virtual signal void set_capabilities (uint caps); + public virtual signal void set_cursor_location (int x, int y, int w, int h); + public virtual signal void set_surrounding_text (GLib.Object text, uint cursor_index, uint anchor_pos); ++ public virtual signal void set_content_type (uint purpose, uint hints); + } + [CCode (cheader_filename = "ibus.h")] + public class EngineDesc : IBus.Serializable { +@@ -653,6 +654,32 @@ namespace IBus { + MENU, + SEPARATOR + } ++ [CCode (cheader_filename = "ibus.h", cprefix = "IBUS_INPUT_PURPOSE_", type_id = "ibus_input_purpose_get_type ()")] ++ public enum InputPurpose { ++ FREE_FORM, ++ ALPHA, ++ DIGITS, ++ NUMBER, ++ PHONE, ++ URL, ++ EMAIL, ++ NAME, ++ PASSWORD, ++ PIN ++ } ++ [CCode (cheader_filename = "ibus.h", cprefix = "IBUS_INPUT_HINT_", type_id = "ibus_input_hints_get_type ()")] ++ [Flags] ++ public enum InputHints { ++ NONE, ++ SPELLCHECK, ++ NO_SPELLCHECK, ++ WORD_COMPLETION, ++ LOWERCASE, ++ UPPERCASE_CHARS, ++ UPPERCASE_WORDS, ++ UPPERCASE_SENTENCES, ++ INHIBIT_OSK ++ } + [CCode (cheader_filename = "ibus.h", has_target = false)] + public delegate void FreeFunc (void* object); + [CCode (cheader_filename = "ibus.h", has_target = false)] +-- +1.8.3.1 + diff --git a/SPECS/ibus-kkc.spec b/SPECS/ibus-kkc.spec new file mode 100644 index 0000000..ac14c06 --- /dev/null +++ b/SPECS/ibus-kkc.spec @@ -0,0 +1,212 @@ +Name: ibus-kkc +Version: 1.5.22 +Release: 9%{?dist} +Summary: Japanese Kana Kanji input method for ibus + +Group: System Environment/Libraries +License: GPLv2+ +URL: https://github.com/ueno/ibus-kkc +Source0: https://github.com/ueno/ibus-kkc/releases/download/v%{version}/%{name}-%{version}.tar.gz +Patch0: ibus-kkc-content-type.patch +Patch1: ibus-HEAD.patch + +BuildRequires: vala +BuildRequires: intltool +BuildRequires: libkkc-devel >= 0.3.4 +BuildRequires: ibus-devel +BuildRequires: gtk3-devel +BuildRequires: desktop-file-utils +Requires: ibus + +%description +A Japanese Kana Kanji Input Method Engine for ibus. + + +%prep +%setup -q +rm src/*vala.stamp +# don't touch XKB layout under Fedora +sed -i 's!jp!default!' src/kkc.xml.in.in +# for ibus 1.5.4 or later +%patch0 -p1 -b .content-type +%patch1 -p1 -b .orig + + +%build +%configure +make %{?_smp_mflags} + + +%install +%make_install INSTALL="install -p" + +# Register as an AppStream component to be visible in the software center +# +# NOTE: It would be *awesome* if this file was maintained by the upstream +# project, translated and installed into the right place during `make install`. +# +# See http://www.freedesktop.org/software/appstream/docs/ for more details. +# +mkdir -p $RPM_BUILD_ROOT%{_datadir}/appdata +cat > $RPM_BUILD_ROOT%{_datadir}/appdata/kkc.appdata.xml < + + kkc.xml + CC0-1.0 + Kana Kanji + Japanese input method + +

+ The Kana Kanji input method is designed for entering Japanese text. + It uses the Kana Kanji conversion library as backend, whose algorithm is based + on 3-gram statistical language model generated from Wikipedia data. +

+

+ Input methods are typing systems allowing users to input complex languages. + They are necessary because these contain too many characters to simply be laid + out on a traditional keyboard. +

+
+ https://bitbucket.org/libkkc/libkkc/ + GNOME + GNOME + The GNOME Project + https://code.google.com/p/ibus/issues/list + http://www.gnome.org/friends/ + https://code.google.com/p/ibus/wiki/FAQ + +
+EOF + +desktop-file-validate %{buildroot}/%{_datadir}/applications/ibus-setup-kkc.desktop + +%find_lang %{name} + + +%post +[ -x %{_bindir}/ibus ] && \ + %{_bindir}/ibus write-cache --system &>/dev/null || : + +%postun +[ -x %{_bindir}/ibus ] && \ + %{_bindir}/ibus write-cache --system &>/dev/null || : + + +%files -f %{name}.lang +%doc AUTHORS COPYING ChangeLog README +%{_datadir}/appdata/*.appdata.xml +%{_datadir}/ibus-kkc +%{_libexecdir}/ibus-*-kkc +%{_datadir}/ibus/component/kkc.xml +%{_datadir}/applications/ibus-setup-kkc.desktop + + +%changelog +* Wed Feb 07 2018 Fedora Release Engineering - 1.5.22-9 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + +* Thu Dec 14 2017 Jens Petersen - 1.5.22-8 +- update to upstream head (f7516ae) +- fixes FTBFS + +* Wed Aug 02 2017 Fedora Release Engineering - 1.5.22-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild + +* Wed Jul 26 2017 Fedora Release Engineering - 1.5.22-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + +* Fri Feb 10 2017 Fedora Release Engineering - 1.5.22-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild + +* Thu Feb 04 2016 Fedora Release Engineering - 1.5.22-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + +* Wed Jun 17 2015 Fedora Release Engineering - 1.5.22-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + +* Wed Mar 25 2015 Richard Hughes - 1.5.22-2 +- Register as an AppStream component. + +* Fri Dec 19 2014 Daiki Ueno - 1.5.22-1 +- new upstream release + +* Sat Aug 16 2014 Fedora Release Engineering - 1.5.21-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild + +* Mon Jul 7 2014 Daiki Ueno - 1.5.21-1 +- new upstream release +- update required libkkc version to 0.3.4, for libgee compatibility + +* Sat Jun 07 2014 Fedora Release Engineering - 1.5.20-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + +* Tue Apr 1 2014 Daiki Ueno - 1.5.20-1 +- new upstream release + +* Tue Dec 17 2013 Daiki Ueno - 1.5.19-1 +- new upstream release + +* Thu Nov 7 2013 Daiki Ueno - 1.5.18-2 +- write ibus registry cache in %%post and %%postun (Closes: #1013980) +- add patch to respect content-type of target application (Closes: #1013398) + +* Fri Sep 13 2013 Daiki Ueno - 1.5.18-1 +- new upstream release, with improved dictionary selection UI (Closes: #1007648) + +* Tue Sep 10 2013 Daiki Ueno - 1.5.17-1 +- new upstream release, to avoid redundant LM loading (Closes: #1004722) + +* Thu Jul 25 2013 Daiki Ueno - 1.5.16-2 +- remove buildroot cleanup +- validate .desktop file on %%install + +* Thu Jul 11 2013 Daiki Ueno - 1.5.16-1 +- new upstream release (Closes: #980872) + +* Fri Jul 5 2013 Daiki Ueno - 1.5.15-1 +- new upstream release + +* Fri Jun 7 2013 Daiki Ueno - 1.5.14-1 +- new upstream release + +* Wed May 15 2013 Daiki Ueno - 1.5.13-1 +- new upstream release + +* Thu May 9 2013 Daiki Ueno - 1.5.12-1 +- new upstream release + +* Thu May 2 2013 Daiki Ueno - 1.5.11-2 +- specify IBus version when configure + +* Wed May 1 2013 Daiki Ueno - 1.5.11-1 +- new upstream release + +* Tue Mar 19 2013 Daiki Ueno - 1.5.10-1 +- new upstream release + +* Tue Mar 12 2013 Daiki Ueno - 1.5.9-1 +- new upstream release (Closes: #911495) + +* Fri Feb 22 2013 Daiki Ueno - 1.5.7-1 +- new upstream release +- don't touch XKB layout (#910959) + +* Mon Feb 11 2013 Daiki Ueno - 1.5.6-1 +- new upstream release +- change the license to GPLv2+ + +* Tue Feb 5 2013 Daiki Ueno - 1.5.5-1 +- new upstream release +- re-add README to %%doc + +* Mon Feb 4 2013 Daiki Ueno - 1.5.4-1 +- new upstream release +- change the license to GPLv3+ +- remove empty README file from %%doc + +* Thu Jan 31 2013 Daiki Ueno - 1.5.3-1 +- new upstream release + +* Thu Jan 24 2013 Daiki Ueno - 1.5.0-1 +- initial packaging +