From 97386b479f804bc5f411ef17ce3ea161ac4e2bce9b4afe0bd93282e41a831c5b Mon Sep 17 00:00:00 2001 From: Marguerite Su Date: Thu, 17 Apr 2014 17:12:25 +0000 Subject: [PATCH 1/4] Accepting request 230507 from home:MargueriteSu:branches:M17N add patch to support sogou-pinyin OBS-URL: https://build.opensuse.org/request/show/230507 OBS-URL: https://build.opensuse.org/package/show/M17N/fcitx?expand=0&rev=88 --- ...ext-variable-disable-punc-on-the-fly.patch | 59 +++++++++++++++++++ fcitx.changes | 7 +++ fcitx.spec | 4 ++ 3 files changed, 70 insertions(+) create mode 100644 fcitx-context-variable-disable-punc-on-the-fly.patch diff --git a/fcitx-context-variable-disable-punc-on-the-fly.patch b/fcitx-context-variable-disable-punc-on-the-fly.patch new file mode 100644 index 0000000..c5803a7 --- /dev/null +++ b/fcitx-context-variable-disable-punc-on-the-fly.patch @@ -0,0 +1,59 @@ +From: Xuetian Weng +Date: Tue, 11 Mar 2014 00:13:43 +0800 +Subject: add a context variable to disable punc + +--- + src/lib/fcitx/context.h | 2 ++ + src/module/punc/punc.c | 12 ++++++++++++ + 2 files changed, 14 insertions(+) + +diff --git a/src/lib/fcitx/context.h b/src/lib/fcitx/context.h +index 32115af..05f0f91 100644 +--- a/src/lib/fcitx/context.h ++++ b/src/lib/fcitx/context.h +@@ -70,6 +70,8 @@ extern "C" { + #define CONTEXT_DISABLE_AUTO_FIRST_CANDIDATE_HIGHTLIGHT "CONTEXT_DISABLE_AUTO_FIRST_CANDIDATE_HIGHTLIGHT" + /** disable auto first candidate highlight */ + #define CONTEXT_DISABLE_FULLWIDTH "CONTEXT_DISABLE_FULLWIDTH" ++ /** disable punc module */ ++ #define CONTEXT_DISABLE_PUNC "CONTEXT_DISABLE_PUNC" + + /** + * @brief register a new global context variable +diff --git a/src/module/punc/punc.c b/src/module/punc/punc.c +index be6dec3..3327f9c 100644 +--- a/src/module/punc/punc.c ++++ b/src/module/punc/punc.c +@@ -154,6 +154,8 @@ void* PuncCreate(FcitxInstance* instance) + PuncWhichCopy, PuncWhichFree, + puncState); + ++ FcitxInstanceRegisterWatchableContext(instance, CONTEXT_DISABLE_PUNC, FCT_Boolean, FCF_ResetOnInputMethodChange); ++ + FcitxPuncAddFunctions(instance); + return puncState; + } +@@ -250,6 +252,11 @@ boolean PuncPreFilter(void* arg, FcitxKeySym sym, unsigned int state, + { + FCITX_UNUSED(retVal); + FcitxPuncState *puncState = (FcitxPuncState*)arg; ++ boolean disablePunc = FcitxInstanceGetContextBoolean( ++ puncState->owner, CONTEXT_DISABLE_PUNC); ++ if (disablePunc) ++ return false; ++ + if (FcitxHotkeyIsHotKeySimple(sym, state) && + !FcitxHotkeyIsHotKeyDigit(sym, state) && !IsHotKeyPunc(sym, state)) + puncState->bLastIsNumber = false; +@@ -269,6 +276,11 @@ boolean ProcessPunc(void* arg, FcitxKeySym sym, unsigned int state, INPUT_RETURN + if (*retVal != IRV_TO_PROCESS) + return false; + ++ boolean disablePunc = FcitxInstanceGetContextBoolean( ++ puncState->owner, CONTEXT_DISABLE_PUNC); ++ if (disablePunc) ++ return false; ++ + FcitxCandidateWordList *candList = FcitxInputStateGetCandidateList(input); + if (FcitxCandidateWordGetListSize(candList) != 0) { + if (FcitxCandidateWordGetHasGoneToNextPage(candList) && diff --git a/fcitx.changes b/fcitx.changes index cf3c943..8f38f1e 100644 --- a/fcitx.changes +++ b/fcitx.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Thu Apr 17 16:10:11 UTC 2014 - i@marguerite.su + +- add patch: fcitx-context-variable-disable-punc-on-the-fly.patch + * To support the recently released Sogou Pinyin, we need this + patch to allow Sogou to disable punc on the fly. + ------------------------------------------------------------------- Fri Feb 14 13:07:53 UTC 2014 - fcrozat@suse.com diff --git a/fcitx.spec b/fcitx.spec index 56d1785..3a7d05c 100644 --- a/fcitx.spec +++ b/fcitx.spec @@ -34,6 +34,9 @@ Source7: xinput-fcitx Source8: openSUSE-default.tar.gz Source9: macros.%{name} BuildRequires: cairo-devel +#PATCH-FEATURE-OPENSUSE marguerite@opensuse.org To support sougou IM, we need a context +# variable to disable punc on the fly +Patch: fcitx-context-variable-disable-punc-on-the-fly.patch %if 0%{?suse_version} BuildRequires: dbus-1-devel BuildRequires: dbus-1-glib-devel @@ -368,6 +371,7 @@ You can either use this package for download from kde-look.org using knewstaff i %prep %setup -q -n %{name}-%{version} +%patch -p1 # hack to fix incompatibility of gtk-query-immodules-2.0 (bnc#845860) %if %suse_version < 1310 sed -i \ From 81b8d70bb2a678c5b4fa5bc0f5953a83eee44734c861d2ff5368186971c4da7b Mon Sep 17 00:00:00 2001 From: Marguerite Su Date: Fri, 18 Apr 2014 05:32:17 +0000 Subject: [PATCH 2/4] Accepting request 230717 from home:MargueriteSu:branches:M17N OBS-URL: https://build.opensuse.org/request/show/230717 OBS-URL: https://build.opensuse.org/package/show/M17N/fcitx?expand=0&rev=89 --- fcitx.changes | 6 +++++ fcitx.spec | 62 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 68 insertions(+) diff --git a/fcitx.changes b/fcitx.changes index 8f38f1e..4c9cef9 100644 --- a/fcitx.changes +++ b/fcitx.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Fri Apr 18 04:25:12 UTC 2014 - i@marguerite.su + +- split two sub-packages: fcitx-module-autoeng-orig and + fcitx-module-punc-orig to avoid conflicts with sogou-pinyin + ------------------------------------------------------------------- Thu Apr 17 16:10:11 UTC 2014 - i@marguerite.su diff --git a/fcitx.spec b/fcitx.spec index 3a7d05c..335340b 100644 --- a/fcitx.spec +++ b/fcitx.spec @@ -80,6 +80,8 @@ BuildRequires: libicu-devel BuildRequires: libxml2-devel BuildRequires: xz Requires: %{name}-gtk2 = %{version}-%{release} +Requires: fcitx-module-autoeng = %{version} +Requires: fcitx-module-punc = %{version} Requires: lib%{name}%{libver} = %{version}-%{release} %if 0%{?suse_version} >= 1140 || 0%{?fedora_version} Requires: %{name}-gtk3 = %{version}-%{release} @@ -127,6 +129,7 @@ Shared libraries for Fcitx input method framework. Summary: Development files for %{name} Group: Development/Libraries/C and C++ Requires: %{name} = %{version}-%{release} +Requires: fcitx-module-punc-devel = %{version} %description devel Development header files for Fcitx input method framework. @@ -184,6 +187,36 @@ QT4 input module for Fcitx input method framework. %endif +%package -n fcitx-module-autoeng-orig +Summary: AutoEng module for fcitx input method +Group: System/I18n/Chinese +Requires: %{name} = %{version} +Provides: fcitx-module-autoeng = %{version} +Obsoletes: fcitx-module-autoeng < %{version} + +%description -n fcitx-module-autoeng-orig +This package provides an AutoEng module for fcitx. + +%package -n fcitx-module-punc-orig +Summary: Punc module for fcitx input method +Group: System/I18n/Chinese +Requires: %{name} = %{version} +Provides: fcitx-module-punc = %{version} +Obsoletes: fcitx-module-punc < %{version} + +%description -n fcitx-module-punc-orig +This package provides a Punc module for fcitx. + +%package -n fcitx-module-punc-orig-devel +Summary: Development headers for fcitx-module-punc-oirg +Group: Development/Libraries/C and C++ +Requires: fcitx-module-punc-oirg = %{version} +Provides: fcitx-module-punc-devel = %{version} +Obsoletes: fcitx-module-punc-devel < %{Version} + +%description -n fcitx-module-punc-orig-devel +Development headers for fcitx-module-punc-orig. + %package quwei Summary: Chinese Zone-bit(QuWei) engine for %{name} Group: System/I18n/Chinese @@ -599,11 +632,20 @@ update-desktop-database %{_datadir}/applications &>/dev/null || %exclude %{_datadir}/%{name}/table/* %exclude %{_datadir}/%{name}/imicon/* %exclude %{_datadir}/%{name}/inputmethod/* +%exclude %{_datadir}/%{name}/addon/%{name}-autoeng.conf +%exclude %{_datadir}/%{name}/addon/%{name}-punc.conf %exclude %{_datadir}/%{name}/addon/%{name}-pinyin.conf %exclude %{_datadir}/%{name}/addon/%{name}-table.conf %exclude %{_datadir}/%{name}/addon/%{name}-qw.conf +%exclude %{_datadir}/%{name}/configdesc/%{name}-autoeng.desc %exclude %{_datadir}/%{name}/configdesc/%{name}-pinyin.desc %exclude %{_datadir}/%{name}/configdesc/table.desc +%exclude %{_datadir}/%{name}/data/AutoEng.dat +%exclude %{_datadir}/%{name}/data/punc.mb.zh_CN +%exclude %{_datadir}/%{name}/data/punc.mb.zh_HK +%exclude %{_datadir}/%{name}/data/punc.mb.zh_TW +%exclude %{_libdir}/%{name}/fcitx-autoeng.so +%exclude %{_libdir}/%{name}/fcitx-punc.so %exclude %{_libdir}/%{name}/fcitx-pinyin.so %exclude %{_libdir}/%{name}/fcitx-table.so %exclude %{_libdir}/%{name}/fcitx-qw.so @@ -637,6 +679,25 @@ update-desktop-database %{_datadir}/applications &>/dev/null || %endif +%files -n fcitx-module-autoeng-orig +%defattr(-,root,root) +%{_libdir}/%{name}/%{name}-autoeng.so +%{_datadir}/%{name}/addon/%{name}-autoeng.conf +%{_datadir}/%{name}/configdesc/%{name}-autoeng.desc +%{_datadir}/%{name}/data/AutoEng.dat + +%files -n fcitx-module-punc-orig +%defattr(-,root,root) +%{_libdir}/%{name}/%{name}-punc.so +%{_datadir}/%{name}/addon/%{name}-punc.conf +%{_datadir}/%{name}/data/punc.mb.zh_CN +%{_datadir}/%{name}/data/punc.mb.zh_HK +%{_datadir}/%{name}/data/punc.mb.zh_TW + +%files -n fcitx-module-punc-orig-devel +%defattr(-,root,root) +%{_includedir}/fcitx/module/punc + %files quwei %defattr(-,root,root) %{_libdir}/%{name}/%{name}-qw.so @@ -752,6 +813,7 @@ update-desktop-database %{_datadir}/applications &>/dev/null || %if 0%{?suse_version} >= 1140 || 0%{?fedora_version} %{_datadir}/gir-1.0/Fcitx-1.0.gir %endif +%exclude %{_includedir}/fcitx/module/punc %if 0%{?suse_version} > 1110 || 0%{?fedora_version} From 318d323ac3a7cfba5b01eea06776507f87e08f5a3eaa774fdaf4cc733eb814dc Mon Sep 17 00:00:00 2001 From: Marguerite Su Date: Fri, 18 Apr 2014 05:55:47 +0000 Subject: [PATCH 3/4] OBS-URL: https://build.opensuse.org/package/show/M17N/fcitx?expand=0&rev=90 --- fcitx.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fcitx.spec b/fcitx.spec index 335340b..aaccf62 100644 --- a/fcitx.spec +++ b/fcitx.spec @@ -208,9 +208,9 @@ Obsoletes: fcitx-module-punc < %{version} This package provides a Punc module for fcitx. %package -n fcitx-module-punc-orig-devel -Summary: Development headers for fcitx-module-punc-oirg +Summary: Development headers for fcitx-module-punc-orig Group: Development/Libraries/C and C++ -Requires: fcitx-module-punc-oirg = %{version} +Requires: fcitx-module-punc-orig = %{version} Provides: fcitx-module-punc-devel = %{version} Obsoletes: fcitx-module-punc-devel < %{Version} From 1f8197361ad7d43e8855a1374ef1c585c81043ac50da28ad9b5f6c5e203c8241 Mon Sep 17 00:00:00 2001 From: Marguerite Su Date: Sat, 19 Apr 2014 08:43:40 +0000 Subject: [PATCH 4/4] Accepting request 230841 from home:MargueriteSu:branches:M17N revert OBS-URL: https://build.opensuse.org/request/show/230841 OBS-URL: https://build.opensuse.org/package/show/M17N/fcitx?expand=0&rev=91 --- fcitx.changes | 6 ----- fcitx.spec | 62 --------------------------------------------------- 2 files changed, 68 deletions(-) diff --git a/fcitx.changes b/fcitx.changes index 4c9cef9..8f38f1e 100644 --- a/fcitx.changes +++ b/fcitx.changes @@ -1,9 +1,3 @@ -------------------------------------------------------------------- -Fri Apr 18 04:25:12 UTC 2014 - i@marguerite.su - -- split two sub-packages: fcitx-module-autoeng-orig and - fcitx-module-punc-orig to avoid conflicts with sogou-pinyin - ------------------------------------------------------------------- Thu Apr 17 16:10:11 UTC 2014 - i@marguerite.su diff --git a/fcitx.spec b/fcitx.spec index aaccf62..3a7d05c 100644 --- a/fcitx.spec +++ b/fcitx.spec @@ -80,8 +80,6 @@ BuildRequires: libicu-devel BuildRequires: libxml2-devel BuildRequires: xz Requires: %{name}-gtk2 = %{version}-%{release} -Requires: fcitx-module-autoeng = %{version} -Requires: fcitx-module-punc = %{version} Requires: lib%{name}%{libver} = %{version}-%{release} %if 0%{?suse_version} >= 1140 || 0%{?fedora_version} Requires: %{name}-gtk3 = %{version}-%{release} @@ -129,7 +127,6 @@ Shared libraries for Fcitx input method framework. Summary: Development files for %{name} Group: Development/Libraries/C and C++ Requires: %{name} = %{version}-%{release} -Requires: fcitx-module-punc-devel = %{version} %description devel Development header files for Fcitx input method framework. @@ -187,36 +184,6 @@ QT4 input module for Fcitx input method framework. %endif -%package -n fcitx-module-autoeng-orig -Summary: AutoEng module for fcitx input method -Group: System/I18n/Chinese -Requires: %{name} = %{version} -Provides: fcitx-module-autoeng = %{version} -Obsoletes: fcitx-module-autoeng < %{version} - -%description -n fcitx-module-autoeng-orig -This package provides an AutoEng module for fcitx. - -%package -n fcitx-module-punc-orig -Summary: Punc module for fcitx input method -Group: System/I18n/Chinese -Requires: %{name} = %{version} -Provides: fcitx-module-punc = %{version} -Obsoletes: fcitx-module-punc < %{version} - -%description -n fcitx-module-punc-orig -This package provides a Punc module for fcitx. - -%package -n fcitx-module-punc-orig-devel -Summary: Development headers for fcitx-module-punc-orig -Group: Development/Libraries/C and C++ -Requires: fcitx-module-punc-orig = %{version} -Provides: fcitx-module-punc-devel = %{version} -Obsoletes: fcitx-module-punc-devel < %{Version} - -%description -n fcitx-module-punc-orig-devel -Development headers for fcitx-module-punc-orig. - %package quwei Summary: Chinese Zone-bit(QuWei) engine for %{name} Group: System/I18n/Chinese @@ -632,20 +599,11 @@ update-desktop-database %{_datadir}/applications &>/dev/null || %exclude %{_datadir}/%{name}/table/* %exclude %{_datadir}/%{name}/imicon/* %exclude %{_datadir}/%{name}/inputmethod/* -%exclude %{_datadir}/%{name}/addon/%{name}-autoeng.conf -%exclude %{_datadir}/%{name}/addon/%{name}-punc.conf %exclude %{_datadir}/%{name}/addon/%{name}-pinyin.conf %exclude %{_datadir}/%{name}/addon/%{name}-table.conf %exclude %{_datadir}/%{name}/addon/%{name}-qw.conf -%exclude %{_datadir}/%{name}/configdesc/%{name}-autoeng.desc %exclude %{_datadir}/%{name}/configdesc/%{name}-pinyin.desc %exclude %{_datadir}/%{name}/configdesc/table.desc -%exclude %{_datadir}/%{name}/data/AutoEng.dat -%exclude %{_datadir}/%{name}/data/punc.mb.zh_CN -%exclude %{_datadir}/%{name}/data/punc.mb.zh_HK -%exclude %{_datadir}/%{name}/data/punc.mb.zh_TW -%exclude %{_libdir}/%{name}/fcitx-autoeng.so -%exclude %{_libdir}/%{name}/fcitx-punc.so %exclude %{_libdir}/%{name}/fcitx-pinyin.so %exclude %{_libdir}/%{name}/fcitx-table.so %exclude %{_libdir}/%{name}/fcitx-qw.so @@ -679,25 +637,6 @@ update-desktop-database %{_datadir}/applications &>/dev/null || %endif -%files -n fcitx-module-autoeng-orig -%defattr(-,root,root) -%{_libdir}/%{name}/%{name}-autoeng.so -%{_datadir}/%{name}/addon/%{name}-autoeng.conf -%{_datadir}/%{name}/configdesc/%{name}-autoeng.desc -%{_datadir}/%{name}/data/AutoEng.dat - -%files -n fcitx-module-punc-orig -%defattr(-,root,root) -%{_libdir}/%{name}/%{name}-punc.so -%{_datadir}/%{name}/addon/%{name}-punc.conf -%{_datadir}/%{name}/data/punc.mb.zh_CN -%{_datadir}/%{name}/data/punc.mb.zh_HK -%{_datadir}/%{name}/data/punc.mb.zh_TW - -%files -n fcitx-module-punc-orig-devel -%defattr(-,root,root) -%{_includedir}/fcitx/module/punc - %files quwei %defattr(-,root,root) %{_libdir}/%{name}/%{name}-qw.so @@ -813,7 +752,6 @@ update-desktop-database %{_datadir}/applications &>/dev/null || %if 0%{?suse_version} >= 1140 || 0%{?fedora_version} %{_datadir}/gir-1.0/Fcitx-1.0.gir %endif -%exclude %{_includedir}/fcitx/module/punc %if 0%{?suse_version} > 1110 || 0%{?fedora_version}