mozc: update to 2.26.4416.102.

This commit is contained in:
Đoàn Trần Công Danh 2021-07-03 12:44:54 +07:00
parent 15e69f3c5b
commit d6dd2a1c27
12 changed files with 139 additions and 130 deletions

View File

@ -1,7 +0,0 @@
To enable Mozc mode, add this to your ~/.emacs.d/init.el file:
(set-language-environment "Japanese")
(require 'mozc) ; or (load-file "/path/to/mozc.el")
(setq default-input-method "japanese-mozc")
C-\ is bound to `toggle-input-method' by default.

View File

@ -1,7 +0,0 @@
ibus-mozc always starts up in Direct Input mode. If you prefer Hiragana
mode by default, set the IBUS_MOZC_DEFAULT_HIRAGANA environment variable
for ibus-daemon, e.g.:
IBUS_MOZC_DEFAULT_HIRAGANA= ibus-daemon --xim -d
This is a Void Linux extension.

View File

@ -5,11 +5,10 @@ An all-in-one patch that fixes several issues:
1) UnscaledCycleClock not fully implemented for ppc*-musl (disabled on musl)
2) powerpc stacktrace implementation only works on glibc (disabled on musl)
3) powerpc stacktrace implementation has ppc64 assumptions (fixed)
4) examine_stack.cpp makes glibc assumptions on powerpc (fixed)
--- a/mozc/src/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.h
+++ b/mozc/src/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.h
--- a/abseil-cpp/absl/base/internal/unscaledcycleclock.h
+++ b/abseil-cpp/absl/base/internal/unscaledcycleclock.h
@@ -46,7 +46,7 @@
// The following platforms have an implementation of a hardware counter.
@ -19,8 +18,8 @@ An all-in-one patch that fixes several issues:
defined(_M_IX86) || defined(_M_X64)
#define ABSL_HAVE_UNSCALED_CYCLECLOCK_IMPLEMENTATION 1
#else
--- a/mozc/src/third_party/abseil-cpp/absl/debugging/internal/examine_stack.cc
+++ b/mozc/src/third_party/abseil-cpp/absl/debugging/internal/examine_stack.cc
--- a/abseil-cpp/absl/debugging/internal/examine_stack.cc
+++ b/abseil-cpp/absl/debugging/internal/examine_stack.cc
@@ -27,6 +27,10 @@
#include <csignal>
#include <cstdio>
@ -32,21 +31,21 @@ An all-in-one patch that fixes several issues:
#include "absl/base/attributes.h"
#include "absl/base/internal/raw_logging.h"
#include "absl/base/macros.h"
@@ -55,8 +59,10 @@
@@ -63,8 +67,10 @@ void* GetProgramCounter(void* vuc) {
return reinterpret_cast<void*>(context->uc_mcontext.pc);
#elif defined(__powerpc64__)
return reinterpret_cast<void*>(context->uc_mcontext.gp_regs[32]);
-#elif defined(__powerpc__)
+#elif defined(__powerpc__) && defined(__GLIBC__)
return reinterpret_cast<void*>(context->uc_mcontext.regs->nip);
+#elif defined(__powerpc__)
+ return reinterpret_cast<void*>(context->uc_mcontext.regs->nip);
#elif defined(__powerpc__)
- return reinterpret_cast<void*>(context->uc_mcontext.uc_regs->gregs[32]);
+ return reinterpret_cast<void*>(((struct pt_regs *)context->uc_regs)->nip);
#elif defined(__riscv)
return reinterpret_cast<void*>(context->uc_mcontext.__gregs[REG_PC]);
#elif defined(__s390__) && !defined(__s390x__)
--- a/mozc/src/third_party/abseil-cpp/absl/debugging/internal/stacktrace_config.h
+++ b/mozc/src/third_party/abseil-cpp/absl/debugging/internal/stacktrace_config.h
@@ -64,7 +64,7 @@
--- a/abseil-cpp/absl/debugging/internal/stacktrace_config.h
+++ b/abseil-cpp/absl/debugging/internal/stacktrace_config.h
@@ -55,7 +55,7 @@
#elif defined(__i386__) || defined(__x86_64__)
#define ABSL_STACKTRACE_INL_HEADER \
"absl/debugging/internal/stacktrace_x86-inl.inc"
@ -55,19 +54,3 @@ An all-in-one patch that fixes several issues:
#define ABSL_STACKTRACE_INL_HEADER \
"absl/debugging/internal/stacktrace_powerpc-inl.inc"
#elif defined(__aarch64__)
--- a/mozc/src/third_party/abseil-cpp/absl/debugging/internal/stacktrace_powerpc-inl.inc
+++ b/mozc/src/third_party/abseil-cpp/absl/debugging/internal/stacktrace_powerpc-inl.inc
@@ -130,8 +130,13 @@
StacktracePowerPCGetLR(new_sp) == kernel_sigtramp_rt64_address) {
const ucontext_t* signal_context =
reinterpret_cast<const ucontext_t*>(uc);
+#if defined(__powerpc64__)
void **const sp_before_signal =
reinterpret_cast<void**>(signal_context->uc_mcontext.gp_regs[PT_R1]);
+#else
+ void **const sp_before_signal =
+ reinterpret_cast<void**>(signal_context->uc_mcontext.uc_regs->gregs[PT_R1]);
+#endif
// Check that alleged sp before signal is nonnull and is reasonably
// aligned.
if (sp_before_signal != nullptr &&

View File

@ -0,0 +1,13 @@
--- a/mozc/src/config.bzl
+++ b/mozc/src/config.bzl
@@ -30,9 +30,9 @@
BRANDING = "Mozc"
LINUX_MOZC_SERVER_DIRECTORY = "/usr/lib/mozc"
IBUS_MOZC_ICON_PATH = "/usr/share/ibus-mozc/product_icon.png"
-IBUS_MOZC_PATH = "/usr/lib/ibus-mozc/ibus-engine-mozc"
+IBUS_MOZC_PATH = "/usr/lib/ibus/ibus-engine-mozc"
MACOS_BUNDLE_ID_PREFIX = "org.mozc.inputmethod.Japanese"
MACOS_MIN_OS_VER = "10.12"

View File

@ -1,5 +1,3 @@
Index: mozc/src/gyp/common.gypi
===================================================================
--- a/mozc/src/gyp/common.gypi
+++ b/mozc/src/gyp/common.gypi
@@ -409,12 +409,12 @@

View File

@ -1,5 +1,3 @@
Index: mozc/src/gyp/common.gypi
===================================================================
--- a/mozc/src/gyp/common.gypi
+++ b/mozc/src/gyp/common.gypi
@@ -105,7 +105,7 @@

View File

@ -1,5 +1,3 @@
Index: mozc/src/unix/fcitx/fcitx.gyp
===================================================================
--- a/mozc/src/unix/fcitx/fcitx.gyp
+++ b/mozc/src/unix/fcitx/fcitx.gyp
@@ -96,7 +96,7 @@

View File

@ -1,8 +1,6 @@
Index: mozc/src/gui/gui.gyp
===================================================================
--- a/mozc/src/gui/gui.gyp
+++ b/mozc/src/gui/gui.gyp
@@ -790,6 +790,13 @@
@@ -791,6 +791,13 @@
'tool/mozc_tool_main_noqt.cc',
],
}],
@ -16,8 +14,6 @@ Index: mozc/src/gui/gui.gyp
# For Mac, ConfigDialog is the host app for necessary frameworks.
['OS=="win"', {
'product_name': '<(tool_product_name_win)',
Index: mozc/src/gyp/defines.gypi
===================================================================
--- a/mozc/src/gyp/defines.gypi
+++ b/mozc/src/gyp/defines.gypi
@@ -68,6 +68,9 @@
@ -30,8 +26,6 @@ Index: mozc/src/gyp/defines.gypi
},
'target_defaults': {
'defines': [
Index: mozc/src/renderer/renderer.gyp
===================================================================
--- a/mozc/src/renderer/renderer.gyp
+++ b/mozc/src/renderer/renderer.gyp
@@ -592,6 +592,15 @@
@ -50,8 +44,6 @@ Index: mozc/src/renderer/renderer.gyp
},
{
'target_name': 'gtk_renderer_test',
Index: mozc/src/server/server.gyp
===================================================================
--- a/mozc/src/server/server.gyp
+++ b/mozc/src/server/server.gyp
@@ -55,6 +55,13 @@
@ -68,8 +60,6 @@ Index: mozc/src/server/server.gyp
['OS=="mac"', {
'product_name': '<(branding)Converter',
'sources': [
Index: mozc/src/unix/emacs/emacs.gyp
===================================================================
--- a/mozc/src/unix/emacs/emacs.gyp
+++ b/mozc/src/unix/emacs/emacs.gyp
@@ -46,6 +46,15 @@
@ -88,8 +78,6 @@ Index: mozc/src/unix/emacs/emacs.gyp
},
{
'target_name': 'mozc_emacs_helper_lib',
Index: mozc/src/unix/fcitx/fcitx.gyp
===================================================================
--- a/mozc/src/unix/fcitx/fcitx.gyp
+++ b/mozc/src/unix/fcitx/fcitx.gyp
@@ -98,6 +98,15 @@
@ -108,8 +96,6 @@ Index: mozc/src/unix/fcitx/fcitx.gyp
},
],
}, {
Index: mozc/src/unix/fcitx5/fcitx5.gyp
===================================================================
--- a/mozc/src/unix/fcitx5/fcitx5.gyp
+++ b/mozc/src/unix/fcitx5/fcitx5.gyp
@@ -105,6 +105,15 @@
@ -128,8 +114,6 @@ Index: mozc/src/unix/fcitx5/fcitx5.gyp
},
],
}, {
Index: mozc/src/unix/ibus/ibus.gyp
===================================================================
--- a/mozc/src/unix/ibus/ibus.gyp
+++ b/mozc/src/unix/ibus/ibus.gyp
@@ -239,6 +239,15 @@

View File

@ -1,5 +1,3 @@
Index: mozc/src/build_mozc.py
===================================================================
--- a/mozc/src/build_mozc.py
+++ b/mozc/src/build_mozc.py
@@ -496,6 +496,7 @@ def GypMain(options, unused_args):

View File

@ -1,5 +1,3 @@
Index: mozc/src/gui/word_register_dialog/word_register_dialog.cc
===================================================================
--- a/mozc/src/gui/word_register_dialog/word_register_dialog.cc
+++ b/mozc/src/gui/word_register_dialog/word_register_dialog.cc
@@ -94,7 +94,7 @@ QString GetEnv(const char *envname) {
@ -11,8 +9,6 @@ Index: mozc/src/gui/word_register_dialog/word_register_dialog.cc
}
}
return QLatin1String("");
Index: mozc/src/unix/fcitx/surrounding_text_util.cc
===================================================================
--- a/mozc/src/unix/fcitx/surrounding_text_util.cc
+++ b/mozc/src/unix/fcitx/surrounding_text_util.cc
@@ -41,10 +41,10 @@
@ -89,8 +85,6 @@ Index: mozc/src/unix/fcitx/surrounding_text_util.cc
const std::string primary_text(primary);
if (SurroundingTextUtil::GetAnchorPosFromSelection(
surrounding_text, primary_text,
Index: mozc/src/unix/fcitx/surrounding_text_util.h
===================================================================
--- a/mozc/src/unix/fcitx/surrounding_text_util.h
+++ b/mozc/src/unix/fcitx/surrounding_text_util.h
@@ -55,7 +55,7 @@ class SurroundingTextUtil {
@ -113,8 +107,6 @@ Index: mozc/src/unix/fcitx/surrounding_text_util.h
private:
DISALLOW_IMPLICIT_CONSTRUCTORS(SurroundingTextUtil);
Index: mozc/src/unix/fcitx5/surrounding_text_util.cc
===================================================================
--- a/mozc/src/unix/fcitx5/surrounding_text_util.cc
+++ b/mozc/src/unix/fcitx5/surrounding_text_util.cc
@@ -43,10 +43,10 @@ namespace fcitx {
@ -186,8 +178,6 @@ Index: mozc/src/unix/fcitx5/surrounding_text_util.cc
if (SurroundingTextUtil::GetAnchorPosFromSelection(
surrounding_text, primary, cursor_pos, &new_anchor_pos)) {
anchor_pos = new_anchor_pos;
Index: mozc/src/unix/fcitx5/surrounding_text_util.h
===================================================================
--- a/mozc/src/unix/fcitx5/surrounding_text_util.h
+++ b/mozc/src/unix/fcitx5/surrounding_text_util.h
@@ -56,7 +56,7 @@ class SurroundingTextUtil {

View File

@ -1,37 +1,35 @@
# Template file for 'mozc'
pkgname=mozc
# src/data/version/mozc_version_template.bzl
version=2.26.4353.100
revision=2
version=2.26.4416.102
revision=1
_commit=86b2623896042dd6e123371fb582314c6988888b
_abseil=20210324.1
create_wrksrc=yes
build_wrksrc=mozc/src
hostmakedepends="gettext ninja pkg-config protobuf protobuf-devel
python3-six which qt5-qmake qt5-host-tools"
makedepends="gtk+-devel ibus-devel libzinnia-devel protobuf-devel qt5-devel
fcitx-devel libfcitx5-devel"
depends="tegaki-zinnia-japanese>=0.3"
depends="tegaki-zinnia-japanese>=0.3 mozc-base-${version}_${revision}"
short_desc="Japanese IME (Open Source version of Google Japanese Input)"
maintainer="Matthias von Faber <mvf@gmx.eu>"
license="BSD-3-Clause"
homepage="https://github.com/google/mozc"
distfiles="
https://github.com/fcitx/mozc/archive/d384c3b3e7eed1aa54a6af3363781604fe538d65.tar.gz
https://github.com/abseil/abseil-cpp/archive/0f3bb466b868b523cf1dc9b2aaaed65c77b28862.tar.gz
https://github.com/fcitx/mozc/archive/$_commit.tar.gz
https://github.com/abseil/abseil-cpp/archive/refs/tags/$_abseil.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="69cb26e1f9c03e20715356ef568b583f2baf996df5fd8536aca2ed8e7bd9444f
3d74cdc98b42fd4257d91f652575206de195e2c824fcd8d6e6d227f85cb143ef
checksum="68614d1283e52b3d7035f76e587ed057a3292d6dc25d61100122dc0fd8942c15
441db7c09a0565376ecacf0085b2d4c2bbedde6115d7773551bc116212c2a8d6
8d531bc7d3302461d76a32367453cec60ed08b455f27a53d8f313d81761713a8
0b6efee0eebac2c1a8eeea333278aa40fcef7846bba9a379962c6e567e7e3dc1"
CXXFLAGS="-D_GNU_SOURCE"
lib32disabled=yes
if [ "$CROSS_BUILD" ]; then
subpackages="ibus-mozc fcitx-mozc fcitx5-mozc"
fi
if [ "$XBPS_TARGET_ENDIAN" = "be" ]; then
broken="Does not build"
fi
@ -49,9 +47,10 @@ post_extract() {
japanese-usage-dictionary:japanese_usage_dictionary
do
_src=${_src_dest%:*}
_dst=mozc/src/third_party/${_src_dest#*:}
rmdir $_dst
ln -sr $_src-* $_dst
_dst=${_src_dest#*:}
mv $_src-* $_dst
rmdir mozc/src/third_party/$_dst
ln -sr $_dst mozc/src/third_party
done
}
@ -64,6 +63,7 @@ post_patch() {
do_configure() {
GYP_DEFINES="
document_dir=/usr/share/licenses/${pkgname}
ibus_mozc_path=/usr/lib/ibus/ibus-engine-mozc
use_libprotobuf=1
use_libzinnia=1
${XBPS_TARGET_NO_ATOMIC8:+use_libatomic=1}
@ -71,6 +71,9 @@ do_configure() {
}
do_build() {
local _file _lang
local _modir=out_linux/Release/gen/unix/fcitx5/po
python3 build_mozc.py build -c Release \
server/server.gyp:mozc_server \
gui/gui.gyp:mozc_tool \
@ -80,82 +83,140 @@ do_build() {
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
mkdir -p $_modir
for _file in unix/fcitx5/po/*.po
do
_lang=${_file##*/}
_lang=${_lang%.po}
msgfmt "$_file" -o $_modir/$_lang.mo
done
msgfmt --xml -d unix/fcitx5/po \
--template unix/fcitx5/org.fcitx.Fcitx5.Addon.Mozc.metainfo.xml.in \
-o $_modir/org.fcitx.Fcitx5.Addon.Mozc.metainfo.xml
}
do_install() {
local f
# Base package
vinstall out_linux/Release/mozc_server 755 usr/lib/mozc
vlicense data/installer/credits_en.html license.html
head -n 29 unix/fcitx5/fcitx_key_translator.cc >fcitx.LICENSE
vlicense fcitx.LICENSE
# emacs
vbin out_linux/Release/mozc_emacs_helper
vinstall unix/emacs/mozc.el 644 usr/share/emacs/site-lisp
# Qt5 tools
vinstall out_linux/Release/mozc_tool 755 usr/lib/mozc
# ibus
vinstall out_linux/Release/ibus_mozc 755 usr/lib/ibus ibus-engine-mozc
vinstall out_linux/Release/gen/unix/ibus/mozc.xml 644 \
usr/share/ibus/component
vinstall data/images/product_icon_32bpp-128.png 644 \
usr/share/ibus-mozc product_icon.png
for f in data/images/unix/48x48/*.png; do
vinstall "$f" 644 usr/share/ibus-mozc
done
vinstall out_linux/Release/mozc_renderer 755 usr/lib/mozc
# fcitx
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
vinstall data/images/product_icon_32bpp-128.png 644 \
usr/share/fcitx/mozc/icon mozc.png
for f in dictionary properties tool; do
vinstall ../scripts/icons/ui-$f.png 644 \
usr/share/fcitx/mozc/icon mozc-$f.png
done
for f in alpha_full alpha_half direct \
hiragana katakana_full katakana_half; do
vinstall data/images/unix/48x48/$f.png 644 \
usr/share/fcitx/mozc/icon mozc-$f.png
done
# fcitx5
vinstall out_linux/Release/fcitx5-mozc.so 644 usr/lib/fcitx5
vinstall unix/fcitx5/mozc-addon.conf 644 \
usr/share/fcitx5/addon mozc.conf
vinstall unix/fcitx5/mozc.conf 644 usr/share/fcitx5/inputmethod
vinstall data/images/product_icon_32bpp-128.png 644 \
usr/share/icons/hicolor/128x128/apps fcitx-mozc.png
vinstall data/images/unix/ime_product_icon_opensource-32.png 644 \
usr/share/icons/hicolor/32x32/apps fcitx-mozc.png
for f in dictionary properties tool; do
vinstall ../scripts/icons/ui-$f.png 644 \
usr/share/icons/hicolor/48x48/apps fcitx-mozc-$f.png
done
for f in alpha_full alpha_half direct \
hiragana katakana_full katakana_half; do
vinstall data/images/unix/48x48/$f.png 644 \
usr/share/icons/hicolor/48x48/apps fcitx-mozc-${f/_/-}.png
done
vinstall out_linux/Release/gen/unix/fcitx5/po/org.fcitx.Fcitx5.Addon.Mozc.metainfo.xml \
644 usr/share/metainfo/
}
head -n 29 unix/fcitx5/fcitx_key_translator.cc >mozc.LICENSE
vlicense mozc.LICENSE
vlicense data/installer/credits_en.html
vlicense third_party/japanese_usage_dictionary/LICENSE dict.LICENSE
mozc-base_package() {
short_desc+=" - base installation"
lib32disabled=yes
replaces="emacs-mozc>=0"
provides="emacs-mozc-${version}_${revision}"
pkg_install() {
vmove usr/bin
vmove usr/lib/mozc/mozc_server
vmove usr/share/emacs
vmove usr/share/licenses
}
}
ibus-mozc_package() {
short_desc="Mozc engine for IBus - Client of the Mozc input method"
depends="${sourcepkg}-${version}_${revision} ibus>=1.5.14"
depends="mozc-base-${version}_${revision} ibus>=1.5.14"
lib32disabled=yes
pkg_install() {
vinstall out_linux/Release/ibus_mozc 755 usr/lib/ibus-mozc ibus-engine-mozc
vinstall out_linux/Release/gen/unix/ibus/mozc.xml 644 usr/share/ibus/component
vinstall data/images/unix/ime_product_icon_opensource-32.png 644 usr/share/ibus-mozc product_icon.png
for i in data/images/unix/ui-*.png; do
vinstall "${i}" 644 usr/share/ibus-mozc "${i##*/ui-}"
done
vinstall out_linux/Release/mozc_renderer 755 usr/lib/mozc
}
}
emacs-mozc_package() {
pkgdesc="Mozc for Emacs"
depends="${sourcepkg}-${version}_${revision} emacs"
lib32disabled=yes
pkg_install() {
vbin out_linux/Release/mozc_emacs_helper
vinstall unix/emacs/mozc.el 644 usr/share/emacs/site-lisp/emacs-mozc
vmove usr/lib/ibus
vmove usr/lib/mozc/mozc_renderer
vmove "usr/share/ibus*"
}
}
fcitx-mozc_package() {
short_desc="Mozc engine for fcitx - Client of the Mozc input method"
depends="${sourcepkg}-${version}_${revision} fcitx>=4.2.9"
depends="mozc-base-${version}_${revision} fcitx>=4.2.9"
homepage="https://fcitx-im.org/"
lib32disabled=yes
pkg_install() {
local _file _lang
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
vinstall data/images/unix/ime_product_icon_opensource-32.png \
644 usr/share/fcitx/icon mozc.png
vmove usr/lib/fcitx
vmove usr/share/fcitx
# vmove "usr/share/locale/*/LC_MESSAGES/fcitx-mozc.mo"
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
vinstall "$_file" 644 \
usr/share/locale/$_lang/LC_MESSAGES fcitx-mozc.mo
done
}
}
fcitx5-mozc_package() {
short_desc="Mozc engine for fcitx v5"
depends="${sourcepkg}-${version}_${revision} fcitx5"
depends="mozc-base-${version}_${revision} fcitx5"
homepage="https://fcitx-im.org/"
lib32disabled=yes
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/fcitx5/addon mozc.conf
vinstall unix/fcitx5/mozc.conf 644 usr/share/fcitx5/inputmethod
for _file in unix/fcitx5/po/*.po
vmove usr/lib/fcitx5
vmove usr/share/fcitx5
vmove usr/share/icons
# vmove "usr/share/locale/*/LC_MESSAGES/fcitx5-mozc.mo"
for _file in out_linux/Release/gen/unix/fcitx5/po/*.mo
do
_lang=${_file##*/}
_lang=${_lang%.po}
vmkdir usr/share/locale/$_lang
msgfmt "$_file" -o $PKGDESTDIR/usr/share/locale/$_lang/fcitx5-mozc.mo
_lang=${_lang%.mo}
vinstall "$_file" 644 \
usr/share/locale/$_lang/LC_MESSAGES fcitx5-mozc.mo
done
vmove usr/share/metainfo
}
}