From c0e57a08962d505e478c2b22c660e44d748b36cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?= Date: Sun, 25 Apr 2021 22:53:14 +0700 Subject: [PATCH] mozc: update to 2.26.4346.100. --- srcpkgs/fcitx5-mozc | 1 + srcpkgs/mozc/patches/fcitx.patch | 13 +++++ srcpkgs/mozc/patches/fcitx5.patch | 41 ++++++++++++++ srcpkgs/mozc/patches/reiwa-era.patch | 13 +++++ srcpkgs/mozc/patches/standard.patch | 16 ++++++ srcpkgs/mozc/template | 82 +++++++++++++++++----------- 6 files changed, 135 insertions(+), 31 deletions(-) create mode 120000 srcpkgs/fcitx5-mozc create mode 100644 srcpkgs/mozc/patches/fcitx.patch create mode 100644 srcpkgs/mozc/patches/fcitx5.patch create mode 100644 srcpkgs/mozc/patches/reiwa-era.patch create mode 100644 srcpkgs/mozc/patches/standard.patch diff --git a/srcpkgs/fcitx5-mozc b/srcpkgs/fcitx5-mozc new file mode 120000 index 000000000000..6874ca426b5f --- /dev/null +++ b/srcpkgs/fcitx5-mozc @@ -0,0 +1 @@ +mozc \ No newline at end of file diff --git a/srcpkgs/mozc/patches/fcitx.patch b/srcpkgs/mozc/patches/fcitx.patch new file mode 100644 index 000000000000..1ed6d01516f5 --- /dev/null +++ b/srcpkgs/mozc/patches/fcitx.patch @@ -0,0 +1,13 @@ +Index: mozc/src/unix/fcitx/fcitx.gyp +=================================================================== +--- mozc/src/unix/fcitx/fcitx.gyp.orig ++++ mozc/src/unix/fcitx/fcitx.gyp +@@ -96,7 +96,7 @@ + '<@(fcitx_dep_include_dirs)', + ], + 'defines': [ +- 'LOCALEDIR=" candidate(int idx) const override { ++ const CandidateWord& candidate(int idx) const override { + checkIndex(idx); +- return candidateWords_[idx]; ++ return *candidateWords_[idx]; + } + int size() const override { return candidateWords_.size(); } + +Index: mozc/src/unix/fcitx5/mozc_state.cc +=================================================================== +--- mozc/src/unix/fcitx5/mozc_state.cc.orig ++++ mozc/src/unix/fcitx5/mozc_state.cc +@@ -241,7 +241,7 @@ bool MozcState::ProcessKeyEvent(KeySym s + + if (normalized_key.check(Key(FcitxKey_Escape))) { + displayUsage_ = false; +- ProcessKeyEvent(FcitxKey_VoidSymbol, 0, KeyState::None, layout_is_jp, ++ ProcessKeyEvent(FcitxKey_VoidSymbol, 0, KeyState::NoState, layout_is_jp, + false); + } + return true; +Index: mozc/src/unix/fcitx5/mozc.conf +=================================================================== +--- mozc/src/unix/fcitx5/mozc.conf.orig ++++ mozc/src/unix/fcitx5/mozc.conf +@@ -1,6 +1,6 @@ + [InputMethod] + Name=Mozc +-Icon=PREFIX/share/fcitx5/mozc/icon/mozc.png ++Icon=/usr/share/fcitx5/mozc/icon/mozc.png + Label=あ + LangCode=ja + Addon=mozc diff --git a/srcpkgs/mozc/patches/reiwa-era.patch b/srcpkgs/mozc/patches/reiwa-era.patch new file mode 100644 index 000000000000..ad9eb4444e0c --- /dev/null +++ b/srcpkgs/mozc/patches/reiwa-era.patch @@ -0,0 +1,13 @@ +Index: mozc/src/data/dictionary_oss/dictionary08.txt +=================================================================== +--- mozc/src/data/dictionary_oss/dictionary08.txt.orig ++++ mozc/src/data/dictionary_oss/dictionary08.txt +@@ -8591,6 +8591,8 @@ + れいれいと 12 12 7349 れいれいと + れいろう 1847 1847 7276 玲瓏 + れいわ 1847 1847 8251 例話 ++れいわ 1895 1895 1690 令和 ++れいわ 1898 1898 4000 令和 + れいんこーと 1847 1847 5568 レインコート + れいんじゃー 1847 1847 7459 レインジャー + れいんず 1917 1917 3548 レインズ diff --git a/srcpkgs/mozc/patches/standard.patch b/srcpkgs/mozc/patches/standard.patch new file mode 100644 index 000000000000..ca002e8b9854 --- /dev/null +++ b/srcpkgs/mozc/patches/standard.patch @@ -0,0 +1,16 @@ +Index: mozc/src/unix/fcitx5/fcitx5.gyp +=================================================================== +--- mozc/src/unix/fcitx5/fcitx5.gyp.orig ++++ mozc/src/unix/fcitx5/fcitx5.gyp +@@ -112,10 +112,10 @@ + 'fcitx5_build_environment', + ], + 'cflags_cc': [ +- '-std=c++14', ++ '-std=c++17', + ], + 'cflags_cc!': [ + '-std=gnu++0x' + ], + 'cflags!': [ + '-fno-exceptions', diff --git a/srcpkgs/mozc/template b/srcpkgs/mozc/template index 71d32eb5b9cd..565310f60bdd 100644 --- a/srcpkgs/mozc/template +++ b/srcpkgs/mozc/template @@ -1,32 +1,30 @@ # Template file for 'mozc' pkgname=mozc -version=2.23.2815.102 -revision=10 +version=2.26.4346.100 +revision=1 create_wrksrc=yes build_wrksrc=mozc/src -hostmakedepends="gettext ninja pkg-config protobuf protobuf-devel python which" +hostmakedepends="gettext ninja pkg-config protobuf protobuf-devel python which + qt5-qmake qt5-host-tools" makedepends="gtk+-devel ibus-devel libzinnia-devel protobuf-devel qt5-devel - fcitx-devel" + fcitx-devel libfcitx5-devel" depends="tegaki-zinnia-japanese>=0.3" short_desc="Japanese IME (Open Source version of Google Japanese Input)" maintainer="Matthias von Faber " license="BSD-3-Clause" homepage="https://github.com/google/mozc" distfiles=" - https://gitlab.com/fcitx/mozc/repository/dad94584ea5012110ad1d204e433964243a1639d/archive.tar.bz2>${pkgname}-${version}.tar.bz2 - https://github.com/bnoordhuis/gyp/archive/c6f471687407bf28ddfc63f1a8f47aeb7bf54edc.tar.gz + https://github.com/fcitx/mozc/archive/dad94584ea5012110ad1d204e433964243a1639d.tar.gz + ${DEBIAN_SITE}/main/g/gyp/gyp_0.1+20200513gitcaa6002.orig.tar.gz https://github.com/hiroyuki-komatsu/japanese-usage-dictionary/archive/e5b3425575734c323e1d947009dd74709437b684.tar.gz " -checksum=" - e38457e63a7fa8d62d87b4f8b3e89fe5f6939d92e3c4fd287a93358375693892 - 882f074cbb3a4f2bba550fb615e63949c0fbf39eeb1718a0330b4a545ab97616 - 0b6efee0eebac2c1a8eeea333278aa40fcef7846bba9a379962c6e567e7e3dc1 -" +checksum="09835994e4fa0f4e4e2ea4e171900c5e37c35680c4db86eb5a89be7bd82c420f + 8d531bc7d3302461d76a32367453cec60ed08b455f27a53d8f313d81761713a8 + 0b6efee0eebac2c1a8eeea333278aa40fcef7846bba9a379962c6e567e7e3dc1" CXXFLAGS="-D_GNU_SOURCE" if [ "$CROSS_BUILD" ]; then - hostmakedepends+=" qt5-devel" subpackages="ibus-mozc fcitx-mozc" fi @@ -36,7 +34,6 @@ fi post_extract() { ln -s mozc-* mozc - rm -rf mozc/src/unix/fcitx5 # symlink "submodules" into place for _src_dest in gyp japanese-usage-dictionary:japanese_usage_dictionary; do @@ -45,17 +42,15 @@ post_extract() { rmdir $_dst ln -sr $_src-* $_dst done +} - if [ "$CROSS_BUILD" ]; then - # find fcitx4-config - sed -i -e "s;fcitx4-config;${XBPS_CROSS_BASE}/usr/bin/fcitx4-config;" mozc/src/unix/fcitx/fcitx.gyp +post_patch() { + if [ "$XBPS_TARGET_LIBC" = musl ]; then + vsed -i -e 's|PTHREAD_MUTEX_RECURSIVE_NP|PTHREAD_MUTEX_RECURSIVE|g' base/mutex.cc fi } do_configure() { - case "$XBPS_TARGET_MACHINE" in - *-musl) sed -i -e 's|PTHREAD_MUTEX_RECURSIVE_NP|PTHREAD_MUTEX_RECURSIVE|g' base/mutex.cc ;; - esac GYP_DEFINES=" document_dir=/usr/share/licenses/${pkgname} use_libprotobuf=1 @@ -64,16 +59,14 @@ do_configure() { } do_build() { - local targets - targets=" - server/server.gyp:mozc_server - gui/gui.gyp:mozc_tool - unix/emacs/emacs.gyp:mozc_emacs_helper - unix/ibus/ibus.gyp:ibus_mozc - renderer/renderer.gyp:mozc_renderer - unix/fcitx/fcitx.gyp:fcitx-mozc - " - python2 build_mozc.py build -c Release $targets + python2 build_mozc.py build -c Release \ + server/server.gyp:mozc_server \ + gui/gui.gyp:mozc_tool \ + unix/emacs/emacs.gyp:mozc_emacs_helper \ + unix/ibus/ibus.gyp:ibus_mozc \ + renderer/renderer.gyp:mozc_renderer \ + unix/fcitx/fcitx.gyp:fcitx-mozc \ + unix/fcitx5/fcitx5.gyp:fcitx5-mozc sed -i 's|/usr/libexec/|/usr/lib/ibus-mozc/|g' out_linux/Release/gen/unix/ibus/mozc.xml } @@ -82,7 +75,7 @@ do_install() { vinstall out_linux/Release/mozc_server 755 usr/lib/mozc vinstall out_linux/Release/mozc_tool 755 usr/lib/mozc - head -n 29 server/mozc_server.cc > LICENSE + head -n 29 unix/fcitx5/fcitx_key_translator.cc >LICENSE for i in LICENSE data/installer/*.html; do vlicense "$i" done @@ -115,10 +108,37 @@ fcitx-mozc_package() { short_desc="Mozc engine for fcitx - Client of the Mozc input method" depends="${sourcepkg}-${version}_${revision} fcitx>=4.2.9" homepage="https://fcitx-im.org/" - license="GPL-2.0-or-later" pkg_install() { + local _file _lang + head -n 29 unix/fcitx/fcitx_key_translator.cc \ + >unix/fcitx/LICENSE + vlicense unix/fcitx/LICENSE vinstall out_linux/Release/fcitx-mozc.so 644 usr/lib/fcitx vinstall unix/fcitx/fcitx-mozc.conf 644 usr/share/fcitx/addon vinstall unix/fcitx/mozc.conf 644 usr/share/fcitx/inputmethod + for _file in out_linux/Release/gen/unix/fcitx/po/*.mo + do + _lang=${_file##*/} + _lang=${_lang%.mo} + vinstall "$_file" 644 usr/share/locale/$_lang fcitx-mozc.mo + done + } +} + +fcitx5-mozc_package() { + short_desc="Mozc engine for fcitx v5" + depends="${sourcepkg}-${version}_${revision} fcitx5" + homepage="https://fcitx-im.org/" + pkg_install() { + local _file _lang + vinstall out_linux/Release/fcitx5-mozc.so 644 usr/lib/fcitx5 + vinstall unix/fcitx5/mozc-addon.conf 644 usr/share/fcitx/addon + vinstall unix/fcitx/mozc.conf 644 usr/share/fcitx/inputmethod + for _file in out_linux/Release/gen/unix/fcitx5/po/*.mo + do + _lang=${_file##*/} + _lang=${_lang%.mo} + vinstall "$_file" 644 usr/share/locale/$_lang fcitx5-mozc.mo + done } }