* [gentoo-commits] repo/gentoo:master commit in: app-i18n/mozc/, app-i18n/mozc/files/
@ 2017-09-28 17:18 Mike Gilbert
0 siblings, 0 replies; 7+ messages in thread
From: Mike Gilbert @ 2017-09-28 17:18 UTC (permalink / raw
To: gentoo-commits
commit: ab7a7c7c7ca7b03d914d8106a5462f726e8d0a0b
Author: Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Thu Sep 28 15:52:59 2017 +0000
Commit: Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Thu Sep 28 17:11:00 2017 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ab7a7c7c
app-i18n/mozc: Version bump (2.20.2673.102).
Upstream migrated from Qt 4 to Qt 5.
"qt4" / "qt5" USE flag renamed to "gui".
"fcitx" USE flag renamed to "fcitx4".
("fcitx5" USE flag will be used to control support for Fcitx 5.)
"handwriting-tegaki" and "handwriting-tomoe" USE flags introduced to select usage
of handwriting recognition model from app-i18n/tegaki-zinnia-japanese or
app-i18n/zinnia-tomoe. "handwriting-tegaki" is enabled by default in accordance
with upstream default for Mozc.
Test suite unrestricted and fixed to build.
app-i18n/mozc/Manifest | 3 +
.../mozc-2.20.2673.102-system_libraries.patch | 133 +++++++++
.../files/mozc-2.20.2673.102-tests_build.patch | 27 ++
.../files/mozc-2.20.2673.102-tests_skipping.patch | 70 +++++
app-i18n/mozc/metadata.xml | 6 +-
app-i18n/mozc/mozc-2.20.2673.102.ebuild | 309 +++++++++++++++++++++
6 files changed, 547 insertions(+), 1 deletion(-)
diff --git a/app-i18n/mozc/Manifest b/app-i18n/mozc/Manifest
index c88789227fd..ee7002187dc 100644
--- a/app-i18n/mozc/Manifest
+++ b/app-i18n/mozc/Manifest
@@ -1,10 +1,13 @@
DIST fcitx-mozc-2.16.2037.102.2.patch 140421 SHA256 ff175f3e0301c33f750780765ea264887827d00bc7a59fc8b55ae514ba449a1e SHA512 22b885859588bb8e0efd354d153da461a654203729c723156a419bf33fae473e3f7165964aa3cb3b5c969f97c2727f9d87b0d587330e4eeab67f07d4458542a3 WHIRLPOOL cd9534c8904a7c9f866a8ddd41ab4c57b3ad8b5650fda4cf9ccc1e544c8e0da25c749870606687ee66e4252f224babdbe10415e035038ced654812bad8d299dc
+DIST fcitx-mozc-2.18.2612.102.1.patch 140722 SHA256 0ec5dc2e9798ce7a6dbcbe847cf016b0b49be1851008143d167c13333a15ed27 SHA512 725c464727f230707b90975705ef1565f1178f9144e66c5a688696a4ef520a6fec1d11f7aa68ee05f82aa9417060b1cccf49a155e30734871a525eaa4c76addb WHIRLPOOL 25d0efd313175f6648504b989302c73ab6d82a0cf4eecf332b68347331e1feff2df6251edd49c3d4e9251a2c7e01df56eb8de54ebbbc31582f7c2b89d1da53c1
DIST gmock-1.6.0.zip 2053682 SHA256 341ad07c31c619ba32c88c2265bc23693da1df062f47f146a7ed340f646d82b7 SHA512 7adff00bb6ff81a6ffb704be71d0747636d69e24b4a8b709e1fb8c177a9a47f6dea8d14fde73034ebfb1529c291c7212a944ad92a34f88abdfe23c2d0b11b6f7 WHIRLPOOL 1a03ff8f2d96287f5deb24f970688f20f3480e77a4a71089ef1399a87f28f616bf0feaedc217e7ac1ca8ca1246e53f5d882f350704be111ae547961949939530
DIST gtest-1.6.0.zip 1121697 SHA256 5ec97df8e75b4ee796604e74716d1b50582beba22c5502edd055a7e67a3965d8 SHA512 f4718dfbfa3339bb9449c3f14e5b44ae405ea7df64c10a0957a6300985b71c4642981d069a1382e27ae041a4e2873527a9e442aff978447e795a190f99fac115 WHIRLPOOL 745a49020d4353ed2fa38adfc80bbd777358c831719bbe3b7c90d243f84256615222ba5f04d48d98b9e1a803bb40766799b3aedd575024c19d853d9239a12f8a
DIST gyp-20140602.tar.bz2 432422 SHA256 f67be748f4dc36aa1619f43d4624c746728cf268af7f4ebf78dab3fa6d43d973 SHA512 e3a59daac57ddafc5804384c01cf51d4b90cd119d263afd83ec6eef9239c38bc7715736f70e20e44fae04fd8be1b86aa5323908a92d574372aa298f3355ce15f WHIRLPOOL 17e4630dcd7592e8ee197b4130d6147d9fd63404938f62e08ad10a204bd4bddcfc7d394abf3572a337e3dea46d4a7361dbc0cccc02e07ab99ed8f90e80830451
DIST japanese-usage-dictionary-10.tar.bz2 56142 SHA256 8c22284c97fdfad854790517f9200c439453c033db8f6a9d25aa5d95266b2384 SHA512 f299cf9183b9ec219d80c1fa745f351765d246d601f3c4091d1705e3c8b5ef66a32288d4c162e7bbc456b6d49ee90f1e5bf33721e1229165f3ee069daddd3198 WHIRLPOOL d2f690335cf271b0780c969f56616ece9d28f3dbe990548053a252c855db18a4a31d21e6bd8c34160c0893c21fab4543e5ff3cecb48c7f6ecfd5c84465d314a6
+DIST japanese-usage-dictionary-20120416091336.tar.gz 71051 SHA256 0b6efee0eebac2c1a8eeea333278aa40fcef7846bba9a379962c6e567e7e3dc1 SHA512 b7e997a979b6d50e49b9af5dc830ea4df0532f6ab1321b9ef14983f65bb54f1b2967375c82e07957ae7693ebbf43c9b56ecea6bfea8dd1fdaee444bd549d83a7 WHIRLPOOL 1c4324a6408cfc0b2e1df33a32583384ccf10374bc1a8f49f574e681a72174f7bee7e8500c93d714ee6459c087f7cd408e57cb52b8506ec50292249e50045cd2
DIST jsoncpp-src-0.6.0-rc2.tar.gz 117661 SHA256 d4d193d163f520b08b9155cba978615892ca1359d77e3fb261fce2f86d09b283 SHA512 5d44e766aa2d7657bc68cf16173130febaa6744d5fca0c6df5465617a3f306023a17cbeb07a62ad1a34c2d183d916401b4be48f37c2416c895db4ad5d9481b3d WHIRLPOOL bfa7e70e14f3ed0911c5127da0d2099ca8b9159a900a5bc5147d1e50b5a9f9d5be69a8d46a761d277ca1edabaab8d0d3b9f81417572e4664ed8239fd83c953e6
DIST mozc-1.10.1390.102.tar.bz2 57879881 SHA256 72a8ed6657daa1c03b1efe50c262a69be2ab66d45747a47df6e54996b6d5ee39 SHA512 4482e822f8a14bffd02cb1eaa5d14ba0a213266b2f0dd6402c42b9b357bf0d8c4dd572cef79f1d400bd68b7bd6cb4367933574f8f5967f68738249a300e3cfb9 WHIRLPOOL 90518e621ef784b438fcf677e211fdb6753719f3d78d14ce866ccea22d6d87f8d64e334bc568eebe93cb2850d3d545eb0b73d6f6de820eaf1d43f16bfdef4100
DIST mozc-1.13.1651.102.tar.bz2 31635636 SHA256 a275accc726d55d696adf235fa40822ae099f0a02d3dc9f8d0257ba191a1bc49 SHA512 caa75e60704e904a72fd06e315a219ff304a54adaeee70a8ab75d413f7801960add103b9aae1c19ee92f6d10c4c408fd840cf78c5dde0cc21c605feac59deaf4 WHIRLPOOL 72a870cc1bc5bc63227bba61c73183f69160aa5c58c9b89e75fa65bf16bbdc2c2b873b7407d0543b3847bc046866392d9bbe6d771d7b4b7eb3f6be759f1a63b4
DIST mozc-2.16.2037.102.tar.bz2 41172838 SHA256 4b78769b36366f056282267935a859e587f77e9aaf17132687d0e4d0c4da5cd0 SHA512 ff114a93054b43109407c44bc7c75de79fa2b028f9dba5c2ecc1776c5cbb032f184a91155b6b31bc17f0183dd70b0150ce13e80f59e26810daf4b65ba7e52be1 WHIRLPOOL 625c5a28da164ee96cdf523af32a7101357254cea1d57cd7f272bdf86ba8344d3e39bf2b2bfb0a79640d7961fd46c183eabc4002c8d86215ecffe183e4e0d193
+DIST mozc-2.20.2673.102.tar.gz 48623065 SHA256 794ec312e9a5567d2097059beb25718ddb1636cd8dd99b880ec97e26824276ea SHA512 409d406fdb21d55c93a4287cd3757a164c65c1c309918b4e905aec422d9c86bc6e51ae67c23ad0db2c87ab968443bd62f5a58684a0bf5d52751988a5ec5b0bd5 WHIRLPOOL 022029c7828502907f3c3e6fd39cfa059a947f75538b6958ec81528caec0a1be0cce48a3e94ff67303021f2003fcd1a966cdf3a4bbbf113968e454ba3e84295c
DIST protobuf-2.5.0.tar.bz2 1866763 SHA256 13bfc5ae543cf3aa180ac2485c0bc89495e3ae711fc6fab4f8ffe90dfb4bb677 SHA512 5994b3669808b82fef5c860ecad36358c0767f84acac877e7bfcf722e59d972835a955714149bdd4158fbd1328a51d01397a563991d26475351ee72be48142ee WHIRLPOOL 7e6786e1f20bf253d0e386a95c2bbfe1b443f484d492f97552cadcea62c24461436aa88130e3ff20b4dc9f352c101458cb8c03686f1cc4e6e2133b6e78f5b70d
diff --git a/app-i18n/mozc/files/mozc-2.20.2673.102-system_libraries.patch b/app-i18n/mozc/files/mozc-2.20.2673.102-system_libraries.patch
new file mode 100644
index 00000000000..dd6e57717d1
--- /dev/null
+++ b/app-i18n/mozc/files/mozc-2.20.2673.102-system_libraries.patch
@@ -0,0 +1,133 @@
+--- /src/net/jsoncpp.gyp
++++ /src/net/jsoncpp.gyp
+@@ -31,31 +31,25 @@
+ 'targets': [
+ {
+ 'target_name': 'jsoncpp',
+- 'type': 'static_library',
++ 'type': 'none',
+ 'variables': {
+- 'jsoncpp_root': '<(third_party_dir)/jsoncpp',
+- 'jsoncpp_srcs': [
+- '<(jsoncpp_root)/src/lib_json/json_reader.cpp',
+- '<(jsoncpp_root)/src/lib_json/json_value.cpp',
+- '<(jsoncpp_root)/src/lib_json/json_writer.cpp',
+- ],
+- 'jsoncpp_include_dirs': ['<(jsoncpp_root)/include'],
+ 'jsoncpp_additional_macros': ['JSON_USE_EXCEPTION=0'],
+ },
+- 'defines': [
+- '<@(jsoncpp_additional_macros)',
+- ],
+- 'sources': [
+- '<@(jsoncpp_srcs)',
+- 'jsoncpp.h',
+- ],
+- 'include_dirs': [
+- '<@(jsoncpp_include_dirs)',
+- ],
+ 'all_dependent_settings': {
+ 'defines': [
+ '<@(jsoncpp_additional_macros)',
+ ],
++ 'cflags': [
++ '<!@(pkg-config --cflags jsoncpp)',
++ ],
++ 'link_settings': {
++ 'libraries': [
++ '<!@(pkg-config --libs-only-l jsoncpp)',
++ ],
++ 'ldflags': [
++ '<!@(pkg-config --libs-only-L jsoncpp)',
++ ],
++ }
+ },
+ },
+ ],
+--- /src/net/jsoncpp.h
++++ /src/net/jsoncpp.h
+@@ -35,7 +35,7 @@
+ // Mozc basically disables C++ exception.
+ #define JSON_USE_EXCEPTION 0
+ #endif // !JSON_USE_EXCEPTION
+-#include "third_party/jsoncpp/include/json/json.h"
++#include <json/json.h>
+ #define MOZC_JSONCPP_JSON_H_INCLUDED
+ #endif // !MOZC_JSONCPP_JSON_H_INCLUDED
+
+--- /src/testing/testing.gyp
++++ /src/testing/testing.gyp
+@@ -53,14 +53,12 @@
+ 'targets': [
+ {
+ 'target_name': 'testing',
+- 'type': 'static_library',
++ 'type': 'none',
+ 'variables': {
+ 'gtest_defines': [
+ 'GTEST_LANG_CXX11=1',
+ 'GTEST_HAS_TR1_TUPLE=0', # disable tr1 tuple in favor of C++11 tuple.
+ ],
+- 'gtest_dir': '<(third_party_dir)/gtest/googletest',
+- 'gmock_dir': '<(third_party_dir)/gtest/googlemock',
+ 'conditions': [
+ ['_toolset=="target" and target_platform=="Android"', {
+ 'gtest_defines': [
+@@ -75,53 +73,15 @@
+ }],
+ ],
+ },
+- 'sources': [
+- '<(gmock_dir)/src/gmock-cardinalities.cc',
+- '<(gmock_dir)/src/gmock-internal-utils.cc',
+- '<(gmock_dir)/src/gmock-matchers.cc',
+- '<(gmock_dir)/src/gmock-spec-builders.cc',
+- '<(gmock_dir)/src/gmock.cc',
+- '<(gtest_dir)/src/gtest-death-test.cc',
+- '<(gtest_dir)/src/gtest-filepath.cc',
+- '<(gtest_dir)/src/gtest-port.cc',
+- '<(gtest_dir)/src/gtest-printers.cc',
+- '<(gtest_dir)/src/gtest-test-part.cc',
+- '<(gtest_dir)/src/gtest-typed-test.cc',
+- '<(gtest_dir)/src/gtest.cc',
+- ],
+- 'include_dirs': [
+- '<(gmock_dir)',
+- '<(gmock_dir)/include',
+- '<(gtest_dir)',
+- '<(gtest_dir)/include',
+- ],
+- 'defines': [
+- '<@(gtest_defines)',
+- ],
+ 'all_dependent_settings': {
+ 'defines': [
+ '<@(gtest_defines)',
+ ],
+- 'include_dirs': [
+- '<(gmock_dir)/include',
+- '<(gtest_dir)/include',
+- ],
+- },
+- 'conditions': [
+- ['(_toolset=="target" and compiler_target=="clang") or '
+- '(_toolset=="host" and compiler_host=="clang")', {
+- 'cflags': [
+- '-Wno-missing-field-initializers',
+- '-Wno-unused-private-field',
++ 'link_settings': {
++ 'libraries': [
++ '-lgmock -lgtest',
+ ],
+- }],
+- ],
+- 'xcode_settings': {
+- # Remove the force included file. This is not necessary for third
+- # party libraries, and it causes a build error.
+- 'OTHER_CFLAGS!' : [
+- '-include base/namespace.h',
+- ],
++ },
+ },
+ },
+ {
diff --git a/app-i18n/mozc/files/mozc-2.20.2673.102-tests_build.patch b/app-i18n/mozc/files/mozc-2.20.2673.102-tests_build.patch
new file mode 100644
index 00000000000..b8b4477437f
--- /dev/null
+++ b/app-i18n/mozc/files/mozc-2.20.2673.102-tests_build.patch
@@ -0,0 +1,27 @@
+--- /src/net/json_util_test.cc
++++ /src/net/json_util_test.cc
+@@ -784,13 +784,13 @@
+ for (size_t i = 0; i < arraysize(kNumS32ValueKeys); ++i) {
+ {
+ Json::Value json_value;
+- json_value[kNumS32ValueKeys[i]] = -2147483649ll;
++ json_value[kNumS32ValueKeys[i]] = static_cast<Json::Value::Int64>(-2147483649ll);
+ TestMsg msg;
+ EXPECT_FALSE(JsonUtil::JsonValueToProtobufMessage(json_value, &msg));
+ }
+ {
+ Json::Value json_value;
+- json_value[kNumS32ValueKeys[i]] = 2147483648ull;
++ json_value[kNumS32ValueKeys[i]] = static_cast<Json::Value::UInt64>(2147483648ull);
+ TestMsg msg;
+ EXPECT_FALSE(JsonUtil::JsonValueToProtobufMessage(json_value, &msg));
+ }
+@@ -805,7 +805,7 @@
+ }
+ {
+ Json::Value json_value;
+- json_value[kNumU32ValueKeys[i]] = 4294967296ull;
++ json_value[kNumU32ValueKeys[i]] = static_cast<Json::Value::UInt64>(4294967296ull);
+ TestMsg msg;
+ EXPECT_FALSE(JsonUtil::JsonValueToProtobufMessage(json_value, &msg));
+ }
diff --git a/app-i18n/mozc/files/mozc-2.20.2673.102-tests_skipping.patch b/app-i18n/mozc/files/mozc-2.20.2673.102-tests_skipping.patch
new file mode 100644
index 00000000000..28c5486de50
--- /dev/null
+++ b/app-i18n/mozc/files/mozc-2.20.2673.102-tests_skipping.patch
@@ -0,0 +1,70 @@
+Disable test leaving mozc_server orphan process.
+
+--- /src/unix/ibus/mozc_engine_test.cc
++++ /src/unix/ibus/mozc_engine_test.cc
+@@ -41,65 +41,5 @@
+ namespace mozc {
+ namespace ibus {
+
+-class LaunchToolTest : public testing::Test {
+- public:
+- LaunchToolTest() {
+- g_type_init();
+- }
+-
+- protected:
+- virtual void SetUp() {
+- mozc_engine_.reset(new MozcEngine());
+-
+- mock_ = new client::ClientMock();
+- mock_->ClearFunctionCounter();
+- mozc_engine_->client_.reset(mock_);
+- }
+-
+- virtual void TearDown() {
+- mozc_engine_.reset();
+- }
+-
+- client::ClientMock* mock_;
+- unique_ptr<MozcEngine> mozc_engine_;
+-
+- private:
+- DISALLOW_COPY_AND_ASSIGN(LaunchToolTest);
+-};
+-
+-TEST_F(LaunchToolTest, LaunchToolTest) {
+- commands::Output output;
+-
+- // Launch config dialog
+- mock_->ClearFunctionCounter();
+- mock_->SetBoolFunctionReturn("LaunchToolWithProtoBuf", true);
+- output.set_launch_tool_mode(commands::Output::CONFIG_DIALOG);
+- EXPECT_TRUE(mozc_engine_->LaunchTool(output));
+-
+- // Launch dictionary tool
+- mock_->ClearFunctionCounter();
+- mock_->SetBoolFunctionReturn("LaunchToolWithProtoBuf", true);
+- output.set_launch_tool_mode(commands::Output::DICTIONARY_TOOL);
+- EXPECT_TRUE(mozc_engine_->LaunchTool(output));
+-
+- // Launch word register dialog
+- mock_->ClearFunctionCounter();
+- mock_->SetBoolFunctionReturn("LaunchToolWithProtoBuf", true);
+- output.set_launch_tool_mode(commands::Output::WORD_REGISTER_DIALOG);
+- EXPECT_TRUE(mozc_engine_->LaunchTool(output));
+-
+- // Launch no tool(means do nothing)
+- mock_->ClearFunctionCounter();
+- mock_->SetBoolFunctionReturn("LaunchToolWithProtoBuf", false);
+- output.set_launch_tool_mode(commands::Output::NO_TOOL);
+- EXPECT_FALSE(mozc_engine_->LaunchTool(output));
+-
+- // Something occurring in client::Client::LaunchTool
+- mock_->ClearFunctionCounter();
+- mock_->SetBoolFunctionReturn("LaunchToolWithProtoBuf", false);
+- output.set_launch_tool_mode(commands::Output::CONFIG_DIALOG);
+- EXPECT_FALSE(mozc_engine_->LaunchTool(output));
+-}
+-
+ } // namespace ibus
+ } // namespace mozc
diff --git a/app-i18n/mozc/metadata.xml b/app-i18n/mozc/metadata.xml
index 932a35bc627..f5031cbbd25 100644
--- a/app-i18n/mozc/metadata.xml
+++ b/app-i18n/mozc/metadata.xml
@@ -14,8 +14,12 @@ Mozc is a Japanese Input Method Editor (IME) designed for multi-platform such as
</longdescription>
<use>
<flag name="fcitx">Enable support for <pkg>app-i18n/fcitx</pkg></flag>
+ <flag name="fcitx4">Enable support for <pkg>app-i18n/fcitx</pkg> 4</flag>
+ <flag name="gui">Install graphical user interface tool (mozc_tool)</flag>
+ <flag name="handwriting-tegaki">Use handwriting recognition model from <pkg>app-i18n/tegaki-zinnia-japanese</pkg></flag>
+ <flag name="handwriting-tomoe">Use handwriting recognition model from <pkg>app-i18n/zinnia-tomoe</pkg></flag>
<flag name="ibus">Enable support for <pkg>app-i18n/ibus</pkg></flag>
- <flag name="renderer">Enable native candidate window.</flag>
+ <flag name="renderer">Enable native candidate window</flag>
</use>
<upstream>
<remote-id type="sourceforge">jsoncpp</remote-id>
diff --git a/app-i18n/mozc/mozc-2.20.2673.102.ebuild b/app-i18n/mozc/mozc-2.20.2673.102.ebuild
new file mode 100644
index 00000000000..a5b640dac27
--- /dev/null
+++ b/app-i18n/mozc/mozc-2.20.2673.102.ebuild
@@ -0,0 +1,309 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+PYTHON_COMPAT=(python2_7)
+
+inherit elisp-common multiprocessing python-any-r1 toolchain-funcs
+
+if [[ "${PV}" == "9999" ]]; then
+ inherit git-r3
+
+ EGIT_REPO_URI="https://github.com/google/mozc"
+ EGIT_SUBMODULES=(src/third_party/japanese_usage_dictionary)
+else
+ MOZC_GIT_REVISION="280e38fe3d9db4df52f0713acf2ca65898cd697a"
+ JAPANESE_USAGE_DICTIONARY_GIT_REVISION="e5b3425575734c323e1d947009dd74709437b684"
+ JAPANESE_USAGE_DICTIONARY_DATE="20120416091336"
+fi
+
+FCITX_PATCH_VERSION="2.18.2612.102.1"
+
+DESCRIPTION="Mozc - Japanese input method editor"
+HOMEPAGE="https://github.com/google/mozc"
+if [[ "${PV}" == "9999" ]]; then
+ SRC_URI=""
+else
+ SRC_URI="https://github.com/google/${PN}/archive/${MOZC_GIT_REVISION}.tar.gz -> ${P}.tar.gz
+ https://github.com/hiroyuki-komatsu/japanese-usage-dictionary/archive/${JAPANESE_USAGE_DICTIONARY_GIT_REVISION}.tar.gz -> japanese-usage-dictionary-${JAPANESE_USAGE_DICTIONARY_DATE}.tar.gz"
+fi
+SRC_URI+=" fcitx4? ( https://download.fcitx-im.org/fcitx-mozc/fcitx-mozc-${FCITX_PATCH_VERSION}.patch )"
+
+# Mozc: BSD
+# src/data/dictionary_oss: ipadic, public-domain
+# src/data/unicode: unicode
+# japanese-usage-dictionary: BSD-2
+LICENSE="BSD BSD-2 ipadic public-domain unicode"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="debug emacs fcitx4 +gui +handwriting-tegaki handwriting-tomoe ibus renderer test"
+REQUIRED_USE="|| ( emacs fcitx4 ibus ) gui? ( ^^ ( handwriting-tegaki handwriting-tomoe ) ) !gui? ( !handwriting-tegaki !handwriting-tomoe )"
+
+RDEPEND="dev-libs/protobuf:=
+ emacs? ( virtual/emacs )
+ fcitx4? ( app-i18n/fcitx:4 )
+ gui? (
+ app-i18n/zinnia
+ dev-qt/qtcore:5
+ dev-qt/qtgui:5
+ dev-qt/qtwidgets:5
+ handwriting-tegaki? ( app-i18n/tegaki-zinnia-japanese )
+ handwriting-tomoe? ( app-i18n/zinnia-tomoe )
+ )
+ ibus? (
+ >=app-i18n/ibus-1.4.1
+ dev-libs/glib:2
+ x11-libs/libxcb
+ )
+ renderer? (
+ dev-libs/glib:2
+ x11-libs/cairo
+ x11-libs/gtk+:2
+ x11-libs/pango
+ )"
+DEPEND="${RDEPEND}
+ ${PYTHON_DEPS}
+ dev-util/gyp
+ dev-util/ninja
+ virtual/pkgconfig
+ test? (
+ >=dev-cpp/gtest-1.8.0
+ dev-libs/jsoncpp
+ )"
+
+S="${WORKDIR}/${P}/src"
+
+SITEFILE="50${PN}-gentoo.el"
+
+execute() {
+ einfo "$@"
+ "$@"
+}
+
+src_unpack() {
+ if [[ "${PV}" == "9999" ]]; then
+ git-r3_src_unpack
+ else
+ unpack ${P}.tar.gz
+ mv mozc-${MOZC_GIT_REVISION} ${P} || die
+
+ unpack japanese-usage-dictionary-${JAPANESE_USAGE_DICTIONARY_DATE}.tar.gz
+ cp -p japanese-usage-dictionary-${JAPANESE_USAGE_DICTIONARY_GIT_REVISION}/usage_dict.txt ${P}/src/third_party/japanese_usage_dictionary || die
+ fi
+}
+
+src_prepare() {
+ eapply -p2 "${FILESDIR}/${PN}-2.20.2673.102-system_libraries.patch"
+ eapply -p2 "${FILESDIR}/${PN}-2.20.2673.102-tests_build.patch"
+ eapply -p2 "${FILESDIR}/${PN}-2.20.2673.102-tests_skipping.patch"
+
+ if use fcitx4; then
+ eapply -p2 "${DISTDIR}/fcitx-mozc-${FCITX_PATCH_VERSION}.patch"
+ fi
+
+ eapply_user
+
+ sed \
+ -e "s/def GypMain(options, unused_args):/def GypMain(options, gyp_args):/" \
+ -e "s/RunOrDie(gyp_command + gyp_options)/RunOrDie(gyp_command + gyp_options + gyp_args)/" \
+ -e "s/RunOrDie(\[ninja/&, '-j$(makeopts_jobs)', '-l$(makeopts_loadavg "${MAKEOPTS}" 0)', '-v'/" \
+ -i build_mozc.py || die
+
+ sed \
+ -e "s/'release_extra_cflags%': \['-O2'\]/'release_extra_cflags%': []/" \
+ -e "s/'debug_extra_cflags%': \['-O0', '-g'\]/'debug_extra_cflags%': []/" \
+ -i gyp/common.gypi || die
+
+ local ar=($(tc-getAR))
+ local cc=($(tc-getCC))
+ local cxx=($(tc-getCXX))
+ local ld=($(tc-getLD))
+ local nm=($(tc-getNM))
+ local readelf=($(tc-getPROG READELF readelf))
+
+ # Use absolute paths. Non-absolute paths are mishandled by GYP.
+ ar[0]=$(type -P ${ar[0]})
+ cc[0]=$(type -P ${cc[0]})
+ cxx[0]=$(type -P ${cxx[0]})
+ ld[0]=$(type -P ${ld[0]})
+ nm[0]=$(type -P ${nm[0]})
+ readelf[0]=$(type -P ${readelf[0]})
+
+ sed \
+ -e "s:<!(which ar):${ar[@]}:" \
+ -e "s:<!(which clang):${cc[@]}:" \
+ -e "s:<!(which clang++):${cxx[@]}:" \
+ -e "s:<!(which ld):${ld[@]}:" \
+ -e "s:<!(which nm):${nm[@]}:" \
+ -e "s:<!(which readelf):${readelf[@]}:" \
+ -i gyp/common.gypi || die
+}
+
+src_configure() {
+ if use debug; then
+ BUILD_TYPE="Debug"
+ else
+ BUILD_TYPE="Release"
+ fi
+
+ local gyp_arguments=()
+
+ if tc-is-gcc; then
+ gyp_arguments+=(-D compiler_host=gcc -D compiler_target=gcc)
+ elif tc-is-clang; then
+ gyp_arguments+=(-D compiler_host=clang -D compiler_target=clang)
+ else
+ gyp_arguments+=(-D compiler_host=unknown -D compiler_target=unknown)
+ fi
+
+ gyp_arguments+=(-D use_libibus=$(usex ibus 1 0))
+ gyp_arguments+=(-D use_libprotobuf=1)
+ gyp_arguments+=(-D use_libzinnia=1)
+ gyp_arguments+=(-D enable_gtk_renderer=$(usex renderer 1 0))
+
+ gyp_arguments+=(-D server_dir="${EPREFIX}/usr/libexec/mozc")
+ gyp_arguments+=(-D document_dir="${EPREFIX}/usr/libexec/mozc/documents")
+
+ if use handwriting-tegaki; then
+ gyp_arguments+=(-D zinnia_model_file="${EPREFIX}/usr/share/tegaki/models/zinnia/handwriting-ja.model")
+ elif use handwriting-tomoe; then
+ gyp_arguments+=(-D zinnia_model_file="${EPREFIX}/usr/$(get_libdir)/zinnia/model/tomoe/handwriting-ja.model")
+ fi
+
+ if use ibus; then
+ gyp_arguments+=(-D ibus_mozc_path="${EPREFIX}/usr/libexec/ibus-engine-mozc")
+ gyp_arguments+=(-D ibus_mozc_icon_path="${EPREFIX}/usr/share/ibus-mozc/product_icon.png")
+ fi
+
+ unset AR CC CXX LD NM READELF
+
+ execute "${PYTHON}" build_mozc.py gyp \
+ --gypdir="${EPREFIX}/usr/bin" \
+ --server_dir="${EPREFIX}/usr/libexec/mozc" \
+ --verbose \
+ $(usex gui "" --noqt) \
+ -- "${gyp_arguments[@]}" || die "Configuration failed"
+}
+
+src_compile() {
+ local targets=(server/server.gyp:mozc_server)
+ if use emacs; then
+ targets+=(unix/emacs/emacs.gyp:mozc_emacs_helper)
+ fi
+ if use fcitx4; then
+ targets+=(unix/fcitx/fcitx.gyp:fcitx-mozc)
+ fi
+ if use gui; then
+ targets+=(gui/gui.gyp:mozc_tool)
+ fi
+ if use ibus; then
+ targets+=(unix/ibus/ibus.gyp:ibus_mozc)
+ fi
+ if use renderer; then
+ targets+=(renderer/renderer.gyp:mozc_renderer)
+ fi
+ if use test; then
+ targets+=(gyp/tests.gyp:unittests)
+ fi
+
+ execute "${PYTHON}" build_mozc.py build -c ${BUILD_TYPE} -v "${targets[@]}" || die "Building failed"
+
+ if use emacs; then
+ elisp-compile unix/emacs/*.el
+ fi
+}
+
+src_test() {
+ execute "${PYTHON}" build_mozc.py runtests -c ${BUILD_TYPE} --test_jobs 1 || die "Testing failed"
+}
+
+src_install() {
+ exeinto /usr/libexec/mozc
+ doexe out_linux/${BUILD_TYPE}/mozc_server
+
+ if use gui; then
+ doexe out_linux/${BUILD_TYPE}/mozc_tool
+ fi
+
+ if use renderer; then
+ doexe out_linux/${BUILD_TYPE}/mozc_renderer
+ fi
+
+ insinto /usr/libexec/mozc/documents
+ doins data/installer/credits_en.html
+
+ if use emacs; then
+ dobin out_linux/${BUILD_TYPE}/mozc_emacs_helper
+ elisp-install ${PN} unix/emacs/*.{el,elc}
+ elisp-site-file-install "${FILESDIR}/${SITEFILE}" ${PN}
+ fi
+
+ if use fcitx4; then
+ exeinto /usr/$(get_libdir)/fcitx
+ doexe out_linux/${BUILD_TYPE}/fcitx-mozc.so
+
+ insinto /usr/share/fcitx/addon
+ doins unix/fcitx/fcitx-mozc.conf
+
+ insinto /usr/share/fcitx/inputmethod
+ doins unix/fcitx/mozc.conf
+
+ insinto /usr/share/fcitx/mozc/icon
+ newins data/images/product_icon_32bpp-128.png mozc.png
+ local image
+ for image in data/images/unix/ui-*.png; do
+ newins "${image}" "mozc-${image#data/images/unix/ui-}"
+ done
+
+ local locale mo_file
+ for mo_file in out_linux/${BUILD_TYPE}/gen/unix/fcitx/po/*.mo; do
+ locale="${mo_file##*/}"
+ locale="${locale%.mo}"
+ insinto /usr/share/locale/${locale}/LC_MESSAGES
+ newins "${mo_file}" fcitx-mozc.mo
+ done
+ fi
+
+ if use ibus; then
+ exeinto /usr/libexec
+ newexe out_linux/${BUILD_TYPE}/ibus_mozc ibus-engine-mozc
+
+ insinto /usr/share/ibus/component
+ doins out_linux/${BUILD_TYPE}/gen/unix/ibus/mozc.xml
+
+ insinto /usr/share/ibus-mozc
+ newins data/images/unix/ime_product_icon_opensource-32.png product_icon.png
+ local image
+ for image in data/images/unix/ui-*.png; do
+ newins "${image}" "${image#data/images/unix/ui-}"
+ done
+ fi
+}
+
+pkg_postinst() {
+ if use emacs; then
+ elisp-site-regen
+
+ elog "USAGE IN EMACS"
+ elog
+ elog "mozc-mode is minor mode to input Japanese text using Mozc server."
+ elog "mozc-mode can be used via LEIM (Library of Emacs Input Method)."
+ elog
+ elog "In order to use mozc-mode by default, the following settings should be added to"
+ elog "Emacs init file (~/.emacs.d/init.el or ~/.emacs):"
+ elog
+ elog " (require 'mozc)"
+ elog " (set-language-environment \"Japanese\")"
+ elog " (setq default-input-method \"japanese-mozc\")"
+ elog
+ elog "With the above settings, typing C-\\ (which is bound to \"toggle-input-method\""
+ elog "by default) will enable mozc-mode."
+ elog
+ elog "Alternatively, at run time, after loading mozc.el, mozc-mode can be activated by"
+ elog "calling \"set-input-method\" and entering \"japanese-mozc\"."
+ fi
+}
+
+pkg_postrm() {
+ use emacs && elisp-site-regen
+}
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: app-i18n/mozc/, app-i18n/mozc/files/
@ 2018-06-13 14:36 Mike Gilbert
0 siblings, 0 replies; 7+ messages in thread
From: Mike Gilbert @ 2018-06-13 14:36 UTC (permalink / raw
To: gentoo-commits
commit: a917a8214bb56d2486898553788d9764a2b26cdc
Author: Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Fri Jun 1 03:02:06 2018 +0000
Commit: Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Wed Jun 13 14:36:21 2018 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a917a821
app-i18n/mozc: Fix building with GCC 8.
Closes: https://bugs.gentoo.org/655570
app-i18n/mozc/files/mozc-2.23.2815.102-gcc-8.patch | 22 ++++++++++++++++++++++
app-i18n/mozc/mozc-2.23.2815.102.ebuild | 1 +
app-i18n/mozc/mozc-9999.ebuild | 1 +
3 files changed, 24 insertions(+)
diff --git a/app-i18n/mozc/files/mozc-2.23.2815.102-gcc-8.patch b/app-i18n/mozc/files/mozc-2.23.2815.102-gcc-8.patch
new file mode 100644
index 00000000000..07514048e7a
--- /dev/null
+++ b/app-i18n/mozc/files/mozc-2.23.2815.102-gcc-8.patch
@@ -0,0 +1,22 @@
+https://github.com/google/mozc/issues/441
+
+--- /src/prediction/zero_query_dict.h
++++ /src/prediction/zero_query_dict.h
+@@ -147,6 +147,17 @@
+ return iter;
+ }
+
++ iterator &operator--() {
++ ptr_ -= kTokenByteSize;
++ return *this;
++ }
++
++ iterator operator--(int) {
++ const iterator tmp(ptr_, string_array_);
++ ptr_ -= kTokenByteSize;
++ return tmp;
++ }
++
+ iterator &operator-=(ptrdiff_t n) {
+ ptr_ -= n * kTokenByteSize;
+ return *this;
diff --git a/app-i18n/mozc/mozc-2.23.2815.102.ebuild b/app-i18n/mozc/mozc-2.23.2815.102.ebuild
index de335e87e8d..7bc5284670a 100644
--- a/app-i18n/mozc/mozc-2.23.2815.102.ebuild
+++ b/app-i18n/mozc/mozc-2.23.2815.102.ebuild
@@ -99,6 +99,7 @@ src_unpack() {
src_prepare() {
eapply -p2 "${FILESDIR}/${PN}-2.23.2815.102-system_libraries.patch"
+ eapply -p2 "${FILESDIR}/${PN}-2.23.2815.102-gcc-8.patch"
eapply -p2 "${FILESDIR}/${PN}-2.20.2673.102-tests_build.patch"
eapply -p2 "${FILESDIR}/${PN}-2.20.2673.102-tests_skipping.patch"
diff --git a/app-i18n/mozc/mozc-9999.ebuild b/app-i18n/mozc/mozc-9999.ebuild
index e2a00716e05..d8763dd2dfe 100644
--- a/app-i18n/mozc/mozc-9999.ebuild
+++ b/app-i18n/mozc/mozc-9999.ebuild
@@ -99,6 +99,7 @@ src_unpack() {
src_prepare() {
eapply -p2 "${FILESDIR}/${PN}-2.23.2815.102-system_libraries.patch"
+ eapply -p2 "${FILESDIR}/${PN}-2.23.2815.102-gcc-8.patch"
eapply -p2 "${FILESDIR}/${PN}-2.20.2673.102-tests_build.patch"
eapply -p2 "${FILESDIR}/${PN}-2.20.2673.102-tests_skipping.patch"
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: app-i18n/mozc/, app-i18n/mozc/files/
@ 2018-06-13 14:36 Mike Gilbert
0 siblings, 0 replies; 7+ messages in thread
From: Mike Gilbert @ 2018-06-13 14:36 UTC (permalink / raw
To: gentoo-commits
commit: 98bf7ee366d684da3a54769b7be702a4355b123c
Author: Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Wed Jun 13 08:17:32 2018 +0000
Commit: Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Wed Jun 13 14:36:21 2018 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=98bf7ee3
app-i18n/mozc: Delete old version (2.20.2673.102).
app-i18n/mozc/Manifest | 2 -
app-i18n/mozc/files/mozc-2.20.2673.102-gcc-5.patch | 11 -
.../mozc-2.20.2673.102-system_libraries.patch | 291 -------------------
app-i18n/mozc/mozc-2.20.2673.102.ebuild | 321 ---------------------
4 files changed, 625 deletions(-)
diff --git a/app-i18n/mozc/Manifest b/app-i18n/mozc/Manifest
index a85a1186efc..2bd43342203 100644
--- a/app-i18n/mozc/Manifest
+++ b/app-i18n/mozc/Manifest
@@ -1,5 +1,3 @@
-DIST fcitx-mozc-2.18.2612.102.1.patch 140722 BLAKE2B a412b8dd94bcf44f7fd946bcc1072f3dde7d8d8da55d3ad04ef5d8ef851a63f4d4d8e7e6249172a9d1e75e1f1672e32e6a673e6016d94b034f80d23b660a80e2 SHA512 725c464727f230707b90975705ef1565f1178f9144e66c5a688696a4ef520a6fec1d11f7aa68ee05f82aa9417060b1cccf49a155e30734871a525eaa4c76addb
DIST fcitx-mozc-2.23.2815.102.1.patch 295112 BLAKE2B 709b84f6eaed16da38a173f40ae7cccff362fd167e6deb4090ae8a9ec522ac8e11ccff3c9ef6433907249af8c9eb4b7be12d2c05564cabd45c25e26764286ed3 SHA512 e0d4645df919838f0fe31a97bf6dd759c222a696f68133f7584d2c771f70734ea634a25bebb03a756221000d3552423207ee5163d75778dbf480b6e267ba4cd0
DIST japanese-usage-dictionary-20120416091336.tar.gz 71051 BLAKE2B 08eecf0aa021e27a2813f58c2d37f1cec760448f6ae086ae7468b8a11575c6ef9f72f656cb4d53e0179b8a7b00f2d91ff51a0ad7825e078dcbac0810f1d8b3e1 SHA512 b7e997a979b6d50e49b9af5dc830ea4df0532f6ab1321b9ef14983f65bb54f1b2967375c82e07957ae7693ebbf43c9b56ecea6bfea8dd1fdaee444bd549d83a7
-DIST mozc-2.20.2673.102.tar.gz 48624369 BLAKE2B 0d80065f989c1f61e5f2852e7f471dd83777323b21499c118dc87f4fd6596329ab096dd64db3419895090ab61d6aef9a07e61c7fddeaf4f3a40ce3f3acbad949 SHA512 ad7a78b03b29847057625fd5422c03ac8fc5755c5e85c66fd6e80f81be719dd56bf1349a1d745797118deed239641512789687b4f9ffe49bab1bc966385229ae
DIST mozc-2.23.2815.102.tar.gz 47739041 BLAKE2B 045a8a4a07e09cf923b67824111cdf672febc30256a6aef951ae779a3f582b3860042750d766120e376898c63be5b4baea870798a192cee34b0d48647e1ec5e6 SHA512 a3face616ca89990bca52371dcc8003604ebe0e9633116a64550add070152b1bc4d9b21e9f102c5afa6f8b1aa11d8dbc4bafbcebfaf4a12a934f085f245d548f
diff --git a/app-i18n/mozc/files/mozc-2.20.2673.102-gcc-5.patch b/app-i18n/mozc/files/mozc-2.20.2673.102-gcc-5.patch
deleted file mode 100644
index b8b2bf1808e..00000000000
--- a/app-i18n/mozc/files/mozc-2.20.2673.102-gcc-5.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- /src/prediction/user_history_predictor.cc
-+++ /src/prediction/user_history_predictor.cc
-@@ -841,7 +841,7 @@
- // swap.
- if (i + 1 < prefix.size()) {
- string swapped_prefix = prefix;
-- swap(swapped_prefix[i], swapped_prefix[i + 1]);
-+ std::swap(swapped_prefix[i], swapped_prefix[i + 1]);
- if (Util::StartsWith(str, swapped_prefix)) {
- return true;
- }
diff --git a/app-i18n/mozc/files/mozc-2.20.2673.102-system_libraries.patch b/app-i18n/mozc/files/mozc-2.20.2673.102-system_libraries.patch
deleted file mode 100644
index 2b2828b7999..00000000000
--- a/app-i18n/mozc/files/mozc-2.20.2673.102-system_libraries.patch
+++ /dev/null
@@ -1,291 +0,0 @@
---- /src/gyp/defines.gypi
-+++ /src/gyp/defines.gypi
-@@ -71,6 +71,12 @@
- # use_libibus represents if ibus library is used or not.
- # This option is only for Linux.
- 'use_libibus%': '0',
-+
-+ # use_libgtest represents if gtest library is used or not.
-+ 'use_libgtest%': '0',
-+
-+ # use_libjsoncpp represents if jsoncpp library is used or not.
-+ 'use_libjsoncpp%': '0',
- },
- 'target_defaults': {
- 'defines': [
---- /src/net/jsoncpp.gyp
-+++ /src/net/jsoncpp.gyp
-@@ -31,32 +31,57 @@
- 'targets': [
- {
- 'target_name': 'jsoncpp',
-- 'type': 'static_library',
-- 'variables': {
-- 'jsoncpp_root': '<(third_party_dir)/jsoncpp',
-- 'jsoncpp_srcs': [
-- '<(jsoncpp_root)/src/lib_json/json_reader.cpp',
-- '<(jsoncpp_root)/src/lib_json/json_value.cpp',
-- '<(jsoncpp_root)/src/lib_json/json_writer.cpp',
-- ],
-- 'jsoncpp_include_dirs': ['<(jsoncpp_root)/include'],
-- 'jsoncpp_additional_macros': ['JSON_USE_EXCEPTION=0'],
-- },
-- 'defines': [
-- '<@(jsoncpp_additional_macros)',
-+ 'conditions': [
-+ ['use_libjsoncpp==1', {
-+ 'type': 'none',
-+ 'variables': {
-+ 'jsoncpp_additional_macros': ['JSON_USE_EXCEPTION=0'],
-+ },
-+ 'all_dependent_settings': {
-+ 'defines': [
-+ '<@(jsoncpp_additional_macros)',
-+ ],
-+ 'cflags': [
-+ '<!@(pkg-config --cflags jsoncpp)',
-+ ],
-+ 'link_settings': {
-+ 'libraries': [
-+ '<!@(pkg-config --libs-only-l jsoncpp)',
-+ ],
-+ 'ldflags': [
-+ '<!@(pkg-config --libs-only-L jsoncpp)',
-+ ],
-+ }
-+ },
-+ }, {
-+ 'type': 'static_library',
-+ 'variables': {
-+ 'jsoncpp_root': '<(third_party_dir)/jsoncpp',
-+ 'jsoncpp_srcs': [
-+ '<(jsoncpp_root)/src/lib_json/json_reader.cpp',
-+ '<(jsoncpp_root)/src/lib_json/json_value.cpp',
-+ '<(jsoncpp_root)/src/lib_json/json_writer.cpp',
-+ ],
-+ 'jsoncpp_include_dirs': ['<(jsoncpp_root)/include'],
-+ 'jsoncpp_additional_macros': ['JSON_USE_EXCEPTION=0'],
-+ },
-+ 'defines': [
-+ '<@(jsoncpp_additional_macros)',
-+ ],
-+ 'sources': [
-+ '<@(jsoncpp_srcs)',
-+ 'jsoncpp.h',
-+ ],
-+ 'include_dirs': [
-+ '<@(jsoncpp_include_dirs)',
-+ ],
-+ 'all_dependent_settings': {
-+ 'defines': [
-+ '<@(jsoncpp_additional_macros)',
-+ ],
-+ },
-+ }],
- ],
-- 'sources': [
-- '<@(jsoncpp_srcs)',
-- 'jsoncpp.h',
-- ],
-- 'include_dirs': [
-- '<@(jsoncpp_include_dirs)',
-- ],
-- 'all_dependent_settings': {
-- 'defines': [
-- '<@(jsoncpp_additional_macros)',
-- ],
-- },
- },
- ],
- }
---- /src/net/jsoncpp.h
-+++ /src/net/jsoncpp.h
-@@ -35,7 +35,7 @@
- // Mozc basically disables C++ exception.
- #define JSON_USE_EXCEPTION 0
- #endif // !JSON_USE_EXCEPTION
--#include "third_party/jsoncpp/include/json/json.h"
-+#include <json/json.h>
- #define MOZC_JSONCPP_JSON_H_INCLUDED
- #endif // !MOZC_JSONCPP_JSON_H_INCLUDED
-
---- /src/testing/testing.gyp
-+++ /src/testing/testing.gyp
-@@ -53,76 +53,111 @@
- 'targets': [
- {
- 'target_name': 'testing',
-- 'type': 'static_library',
-- 'variables': {
-- 'gtest_defines': [
-- 'GTEST_LANG_CXX11=1',
-- 'GTEST_HAS_TR1_TUPLE=0', # disable tr1 tuple in favor of C++11 tuple.
-- ],
-- 'gtest_dir': '<(third_party_dir)/gtest/googletest',
-- 'gmock_dir': '<(third_party_dir)/gtest/googlemock',
-- 'conditions': [
-- ['_toolset=="target" and target_platform=="Android"', {
-- 'gtest_defines': [
-- 'GTEST_HAS_RTTI=0', # Android NDKr7 requires this.
-- 'GTEST_HAS_CLONE=0',
-- 'GTEST_HAS_GLOBAL_WSTRING=0',
-- 'GTEST_HAS_POSIX_RE=0',
-- 'GTEST_HAS_STD_WSTRING=0',
-- 'GTEST_OS_LINUX=1',
-- 'GTEST_OS_LINUX_ANDROID=1',
-- ],
-- }],
-- ],
-- },
-- 'sources': [
-- '<(gmock_dir)/src/gmock-cardinalities.cc',
-- '<(gmock_dir)/src/gmock-internal-utils.cc',
-- '<(gmock_dir)/src/gmock-matchers.cc',
-- '<(gmock_dir)/src/gmock-spec-builders.cc',
-- '<(gmock_dir)/src/gmock.cc',
-- '<(gtest_dir)/src/gtest-death-test.cc',
-- '<(gtest_dir)/src/gtest-filepath.cc',
-- '<(gtest_dir)/src/gtest-port.cc',
-- '<(gtest_dir)/src/gtest-printers.cc',
-- '<(gtest_dir)/src/gtest-test-part.cc',
-- '<(gtest_dir)/src/gtest-typed-test.cc',
-- '<(gtest_dir)/src/gtest.cc',
-- ],
-- 'include_dirs': [
-- '<(gmock_dir)',
-- '<(gmock_dir)/include',
-- '<(gtest_dir)',
-- '<(gtest_dir)/include',
-- ],
-- 'defines': [
-- '<@(gtest_defines)',
-- ],
-- 'all_dependent_settings': {
-- 'defines': [
-- '<@(gtest_defines)',
-- ],
-- 'include_dirs': [
-- '<(gmock_dir)/include',
-- '<(gtest_dir)/include',
-- ],
-- },
- 'conditions': [
-- ['(_toolset=="target" and compiler_target=="clang") or '
-- '(_toolset=="host" and compiler_host=="clang")', {
-- 'cflags': [
-- '-Wno-missing-field-initializers',
-- '-Wno-unused-private-field',
-+ ['use_libgtest==1', {
-+ 'type': 'none',
-+ 'variables': {
-+ 'gtest_defines': [
-+ 'GTEST_LANG_CXX11=1',
-+ 'GTEST_HAS_TR1_TUPLE=0', # disable tr1 tuple in favor of C++11 tuple.
-+ ],
-+ 'conditions': [
-+ ['_toolset=="target" and target_platform=="Android"', {
-+ 'gtest_defines': [
-+ 'GTEST_HAS_RTTI=0', # Android NDKr7 requires this.
-+ 'GTEST_HAS_CLONE=0',
-+ 'GTEST_HAS_GLOBAL_WSTRING=0',
-+ 'GTEST_HAS_POSIX_RE=0',
-+ 'GTEST_HAS_STD_WSTRING=0',
-+ 'GTEST_OS_LINUX=1',
-+ 'GTEST_OS_LINUX_ANDROID=1',
-+ ],
-+ }],
-+ ],
-+ },
-+ 'all_dependent_settings': {
-+ 'defines': [
-+ '<@(gtest_defines)',
-+ ],
-+ 'link_settings': {
-+ 'libraries': [
-+ '-lgmock -lgtest',
-+ ],
-+ },
-+ },
-+ }, {
-+ 'type': 'static_library',
-+ 'variables': {
-+ 'gtest_defines': [
-+ 'GTEST_LANG_CXX11=1',
-+ 'GTEST_HAS_TR1_TUPLE=0', # disable tr1 tuple in favor of C++11 tuple.
-+ ],
-+ 'gtest_dir': '<(third_party_dir)/gtest/googletest',
-+ 'gmock_dir': '<(third_party_dir)/gtest/googlemock',
-+ 'conditions': [
-+ ['_toolset=="target" and target_platform=="Android"', {
-+ 'gtest_defines': [
-+ 'GTEST_HAS_RTTI=0', # Android NDKr7 requires this.
-+ 'GTEST_HAS_CLONE=0',
-+ 'GTEST_HAS_GLOBAL_WSTRING=0',
-+ 'GTEST_HAS_POSIX_RE=0',
-+ 'GTEST_HAS_STD_WSTRING=0',
-+ 'GTEST_OS_LINUX=1',
-+ 'GTEST_OS_LINUX_ANDROID=1',
-+ ],
-+ }],
-+ ],
-+ },
-+ 'sources': [
-+ '<(gmock_dir)/src/gmock-cardinalities.cc',
-+ '<(gmock_dir)/src/gmock-internal-utils.cc',
-+ '<(gmock_dir)/src/gmock-matchers.cc',
-+ '<(gmock_dir)/src/gmock-spec-builders.cc',
-+ '<(gmock_dir)/src/gmock.cc',
-+ '<(gtest_dir)/src/gtest-death-test.cc',
-+ '<(gtest_dir)/src/gtest-filepath.cc',
-+ '<(gtest_dir)/src/gtest-port.cc',
-+ '<(gtest_dir)/src/gtest-printers.cc',
-+ '<(gtest_dir)/src/gtest-test-part.cc',
-+ '<(gtest_dir)/src/gtest-typed-test.cc',
-+ '<(gtest_dir)/src/gtest.cc',
-+ ],
-+ 'include_dirs': [
-+ '<(gmock_dir)',
-+ '<(gmock_dir)/include',
-+ '<(gtest_dir)',
-+ '<(gtest_dir)/include',
-+ ],
-+ 'defines': [
-+ '<@(gtest_defines)',
- ],
-+ 'all_dependent_settings': {
-+ 'defines': [
-+ '<@(gtest_defines)',
-+ ],
-+ 'include_dirs': [
-+ '<(gmock_dir)/include',
-+ '<(gtest_dir)/include',
-+ ],
-+ },
-+ 'conditions': [
-+ ['(_toolset=="target" and compiler_target=="clang") or '
-+ '(_toolset=="host" and compiler_host=="clang")', {
-+ 'cflags': [
-+ '-Wno-missing-field-initializers',
-+ '-Wno-unused-private-field',
-+ ],
-+ }],
-+ ],
-+ 'xcode_settings': {
-+ # Remove the force included file. This is not necessary for third
-+ # party libraries, and it causes a build error.
-+ 'OTHER_CFLAGS!' : [
-+ '-include base/namespace.h',
-+ ],
-+ },
- }],
- ],
-- 'xcode_settings': {
-- # Remove the force included file. This is not necessary for third
-- # party libraries, and it causes a build error.
-- 'OTHER_CFLAGS!' : [
-- '-include base/namespace.h',
-- ],
-- },
- },
- {
- 'target_name': 'gen_mozc_data_dir_header',
diff --git a/app-i18n/mozc/mozc-2.20.2673.102.ebuild b/app-i18n/mozc/mozc-2.20.2673.102.ebuild
deleted file mode 100644
index a0dd5acee8e..00000000000
--- a/app-i18n/mozc/mozc-2.20.2673.102.ebuild
+++ /dev/null
@@ -1,321 +0,0 @@
-# Copyright 1999-2018 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI="6"
-PYTHON_COMPAT=(python2_7)
-
-inherit elisp-common multiprocessing python-any-r1 toolchain-funcs
-
-if [[ "${PV}" == "9999" ]]; then
- inherit git-r3
-
- EGIT_REPO_URI="https://github.com/google/mozc"
- EGIT_SUBMODULES=(src/third_party/japanese_usage_dictionary)
-else
- MOZC_GIT_REVISION="280e38fe3d9db4df52f0713acf2ca65898cd697a"
- JAPANESE_USAGE_DICTIONARY_GIT_REVISION="e5b3425575734c323e1d947009dd74709437b684"
- JAPANESE_USAGE_DICTIONARY_DATE="20120416091336"
- FCITX_PATCH_VERSION="2.18.2612.102.1"
-fi
-
-DESCRIPTION="Mozc - Japanese input method editor"
-HOMEPAGE="https://github.com/google/mozc"
-if [[ "${PV}" == "9999" ]]; then
- SRC_URI=""
-else
- SRC_URI="https://github.com/google/${PN}/archive/${MOZC_GIT_REVISION}.tar.gz -> ${P}.tar.gz
- https://github.com/hiroyuki-komatsu/japanese-usage-dictionary/archive/${JAPANESE_USAGE_DICTIONARY_GIT_REVISION}.tar.gz -> japanese-usage-dictionary-${JAPANESE_USAGE_DICTIONARY_DATE}.tar.gz
- fcitx4? ( https://download.fcitx-im.org/fcitx-mozc/fcitx-mozc-${FCITX_PATCH_VERSION}.patch )"
-fi
-
-# Mozc: BSD
-# src/data/dictionary_oss: ipadic, public-domain
-# src/data/unicode: unicode
-# japanese-usage-dictionary: BSD-2
-LICENSE="BSD BSD-2 ipadic public-domain unicode"
-SLOT="0"
-KEYWORDS="amd64 ~ppc64 x86"
-IUSE="debug emacs fcitx4 +gui +handwriting-tegaki handwriting-tomoe ibus renderer test"
-REQUIRED_USE="|| ( emacs fcitx4 ibus ) gui? ( ^^ ( handwriting-tegaki handwriting-tomoe ) ) !gui? ( !handwriting-tegaki !handwriting-tomoe )"
-
-RDEPEND=">=dev-libs/protobuf-3.0.0:=
- emacs? ( virtual/emacs )
- fcitx4? ( app-i18n/fcitx:4 )
- gui? (
- app-i18n/zinnia
- dev-qt/qtcore:5
- dev-qt/qtgui:5
- dev-qt/qtwidgets:5
- handwriting-tegaki? ( app-i18n/tegaki-zinnia-japanese )
- handwriting-tomoe? ( app-i18n/zinnia-tomoe )
- )
- ibus? (
- >=app-i18n/ibus-1.4.1
- dev-libs/glib:2
- x11-libs/libxcb
- )
- renderer? (
- dev-libs/glib:2
- x11-libs/cairo
- x11-libs/gtk+:2
- x11-libs/pango
- )"
-DEPEND="${RDEPEND}
- ${PYTHON_DEPS}
- dev-util/gyp
- dev-util/ninja
- virtual/pkgconfig
- test? (
- >=dev-cpp/gtest-1.8.0
- dev-libs/jsoncpp
- )"
-
-S="${WORKDIR}/${P}/src"
-
-SITEFILE="50${PN}-gentoo.el"
-
-execute() {
- einfo "$@"
- "$@"
-}
-
-src_unpack() {
- if [[ "${PV}" == "9999" ]]; then
- git-r3_src_unpack
-
- if use fcitx4; then
- local EGIT_SUBMODULES=()
- git-r3_fetch https://github.com/fcitx/mozc refs/heads/fcitx
- git-r3_checkout https://github.com/fcitx/mozc "${WORKDIR}/fcitx-mozc"
- fi
- else
- unpack ${P}.tar.gz
- mv mozc-${MOZC_GIT_REVISION} ${P} || die
-
- unpack japanese-usage-dictionary-${JAPANESE_USAGE_DICTIONARY_DATE}.tar.gz
- cp -p japanese-usage-dictionary-${JAPANESE_USAGE_DICTIONARY_GIT_REVISION}/usage_dict.txt ${P}/src/third_party/japanese_usage_dictionary || die
- fi
-}
-
-src_prepare() {
- eapply -p2 "${FILESDIR}/${PN}-2.20.2673.102-system_libraries.patch"
- eapply -p2 "${FILESDIR}/${PN}-2.20.2673.102-gcc-5.patch"
- eapply -p2 "${FILESDIR}/${PN}-2.20.2673.102-tests_build.patch"
- eapply -p2 "${FILESDIR}/${PN}-2.20.2673.102-tests_skipping.patch"
-
- if use fcitx4; then
- if [[ "${PV}" == "9999" ]]; then
- cp -pr "${WORKDIR}/fcitx-mozc/src/unix/fcitx" unix || die
- else
- eapply -p2 "${DISTDIR}/fcitx-mozc-${FCITX_PATCH_VERSION}.patch"
- fi
- fi
-
- eapply_user
-
- sed \
- -e "s/def GypMain(options, unused_args):/def GypMain(options, gyp_args):/" \
- -e "s/RunOrDie(gyp_command + gyp_options)/RunOrDie(gyp_command + gyp_options + gyp_args)/" \
- -e "s/RunOrDie(\[ninja/&, '-j$(makeopts_jobs)', '-l$(makeopts_loadavg "${MAKEOPTS}" 0)', '-v'/" \
- -i build_mozc.py || die
-
- sed \
- -e "s/'release_extra_cflags%': \['-O2'\]/'release_extra_cflags%': []/" \
- -e "s/'debug_extra_cflags%': \['-O0', '-g'\]/'debug_extra_cflags%': []/" \
- -i gyp/common.gypi || die
-
- local ar=($(tc-getAR))
- local cc=($(tc-getCC))
- local cxx=($(tc-getCXX))
- local ld=($(tc-getLD))
- local nm=($(tc-getNM))
- local readelf=($(tc-getPROG READELF readelf))
-
- # Use absolute paths. Non-absolute paths are mishandled by GYP.
- ar[0]=$(type -P ${ar[0]})
- cc[0]=$(type -P ${cc[0]})
- cxx[0]=$(type -P ${cxx[0]})
- ld[0]=$(type -P ${ld[0]})
- nm[0]=$(type -P ${nm[0]})
- readelf[0]=$(type -P ${readelf[0]})
-
- sed \
- -e "s:<!(which ar):${ar[@]}:" \
- -e "s:<!(which clang):${cc[@]}:" \
- -e "s:<!(which clang++):${cxx[@]}:" \
- -e "s:<!(which ld):${ld[@]}:" \
- -e "s:<!(which nm):${nm[@]}:" \
- -e "s:<!(which readelf):${readelf[@]}:" \
- -i gyp/common.gypi || die
-}
-
-src_configure() {
- if use debug; then
- BUILD_TYPE="Debug"
- else
- BUILD_TYPE="Release"
- fi
-
- local gyp_arguments=()
-
- if tc-is-gcc; then
- gyp_arguments+=(-D compiler_host=gcc -D compiler_target=gcc)
- elif tc-is-clang; then
- gyp_arguments+=(-D compiler_host=clang -D compiler_target=clang)
- else
- gyp_arguments+=(-D compiler_host=unknown -D compiler_target=unknown)
- fi
-
- gyp_arguments+=(-D use_libgtest=$(usex test 1 0))
- gyp_arguments+=(-D use_libibus=$(usex ibus 1 0))
- gyp_arguments+=(-D use_libjsoncpp=$(usex test 1 0))
- gyp_arguments+=(-D use_libprotobuf=1)
- gyp_arguments+=(-D use_libzinnia=$(usex gui 1 0))
- gyp_arguments+=(-D enable_gtk_renderer=$(usex renderer 1 0))
-
- gyp_arguments+=(-D server_dir="${EPREFIX}/usr/libexec/mozc")
- gyp_arguments+=(-D document_dir="${EPREFIX}/usr/libexec/mozc/documents")
-
- if use handwriting-tegaki; then
- gyp_arguments+=(-D zinnia_model_file="${EPREFIX}/usr/share/tegaki/models/zinnia/handwriting-ja.model")
- elif use handwriting-tomoe; then
- gyp_arguments+=(-D zinnia_model_file="${EPREFIX}/usr/$(get_libdir)/zinnia/model/tomoe/handwriting-ja.model")
- fi
-
- if use ibus; then
- gyp_arguments+=(-D ibus_mozc_path="${EPREFIX}/usr/libexec/ibus-engine-mozc")
- gyp_arguments+=(-D ibus_mozc_icon_path="${EPREFIX}/usr/share/ibus-mozc/product_icon.png")
- fi
-
- unset AR CC CXX LD NM READELF
-
- execute "${PYTHON}" build_mozc.py gyp \
- --gypdir="${EPREFIX}/usr/bin" \
- --server_dir="${EPREFIX}/usr/libexec/mozc" \
- --verbose \
- $(usex gui "" --noqt) \
- -- "${gyp_arguments[@]}" || die "Configuration failed"
-}
-
-src_compile() {
- local targets=(server/server.gyp:mozc_server)
- if use emacs; then
- targets+=(unix/emacs/emacs.gyp:mozc_emacs_helper)
- fi
- if use fcitx4; then
- targets+=(unix/fcitx/fcitx.gyp:fcitx-mozc)
- fi
- if use gui; then
- targets+=(gui/gui.gyp:mozc_tool)
- fi
- if use ibus; then
- targets+=(unix/ibus/ibus.gyp:ibus_mozc)
- fi
- if use renderer; then
- targets+=(renderer/renderer.gyp:mozc_renderer)
- fi
- if use test; then
- targets+=(gyp/tests.gyp:unittests)
- fi
-
- execute "${PYTHON}" build_mozc.py build -c ${BUILD_TYPE} -v "${targets[@]}" || die "Building failed"
-
- if use emacs; then
- elisp-compile unix/emacs/*.el
- fi
-}
-
-src_test() {
- execute "${PYTHON}" build_mozc.py runtests -c ${BUILD_TYPE} --test_jobs 1 || die "Testing failed"
-}
-
-src_install() {
- exeinto /usr/libexec/mozc
- doexe out_linux/${BUILD_TYPE}/mozc_server
-
- if use gui; then
- doexe out_linux/${BUILD_TYPE}/mozc_tool
- fi
-
- if use renderer; then
- doexe out_linux/${BUILD_TYPE}/mozc_renderer
- fi
-
- insinto /usr/libexec/mozc/documents
- doins data/installer/credits_en.html
-
- if use emacs; then
- dobin out_linux/${BUILD_TYPE}/mozc_emacs_helper
- elisp-install ${PN} unix/emacs/*.{el,elc}
- elisp-site-file-install "${FILESDIR}/${SITEFILE}" ${PN}
- fi
-
- if use fcitx4; then
- exeinto /usr/$(get_libdir)/fcitx
- doexe out_linux/${BUILD_TYPE}/fcitx-mozc.so
-
- insinto /usr/share/fcitx/addon
- doins unix/fcitx/fcitx-mozc.conf
-
- insinto /usr/share/fcitx/inputmethod
- doins unix/fcitx/mozc.conf
-
- insinto /usr/share/fcitx/mozc/icon
- newins data/images/product_icon_32bpp-128.png mozc.png
- local image
- for image in data/images/unix/ui-*.png; do
- newins "${image}" "mozc-${image#data/images/unix/ui-}"
- done
-
- local locale mo_file
- for mo_file in out_linux/${BUILD_TYPE}/gen/unix/fcitx/po/*.mo; do
- locale="${mo_file##*/}"
- locale="${locale%.mo}"
- insinto /usr/share/locale/${locale}/LC_MESSAGES
- newins "${mo_file}" fcitx-mozc.mo
- done
- fi
-
- if use ibus; then
- exeinto /usr/libexec
- newexe out_linux/${BUILD_TYPE}/ibus_mozc ibus-engine-mozc
-
- insinto /usr/share/ibus/component
- doins out_linux/${BUILD_TYPE}/gen/unix/ibus/mozc.xml
-
- insinto /usr/share/ibus-mozc
- newins data/images/unix/ime_product_icon_opensource-32.png product_icon.png
- local image
- for image in data/images/unix/ui-*.png; do
- newins "${image}" "${image#data/images/unix/ui-}"
- done
- fi
-}
-
-pkg_postinst() {
- if use emacs; then
- elisp-site-regen
-
- elog "USAGE IN EMACS"
- elog
- elog "mozc-mode is minor mode to input Japanese text using Mozc server."
- elog "mozc-mode can be used via LEIM (Library of Emacs Input Method)."
- elog
- elog "In order to use mozc-mode by default, the following settings should be added to"
- elog "Emacs init file (~/.emacs.d/init.el or ~/.emacs):"
- elog
- elog " (require 'mozc)"
- elog " (set-language-environment \"Japanese\")"
- elog " (setq default-input-method \"japanese-mozc\")"
- elog
- elog "With the above settings, typing C-\\ (which is bound to \"toggle-input-method\""
- elog "by default) will enable mozc-mode."
- elog
- elog "Alternatively, at run time, after loading mozc.el, mozc-mode can be activated by"
- elog "calling \"set-input-method\" and entering \"japanese-mozc\"."
- fi
-}
-
-pkg_postrm() {
- use emacs && elisp-site-regen
-}
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: app-i18n/mozc/, app-i18n/mozc/files/
@ 2019-08-16 17:03 Mike Gilbert
0 siblings, 0 replies; 7+ messages in thread
From: Mike Gilbert @ 2019-08-16 17:03 UTC (permalink / raw
To: gentoo-commits
commit: c4eebe84bd56d0a695538ecdc0f4d319bfd26942
Author: Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Thu Aug 15 18:32:47 2019 +0000
Commit: Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Fri Aug 16 17:02:27 2019 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c4eebe84
app-i18n/mozc: Add some support for 令和 (Reiwa).
Signed-off-by: Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache.Org>
Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>
app-i18n/mozc/files/mozc-2.23.2815.102-reiwa.patch | 35 ++++++++++++++++++++++
app-i18n/mozc/mozc-2.23.2815.102.ebuild | 1 +
app-i18n/mozc/mozc-9999.ebuild | 1 +
3 files changed, 37 insertions(+)
diff --git a/app-i18n/mozc/files/mozc-2.23.2815.102-reiwa.patch b/app-i18n/mozc/files/mozc-2.23.2815.102-reiwa.patch
new file mode 100644
index 00000000000..561a989a41d
--- /dev/null
+++ b/app-i18n/mozc/files/mozc-2.23.2815.102-reiwa.patch
@@ -0,0 +1,35 @@
+https://github.com/google/mozc/issues/461
+
+--- /src/data/symbol/categorized.tsv
++++ /src/data/symbol/categorized.tsv
+@@ -405,6 +405,7 @@
+ ㍽ MATH たいしょう ねんごう
+ ㍼ MATH しょうわ ねんごう
+ ㍻ MATH へいせい ねんごう
++㋿ MATH れいわ ねんごう
+
+ ㌣ MATH せんと たんい
+ ㌦ MATH どる たんい
+--- /src/data/symbol/symbol.tsv
++++ /src/data/symbol/symbol.tsv
+@@ -528,6 +528,7 @@
+ 記号 ㊦ した げ 丸下
+ 記号 ㊧ ひだり 丸左
+ 記号 ㊨ みぎ 丸右
++記号 ㋿ れいわ ねんごう 年号 OTHER
+ 記号 ㍻ へいせい ねんごう 年号 OTHER
+ 記号 ㍼ しょうわ ねんごう 年号 OTHER
+ 記号 ㍽ たいしょう ねんごう 年号 OTHER
+--- /src/rewriter/date_rewriter.cc
++++ /src/rewriter/date_rewriter.cc
+@@ -1239,6 +1239,10 @@
+ 1989,
+ "平成",
+ "へいせい",
++ }, {
++ 2019,
++ "令和",
++ "れいわ",
+ }
+ };
+
diff --git a/app-i18n/mozc/mozc-2.23.2815.102.ebuild b/app-i18n/mozc/mozc-2.23.2815.102.ebuild
index 3aed7d8c7b6..f198c294cea 100644
--- a/app-i18n/mozc/mozc-2.23.2815.102.ebuild
+++ b/app-i18n/mozc/mozc-2.23.2815.102.ebuild
@@ -108,6 +108,7 @@ src_prepare() {
eapply -p2 "${FILESDIR}/${PN}-2.23.2815.102-system_libraries.patch"
eapply -p2 "${FILESDIR}/${PN}-2.23.2815.102-gcc-8.patch"
eapply -p2 "${FILESDIR}/${PN}-2.23.2815.102-protobuf_generated_classes_no_inheritance.patch"
+ eapply -p2 "${FILESDIR}/${PN}-2.23.2815.102-reiwa.patch"
eapply -p2 "${FILESDIR}/${PN}-2.20.2673.102-tests_build.patch"
eapply -p2 "${FILESDIR}/${PN}-2.20.2673.102-tests_skipping.patch"
diff --git a/app-i18n/mozc/mozc-9999.ebuild b/app-i18n/mozc/mozc-9999.ebuild
index 85d5fbb98be..037a8d2d256 100644
--- a/app-i18n/mozc/mozc-9999.ebuild
+++ b/app-i18n/mozc/mozc-9999.ebuild
@@ -108,6 +108,7 @@ src_prepare() {
eapply -p2 "${FILESDIR}/${PN}-2.23.2815.102-system_libraries.patch"
eapply -p2 "${FILESDIR}/${PN}-2.23.2815.102-gcc-8.patch"
eapply -p2 "${FILESDIR}/${PN}-2.23.2815.102-protobuf_generated_classes_no_inheritance.patch"
+ eapply -p2 "${FILESDIR}/${PN}-2.23.2815.102-reiwa.patch"
eapply -p2 "${FILESDIR}/${PN}-2.20.2673.102-tests_build.patch"
eapply -p2 "${FILESDIR}/${PN}-2.20.2673.102-tests_skipping.patch"
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: app-i18n/mozc/, app-i18n/mozc/files/
@ 2020-01-17 19:09 Mike Gilbert
0 siblings, 0 replies; 7+ messages in thread
From: Mike Gilbert @ 2020-01-17 19:09 UTC (permalink / raw
To: gentoo-commits
commit: a1ff8a4ff637d2a7a8ed60297ab90fe8bdc7fb46
Author: Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Fri Jan 17 17:39:29 2020 +0000
Commit: Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Fri Jan 17 19:08:54 2020 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a1ff8a4f
app-i18n/mozc: Use Python 3.
Closes: https://bugs.gentoo.org/695006
Signed-off-by: Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache.Org>
Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>
.../mozc/files/mozc-2.23.2815.102-python-3_1.patch | 621 +++++++++++++++++++++
.../mozc/files/mozc-2.23.2815.102-python-3_2.patch | 600 ++++++++++++++++++++
.../mozc/files/mozc-2.23.2815.102-python-3_3.patch | 583 +++++++++++++++++++
.../mozc/files/mozc-2.23.2815.102-python-3_4.patch | 537 ++++++++++++++++++
app-i18n/mozc/mozc-2.23.2815.102.ebuild | 8 +-
app-i18n/mozc/mozc-9999.ebuild | 8 +-
6 files changed, 2353 insertions(+), 4 deletions(-)
diff --git a/app-i18n/mozc/files/mozc-2.23.2815.102-python-3_1.patch b/app-i18n/mozc/files/mozc-2.23.2815.102-python-3_1.patch
new file mode 100644
index 00000000000..2b9bbd720cd
--- /dev/null
+++ b/app-i18n/mozc/files/mozc-2.23.2815.102-python-3_1.patch
@@ -0,0 +1,621 @@
+https://github.com/google/mozc/issues/462
+
+--- /src/base/gen_character_set.py
++++ /src/base/gen_character_set.py
+@@ -33,7 +33,6 @@
+ import itertools
+ import optparse
+ import re
+-import string
+ import sys
+
+
+@@ -89,7 +88,8 @@
+ @staticmethod
+ def _LoadTable(filename, column_index, pattern, validater):
+ result = set()
+- for line in open(filename):
++ fh = open(filename)
++ for line in fh:
+ if line.startswith('#'):
+ # Skip a comment line.
+ continue
+@@ -100,6 +100,7 @@
+ ucs = int(match.group(1), 16)
+ if validater(ucs):
+ result.add(ucs)
++ fh.close()
+
+ return result
+
+@@ -250,7 +251,7 @@
+ # (at most) four code points.
+ bit_list = []
+ for _, group in itertools.groupby(enumerate(category_list),
+- lambda (codepoint, _): codepoint / 4):
++ lambda x: x[0] // 4):
+ # Fill bits from LSB to MSB for each group.
+ bits = 0
+ for index, (_, category) in enumerate(group):
+@@ -263,7 +264,7 @@
+
+ # Output the content. Each line would have (at most) 16 bytes.
+ for _, group in itertools.groupby(enumerate(bit_list),
+- lambda (index, _): index / 16):
++ lambda x: x[0] // 16):
+ line = [' \"']
+ for _, bits in group:
+ line.append('\\x%02X' % bits)
+@@ -386,7 +387,7 @@
+ # Bitmap lookup.
+ # TODO(hidehiko): the bitmap has two huge 0-bits ranges. Reduce them.
+ category_map = [
+- (bits, category) for category, bits in CATEGORY_BITMAP.iteritems()]
++ (bits, category) for category, bits in CATEGORY_BITMAP.items()]
+ category_map.sort()
+
+ lines.extend([
+@@ -451,7 +452,7 @@
+ options.jisx0213file)
+ category_list = [
+ categorizer.GetCategory(codepoint)
+- for codepoint in xrange(categorizer.MaxCodePoint() + 1)]
++ for codepoint in range(categorizer.MaxCodePoint() + 1)]
+ generated_character_set_header = GenerateCharacterSetHeader(category_list)
+
+ # Write the result.
+--- /src/base/gen_config_file_stream_data.py
++++ /src/base/gen_config_file_stream_data.py
+@@ -58,7 +58,7 @@
+ result = []
+ result.append(' { "%s", "' % os.path.basename(path))
+ with open(path, 'rb') as stream:
+- result.extend(r'\x%02X' % ord(byte) for byte in stream.read())
++ result.extend(r'\x%02X' % byte for byte in stream.read())
+ result.append('", %d }' % os.path.getsize(path))
+
+ return ''.join(result)
+@@ -93,8 +93,8 @@
+ def main():
+ (options, args) = ParseOptions()
+ if not options.output:
+- print >>sys.stderr, (
+- 'usage: gen_config_file_stream_data.py --output=filepath input ...')
++ print('usage: gen_config_file_stream_data.py --output=filepath input ...',
++ file=sys.stderr)
+ sys.exit(2)
+
+ with open(options.output, 'w') as output:
+--- /src/build_mozc.py
++++ /src/build_mozc.py
+@@ -943,7 +943,7 @@
+ logging.info('running %s...', binary)
+ try:
+ test_function(binary, gtest_report_dir, options)
+- except RunOrDieError, e:
++ except RunOrDieError as e:
+ logging.error(e)
+ failed_tests.append(binary)
+ else:
+@@ -1082,7 +1082,7 @@
+ # and '-c' and 'Release' are build options.
+ targets = []
+ build_options = []
+- for i in xrange(len(args)):
++ for i in range(len(args)):
+ if args[i].startswith('-'):
+ # starting with build options
+ build_options = args[i:]
+@@ -1190,14 +1190,14 @@
+
+ def ShowHelpAndExit():
+ """Shows the help message."""
+- print 'Usage: build_mozc.py COMMAND [ARGS]'
+- print 'Commands: '
+- print ' gyp Generate project files.'
+- print ' build Build the specified target.'
+- print ' runtests Build all tests and run them.'
+- print ' clean Clean all the build files and directories.'
+- print ''
+- print 'See also the comment in the script for typical usage.'
++ print('Usage: build_mozc.py COMMAND [ARGS]')
++ print('Commands: ')
++ print(' gyp Generate project files.')
++ print(' build Build the specified target.')
++ print(' runtests Build all tests and run them.')
++ print(' clean Clean all the build files and directories.')
++ print('')
++ print('See also the comment in the script for typical usage.')
+ sys.exit(1)
+
+
+--- /src/build_tools/android_util.py
++++ /src/build_tools/android_util.py
+@@ -548,7 +548,7 @@
+ (devices_result, _) = process.communicate()
+ used_ports = set(int(port) for port
+ in re.findall(r'emulator-(\d+)', devices_result))
+- return [port for port in xrange(5554, 5586, 2) if port not in used_ports]
++ return [port for port in range(5554, 5586, 2) if port not in used_ports]
+
+
+ def SetUpTestingSdkHomeDirectory(dest_android_sdk_home,
+@@ -575,7 +575,7 @@
+ 'create', 'avd',
+ '--force',
+ '--sdcard', '512M',]
+- for key, value in options.iteritems():
++ for key, value in options.items():
+ args.extend([key, value])
+ env = {'ANDROID_SDK_HOME': os.path.abspath(dest_android_sdk_home)}
+ logging.info('Creating AVD: %s', args)
+@@ -615,7 +615,7 @@
+ def main():
+ for arg in sys.argv[1:]:
+ for item in sorted(GetApkProperties(arg).items()):
+- print '%s: %s' % item
++ print('%s: %s' % item)
+
+
+ if __name__ == '__main__':
+--- /src/build_tools/binary_size_checker.py
++++ /src/build_tools/binary_size_checker.py
+@@ -70,12 +70,12 @@
+ actual_size = os.stat(filename).st_size
+ expected_size = EXPECTED_MAXIMUM_SIZES[basename]
+ if actual_size < expected_size * 1024 * 1024:
+- print 'Pass: %s (size: %d) is smaller than expected (%d MB)' % (
+- filename, actual_size, expected_size)
++ print('Pass: %s (size: %d) is smaller than expected (%d MB)' % (
++ filename, actual_size, expected_size))
+ return True
+ else:
+- print 'WARNING: %s (size: %d) is larger than expected (%d MB)' % (
+- filename, actual_size, expected_size)
++ print('WARNING: %s (size: %d) is larger than expected (%d MB)' % (
++ filename, actual_size, expected_size))
+ return False
+
+
+--- /src/build_tools/build_and_sign_pkg_mac.py
++++ /src/build_tools/build_and_sign_pkg_mac.py
+@@ -44,8 +44,8 @@
+ import shutil
+ import sys
+
+-from util import PrintErrorAndExit
+-from util import RunOrDie
++from .util import PrintErrorAndExit
++from .util import RunOrDie
+
+
+ def ParseOption():
+--- /src/build_tools/build_breakpad.py
++++ /src/build_tools/build_breakpad.py
+@@ -54,9 +54,9 @@
+ try:
+ subprocess.check_output(command)
+ except subprocess.CalledProcessError as e:
+- print e.output
++ print(e.output)
+ sys.exit(e.returncode)
+- print 'Done: %s' % ' '.join(command)
++ print('Done: %s' % ' '.join(command))
+
+
+ def Xcodebuild(projdir, target, arch, sdk, outdir):
+--- /src/build_tools/build_diskimage_mac.py
++++ /src/build_tools/build_diskimage_mac.py
+@@ -90,7 +90,7 @@
+ # setup volume directory
+ temp_dir = tempfile.mkdtemp()
+ CopyFile(path.join(build_dir, ".keystone_install"), temp_dir)
+- os.chmod(path.join(temp_dir, ".keystone_install"), 0755) # rwxr-xr-x
++ os.chmod(path.join(temp_dir, ".keystone_install"), 0o755) # rwxr-xr-x
+ for a in args:
+ CopyFile(path.join(build_dir, a), temp_dir)
+
+--- /src/build_tools/change_reference_mac.py
++++ /src/build_tools/change_reference_mac.py
+@@ -41,8 +41,8 @@
+ import optparse
+ import os
+
+-from util import PrintErrorAndExit
+-from util import RunOrDie
++from .util import PrintErrorAndExit
++from .util import RunOrDie
+
+
+ def ParseOption():
+--- /src/build_tools/code_generator_util.py
++++ /src/build_tools/code_generator_util.py
+@@ -33,27 +33,26 @@
+ __author__ = "hidehiko"
+
+ import struct
+-import types
+
+
+ def ToCppStringLiteral(s):
+ """Returns C-style string literal, or NULL if given s is None."""
+ if s is None:
+- return 'NULL'
++ return b'NULL'
+
+- if all(0x20 <= ord(c) <= 0x7E for c in s):
++ if all(0x20 <= c <= 0x7E for c in s):
+ # All characters are in ascii code.
+- return '"%s"' % s.replace('\\', r'\\').replace('"', r'\"')
++ return b'"%b"' % s.replace(b'\\', br'\\').replace(b'"', br'\"')
+ else:
+ # One or more characters are non-ascii.
+- return '"%s"' % ''.join(r'\x%02X' % ord(c) for c in s)
++ return b'"%b"' % b''.join(br'\x%02X' % c for c in s)
+
+
+ def FormatWithCppEscape(format_text, *args):
+ """Returns a string filling format with args."""
+ literal_list = []
+ for arg in args:
+- if isinstance(arg, (types.StringType, types.NoneType)):
++ if isinstance(arg, (bytes, type(None))):
+ arg = ToCppStringLiteral(arg)
+ literal_list.append(arg)
+
+@@ -95,7 +94,7 @@
+ if target_compiler and target_compiler.startswith('msvs'):
+ stream.write('const uint64 k%s_data_wordtype[] = {\n' % variable_name)
+
+- for word_index in xrange(0, len(data), 8):
++ for word_index in range(0, len(data), 8):
+ word_chunk = data[word_index:word_index + 8].ljust(8, '\x00')
+ stream.write('0x%016X, ' % struct.unpack('<Q', word_chunk))
+ if (word_index / 8) % 4 == 3:
+@@ -111,7 +110,7 @@
+ stream.write('const char k%s_data[] =\n' % variable_name)
+ # Output 16bytes per line.
+ chunk_size = 16
+- for index in xrange(0, len(data), chunk_size):
++ for index in range(0, len(data), chunk_size):
+ chunk = data[index:index + chunk_size]
+ stream.write('"')
+ stream.writelines(r'\x%02X' % ord(c) for c in chunk)
+@@ -126,36 +125,50 @@
+ if type(codepoint_list) is int:
+ codepoint_list = (codepoint_list,)
+ if codepoint_list is None or len(codepoint_list) == 0:
+- return 'null'
+- result = r'"'
++ return b'null'
++ result = b'"'
+ for codepoint in codepoint_list:
+- utf16_string = unichr(codepoint).encode('utf-16be')
++ utf16_string = chr(codepoint).encode('utf-16be')
+ if len(utf16_string) == 2:
+ (u0, l0) = utf16_string
+- result += r'\u%02X%02X' % (ord(u0), ord(l0))
++ result += br'\u%02X%02X' % (u0, l0)
+ else:
+ (u0, l0, u1, l1) = utf16_string
+- result += r'\u%02X%02X\u%02X%02X' % (ord(u0), ord(l0), ord(u1), ord(l1))
+- result += r'"'
++ result += br'\u%02X%02X\u%02X%02X' % (u0, l0, u1, l1)
++ result += b'"'
+ return result
+
+
+ def SkipLineComment(stream, comment_prefix='#'):
+ """Skips line comments from stream."""
+ for line in stream:
++ if isinstance(line, bytes):
++ if isinstance(comment_prefix, str):
++ comment_prefix = comment_prefix.encode('utf-8')
++ line_ending = b'\n'
++ else:
++ line_ending = '\n'
+ stripped_line = line.strip()
+ if stripped_line and not stripped_line.startswith(comment_prefix):
+- yield line.rstrip('\n')
++ yield line.rstrip(line_ending)
+
+
+ def ParseColumnStream(stream, num_column=None, delimiter=None):
+ """Returns parsed columns read from stream."""
+ if num_column is None:
+ for line in stream:
+- yield line.rstrip('\n').split(delimiter)
++ if isinstance(line, bytes):
++ line_ending = b'\n'
++ else:
++ line_ending = '\n'
++ yield line.rstrip(line_ending).split(delimiter)
+ else:
+ for line in stream:
+- yield line.rstrip('\n').split(delimiter)[:num_column]
++ if isinstance(line, bytes):
++ line_ending = b'\n'
++ else:
++ line_ending = '\n'
++ yield line.rstrip(line_ending).split(delimiter)[:num_column]
+
+
+ def SelectColumn(stream, column_index):
+@@ -172,5 +185,5 @@
+ grouper extends the last chunk to make it an n-element chunk by adding
+ appropriate value, but this returns truncated chunk.
+ """
+- for index in xrange(0, len(iterable), n):
++ for index in range(0, len(iterable), n):
+ yield iterable[index:index + n]
+--- /src/build_tools/codesign_mac.py
++++ /src/build_tools/codesign_mac.py
+@@ -46,17 +46,17 @@
+
+ def RunOrDie(command):
+ """Run the command, or die if it failed."""
+- print "Running: " + command
++ print("Running: " + command)
+ try:
+ output = subprocess.check_output(command, shell=True)
+- print >> sys.stderr, "=========="
+- print >> sys.stderr, "COMMAND: " + command
+- print >> sys.stderr, output
++ print("==========", file=sys.stderr)
++ print("COMMAND: " + command, file=sys.stderr)
++ print(output, file=sys.stderr)
+ except subprocess.CalledProcessError as e:
+- print >> sys.stderr, "=========="
+- print >> sys.stderr, "ERROR: " + command
+- print >> sys.stderr, e.output
+- print >> sys.stderr, "=========="
++ print("==========", file=sys.stderr)
++ print("ERROR: " + command, file=sys.stderr)
++ print(e.output, file=sys.stderr)
++ print("==========", file=sys.stderr)
+ sys.exit(1)
+
+
+@@ -119,18 +119,18 @@
+ (options, unused_args) = parser.parse_args()
+
+ if not options.target:
+- print "Error: --target should be specified."
+- print parser.print_help()
++ print("Error: --target should be specified.")
++ print(parser.print_help())
+ sys.exit(1)
+
+ return options
+
+
+ def DumpEnviron():
+- print "=== os.environ ==="
++ print("=== os.environ ===")
+ for key in sorted(os.environ):
+- print "%s = %s" % (key, os.getenv(key))
+- print "=================="
++ print("%s = %s" % (key, os.getenv(key)))
++ print("==================")
+
+
+ def main():
+--- /src/build_tools/copy_dll_and_symbol.py
++++ /src/build_tools/copy_dll_and_symbol.py
+@@ -38,7 +38,7 @@
+ import os
+ import shutil
+
+-from util import PrintErrorAndExit
++from .util import PrintErrorAndExit
+
+ def ParseOption():
+ """Parse command line options."""
+@@ -98,7 +98,7 @@
+ if _GetLastModifiedTime(src) <= target_file_mtime:
+ # Older file found. Ignore.
+ continue
+- print 'Copying %s to %s' % (src, target_file_abspath)
++ print('Copying %s to %s' % (src, target_file_abspath))
+ shutil.copy2(src, target_file_abspath)
+ break
+
+--- /src/build_tools/copy_file.py
++++ /src/build_tools/copy_file.py
+@@ -52,7 +52,7 @@
+ Args:
+ message: The error message to be printed to stderr.
+ """
+- print >>sys.stderr, message
++ print(message, file=sys.stderr)
+ sys.exit(1)
+
+
+--- /src/build_tools/copy_qt_frameworks_mac.py
++++ /src/build_tools/copy_qt_frameworks_mac.py
+@@ -41,9 +41,9 @@
+ import optparse
+ import os
+
+-from copy_file import CopyFiles
+-from util import PrintErrorAndExit
+-from util import RunOrDie
++from .copy_file import CopyFiles
++from .util import PrintErrorAndExit
++from .util import RunOrDie
+
+
+ def ParseOption():
+--- /src/build_tools/embed_file.py
++++ /src/build_tools/embed_file.py
+@@ -46,10 +46,10 @@
+
+ def _FormatAsUint64LittleEndian(s):
+ """Formats a string as uint64 value in little endian order."""
+- for _ in xrange(len(s), 8):
+- s += '\0'
++ for _ in range(len(s), 8):
++ s += b'\0'
+ s = s[::-1] # Reverse the string
+- return '0x%s' % binascii.b2a_hex(s)
++ return b'0x%b' % binascii.b2a_hex(s)
+
+
+ def main():
+@@ -57,30 +57,30 @@
+ with open(opts.input, 'rb') as infile:
+ with open(opts.output, 'wb') as outfile:
+ outfile.write(
+- '#ifdef MOZC_EMBEDDED_FILE_%(name)s\n'
+- '#error "%(name)s was already included or defined elsewhere"\n'
+- '#else\n'
+- '#define MOZC_EMBEDDED_FILE_%(name)s\n'
+- 'const uint64 %(name)s_data[] = {\n'
+- % {'name': opts.name})
++ b'#ifdef MOZC_EMBEDDED_FILE_%(name)b\n'
++ b'#error "%(name)b was already included or defined elsewhere"\n'
++ b'#else\n'
++ b'#define MOZC_EMBEDDED_FILE_%(name)b\n'
++ b'const uint64 %(name)b_data[] = {\n'
++ % {b'name': opts.name.encode('utf-8')})
+
+ while True:
+ chunk = infile.read(8)
+ if not chunk:
+ break
+- outfile.write(' ')
++ outfile.write(b' ')
+ outfile.write(_FormatAsUint64LittleEndian(chunk))
+- outfile.write(',\n')
++ outfile.write(b',\n')
+
+ outfile.write(
+- '};\n'
+- 'const EmbeddedFile %(name)s = {\n'
+- ' %(name)s_data,\n'
+- ' %(size)d,\n'
+- '};\n'
+- '#endif // MOZC_EMBEDDED_FILE_%(name)s\n'
+- % {'name': opts.name,
+- 'size': os.stat(opts.input).st_size})
++ b'};\n'
++ b'const EmbeddedFile %(name)b = {\n'
++ b' %(name)b_data,\n'
++ b' %(size)d,\n'
++ b'};\n'
++ b'#endif // MOZC_EMBEDDED_FILE_%(name)b\n'
++ % {b'name': opts.name.encode('utf-8'),
++ b'size': os.stat(opts.input).st_size})
+
+
+ if __name__ == '__main__':
+--- /src/build_tools/embed_pathname.py
++++ /src/build_tools/embed_pathname.py
+@@ -28,7 +28,7 @@
+ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+-"""A script to embed the given (relative) path name to C/C++ characters array.
++r"""A script to embed the given (relative) path name to C/C++ characters array.
+
+ Example:
+ ./embed_pathname.py --path_to_be_embedded=d:\data\mozc
+@@ -53,7 +53,7 @@
+
+ (options, unused_args) = parser.parse_args()
+ if not all(vars(options).values()):
+- print parser.print_help()
++ print(parser.print_help())
+ sys.exit(1)
+
+ return options
+@@ -63,7 +63,7 @@
+ opt = ParseOption()
+ path = os.path.abspath(opt.path_to_be_embedded)
+ # TODO(yukawa): Consider the case of non-ASCII characters.
+- escaped_path = path.encode('string-escape')
++ escaped_path = path.replace('\\', '\\\\')
+ with open(opt.output, 'w') as output_file:
+ output_file.write(
+ 'const char %s[] = "%s";\n' % (opt.constant_name, escaped_path))
+--- /src/build_tools/ensure_gyp_module_path.py
++++ /src/build_tools/ensure_gyp_module_path.py
+@@ -48,7 +48,7 @@
+
+ (options, _) = parser.parse_args()
+ if not options.expected:
+- print parser.print_help()
++ print(parser.print_help())
+ sys.exit(1)
+
+ return options
+@@ -59,20 +59,20 @@
+ opt = ParseOption()
+ expected_path = os.path.abspath(opt.expected)
+ if not os.path.exists(expected_path):
+- print '%s does not exist.' % expected_path
++ print('%s does not exist.' % expected_path)
+ sys.exit(1)
+
+ try:
+ import gyp # NOLINT
+ except ImportError as e:
+- print 'import gyp failed: %s' % e
++ print('import gyp failed: %s' % e)
+ sys.exit(1)
+
+ actual_path = os.path.abspath(gyp.__path__[0])
+ if expected_path != actual_path:
+- print 'Unexpected gyp module is loaded on this environment.'
+- print ' expected: %s' % expected_path
+- print ' actual : %s' % actual_path
++ print('Unexpected gyp module is loaded on this environment.')
++ print(' expected: %s' % expected_path)
++ print(' actual : %s' % actual_path)
+ sys.exit(1)
+
+ if __name__ == '__main__':
+--- /src/build_tools/gen_win32_resource_header.py
++++ /src/build_tools/gen_win32_resource_header.py
+@@ -39,7 +39,7 @@
+ __author__ = "yukawa"
+
+ import logging
+-import mozc_version
++from . import mozc_version
+ import optparse
+ import os
+ import sys
+--- /src/build_tools/mozc_version.py
++++ /src/build_tools/mozc_version.py
+@@ -94,7 +94,7 @@
+ last_digit = TARGET_PLATFORM_TO_DIGIT.get(target_platform, None)
+ if last_digit is None:
+ logging.critical('target_platform %s is invalid. Accetable ones are %s',
+- target_platform, TARGET_PLATFORM_TO_DIGIT.keys())
++ target_platform, list(TARGET_PLATFORM_TO_DIGIT.keys()))
+ sys.exit(1)
+
+ if not revision:
+@@ -314,13 +314,14 @@
+ self._properties = {}
+ if not os.path.isfile(path):
+ return
+- for line in open(path):
+- matchobj = re.match(r'(\w+)=(.*)', line.strip())
+- if matchobj:
+- var = matchobj.group(1)
+- val = matchobj.group(2)
+- if var not in self._properties:
+- self._properties[var] = val
++ with open(path) as file:
++ for line in file:
++ matchobj = re.match(r'(\w+)=(.*)', line.strip())
++ if matchobj:
++ var = matchobj.group(1)
++ val = matchobj.group(2)
++ if var not in self._properties:
++ self._properties[var] = val
+
+ # Check mandatory properties.
+ for key in VERSION_PROPERTIES:
diff --git a/app-i18n/mozc/files/mozc-2.23.2815.102-python-3_2.patch b/app-i18n/mozc/files/mozc-2.23.2815.102-python-3_2.patch
new file mode 100644
index 00000000000..456e8368049
--- /dev/null
+++ b/app-i18n/mozc/files/mozc-2.23.2815.102-python-3_2.patch
@@ -0,0 +1,600 @@
+https://github.com/google/mozc/issues/462
+
+--- /src/build_tools/redirect.py
++++ /src/build_tools/redirect.py
+@@ -58,14 +58,15 @@
+ process = subprocess.Popen(sys.argv, stdout=subprocess.PIPE,
+ universal_newlines=True)
+ except:
+- print '=========='
+- print ' ERROR: %s' % ' '.join(sys.argv)
+- print '=========='
++ print('==========')
++ print(' ERROR: %s' % ' '.join(sys.argv))
++ print('==========')
+ raise
+ (stdout_content, _) = process.communicate()
+ # Write the stdout content to the output file.
+ output_file = open(output_file_name, 'w')
+ output_file.write(stdout_content)
++ output_file.close()
+ return process.wait()
+
+ if __name__ == '__main__':
+--- /src/build_tools/run_after_chdir.py
++++ /src/build_tools/run_after_chdir.py
+@@ -57,7 +57,7 @@
+ sys.argv.insert(0, sys.executable) # Inject the python interpreter path.
+ # We don't capture stdout and stderr from Popen. The output will just
+ # be emitted to a terminal or console.
+- print sys.argv
++ print(sys.argv)
+ sys.exit(subprocess.call(sys.argv))
+
+ if __name__ == '__main__':
+--- /src/build_tools/serialized_string_array_builder.py
++++ /src/build_tools/serialized_string_array_builder.py
+@@ -58,11 +58,11 @@
+ f.write(struct.pack('<I', array_size))
+
+ # Offset and length array of (4 + 4) * array_size bytes.
+- for i in xrange(array_size):
++ for i in range(array_size):
+ f.write(struct.pack('<I', offsets[i]))
+ f.write(struct.pack('<I', lengths[i]))
+
+ # Strings chunk.
+- for i in xrange(array_size):
++ for i in range(array_size):
+ f.write(strings[i])
+- f.write('\0')
++ f.write(b'\0')
+--- /src/build_tools/test_tools/gtest_report.py
++++ /src/build_tools/test_tools/gtest_report.py
+@@ -36,9 +36,9 @@
+
+ __author__ = "nona"
+
+-import cStringIO as StringIO
++import io
+ import logging
+-from xml.etree import cElementTree as ElementTree
++from xml.etree import ElementTree
+
+
+ class Failure(object):
+@@ -87,13 +87,13 @@
+ """Returns summarized error report text."""
+ if self.fail_num == 0:
+ return ''
+- output = StringIO.StringIO()
++ output = io.StringIO()
+ for testcase in self.testcases:
+ if not testcase.failures:
+ continue
+- print >>output, '%s.%s:' % (self.name, testcase.name)
++ print('%s.%s:' % (self.name, testcase.name), file=output)
+ for failure in testcase.failures:
+- print >>output, failure.contents.encode('utf-8')
++ print(failure.contents.encode('utf-8'), file=output)
+ return output.getvalue()
+
+ @classmethod
+--- /src/build_tools/test_tools/test_launcher.py
++++ /src/build_tools/test_tools/test_launcher.py
+@@ -101,11 +101,11 @@
+ time.sleep(1)
+ try:
+ shutil.rmtree(self._path)
+- except OSError, e:
++ except OSError as e:
+ logging.error('Failed to remove %s. error: %s', self._path, e)
+
+
+-def _ExecuteTest((command, gtest_report_dir)):
++def _ExecuteTest(args):
+ """Executes tests with specified Test command.
+
+ Args:
+@@ -122,6 +122,7 @@
+ module, which is used in multiprocessing module.
+ (http://docs.python.org/library/pickle.html)
+ """
++ (command, gtest_report_dir) = args
+ binary = command[0]
+ binary_filename = os.path.basename(binary)
+ tmp_dir = tempfile.mkdtemp()
+--- /src/build_tools/tweak_data.py
++++ /src/build_tools/tweak_data.py
+@@ -55,7 +55,7 @@
+ The value for the variable if the variable is defined in the
+ environment. Otherwise original string is returned.
+ """
+- if environment.has_key(matchobj.group(1)):
++ if matchobj.group(1) in environment:
+ return environment[matchobj.group(1)]
+ return matchobj.group(0)
+
+--- /src/build_tools/tweak_info_plist.py
++++ /src/build_tools/tweak_info_plist.py
+@@ -42,8 +42,8 @@
+ import logging
+ import optparse
+ import sys
+-import mozc_version
+-import tweak_data
++from . import mozc_version
++from . import tweak_data
+
+ _COPYRIGHT_YEAR = datetime.date.today().year
+
+@@ -81,7 +81,7 @@
+
+ version = mozc_version.MozcVersion(options.version_file)
+
+- copyright_message = (u'© %d Google Inc.' % _COPYRIGHT_YEAR).encode('utf-8')
++ copyright_message = ('© %d Google Inc.' % _COPYRIGHT_YEAR).encode('utf-8')
+ long_version = version.GetVersionString()
+ short_version = version.GetVersionInFormat('@MAJOR@.@MINOR@.@BUILD@')
+
+--- /src/build_tools/tweak_info_plist_strings.py
++++ /src/build_tools/tweak_info_plist_strings.py
+@@ -40,7 +40,7 @@
+ import logging
+ import optparse
+ import sys
+-import tweak_data
++from . import tweak_data
+
+ _COPYRIGHT_YEAR = datetime.date.today().year
+
+@@ -77,7 +77,7 @@
+ if options.branding == 'GoogleJapaneseInput':
+ variables = {
+ 'CF_BUNDLE_NAME_EN': 'Google Japanese Input',
+- 'CF_BUNDLE_NAME_JA': u'Google 日本語入力'.encode('utf-8'),
++ 'CF_BUNDLE_NAME_JA': 'Google 日本語入力'.encode('utf-8'),
+ 'NS_HUMAN_READABLE_COPYRIGHT': copyright_message,
+ 'INPUT_MODE_ANNOTATION': 'Google',
+ }
+--- /src/build_tools/tweak_macinstaller_script.py
++++ /src/build_tools/tweak_macinstaller_script.py
+@@ -39,7 +39,7 @@
+ import logging
+ import optparse
+
+-import mozc_version
++from . import mozc_version
+
+
+ def _ReplaceVariables(data, environment):
+--- /src/build_tools/tweak_pkgproj.py
++++ /src/build_tools/tweak_pkgproj.py
+@@ -45,7 +45,7 @@
+ import os
+ import plistlib
+ import re
+-import mozc_version
++from . import mozc_version
+
+ from os import path
+
+@@ -71,7 +71,7 @@
+ The value for the variable if the variable is defined in the
+ environment. Otherwise original string is returned.
+ """
+- if environment.has_key(matchobj.group(1)):
++ if matchobj.group(1) in environment:
+ return environment[matchobj.group(1)]
+ return matchobj.group(0)
+
+--- /src/build_tools/util.py
++++ /src/build_tools/util.py
+@@ -73,11 +73,11 @@
+ return 1
+
+
+-class RunOrDieError(StandardError):
++class RunOrDieError(Exception):
+ """The exception class for RunOrDie."""
+
+ def __init__(self, message):
+- StandardError.__init__(self, message)
++ Exception.__init__(self, message)
+
+
+ def RunOrDie(argv):
+@@ -105,7 +105,7 @@
+ return # Do nothing if not exist.
+ if IsWindows():
+ # Read-only files cannot be deleted on Windows.
+- os.chmod(file_name, 0700)
++ os.chmod(file_name, 0o700)
+ logging.debug('Removing file: %s', file_name)
+ os.unlink(file_name)
+
+--- /src/build_tools/zlib_util.py
++++ /src/build_tools/zlib_util.py
+@@ -58,7 +58,7 @@
+
+ def main():
+ if len(sys.argv) != 4:
+- print >>sys.stderr, 'Invalid arguments'
++ print('Invalid arguments', file=sys.stderr)
+ return
+ if sys.argv[1] == 'compress':
+ Compress(sys.argv[2], sys.argv[3])
+@@ -66,7 +66,7 @@
+ if sys.argv[1] == 'decompress':
+ Decompress(sys.argv[2], sys.argv[3])
+ return
+- print >>sys.stderr, 'Unknown command:', sys.argv[1]
++ print('Unknown command:', sys.argv[1], file=sys.stderr)
+
+
+ if __name__ == '__main__':
+--- /src/composer/internal/gen_typing_model.py
++++ /src/composer/internal/gen_typing_model.py
+@@ -54,14 +54,13 @@
+ __author__ = "noriyukit"
+
+ import bisect
+-import codecs
+ import collections
+ import optparse
+ import struct
+
+ UNDEFINED_COST = -1
+-MAX_UINT16 = struct.unpack('H', '\xFF\xFF')[0]
+-MAX_UINT8 = struct.unpack('B', '\xFF')[0]
++MAX_UINT16 = struct.unpack('H', b'\xFF\xFF')[0]
++MAX_UINT8 = struct.unpack('B', b'\xFF')[0]
+
+
+ def ParseArgs():
+@@ -113,7 +112,7 @@
+ sorted_values = list(sorted(set(values)))
+ mapping_table = sorted_values[0]
+ mapping_table_size_without_special_value = mapping_table_size - 1
+- span = len(sorted_values) / (mapping_table_size_without_special_value - 1)
++ span = len(sorted_values) // (mapping_table_size_without_special_value - 1)
+ mapping_table = [sorted_values[i * span]
+ for i
+ in range(0, mapping_table_size_without_special_value - 1)]
+@@ -150,7 +149,7 @@
+
+ def GetValueTable(unique_characters, mapping_table, dictionary):
+ result = []
+- for key, value in dictionary.iteritems():
++ for key, value in dictionary.items():
+ index = GetIndexFromKey(unique_characters, key)
+ while len(result) <= index:
+ result.append(len(mapping_table) - 1)
+@@ -167,13 +166,13 @@
+ romaji_transition_cost)
+ with open(output_path, 'wb') as f:
+ f.write(struct.pack('<I', len(unique_characters)))
+- f.write(''.join(unique_characters))
++ f.write(''.join(unique_characters).encode('utf-8'))
+ offset = 4 + len(unique_characters)
+
+ # Add padding to place value list size at 4-byte boundary.
+ if offset % 4:
+ padding_size = 4 - offset % 4
+- f.write('\x00' * padding_size)
++ f.write(b'\x00' * padding_size)
+ offset += padding_size
+
+ f.write(struct.pack('<I', len(value_list)))
+@@ -184,7 +183,7 @@
+ # Add padding to place mapping_table at 4-byte boundary.
+ if offset % 4:
+ padding_size = 4 - offset % 4
+- f.write('\x00' * padding_size)
++ f.write(b'\x00' * padding_size)
+ offset += padding_size
+
+ for v in mapping_table:
+@@ -198,7 +197,8 @@
+ # - trigram['vw']['x'] = -500 * log(P(x | 'vw'))
+ unigram = {}
+ trigram = collections.defaultdict(dict)
+- for line in codecs.open(options.input_path, 'r', encoding='utf-8'):
++ input_file = open(options.input_path, 'r', encoding='utf-8')
++ for line in input_file:
+ line = line.rstrip()
+ ngram, cost = line.split('\t')
+ cost = int(cost)
+@@ -206,6 +206,7 @@
+ unigram[ngram] = cost
+ else:
+ trigram[ngram[:-1]][ngram[-1]] = cost
++ input_file.close()
+
+ # Calculate ngram-related cost for each 'vw' and 'x':
+ # -500 * log( P('x' | 'vw') / P('x') )
+--- /src/converter/gen_boundary_data.py
++++ /src/converter/gen_boundary_data.py
+@@ -70,7 +70,8 @@
+ def LoadPatterns(file):
+ prefix = []
+ suffix = []
+- for line in open(file, 'r'):
++ fh = open(file, 'r')
++ for line in fh:
+ if len(line) <= 1 or line[0] == '#':
+ continue
+ fields = line.split()
+@@ -84,8 +85,9 @@
+ elif label == 'SUFFIX':
+ suffix.append([re.compile(PatternToRegexp(feature)), cost])
+ else:
+- print 'format error %s' % (line)
++ print('format error %s' % (line))
+ sys.exit(0)
++ fh.close()
+ return (prefix, suffix)
+
+
+@@ -100,19 +102,23 @@
+
+ def LoadFeatures(filename):
+ features = []
+- for line in open(filename, 'r'):
++ fh = open(filename, 'r')
++ for line in fh:
+ fields = line.split()
+ features.append(fields[1])
++ fh.close()
+ return features
+
+
+ def CountSpecialPos(filename):
+ count = 0
+- for line in open(filename, 'r'):
++ fh = open(filename, 'r')
++ for line in fh:
+ line = line.rstrip()
+ if not line or line[0] == '#':
+ continue
+ count += 1
++ fh.close()
+ return count
+
+
+@@ -141,7 +147,7 @@
+ f.write(struct.pack('<H', GetCost(prefix, feature)))
+ f.write(struct.pack('<H', GetCost(suffix, feature)))
+
+- for _ in xrange(num_special_pos):
++ for _ in range(num_special_pos):
+ f.write(struct.pack('<H', 0))
+ f.write(struct.pack('<H', 0))
+
+--- /src/converter/gen_quality_regression_test_data.py
++++ /src/converter/gen_quality_regression_test_data.py
+@@ -84,7 +84,7 @@
+ else _ENABLED)
+ id = issue.attributes['id'].value
+ target = GetText(issue.getElementsByTagName('target'))
+- for detail in issue.getElementsByTagName(u'detail'):
++ for detail in issue.getElementsByTagName('detail'):
+ fields = []
+ fields.append('mozcsu_%s' % id)
+ for key in ('reading', 'output', 'actionStatus', 'rank', 'accuracy'):
+@@ -104,19 +104,19 @@
+
+ def GenerateHeader(files):
+ try:
+- print 'namespace mozc{'
+- print 'struct TestCase {'
+- print ' const bool enabled;'
+- print ' const char *tsv;'
+- print '} kTestData[] = {'
++ print('namespace mozc{')
++ print('struct TestCase {')
++ print(' const bool enabled;')
++ print(' const char *tsv;')
++ print('} kTestData[] = {')
+ for file in files:
+ for enabled, line in ParseFile(file):
+- print ' {%s, "%s"},' % (enabled, EscapeString(line))
+- print ' {false, nullptr},'
+- print '};'
+- print '} // namespace mozc'
++ print(' {%s, "%s"},' % (enabled, EscapeString(line)))
++ print(' {false, nullptr},')
++ print('};')
++ print('} // namespace mozc')
+ except:
+- print 'cannot open %s' % (file)
++ print('cannot open %s' % (file))
+ sys.exit(1)
+
+
+--- /src/converter/gen_segmenter_code.py
++++ /src/converter/gen_segmenter_code.py
+@@ -54,18 +54,22 @@
+ pos = {}
+ max_id = 0
+
+- for line in open(id_file, "r"):
++ fh = open(id_file, "r")
++ for line in fh:
+ fields = line.split()
+ pos[fields[1]] = fields[0]
+ max_id = max(int(fields[0]), max_id)
++ fh.close()
+
+ max_id = max_id + 1
+- for line in open(special_pos_file, "r"):
++ fh = open(special_pos_file, "r")
++ for line in fh:
+ if len(line) <= 1 or line[0] == '#':
+ continue
+ fields = line.split()
+ pos[fields[0]] = ("%d" % max_id)
+ max_id = max_id + 1
++ fh.close()
+
+ return pos
+
+@@ -79,8 +83,7 @@
+ pat = re.compile(PatternToRegexp(pattern))
+ min = -1;
+ max = -1;
+- keys = pos.keys()
+- keys.sort()
++ keys = sorted(pos.keys())
+
+ range = []
+
+@@ -107,7 +110,7 @@
+ tmp.append("(%s >= %s && %s <= %s)" % (name, r[0], name, r[1]))
+
+ if len(tmp) == 0:
+- print "FATAL: No rule fiind %s" % (pattern)
++ print("FATAL: No rule fiind %s" % (pattern))
+ sys.exit(-1)
+
+ return " || ".join(tmp)
+@@ -115,19 +118,21 @@
+ def main():
+ pos = ReadPOSID(sys.argv[1], sys.argv[2])
+
+- print HEADER % (len(pos.keys()), len(pos.keys()))
++ print(HEADER % (len(pos.keys()), len(pos.keys())))
+
+- for line in open(sys.argv[3], "r"):
++ fh = open(sys.argv[3], "r")
++ for line in fh:
+ if len(line) <= 1 or line[0] == '#':
+ continue
+ (l, r, result) = line.split()
+ result = result.lower()
+ lcond = GetRange(pos, l, "rid") or "true";
+ rcond = GetRange(pos, r, "lid") or "true";
+- print " // %s %s %s" % (l, r, result)
+- print " if ((%s) && (%s)) { return %s; }" % (lcond, rcond, result)
++ print(" // %s %s %s" % (l, r, result))
++ print(" if ((%s) && (%s)) { return %s; }" % (lcond, rcond, result))
++ fh.close()
+
+- print FOOTER
++ print(FOOTER)
+
+ if __name__ == "__main__":
+ main()
+--- /src/data_manager/gen_connection_data.py
++++ /src/data_manager/gen_connection_data.py
+@@ -32,8 +32,7 @@
+
+ __author__ = "hidehiko"
+
+-import cStringIO as StringIO
+-import itertools
++import io
+ import logging
+ import optparse
+ import os
+@@ -45,7 +44,7 @@
+ INVALID_COST = 30000
+ INVALID_1BYTE_COST = 255
+ RESOLUTION_FOR_1BYTE = 64
+-FILE_MAGIC = '\xAB\xCD'
++FILE_MAGIC = b'\xAB\xCD'
+
+ FALSE_VALUES = ['f', 'false', '0']
+ TRUE_VALUES = ['t', 'true', '1']
+@@ -79,28 +78,28 @@
+ # The result is a square matrix.
+ mat_size = pos_size + special_pos_size
+
+- matrix = [[0] * mat_size for _ in xrange(mat_size)]
++ matrix = [[0] * mat_size for _ in range(mat_size)]
+ with open(text_connection_file) as stream:
+ stream = code_generator_util.SkipLineComment(stream)
+ # The first line contains the matrix column/row size.
+- size = stream.next().rstrip()
++ size = next(stream).rstrip()
+ assert (int(size) == pos_size), '%s != %d' % (size, pos_size)
+
+ for array_index, cost in enumerate(stream):
+ cost = int(cost.rstrip())
+- rid = array_index / pos_size
++ rid = array_index // pos_size
+ lid = array_index % pos_size
+ if rid == 0 and lid == 0:
+ cost = 0
+ matrix[rid][lid] = cost
+
+ # Fill INVALID_COST in matrix elements for special POS.
+- for rid in xrange(pos_size, mat_size):
+- for lid in xrange(1, mat_size): # Skip EOS
++ for rid in range(pos_size, mat_size):
++ for lid in range(1, mat_size): # Skip EOS
+ matrix[rid][lid] = INVALID_COST
+
+- for lid in xrange(pos_size, mat_size):
+- for rid in xrange(1, mat_size): # Skip BOS
++ for lid in range(pos_size, mat_size):
++ for rid in range(1, mat_size): # Skip BOS
+ matrix[rid][lid] = INVALID_COST
+
+ return matrix
+@@ -116,7 +115,7 @@
+ # Heuristically, we do not compress INVALID_COST.
+ continue
+ m[cost] = m.get(cost, 0) + 1
+- mode_value = max(m.iteritems(), key=lambda (_, count): count)[0]
++ mode_value = max(m.items(), key=lambda x: x[1])[0]
+ result.append(mode_value)
+ return result
+
+@@ -126,8 +125,8 @@
+ # list, and fill None into the matrix if it equals to the corresponding
+ # mode value.
+ assert len(matrix) == len(mode_value_list)
+- for row, mode_value in itertools.izip(matrix, mode_value_list):
+- for index in xrange(len(row)):
++ for row, mode_value in zip(matrix, mode_value_list):
++ for index in range(len(row)):
+ if row[index] == mode_value:
+ row[index] = None
+
+@@ -179,7 +178,7 @@
+ resolution = RESOLUTION_FOR_1BYTE
+ else:
+ resolution = 1
+- stream = StringIO.StringIO()
++ stream = io.BytesIO()
+
+ # Output header.
+ stream.write(FILE_MAGIC)
+@@ -194,7 +193,7 @@
+
+ # 4 bytes alignment.
+ if len(mode_value_list) % 2:
+- stream.write('\x00\x00')
++ stream.write(b'\x00\x00')
+
+ # Process each row:
+ for row in matrix:
+@@ -218,7 +217,7 @@
+ if cost == INVALID_COST:
+ cost = INVALID_1BYTE_COST
+ else:
+- cost /= resolution
++ cost //= resolution
+ assert cost != INVALID_1BYTE_COST
+ values.append(cost)
+
+@@ -237,7 +236,7 @@
+ values_size = len(values) * 2
+
+ # Output the bits for a row.
+- stream.write(struct.pack('<HH', len(compact_bits) / 8, values_size))
++ stream.write(struct.pack('<HH', len(compact_bits) // 8, values_size))
+ OutputBitList(chunk_bits, stream)
+ OutputBitList(compact_bits, stream)
+ if use_1byte_cost:
diff --git a/app-i18n/mozc/files/mozc-2.23.2815.102-python-3_3.patch b/app-i18n/mozc/files/mozc-2.23.2815.102-python-3_3.patch
new file mode 100644
index 00000000000..a5c5a2dc803
--- /dev/null
+++ b/app-i18n/mozc/files/mozc-2.23.2815.102-python-3_3.patch
@@ -0,0 +1,583 @@
+https://github.com/google/mozc/issues/462
+
+--- /src/dictionary/gen_pos_map.py
++++ /src/dictionary/gen_pos_map.py
+@@ -39,7 +39,7 @@
+ from build_tools import code_generator_util
+
+
+-HEADER = """// Copyright 2009 Google Inc. All Rights Reserved.
++HEADER = b"""// Copyright 2009 Google Inc. All Rights Reserved.
+ // Author: keni
+
+ #ifndef MOZC_DICTIONARY_POS_MAP_H_
+@@ -48,13 +48,13 @@
+ // POS conversion rules
+ const POSMap kPOSMap[] = {
+ """
+-FOOTER = """};
++FOOTER = b"""};
+
+ #endif // MOZC_DICTIONARY_POS_MAP_H_
+ """
+
+ def ParseUserPos(user_pos_file):
+- with open(user_pos_file, 'r') as stream:
++ with open(user_pos_file, 'rb') as stream:
+ stream = code_generator_util.SkipLineComment(stream)
+ stream = code_generator_util.ParseColumnStream(stream, num_column=2)
+ return dict((key, enum_value) for key, enum_value in stream)
+@@ -64,7 +64,7 @@
+ user_pos_map = ParseUserPos(user_pos_file)
+
+ result = {}
+- with open(third_party_pos_map_file, 'r') as stream:
++ with open(third_party_pos_map_file, 'rb') as stream:
+ stream = code_generator_util.SkipLineComment(stream)
+ for columns in code_generator_util.ParseColumnStream(stream, num_column=2):
+ third_party_pos_name, mozc_pos = (columns + [None])[:2]
+@@ -78,7 +78,7 @@
+ result[third_party_pos_name] = mozc_pos
+
+ # Create mozc_pos to mozc_pos map.
+- for key, value in user_pos_map.iteritems():
++ for key, value in user_pos_map.items():
+ if key in result:
+ assert (result[key] == value)
+ continue
+@@ -94,10 +94,10 @@
+ if value is None:
+ # Invalid PosType.
+ value = (
+- 'static_cast< ::mozc::user_dictionary::UserDictionary::PosType>(-1)')
++ b'static_cast< ::mozc::user_dictionary::UserDictionary::PosType>(-1)')
+ else:
+- value = '::mozc::user_dictionary::UserDictionary::' + value
+- output.write(' { %s, %s },\n' % (key, value))
++ value = b'::mozc::user_dictionary::UserDictionary::' + value
++ output.write(b' { %s, %s },\n' % (key, value))
+ output.write(FOOTER)
+
+
+@@ -121,7 +121,7 @@
+ pos_map = GeneratePosMap(options.third_party_pos_map_file,
+ options.user_pos_file)
+
+- with open(options.output, 'w') as stream:
++ with open(options.output, 'wb') as stream:
+ OutputPosMap(pos_map, stream)
+
+
+--- /src/dictionary/gen_pos_rewrite_rule.py
++++ /src/dictionary/gen_pos_rewrite_rule.py
+@@ -46,29 +46,34 @@
+
+
+ def LoadRewriteMapRule(filename):
+- fh = open(filename)
++ fh = open(filename, 'rb')
+ rule = []
+ for line in fh:
+- line = line.rstrip('\n')
+- if not line or line.startswith('#'):
++ line = line.rstrip(b'\n')
++ if not line or line.startswith(b'#'):
+ continue
+ fields = line.split()
+ rule.append([fields[0], fields[1]])
++ fh.close()
+ return rule
+
+
+ def ReadPOSID(id_file, special_pos_file):
+ pos_list = []
+
+- for line in open(id_file, 'r'):
++ fh = open(id_file, 'rb')
++ for line in fh:
+ fields = line.split()
+ pos_list.append(fields[1])
++ fh.close()
+
+- for line in open(special_pos_file, 'r'):
+- if len(line) <= 1 or line[0] == '#':
++ fh = open(special_pos_file, 'rb')
++ for line in fh:
++ if len(line) <= 1 or line[0:1] == b'#':
+ continue
+ fields = line.split()
+ pos_list.append(fields[0])
++ fh.close()
+
+ return pos_list
+
+@@ -112,7 +117,7 @@
+ ids.append(id)
+
+ with open(opts.output, 'wb') as f:
+- f.write(''.join(chr(id) for id in ids))
++ f.write(''.join(chr(id) for id in ids).encode('utf-8'))
+
+
+ if __name__ == '__main__':
+--- /src/dictionary/gen_suffix_data.py
++++ /src/dictionary/gen_suffix_data.py
+@@ -52,10 +52,10 @@
+ opts = _ParseOptions()
+
+ result = []
+- with open(opts.input, 'r') as stream:
++ with open(opts.input, 'rb') as stream:
+ for line in stream:
+- line = line.rstrip('\r\n')
+- fields = line.split('\t')
++ line = line.rstrip(b'\r\n')
++ fields = line.split(b'\t')
+ key = fields[0]
+ lid = int(fields[1])
+ rid = int(fields[2])
+@@ -63,7 +63,7 @@
+ value = fields[4]
+
+ if key == value:
+- value = ''
++ value = b''
+
+ result.append((key, value, lid, rid, cost))
+
+--- /src/dictionary/gen_user_pos_data.py
++++ /src/dictionary/gen_user_pos_data.py
+@@ -64,7 +64,7 @@
+ f.write(struct.pack('<H', conjugation_id))
+
+ serialized_string_array_builder.SerializeToFile(
+- sorted(string_index.iterkeys()), output_string_array)
++ sorted(x.encode('utf-8') for x in string_index.keys()), output_string_array)
+
+
+ def ParseOptions():
+@@ -100,7 +100,7 @@
+
+ if options.output_pos_list:
+ serialized_string_array_builder.SerializeToFile(
+- [pos for (pos, _) in user_pos.data], options.output_pos_list)
++ [pos.encode('utf-8') for (pos, _) in user_pos.data], options.output_pos_list)
+
+
+ if __name__ == '__main__':
+--- /src/dictionary/gen_zip_code_seed.py
++++ /src/dictionary/gen_zip_code_seed.py
+@@ -83,7 +83,7 @@
+ address = unicodedata.normalize('NFKC', self.address)
+ line = '\t'.join([zip_code, '0', '0', str(ZIP_CODE_COST),
+ address, ZIP_CODE_LABEL])
+- print line.encode('utf-8')
++ print(line.encode('utf-8'))
+
+
+ def ProcessZipCodeCSV(file_name):
+@@ -105,26 +105,26 @@
+
+ def ReadZipCodeEntries(zip_code, level1, level2, level3):
+ """Read zip code entries."""
+- return [ZipEntry(zip_code, u''.join([level1, level2, town]))
++ return [ZipEntry(zip_code, ''.join([level1, level2, town]))
+ for town in ParseTownName(level3)]
+
+
+ def ReadJigyosyoEntry(zip_code, level1, level2, level3, name):
+ """Read jigyosyo entry."""
+ return ZipEntry(zip_code,
+- u''.join([level1, level2, level3, u' ', name]))
++ ''.join([level1, level2, level3, ' ', name]))
+
+
+ def ParseTownName(level3):
+ """Parse town name."""
+- if level3.find(u'以下に掲載がない場合') != -1:
++ if level3.find('以下に掲載がない場合') != -1:
+ return ['']
+
+ assert CanParseAddress(level3), ('failed to be merged %s'
+ % level3.encode('utf-8'))
+
+ # We ignore additional information here.
+- level3 = re.sub(u'(.*)', u'', level3, re.U)
++ level3 = re.sub('(.*)', '', level3, re.U)
+
+ # For 地割, we have these cases.
+ # XX1地割
+@@ -134,7 +134,7 @@
+ # XX第1地割、XX第2地割、
+ # XX第1地割〜XX第2地割、
+ # We simply use XX for them.
+- chiwari_match = re.match(u'(\D*?)第?\d+地割.*', level3, re.U)
++ chiwari_match = re.match('(\D*?)第?\d+地割.*', level3, re.U)
+ if chiwari_match:
+ town = chiwari_match.group(1)
+ return [town]
+@@ -144,21 +144,21 @@
+ # -> XX町YY and (XX町)ZZ
+ # YY、ZZ
+ # -> YY and ZZ
+- chou_match = re.match(u'(.*町)?(.*)', level3, re.U)
++ chou_match = re.match('(.*町)?(.*)', level3, re.U)
+ if chou_match:
+- chou = u''
++ chou = ''
+ if chou_match.group(1):
+ chou = chou_match.group(1)
+ rests = chou_match.group(2)
+- return [chou + rest for rest in rests.split(u'、')]
++ return [chou + rest for rest in rests.split('、')]
+
+ return [level3]
+
+
+ def CanParseAddress(address):
+ """Return true for valid address."""
+- return (address.find(u'(') == -1 or
+- address.find(u')') != -1)
++ return (address.find('(') == -1 or
++ address.find(')') != -1)
+
+
+ def ParseOptions():
+--- /src/dictionary/zip_code_util.py
++++ /src/dictionary/zip_code_util.py
+@@ -86,11 +86,11 @@
+
+
+ _SPECIAL_CASES = [
+- SpecialMergeZip(u'5900111', u'大阪府', u'堺市中区', [u'三原台']),
+- SpecialMergeZip(u'8710046', u'大分県', u'中津市',
+- [u'金谷', u'西堀端', u'東堀端', u'古金谷']),
+- SpecialMergeZip(u'9218046', u'石川県', u'金沢市',
+- [u'大桑町', u'三小牛町']),
++ SpecialMergeZip('5900111', '大阪府', '堺市中区', ['三原台']),
++ SpecialMergeZip('8710046', '大分県', '中津市',
++ ['金谷', '西堀端', '東堀端', '古金谷']),
++ SpecialMergeZip('9218046', '石川県', '金沢市',
++ ['大桑町', '三小牛町']),
+ ]
+
+
+--- /src/gui/character_pad/data/gen_cp932_map.py
++++ /src/gui/character_pad/data/gen_cp932_map.py
+@@ -32,7 +32,6 @@
+
+ import re
+ import sys
+-import string
+
+ kUnicodePat = re.compile(r'0x[0-9A-Fa-f]{2,4}')
+ def IsValidUnicode(n):
+@@ -42,28 +41,29 @@
+ fh = open(sys.argv[1])
+ result = {}
+ for line in fh.readlines():
+- if line[0] is '#':
++ if line[0] == '#':
+ continue
+- array = string.split(line)
++ array = line.split()
+ sjis = array[0]
+ ucs2 = array[1]
+ if eval(sjis) < 32 or not IsValidUnicode(ucs2):
+ continue
+ result.setdefault(ucs2, sjis)
++ fh.close()
+
+ keys = sorted(result.keys())
+
+- print "struct CP932MapData {"
+- print " unsigned int ucs4;"
+- print " unsigned short int sjis;"
+- print "};"
+- print ""
+- print "static const size_t kCP932MapDataSize = %d;" % (len(keys))
+- print "static const CP932MapData kCP932MapData[] = {"
++ print("struct CP932MapData {")
++ print(" unsigned int ucs4;")
++ print(" unsigned short int sjis;")
++ print("};")
++ print("")
++ print("static const size_t kCP932MapDataSize = %d;" % (len(keys)))
++ print("static const CP932MapData kCP932MapData[] = {")
+ for n in keys:
+- print " { %s, %s }," % (n ,result[n])
+- print " { 0, 0 }";
+- print "};"
++ print(" { %s, %s }," % (n ,result[n]))
++ print(" { 0, 0 }");
++ print("};")
+
+ if __name__ == "__main__":
+ main()
+--- /src/gui/character_pad/data/gen_local_character_map.py
++++ /src/gui/character_pad/data/gen_local_character_map.py
+@@ -30,7 +30,6 @@
+
+ __author__ = "taku"
+
+-import string
+ import re
+ import sys
+
+@@ -43,9 +42,9 @@
+ fh = open(filename)
+ result = []
+ for line in fh.readlines():
+- if line[0] is '#':
++ if line[0] == '#':
+ continue
+- array = string.split(line)
++ array = line.split()
+ jis = array[0].replace('0x', '')
+ ucs2 = array[1].replace('0x', '')
+ if len(jis) == 2:
+@@ -53,6 +52,7 @@
+
+ if IsValidUnicode(ucs2):
+ result.append([jis, ucs2])
++ fh.close()
+
+ return ["JISX0201", result]
+
+@@ -60,13 +60,14 @@
+ fh = open(filename)
+ result = []
+ for line in fh.readlines():
+- if line[0] is '#':
++ if line[0] == '#':
+ continue
+ array = line.split()
+ jis = array[1].replace('0x', '')
+ ucs2 = array[2].replace('0x', '')
+ if IsValidUnicode(ucs2):
+ result.append([jis, ucs2])
++ fh.close()
+
+ return ["JISX0208", result]
+
+@@ -74,13 +75,14 @@
+ fh = open(filename)
+ result = []
+ for line in fh.readlines():
+- if line[0] is '#':
++ if line[0] == '#':
+ continue
+ array = line.split()
+ jis = array[0].replace('0x', '')
+ ucs2 = array[1].replace('0x', '')
+ if IsValidUnicode(ucs2):
+ result.append([jis, ucs2])
++ fh.close()
+
+ return ["JISX0212", result]
+
+@@ -88,7 +90,7 @@
+ fh = open(filename)
+ result = []
+ for line in fh.readlines():
+- if line[0] is '#':
++ if line[0] == '#':
+ continue
+ array = line.split()
+ sjis = array[0].replace('0x', '')
+@@ -100,19 +102,20 @@
+
+ if IsValidUnicode(ucs2):
+ result.append([sjis, ucs2])
++ fh.close()
+
+ return ["CP932", result]
+
+ def Output(arg):
+ name = arg[0]
+ result = arg[1]
+- print "static const size_t k%sMapSize = %d;" % (name, len(result))
+- print "static const mozc::gui::CharacterPalette::LocalCharacterMap k%sMap[] = {" % (name)
++ print("static const size_t k%sMapSize = %d;" % (name, len(result)))
++ print("static const mozc::gui::CharacterPalette::LocalCharacterMap k%sMap[] = {" % (name))
+ for n in result:
+- print " { 0x%s, 0x%s }," % (n[0] ,n[1])
+- print " { 0, 0 }";
+- print "};"
+- print ""
++ print(" { 0x%s, 0x%s }," % (n[0] ,n[1]))
++ print(" { 0, 0 }");
++ print("};")
++ print("")
+
+ if __name__ == "__main__":
+ Output(LoadJISX0201(sys.argv[1]))
+--- /src/gui/character_pad/data/gen_unicode_blocks.py
++++ /src/gui/character_pad/data/gen_unicode_blocks.py
+@@ -33,13 +33,13 @@
+ import sys
+ import re
+
+-re = re.compile('^(.....?)\.\.(.....?); (.+)')
++re = re.compile(r'^(.....?)\.\.(.....?); (.+)')
+
+ def main():
+- print "static const mozc::gui::CharacterPalette::UnicodeBlock kUnicodeBlockTable[] = {"
++ print("static const mozc::gui::CharacterPalette::UnicodeBlock kUnicodeBlockTable[] = {")
+ fh = open(sys.argv[1])
+ for line in fh.readlines():
+- if line[0] is '#':
++ if line[0] == '#':
+ continue
+ m = re.match(line)
+ if m is not None:
+@@ -47,11 +47,12 @@
+ end = int(m.group(2), 16)
+ name = m.group(3)
+ if start <= 0x2FFFF and end <= 0x2FFFF:
+- print " { \"%s\", { %d, %d } }," % (name, start, end)
++ print(" { \"%s\", { %d, %d } }," % (name, start, end))
++ fh.close()
+
+- print " { NULL, { 0, 0 } }"
+- print "};"
+- print ""
++ print(" { NULL, { 0, 0 } }")
++ print("};")
++ print("")
+
+ if __name__ == "__main__":
+ main()
+--- /src/gui/character_pad/data/gen_unicode_data.py
++++ /src/gui/character_pad/data/gen_unicode_data.py
+@@ -46,18 +46,19 @@
+ code = int(code, 16)
+ if code < 0x2FFFF:
+ results.append(" { %d, \"%s\" }," % (code, desc))
++ fh.close()
+
+- print "struct UnicodeData {";
+- print " char32 ucs4;";
+- print " const char *description;";
+- print "};";
+- print ""
+- print "static const size_t kUnicodeDataSize = %d;" % (len(results))
+- print "static const UnicodeData kUnicodeData[] = {";
++ print("struct UnicodeData {");
++ print(" char32 ucs4;");
++ print(" const char *description;");
++ print("};");
++ print("")
++ print("static const size_t kUnicodeDataSize = %d;" % (len(results)))
++ print("static const UnicodeData kUnicodeData[] = {");
+ for line in results:
+- print line;
+- print " { 0, NULL }";
+- print "};";
++ print(line);
++ print(" { 0, NULL }");
++ print("};");
+
+ if __name__ == "__main__":
+ main()
+--- /src/gui/character_pad/data/gen_unihan_data.py
++++ /src/gui/character_pad/data/gen_unihan_data.py
+@@ -31,35 +31,34 @@
+ __author__ = "taku"
+
+ import re
+-import string
+ import sys
+ rs = {}
+
+ def Escape(n):
+- if n is not "NULL":
++ if n != "NULL":
+ return "\"%s\"" % (n)
+ else:
+ return "NULL"
+
+ def GetCode(n):
+- if n is not "NULL":
+- n = string.replace(n, '0-', 'JIS X 0208: 0x')
+- n = string.replace(n, '1-', 'JIS X 0212: 0x')
+- n = string.replace(n, '3-', 'JIS X 0213: 0x')
+- n = string.replace(n, '4-', 'JIS X 0213: 0x')
+- n = string.replace(n, 'A-', 'Vendors Ideographs: 0x')
+- n = string.replace(n, '3A', 'JIS X 0213 2000: 0x')
++ if n != "NULL":
++ n = n.replace('0-', 'JIS X 0208: 0x')
++ n = n.replace('1-', 'JIS X 0212: 0x')
++ n = n.replace('3-', 'JIS X 0213: 0x')
++ n = n.replace('4-', 'JIS X 0213: 0x')
++ n = n.replace('A-', 'Vendors Ideographs: 0x')
++ n = n.replace('3A', 'JIS X 0213 2000: 0x')
+ return "\"%s\"" % n
+ else:
+ return "NULL"
+
+ def GetRadical(n):
+ pat = re.compile(r'^(\d+)\.')
+- if n is not "NULL":
++ if n != "NULL":
+ m = pat.match(n)
+ if m:
+ result = rs[m.group(1)]
+- return "\"%s\"" % (result.encode('string_escape'))
++ return "\"%s\"" % result
+ else:
+ return "NULL"
+ else:
+@@ -73,6 +72,7 @@
+ id = array[1]
+ radical = array[2]
+ rs[id] = radical
++ fh.close()
+
+ dic = {}
+ pat = re.compile(r'^U\+(\S+)\s+(kTotalStrokes|kJapaneseKun|kJapaneseOn|kRSUnicode|kIRG_JSource)\t(.+)')
+@@ -86,23 +86,24 @@
+ n = int(m.group(1), 16)
+ if n <= 65536:
+ dic.setdefault(key, {}).setdefault(field, value)
++ fh.close()
+
+ keys = sorted(dic.keys())
+
+- print "struct UnihanData {";
+- print " unsigned int ucs4;";
++ print("struct UnihanData {");
++ print(" unsigned int ucs4;");
+ # Since the total strokes defined in Unihan data is Chinese-based
+ # number, we can't use it.
+ # print " unsigned char total_strokes;";
+- print " const char *japanese_kun;";
+- print " const char *japanese_on;";
++ print(" const char *japanese_kun;");
++ print(" const char *japanese_on;");
+ # Since the radical information defined in Unihan data is Chinese-based
+ # number, we can't use it.
+ # print " const char *radical;";
+- print " const char *IRG_jsource;";
+- print "};"
+- print "static const size_t kUnihanDataSize = %d;" % (len(keys))
+- print "static const UnihanData kUnihanData[] = {"
++ print(" const char *IRG_jsource;");
++ print("};")
++ print("static const size_t kUnihanDataSize = %d;" % (len(keys)))
++ print("static const UnihanData kUnihanData[] = {")
+
+ for key in keys:
+ total_strokes = dic[key].get("kTotalStrokes", "0")
+@@ -111,9 +112,9 @@
+ rad = GetRadical(dic[key].get("kRSUnicode", "NULL"))
+ code = GetCode(dic[key].get("kIRG_JSource", "NULL"))
+ # print " { 0x%s, %s, %s, %s, %s, %s }," % (key, total_strokes, kun, on, rad, code)
+- print " { 0x%s, %s, %s, %s }," % (key, kun, on, code)
++ print(" { 0x%s, %s, %s, %s }," % (key, kun, on, code))
+
+- print "};"
++ print("};")
+
+ if __name__ == "__main__":
+ main()
diff --git a/app-i18n/mozc/files/mozc-2.23.2815.102-python-3_4.patch b/app-i18n/mozc/files/mozc-2.23.2815.102-python-3_4.patch
new file mode 100644
index 00000000000..41d2bf9eeb9
--- /dev/null
+++ b/app-i18n/mozc/files/mozc-2.23.2815.102-python-3_4.patch
@@ -0,0 +1,537 @@
+https://github.com/google/mozc/issues/462
+
+--- /src/prediction/gen_zero_query_data.py
++++ /src/prediction/gen_zero_query_data.py
+@@ -59,20 +59,20 @@
+ Returns:
+ A integer indicating parsed pua.
+ """
+- if not s or s[0] == '>':
++ if not s or s[0:1] == b'>':
+ return 0
+ return int(s, 16)
+
+
+ def NormalizeString(string):
+ return unicodedata.normalize(
+- 'NFKC', string.decode('utf-8')).encode('utf-8').replace('~', '〜')
++ 'NFKC', string.decode('utf-8')).replace('~', '〜').encode('utf-8')
+
+
+ def RemoveTrailingNumber(string):
+ if not string:
+- return ''
+- return re.sub(r'^([^0-9]+)[0-9]+$', r'\1', string)
++ return b''
++ return re.sub(br'^([^0-9]+)[0-9]+$', r'\1', string)
+
+
+ def GetReadingsFromDescription(description):
+@@ -84,19 +84,19 @@
+ # - ビル・建物
+ # \xE3\x83\xBB : "・"
+ return [RemoveTrailingNumber(token) for token
+- in re.split(r'(?:\(|\)|/|\xE3\x83\xBB)+', normalized)]
++ in re.split(br'(?:\(|\)|/|\xE3\x83\xBB)+', normalized)]
+
+
+ def ReadEmojiTsv(stream):
+ """Reads emoji data from stream and returns zero query data."""
+ zero_query_dict = defaultdict(list)
+ stream = code_generator_util.SkipLineComment(stream)
+- for columns in code_generator_util.ParseColumnStream(stream, delimiter='\t'):
++ for columns in code_generator_util.ParseColumnStream(stream, delimiter=b'\t'):
+ if len(columns) != 13:
+- logging.critical('format error: %s', '\t'.join(columns))
++ logging.critical('format error: %s', b'\t'.join(columns))
+ sys.exit(1)
+
+- code_points = columns[0].split(' ')
++ code_points = columns[0].split(b' ')
+
+ # Emoji code point.
+ emoji = columns[1]
+@@ -114,12 +114,12 @@
+ # - Composite emoji which has multiple code point.
+ # NOTE: Some Unicode 6.0 emoji don't have PUA, and it is also omitted.
+ # TODO(hsumita): Check the availability of such emoji and enable it.
+- logging.info('Skip %s', ' '.join(code_points))
++ logging.info('Skip %s', b' '.join(code_points))
+ continue
+
+ reading_list = []
+ # \xe3\x80\x80 is a full-width space
+- for reading in re.split(r'(?: |\xe3\x80\x80)+', NormalizeString(readings)):
++ for reading in re.split(br'(?: |\xe3\x80\x80)+', NormalizeString(readings)):
+ if not reading:
+ continue
+ reading_list.append(reading)
+@@ -158,15 +158,15 @@
+ zero_query_dict = defaultdict(list)
+
+ for line in input_stream:
+- if line.startswith('#'):
++ if line.startswith(b'#'):
+ continue
+- line = line.rstrip('\r\n')
++ line = line.rstrip(b'\r\n')
+ if not line:
+ continue
+
+- tokens = line.split('\t')
++ tokens = line.split(b'\t')
+ key = tokens[0]
+- values = tokens[1].split(',')
++ values = tokens[1].split(b',')
+
+ for value in values:
+ zero_query_dict[key].append(
+@@ -179,16 +179,16 @@
+ """Reads emoticon data from stream and returns zero query data."""
+ zero_query_dict = defaultdict(list)
+ stream = code_generator_util.SkipLineComment(stream)
+- for columns in code_generator_util.ParseColumnStream(stream, delimiter='\t'):
++ for columns in code_generator_util.ParseColumnStream(stream, delimiter=b'\t'):
+ if len(columns) != 3:
+- logging.critical('format error: %s', '\t'.join(columns))
++ logging.critical('format error: %s', b'\t'.join(columns))
+ sys.exit(1)
+
+ emoticon = columns[0]
+ readings = columns[2]
+
+ # \xe3\x80\x80 is a full-width space
+- for reading in re.split(r'(?: |\xe3\x80\x80)+', readings.strip()):
++ for reading in re.split(br'(?: |\xe3\x80\x80)+', readings.strip()):
+ if not reading:
+ continue
+ zero_query_dict[reading].append(
+@@ -202,9 +202,9 @@
+ """Reads emoji data from stream and returns zero query data."""
+ zero_query_dict = defaultdict(list)
+ stream = code_generator_util.SkipLineComment(stream)
+- for columns in code_generator_util.ParseColumnStream(stream, delimiter='\t'):
++ for columns in code_generator_util.ParseColumnStream(stream, delimiter=b'\t'):
+ if len(columns) < 3:
+- logging.warning('format error: %s', '\t'.join(columns))
++ logging.warning('format error: %s', b'\t'.join(columns))
+ continue
+
+ symbol = columns[1]
+@@ -222,7 +222,7 @@
+ continue
+
+ # \xe3\x80\x80 is a full-width space
+- for reading in re.split(r'(?: |\xe3\x80\x80)+', readings.strip()):
++ for reading in re.split(br'(?: |\xe3\x80\x80)+', readings.strip()):
+ if not reading:
+ continue
+ zero_query_dict[reading].append(
+@@ -247,7 +247,7 @@
+
+ def IsValidKeyForZeroQuery(key):
+ """Returns if the key is valid for zero query trigger."""
+- is_ascii = all(ord(char) < 128 for char in key)
++ is_ascii = all(char < 128 for char in key)
+ return not is_ascii
+
+
+@@ -301,13 +301,13 @@
+
+ def main():
+ options = ParseOptions()
+- with open(options.input_rule, 'r') as input_stream:
++ with open(options.input_rule, 'rb') as input_stream:
+ zero_query_rule_dict = ReadZeroQueryRuleData(input_stream)
+- with open(options.input_symbol, 'r') as input_stream:
++ with open(options.input_symbol, 'rb') as input_stream:
+ zero_query_symbol_dict = ReadSymbolTsv(input_stream)
+- with open(options.input_emoji, 'r') as input_stream:
++ with open(options.input_emoji, 'rb') as input_stream:
+ zero_query_emoji_dict = ReadEmojiTsv(input_stream)
+- with open(options.input_emoticon, 'r') as input_stream:
++ with open(options.input_emoticon, 'rb') as input_stream:
+ zero_query_emoticon_dict = ReadEmoticonTsv(input_stream)
+
+ merged_zero_query_dict = MergeZeroQueryData(
+--- /src/prediction/gen_zero_query_number_data.py
++++ /src/prediction/gen_zero_query_number_data.py
+@@ -41,15 +41,15 @@
+ zero_query_dict = defaultdict(list)
+
+ for line in input_stream:
+- if line.startswith('#'):
++ if line.startswith(b'#'):
+ continue
+- line = line.rstrip('\r\n')
++ line = line.rstrip(b'\r\n')
+ if not line:
+ continue
+
+- tokens = line.split('\t')
++ tokens = line.split(b'\t')
+ key = tokens[0]
+- values = tokens[1].split(',')
++ values = tokens[1].split(b',')
+
+ for value in values:
+ zero_query_dict[key].append(
+@@ -71,7 +71,7 @@
+
+ def main():
+ options = ParseOption()
+- with open(options.input, 'r') as input_stream:
++ with open(options.input, 'rb') as input_stream:
+ zero_query_dict = ReadZeroQueryNumberData(input_stream)
+ util.WriteZeroQueryData(zero_query_dict,
+ options.output_token_array,
+--- /src/prediction/gen_zero_query_util.py
++++ /src/prediction/gen_zero_query_util.py
+@@ -69,7 +69,7 @@
+ output_string_array):
+ # Collect all the strings and assing index in ascending order
+ string_index = {}
+- for key, entry_list in zero_query_dict.iteritems():
++ for key, entry_list in zero_query_dict.items():
+ string_index[key] = 0
+ for entry in entry_list:
+ string_index[entry.value] = 0
+--- /src/rewriter/gen_counter_suffix_array.py
++++ /src/rewriter/gen_counter_suffix_array.py
+@@ -43,7 +43,7 @@
+ with codecs.open(id_file, 'r', encoding='utf-8') as stream:
+ stream = code_generator_util.ParseColumnStream(stream, num_column=2)
+ for pos_id, pos_name in stream:
+- if pos_name.startswith(u'名詞,接尾,助数詞'):
++ if pos_name.startswith('名詞,接尾,助数詞'):
+ pos_ids.add(pos_id)
+ return pos_ids
+
+--- /src/rewriter/gen_emoji_rewriter_data.py
++++ /src/rewriter/gen_emoji_rewriter_data.py
+@@ -74,19 +74,19 @@
+ the glyph (in other words, it has alternative (primary) code point, which
+ doesn't lead '>' and that's why we'll ignore it).
+ """
+- if not s or s[0] == '>':
++ if not s or s[0:1] == b'>':
+ return None
+ return int(s, 16)
+
+
+-_FULLWIDTH_RE = re.compile(ur'[!-~]') # U+FF01 - U+FF5E
++_FULLWIDTH_RE = re.compile(r'[!-~]') # U+FF01 - U+FF5E
+
+
+ def NormalizeString(string):
+ """Normalize full width ascii characters to half width characters."""
+- offset = ord(u'A') - ord(u'A')
+- return _FULLWIDTH_RE.sub(lambda x: unichr(ord(x.group(0)) - offset),
+- unicode(string, 'utf-8')).encode('utf-8')
++ offset = ord('A') - ord('A')
++ return _FULLWIDTH_RE.sub(lambda x: chr(ord(x.group(0)) - offset),
++ string.decode('utf-8')).encode('utf-8')
+
+
+ def ReadEmojiTsv(stream):
+@@ -96,14 +96,14 @@
+ token_dict = defaultdict(list)
+
+ stream = code_generator_util.SkipLineComment(stream)
+- for columns in code_generator_util.ParseColumnStream(stream, delimiter='\t'):
++ for columns in code_generator_util.ParseColumnStream(stream, delimiter=b'\t'):
+ if len(columns) != 13:
+- logging.critical('format error: %s', '\t'.join(columns))
++ logging.critical('format error: %s', b'\t'.join(columns))
+ sys.exit(1)
+
+- code_points = columns[0].split(' ')
++ code_points = columns[0].split(b' ')
+ # Emoji code point.
+- emoji = columns[1] if columns[1] else ''
++ emoji = columns[1] if columns[1] else b''
+ android_pua = ParseCodePoint(columns[2])
+ docomo_pua = ParseCodePoint(columns[3])
+ softbank_pua = ParseCodePoint(columns[4])
+@@ -112,10 +112,10 @@
+ readings = columns[6]
+
+ # [7]: Name defined in Unicode. It is ignored in current implementation.
+- utf8_description = columns[8] if columns[8] else ''
+- docomo_description = columns[9] if columns[9] else ''
+- softbank_description = columns[10] if columns[10] else ''
+- kddi_description = columns[11] if columns[11] else ''
++ utf8_description = columns[8] if columns[8] else b''
++ docomo_description = columns[9] if columns[9] else b''
++ softbank_description = columns[10] if columns[10] else b''
++ kddi_description = columns[11] if columns[11] else b''
+
+ if not android_pua or len(code_points) > 1:
+ # Skip some emoji, which is not supported on old devices.
+@@ -123,7 +123,7 @@
+ # - Composite emoji which has multiple code point.
+ # NOTE: Some Unicode 6.0 emoji don't have PUA, and it is also omitted.
+ # TODO(hsumita): Check the availability of such emoji and enable it.
+- logging.info('Skip %s', ' '.join(code_points))
++ logging.info('Skip %s', b' '.join(code_points))
+ continue
+
+ # Check consistency between carrier PUA codes and descriptions for Android
+@@ -132,7 +132,7 @@
+ (bool(softbank_pua) != bool(softbank_description)) or
+ (bool(kddi_pua) != bool(kddi_description))):
+ logging.warning('carrier PUA and description conflict: %s',
+- '\t'.join(columns))
++ b'\t'.join(columns))
+ continue
+
+ # Check if the character is usable on Android.
+@@ -140,7 +140,7 @@
+ android_pua = 0 # Replace None with 0.
+
+ if not emoji and not android_pua:
+- logging.info('Skip: %s', '\t'.join(columns))
++ logging.info('Skip: %s', b'\t'.join(columns))
+ continue
+
+ index = len(emoji_data_list)
+@@ -149,7 +149,7 @@
+ kddi_description))
+
+ # \xe3\x80\x80 is a full-width space
+- for reading in re.split(r'(?: |\xe3\x80\x80)+', readings.strip()):
++ for reading in re.split(br'(?: |\xe3\x80\x80)+', readings.strip()):
+ if reading:
+ token_dict[NormalizeString(reading)].append(index)
+
+@@ -159,7 +159,7 @@
+ def OutputData(emoji_data_list, token_dict,
+ token_array_file, string_array_file):
+ """Output token and string arrays to files."""
+- sorted_token_dict = sorted(token_dict.iteritems())
++ sorted_token_dict = sorted(token_dict.items())
+
+ strings = {}
+ for reading, _ in sorted_token_dict:
+@@ -171,7 +171,7 @@
+ strings[docomo_description] = 0
+ strings[softbank_description] = 0
+ strings[kddi_description] = 0
+- sorted_strings = sorted(strings.iterkeys())
++ sorted_strings = sorted(strings.keys())
+ for index, s in enumerate(sorted_strings):
+ strings[s] = index
+
+@@ -205,7 +205,7 @@
+
+ def main():
+ options = ParseOptions()
+- with open(options.input, 'r') as input_stream:
++ with open(options.input, 'rb') as input_stream:
+ (emoji_data_list, token_dict) = ReadEmojiTsv(input_stream)
+
+ OutputData(emoji_data_list, token_dict,
+--- /src/rewriter/gen_reading_correction_data.py
++++ /src/rewriter/gen_reading_correction_data.py
+@@ -63,7 +63,7 @@
+ def WriteData(input_path, output_value_array_path, output_error_array_path,
+ output_correction_array_path):
+ outputs = []
+- with open(input_path) as input_stream:
++ with open(input_path, 'rb') as input_stream:
+ input_stream = code_generator_util.SkipLineComment(input_stream)
+ input_stream = code_generator_util.ParseColumnStream(input_stream,
+ num_column=3)
+@@ -73,7 +73,7 @@
+
+ # In order to lookup the entries via |error| with binary search,
+ # sort outputs here.
+- outputs.sort(lambda x, y: cmp(x[1], y[1]) or cmp(x[0], y[0]))
++ outputs.sort(key=lambda x: (x[1], x[0]))
+
+ serialized_string_array_builder.SerializeToFile(
+ [value for (value, _, _) in outputs], output_value_array_path)
+--- /src/rewriter/gen_single_kanji_rewriter_data.py
++++ /src/rewriter/gen_single_kanji_rewriter_data.py
+@@ -52,7 +52,7 @@
+ stream = code_generator_util.ParseColumnStream(stream, num_column=2)
+ outputs = list(stream)
+ # For binary search by |key|, sort outputs here.
+- outputs.sort(lambda x, y: cmp(x[0], y[0]))
++ outputs.sort(key=lambda x: x[0])
+
+ return outputs
+
+@@ -72,7 +72,7 @@
+ variant_items.append([target, original, len(variant_types) - 1])
+
+ # For binary search by |target|, sort variant items here.
+- variant_items.sort(lambda x, y: cmp(x[0], y[0]))
++ variant_items.sort(key=lambda x: x[0])
+
+ return (variant_types, variant_items)
+
+@@ -151,10 +151,10 @@
+ def main():
+ options = _ParseOptions()
+
+- with open(options.single_kanji_file, 'r') as single_kanji_stream:
++ with open(options.single_kanji_file, 'rb') as single_kanji_stream:
+ single_kanji = ReadSingleKanji(single_kanji_stream)
+
+- with open(options.variant_file, 'r') as variant_stream:
++ with open(options.variant_file, 'rb') as variant_stream:
+ variant_info = ReadVariant(variant_stream)
+
+ WriteSingleKanji(single_kanji,
+--- /src/session/gen_session_stress_test_data.py
++++ /src/session/gen_session_stress_test_data.py
+@@ -50,24 +50,26 @@
+ """
+ result = ''
+ for c in s:
+- hexstr = hex(ord(c))
++ hexstr = hex(c)
+ # because hexstr contains '0x', remove the prefix and add our prefix
+ result += '\\x' + hexstr[2:]
+ return result
+
+ def GenerateHeader(file):
+ try:
+- print "const char *kTestSentences[] = {"
+- for line in open(file, "r"):
+- if line.startswith('#'):
++ print("const char *kTestSentences[] = {")
++ fh = open(file, "rb")
++ for line in fh:
++ if line.startswith(b'#'):
+ continue
+- line = line.rstrip('\r\n')
++ line = line.rstrip(b'\r\n')
+ if not line:
+ continue
+- print " \"%s\"," % escape_string(line)
+- print "};"
++ print(" \"%s\"," % escape_string(line))
++ fh.close()
++ print("};")
+ except:
+- print "cannot open %s" % (file)
++ print("cannot open %s" % (file))
+ sys.exit(1)
+
+ def main():
+--- /src/unix/ibus/gen_mozc_xml.py
++++ /src/unix/ibus/gen_mozc_xml.py
+@@ -74,7 +74,7 @@
+
+
+ def OutputXmlElement(param_dict, element_name, value):
+- print ' <%s>%s</%s>' % (element_name, (value % param_dict), element_name)
++ print(' <%s>%s</%s>' % (element_name, (value % param_dict), element_name))
+
+
+ def OutputXml(param_dict, component, engine_common, engines, setup_arg):
+@@ -90,26 +90,26 @@
+ engines: A dictionary from a property name to a list of property values of
+ engines. For example, {'name': ['mozc-jp', 'mozc', 'mozc-dv']}.
+ """
+- print '<component>'
+- for key in component:
++ print('<component>')
++ for key in sorted(component):
+ OutputXmlElement(param_dict, key, component[key])
+- print '<engines>'
++ print('<engines>')
+ for i in range(len(engines['name'])):
+- print '<engine>'
+- for key in engine_common:
++ print('<engine>')
++ for key in sorted(engine_common):
+ OutputXmlElement(param_dict, key, engine_common[key])
+ if setup_arg:
+ OutputXmlElement(param_dict, 'setup', ' '.join(setup_arg))
+- for key in engines:
++ for key in sorted(engines):
+ OutputXmlElement(param_dict, key, engines[key][i])
+- print '</engine>'
+- print '</engines>'
+- print '</component>'
++ print('</engine>')
++ print('</engines>')
++ print('</component>')
+
+
+ def OutputCppVariable(param_dict, prefix, variable_name, value):
+- print 'const char k%s%s[] = "%s";' % (prefix, variable_name.capitalize(),
+- (value % param_dict))
++ print('const char k%s%s[] = "%s";' % (prefix, variable_name.capitalize(),
++ (value % param_dict)))
+
+
+ def OutputCpp(param_dict, component, engine_common, engines):
+@@ -122,18 +122,18 @@
+ engines: ditto.
+ """
+ guard_name = 'MOZC_UNIX_IBUS_MAIN_H_'
+- print CPP_HEADER % (guard_name, guard_name)
+- for key in component:
++ print(CPP_HEADER % (guard_name, guard_name))
++ for key in sorted(component):
+ OutputCppVariable(param_dict, 'Component', key, component[key])
+- for key in engine_common:
++ for key in sorted(engine_common):
+ OutputCppVariable(param_dict, 'Engine', key, engine_common[key])
+- for key in engines:
+- print 'const char* kEngine%sArray[] = {' % key.capitalize()
++ for key in sorted(engines):
++ print('const char* kEngine%sArray[] = {' % key.capitalize())
+ for i in range(len(engines[key])):
+- print '"%s",' % (engines[key][i] % param_dict)
+- print '};'
+- print 'const size_t kEngineArrayLen = %s;' % len(engines['name'])
+- print CPP_FOOTER % guard_name
++ print('"%s",' % (engines[key][i] % param_dict))
++ print('};')
++ print('const size_t kEngineArrayLen = %s;' % len(engines['name']))
++ print(CPP_FOOTER % guard_name)
+
+
+ def CheckIBusVersion(options, minimum_version):
+--- /src/usage_stats/gen_stats_list.py
++++ /src/usage_stats/gen_stats_list.py
+@@ -37,23 +37,24 @@
+
+ def GetStatsNameList(filename):
+ stats = []
+- for line in open(filename, 'r'):
+- stat = line.strip()
+- if not stat or stat[0] == '#':
+- continue
+- stats.append(stat)
++ with open(filename, 'r') as file:
++ for line in file:
++ stat = line.strip()
++ if not stat or stat[0] == '#':
++ continue
++ stats.append(stat)
+ return stats
+
+
+ def main():
+ stats_list = GetStatsNameList(sys.argv[1])
+- print '// This header file is generated by gen_stats_list.py'
++ print('// This header file is generated by gen_stats_list.py')
+ for stats in stats_list:
+- print 'const char k%s[] = "%s";' % (stats, stats)
+- print 'const char *kStatsList[] = {'
++ print('const char k%s[] = "%s";' % (stats, stats))
++ print('const char *kStatsList[] = {')
+ for stats in stats_list:
+- print ' k%s,' % (stats)
+- print '};'
++ print(' k%s,' % (stats))
++ print('};')
+
+
+ if __name__ == '__main__':
diff --git a/app-i18n/mozc/mozc-2.23.2815.102.ebuild b/app-i18n/mozc/mozc-2.23.2815.102.ebuild
index 425b785cbfa..8a55204d5db 100644
--- a/app-i18n/mozc/mozc-2.23.2815.102.ebuild
+++ b/app-i18n/mozc/mozc-2.23.2815.102.ebuild
@@ -1,8 +1,8 @@
-# Copyright 2010-2019 Gentoo Authors
+# Copyright 2010-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI="7"
-PYTHON_COMPAT=(python2_7)
+PYTHON_COMPAT=(python{3_6,3_7,3_8})
inherit elisp-common multiprocessing python-any-r1 toolchain-funcs
@@ -105,6 +105,10 @@ src_unpack() {
}
src_prepare() {
+ eapply -p2 "${FILESDIR}/${PN}-2.23.2815.102-python-3_1.patch"
+ eapply -p2 "${FILESDIR}/${PN}-2.23.2815.102-python-3_2.patch"
+ eapply -p2 "${FILESDIR}/${PN}-2.23.2815.102-python-3_3.patch"
+ eapply -p2 "${FILESDIR}/${PN}-2.23.2815.102-python-3_4.patch"
eapply -p2 "${FILESDIR}/${PN}-2.23.2815.102-system_libraries.patch"
eapply -p2 "${FILESDIR}/${PN}-2.23.2815.102-gcc-8.patch"
eapply -p2 "${FILESDIR}/${PN}-2.23.2815.102-protobuf_generated_classes_no_inheritance.patch"
diff --git a/app-i18n/mozc/mozc-9999.ebuild b/app-i18n/mozc/mozc-9999.ebuild
index d7c66b558d9..e82d56df336 100644
--- a/app-i18n/mozc/mozc-9999.ebuild
+++ b/app-i18n/mozc/mozc-9999.ebuild
@@ -1,8 +1,8 @@
-# Copyright 2010-2019 Gentoo Authors
+# Copyright 2010-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI="7"
-PYTHON_COMPAT=(python2_7)
+PYTHON_COMPAT=(python{3_6,3_7,3_8})
inherit elisp-common multiprocessing python-any-r1 toolchain-funcs
@@ -105,6 +105,10 @@ src_unpack() {
}
src_prepare() {
+ eapply -p2 "${FILESDIR}/${PN}-2.23.2815.102-python-3_1.patch"
+ eapply -p2 "${FILESDIR}/${PN}-2.23.2815.102-python-3_2.patch"
+ eapply -p2 "${FILESDIR}/${PN}-2.23.2815.102-python-3_3.patch"
+ eapply -p2 "${FILESDIR}/${PN}-2.23.2815.102-python-3_4.patch"
eapply -p2 "${FILESDIR}/${PN}-2.23.2815.102-system_libraries.patch"
eapply -p2 "${FILESDIR}/${PN}-2.23.2815.102-gcc-8.patch"
eapply -p2 "${FILESDIR}/${PN}-2.23.2815.102-protobuf_generated_classes_no_inheritance.patch"
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: app-i18n/mozc/, app-i18n/mozc/files/
@ 2020-11-15 15:31 Joonas Niilola
0 siblings, 0 replies; 7+ messages in thread
From: Joonas Niilola @ 2020-11-15 15:31 UTC (permalink / raw
To: gentoo-commits
commit: 0bc62bb09a1a8ef9db031b3c5de6ea11935cc3ad
Author: Joonas Niilola <juippis <AT> gentoo <DOT> org>
AuthorDate: Sun Nov 15 15:26:51 2020 +0000
Commit: Joonas Niilola <juippis <AT> gentoo <DOT> org>
CommitDate: Sun Nov 15 15:31:22 2020 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0bc62bb0
app-i18n/mozc: fix SizeViolation issue
Closes: https://bugs.gentoo.org/748150
Signed-off-by: Joonas Niilola <juippis <AT> gentoo.org>
app-i18n/mozc/Manifest | 1 +
...protobuf_generated_classes_no_inheritance.patch | 1039 --------------------
app-i18n/mozc/mozc-2.23.2815.102.ebuild | 3 +-
app-i18n/mozc/mozc-9999.ebuild | 3 +-
4 files changed, 5 insertions(+), 1041 deletions(-)
diff --git a/app-i18n/mozc/Manifest b/app-i18n/mozc/Manifest
index 2bd43342203..72d8dc73f38 100644
--- a/app-i18n/mozc/Manifest
+++ b/app-i18n/mozc/Manifest
@@ -1,3 +1,4 @@
DIST fcitx-mozc-2.23.2815.102.1.patch 295112 BLAKE2B 709b84f6eaed16da38a173f40ae7cccff362fd167e6deb4090ae8a9ec522ac8e11ccff3c9ef6433907249af8c9eb4b7be12d2c05564cabd45c25e26764286ed3 SHA512 e0d4645df919838f0fe31a97bf6dd759c222a696f68133f7584d2c771f70734ea634a25bebb03a756221000d3552423207ee5163d75778dbf480b6e267ba4cd0
DIST japanese-usage-dictionary-20120416091336.tar.gz 71051 BLAKE2B 08eecf0aa021e27a2813f58c2d37f1cec760448f6ae086ae7468b8a11575c6ef9f72f656cb4d53e0179b8a7b00f2d91ff51a0ad7825e078dcbac0810f1d8b3e1 SHA512 b7e997a979b6d50e49b9af5dc830ea4df0532f6ab1321b9ef14983f65bb54f1b2967375c82e07957ae7693ebbf43c9b56ecea6bfea8dd1fdaee444bd549d83a7
+DIST mozc-2.23.2815.102-protobuf_generated_classes_no_inheritance.patch 40296 BLAKE2B 982f43fa68031eb0f779ec4d034fef838a4fce7834291db889c9edffba3df4acd5bfdf187dd4a52ee8fd0714de943f9d5112070cd69502e1449dab4dbf8543b2 SHA512 6e05b2f22663ddbfb24a8344928ec24c0b4cf523728c1623367970b8f263142af95c056c82d0827414833d5b9f26c3a024a04a688851021601a5cbcc1474e754
DIST mozc-2.23.2815.102.tar.gz 47739041 BLAKE2B 045a8a4a07e09cf923b67824111cdf672febc30256a6aef951ae779a3f582b3860042750d766120e376898c63be5b4baea870798a192cee34b0d48647e1ec5e6 SHA512 a3face616ca89990bca52371dcc8003604ebe0e9633116a64550add070152b1bc4d9b21e9f102c5afa6f8b1aa11d8dbc4bafbcebfaf4a12a934f085f245d548f
diff --git a/app-i18n/mozc/files/mozc-2.23.2815.102-protobuf_generated_classes_no_inheritance.patch b/app-i18n/mozc/files/mozc-2.23.2815.102-protobuf_generated_classes_no_inheritance.patch
deleted file mode 100644
index 2cd75728154..00000000000
--- a/app-i18n/mozc/files/mozc-2.23.2815.102-protobuf_generated_classes_no_inheritance.patch
+++ /dev/null
@@ -1,1039 +0,0 @@
-https://github.com/google/mozc/issues/460
-
---- /src/dictionary/user_dictionary.cc
-+++ /src/dictionary/user_dictionary.cc
-@@ -289,7 +289,7 @@
- }
-
- auto_register_mode_ = false;
-- dic_->Load(*(storage.get()));
-+ dic_->Load(storage.get()->user_dictionary_storage_base);
- }
-
- private:
---- /src/dictionary/user_dictionary_session.cc
-+++ /src/dictionary/user_dictionary_session.cc
-@@ -69,11 +69,11 @@
- }
-
- virtual bool RunUndo(mozc::UserDictionaryStorage *storage) {
-- if (storage->dictionaries_size() == 0) {
-+ if (storage->user_dictionary_storage_base.dictionaries_size() == 0) {
- return false;
- }
-
-- storage->mutable_dictionaries()->RemoveLast();
-+ storage->user_dictionary_storage_base.mutable_dictionaries()->RemoveLast();
- return true;
- }
-
-@@ -94,7 +94,7 @@
- }
-
- RepeatedPtrField<UserDictionary> *dictionaries =
-- storage->mutable_dictionaries();
-+ storage->user_dictionary_storage_base.mutable_dictionaries();
- dictionaries->AddAllocated(dictionary_.release());
-
- // Adjust the position of the reverted dictionary.
-@@ -120,10 +120,10 @@
- }
-
- virtual bool RunUndo(mozc::UserDictionaryStorage *storage) {
-- if (storage->dictionaries_size() != 1) {
-+ if (storage->user_dictionary_storage_base.dictionaries_size() != 1) {
- return false;
- }
-- dictionary_->Swap(storage->mutable_dictionaries(0));
-+ dictionary_->Swap(storage->user_dictionary_storage_base.mutable_dictionaries(0));
- return true;
- }
-
-@@ -144,7 +144,7 @@
- virtual bool RunUndo(mozc::UserDictionaryStorage *storage) {
- UserDictionary *dictionary =
- UserDictionaryUtil::GetMutableUserDictionaryById(
-- storage, dictionary_id_);
-+ &storage->user_dictionary_storage_base, dictionary_id_);
- if (dictionary == NULL) {
- return false;
- }
-@@ -169,7 +169,7 @@
- virtual bool RunUndo(mozc::UserDictionaryStorage *storage) {
- UserDictionary *dictionary =
- UserDictionaryUtil::GetMutableUserDictionaryById(
-- storage, dictionary_id_);
-+ &storage->user_dictionary_storage_base, dictionary_id_);
- if (dictionary == NULL || dictionary->entries_size() == 0) {
- return false;
- }
-@@ -195,7 +195,7 @@
- virtual bool RunUndo(mozc::UserDictionaryStorage *storage) {
- UserDictionary *dictionary =
- UserDictionaryUtil::GetMutableUserDictionaryById(
-- storage, dictionary_id_);
-+ &storage->user_dictionary_storage_base, dictionary_id_);
- if (dictionary == NULL ||
- index_ < 0 || dictionary->entries_size() <= index_) {
- return false;
-@@ -240,7 +240,7 @@
- virtual bool RunUndo(mozc::UserDictionaryStorage *storage) {
- UserDictionary *dictionary =
- UserDictionaryUtil::GetMutableUserDictionaryById(
-- storage, dictionary_id_);
-+ &storage->user_dictionary_storage_base, dictionary_id_);
- if (dictionary == NULL) {
- return false;
- }
-@@ -306,7 +306,7 @@
- virtual bool RunUndo(mozc::UserDictionaryStorage *storage) {
- UserDictionary *dictionary =
- UserDictionaryUtil::GetMutableUserDictionaryById(
-- storage, dictionary_id_);
-+ &storage->user_dictionary_storage_base, dictionary_id_);
- if (dictionary == NULL) {
- return false;
- }
-@@ -345,7 +345,7 @@
-
- // TODO(hidehiko) move this to header.
- const UserDictionaryStorage &UserDictionarySession::storage() const {
-- return *storage_;
-+ return storage_->user_dictionary_storage_base;
- }
- mozc::UserDictionaryStorage *UserDictionarySession::mutable_storage() {
- return storage_.get();
-@@ -464,7 +464,7 @@
- const string &dictionary_name, uint64 *new_dictionary_id) {
- UserDictionaryCommandStatus::Status status =
- UserDictionaryUtil::CreateDictionary(
-- storage_.get(), dictionary_name, new_dictionary_id);
-+ &storage_->user_dictionary_storage_base, dictionary_name, new_dictionary_id);
- if (status == UserDictionaryCommandStatus::USER_DICTIONARY_COMMAND_SUCCESS) {
- AddUndoCommand(new UndoCreateDictionaryCommand);
- }
-@@ -488,7 +488,7 @@
- int original_index;
- UserDictionary *deleted_dictionary;
- if (!UserDictionaryUtil::DeleteDictionary(
-- storage_.get(), dictionary_id,
-+ &storage_->user_dictionary_storage_base, dictionary_id,
- &original_index, &deleted_dictionary)) {
- // Failed to delete the dictionary.
- return UserDictionaryCommandStatus::UNKNOWN_DICTIONARY_ID;
-@@ -510,7 +510,7 @@
- uint64 dictionary_id, const string &dictionary_name) {
- string original_name;
- const UserDictionary *dictionary =
-- UserDictionaryUtil::GetUserDictionaryById(*storage_, dictionary_id);
-+ UserDictionaryUtil::GetUserDictionaryById(storage_->user_dictionary_storage_base, dictionary_id);
- if (dictionary != NULL) {
- // Note that if dictionary is null, it means the dictionary_id is invalid
- // so following RenameDictionary will fail, and error handling is done
-@@ -547,7 +547,7 @@
- uint64 dictionary_id, const UserDictionary::Entry &entry) {
- UserDictionary *dictionary =
- UserDictionaryUtil::GetMutableUserDictionaryById(
-- storage_.get(), dictionary_id);
-+ &storage_->user_dictionary_storage_base, dictionary_id);
- if (dictionary == NULL) {
- return UserDictionaryCommandStatus::UNKNOWN_DICTIONARY_ID;
- }
-@@ -575,7 +575,7 @@
- uint64 dictionary_id, int index, const UserDictionary::Entry &entry) {
- UserDictionary *dictionary =
- UserDictionaryUtil::GetMutableUserDictionaryById(
-- storage_.get(), dictionary_id);
-+ &storage_->user_dictionary_storage_base, dictionary_id);
- if (dictionary == NULL) {
- return UserDictionaryCommandStatus::UNKNOWN_DICTIONARY_ID;
- }
-@@ -604,7 +604,7 @@
- uint64 dictionary_id, const std::vector<int> &index_list) {
- UserDictionary *dictionary =
- UserDictionaryUtil::GetMutableUserDictionaryById(
-- storage_.get(), dictionary_id);
-+ &storage_->user_dictionary_storage_base, dictionary_id);
- if (dictionary == NULL) {
- return UserDictionaryCommandStatus::UNKNOWN_DICTIONARY_ID;
- }
-@@ -644,7 +644,7 @@
- uint64 dictionary_id, const string &data) {
- UserDictionary *dictionary =
- UserDictionaryUtil::GetMutableUserDictionaryById(
-- storage_.get(), dictionary_id);
-+ &storage_->user_dictionary_storage_base, dictionary_id);
- if (dictionary == NULL) {
- return UserDictionaryCommandStatus::UNKNOWN_DICTIONARY_ID;
- }
-@@ -699,7 +699,7 @@
- uint64 *new_dictionary_id) {
- UserDictionaryCommandStatus::Status status =
- UserDictionaryUtil::CreateDictionary(
-- storage_.get(), dictionary_name, new_dictionary_id);
-+ &storage_->user_dictionary_storage_base, dictionary_name, new_dictionary_id);
- if (status != UserDictionaryCommandStatus::USER_DICTIONARY_COMMAND_SUCCESS) {
- return status;
- }
-@@ -709,7 +709,7 @@
-
- UserDictionary *dictionary =
- UserDictionaryUtil::GetMutableUserDictionaryById(
-- storage_.get(), *new_dictionary_id);
-+ &storage_->user_dictionary_storage_base, *new_dictionary_id);
- if (dictionary == NULL) {
- // The dictionary should be always found.
- return UserDictionaryCommandStatus::UNKNOWN_ERROR;
-@@ -719,7 +719,7 @@
- }
-
- bool UserDictionarySession::EnsureNonEmptyStorage() {
-- if (storage_->dictionaries_size() > 0) {
-+ if (storage_->user_dictionary_storage_base.dictionaries_size() > 0) {
- // The storage already has at least one dictionary. Do nothing.
- return false;
- }
-@@ -728,7 +728,7 @@
- uint64 new_dictionary_id;
- UserDictionaryCommandStatus::Status status =
- UserDictionaryUtil::CreateDictionary(
-- storage_.get(), default_dictionary_name_, &new_dictionary_id);
-+ &storage_->user_dictionary_storage_base, default_dictionary_name_, &new_dictionary_id);
- CHECK_EQ(
- status, UserDictionaryCommandStatus::USER_DICTIONARY_COMMAND_SUCCESS);
- return true;
-@@ -755,7 +755,7 @@
-
- void UserDictionarySession::ClearDictionariesAndUndoHistory() {
- ScopedUserDictionaryLocker l(storage_.get());
-- storage_->clear_dictionaries();
-+ storage_->user_dictionary_storage_base.clear_dictionaries();
- ClearUndoHistory();
- }
-
---- /src/dictionary/user_dictionary_session_test.cc
-+++ /src/dictionary/user_dictionary_session_test.cc
-@@ -95,12 +95,12 @@
-
- ASSERT_EQ(UserDictionaryCommandStatus::FILE_NOT_FOUND, session.Load());
-
-- session.mutable_storage()->set_version(10);
-+ session.mutable_storage()->user_dictionary_storage_base.set_version(10);
- ASSERT_EQ(UserDictionaryCommandStatus::USER_DICTIONARY_COMMAND_SUCCESS,
- session.Save());
-
- // Clear once, in order to make sure that Load is actually working.
-- session.mutable_storage()->Clear();
-+ session.mutable_storage()->user_dictionary_storage_base.Clear();
- ASSERT_EQ(UserDictionaryCommandStatus::USER_DICTIONARY_COMMAND_SUCCESS,
- session.Load());
-
-@@ -130,7 +130,7 @@
-
- // Create huge dummy data.
- {
-- UserDictionaryStorage *storage = session.mutable_storage();
-+ UserDictionaryStorage *storage = &session.mutable_storage()->user_dictionary_storage_base;
- for (int i = 0; i < 100; ++i) {
- UserDictionary *dictionary = storage->add_dictionaries();
- for (int j = 0; j < 1000; ++j) {
-@@ -147,7 +147,7 @@
- ASSERT_EQ(UserDictionaryCommandStatus::FILE_SIZE_LIMIT_EXCEEDED,
- session.Save());
-
-- session.mutable_storage()->Clear();
-+ session.mutable_storage()->user_dictionary_storage_base.Clear();
- ASSERT_EQ(UserDictionaryCommandStatus::USER_DICTIONARY_COMMAND_SUCCESS,
- session.Load());
-
-@@ -191,7 +191,7 @@
-
- while (session.storage().dictionaries_size() <
- ::mozc::UserDictionaryStorage::max_dictionary_size()) {
-- session.mutable_storage()->add_dictionaries();
-+ session.mutable_storage()->user_dictionary_storage_base.add_dictionaries();
- }
- EXPECT_EQ(UserDictionaryCommandStatus::DICTIONARY_SIZE_LIMIT_EXCEEDED,
- session.CreateDictionary("dictionary 2", &dummy_dictionary_id));
-@@ -204,7 +204,7 @@
- const uint64 kDummyId = 10;
- {
- UserDictionary *user_dictionary =
-- session.mutable_storage()->add_dictionaries();
-+ session.mutable_storage()->user_dictionary_storage_base.add_dictionaries();
- user_dictionary->set_id(kDummyId);
- }
-
-@@ -229,7 +229,7 @@
- const uint64 kDummyId = 10;
- {
- UserDictionary *user_dictionary =
-- session.mutable_storage()->add_dictionaries();
-+ session.mutable_storage()->user_dictionary_storage_base.add_dictionaries();
- user_dictionary->set_id(kDummyId);
- }
-
---- /src/dictionary/user_dictionary_storage.cc
-+++ /src/dictionary/user_dictionary_storage.cc
-@@ -109,7 +109,7 @@
- mozc::protobuf::io::IstreamInputStream zero_copy_input(&ifs);
- mozc::protobuf::io::CodedInputStream decoder(&zero_copy_input);
- decoder.SetTotalBytesLimit(kDefaultTotalBytesLimit, -1);
-- if (!ParseFromCodedStream(&decoder)) {
-+ if (!user_dictionary_storage_base.ParseFromCodedStream(&decoder)) {
- LOG(ERROR) << "Failed to parse";
- if (!decoder.ConsumedEntireMessage() || !ifs.eof()) {
- LOG(ERROR) << "ParseFromStream failed: file seems broken";
-@@ -137,11 +137,11 @@
- }
-
- // Check dictionary id here. if id is 0, assign random ID.
-- for (int i = 0; i < dictionaries_size(); ++i) {
-- const UserDictionary &dict = dictionaries(i);
-+ for (int i = 0; i < user_dictionary_storage_base.dictionaries_size(); ++i) {
-+ const UserDictionary &dict = user_dictionary_storage_base.dictionaries(i);
- if (dict.id() == 0) {
-- mutable_dictionaries(i)->set_id(
-- UserDictionaryUtil::CreateNewDictionaryId(*this));
-+ user_dictionary_storage_base.mutable_dictionaries(i)->set_id(
-+ UserDictionaryUtil::CreateNewDictionaryId(this->user_dictionary_storage_base));
- }
- }
-
-@@ -171,7 +171,7 @@
- return false;
- }
-
-- if (!SerializeToOstream(&ofs)) {
-+ if (!user_dictionary_storage_base.SerializeToOstream(&ofs)) {
- LOG(ERROR) << "SerializeToString failed";
- last_error_type_ = SYNC_FAILURE;
- return false;
-@@ -227,7 +227,7 @@
- return false;
- }
-
-- const UserDictionary &dic = dictionaries(index);
-+ const UserDictionary &dic = user_dictionary_storage_base.dictionaries(index);
- for (size_t i = 0; i < dic.entries_size(); ++i) {
- const UserDictionaryEntry &entry = dic.entries(i);
- ofs << entry.key() << "\t" << entry.value() << "\t"
-@@ -241,7 +241,7 @@
- bool UserDictionaryStorage::CreateDictionary(
- const string &dic_name, uint64 *new_dic_id) {
- UserDictionaryCommandStatus::Status status =
-- UserDictionaryUtil::CreateDictionary(this, dic_name, new_dic_id);
-+ UserDictionaryUtil::CreateDictionary(&this->user_dictionary_storage_base, dic_name, new_dic_id);
- // Update last_error_type_
- switch (status) {
- case UserDictionaryCommandStatus::DICTIONARY_NAME_EMPTY:
-@@ -273,7 +273,7 @@
- }
-
- bool UserDictionaryStorage::DeleteDictionary(uint64 dic_id) {
-- if (!UserDictionaryUtil::DeleteDictionary(this, dic_id, NULL, NULL)) {
-+ if (!UserDictionaryUtil::DeleteDictionary(&this->user_dictionary_storage_base, dic_id, NULL, NULL)) {
- // Failed to delete dictionary.
- last_error_type_ = INVALID_DICTIONARY_ID;
- return false;
-@@ -304,8 +304,8 @@
- return true;
- }
-
-- for (int i = 0; i < dictionaries_size(); ++i) {
-- if (dic_name == dictionaries(i).name()) {
-+ for (int i = 0; i < user_dictionary_storage_base.dictionaries_size(); ++i) {
-+ if (dic_name == user_dictionary_storage_base.dictionaries(i).name()) {
- last_error_type_ = DUPLICATED_DICTIONARY_NAME;
- LOG(ERROR) << "duplicated dictionary name";
- return false;
-@@ -318,14 +318,14 @@
- }
-
- int UserDictionaryStorage::GetUserDictionaryIndex(uint64 dic_id) const {
-- return UserDictionaryUtil::GetUserDictionaryIndexById(*this, dic_id);
-+ return UserDictionaryUtil::GetUserDictionaryIndexById(this->user_dictionary_storage_base, dic_id);
- }
-
- bool UserDictionaryStorage::GetUserDictionaryId(const string &dic_name,
- uint64 *dic_id) {
-- for (size_t i = 0; i < dictionaries_size(); ++i) {
-- if (dic_name == dictionaries(i).name()) {
-- *dic_id = dictionaries(i).id();
-+ for (size_t i = 0; i < user_dictionary_storage_base.dictionaries_size(); ++i) {
-+ if (dic_name == user_dictionary_storage_base.dictionaries(i).name()) {
-+ *dic_id = user_dictionary_storage_base.dictionaries(i).id();
- return true;
- }
- }
-@@ -335,7 +335,7 @@
-
- user_dictionary::UserDictionary *UserDictionaryStorage::GetUserDictionary(
- uint64 dic_id) {
-- return UserDictionaryUtil::GetMutableUserDictionaryById(this, dic_id);
-+ return UserDictionaryUtil::GetMutableUserDictionaryById(&this->user_dictionary_storage_base, dic_id);
- }
-
- UserDictionaryStorage::UserDictionaryStorageErrorType
-@@ -352,8 +352,8 @@
- }
-
- int auto_index = -1;
-- for (int i = 0; i < dictionaries_size(); ++i) {
-- if (dictionaries(i).name() == kAutoRegisteredDictionaryName) {
-+ for (int i = 0; i < user_dictionary_storage_base.dictionaries_size(); ++i) {
-+ if (user_dictionary_storage_base.dictionaries(i).name() == kAutoRegisteredDictionaryName) {
- auto_index = i;
- break;
- }
-@@ -361,17 +361,17 @@
-
- UserDictionary *dic = NULL;
- if (auto_index == -1) {
-- if (UserDictionaryUtil::IsStorageFull(*this)) {
-+ if (UserDictionaryUtil::IsStorageFull(this->user_dictionary_storage_base)) {
- last_error_type_ = TOO_MANY_DICTIONARIES;
- LOG(ERROR) << "too many dictionaries";
- UnLock();
- return false;
- }
-- dic = add_dictionaries();
-- dic->set_id(UserDictionaryUtil::CreateNewDictionaryId(*this));
-+ dic = user_dictionary_storage_base.add_dictionaries();
-+ dic->set_id(UserDictionaryUtil::CreateNewDictionaryId(this->user_dictionary_storage_base));
- dic->set_name(kAutoRegisteredDictionaryName);
- } else {
-- dic = mutable_dictionaries(auto_index);
-+ dic = user_dictionary_storage_base.mutable_dictionaries(auto_index);
- }
-
- if (dic == NULL) {
-@@ -410,13 +410,13 @@
- }
-
- bool UserDictionaryStorage::ConvertSyncDictionariesToNormalDictionaries() {
-- if (CountSyncableDictionaries(*this) == 0) {
-+ if (CountSyncableDictionaries(this->user_dictionary_storage_base) == 0) {
- return false;
- }
-
-- for (int dictionary_index = dictionaries_size() - 1;
-+ for (int dictionary_index = user_dictionary_storage_base.dictionaries_size() - 1;
- dictionary_index >= 0; --dictionary_index) {
-- UserDictionary *dic = mutable_dictionaries(dictionary_index);
-+ UserDictionary *dic = user_dictionary_storage_base.mutable_dictionaries(dictionary_index);
- if (!dic->syncable()) {
- continue;
- }
-@@ -433,10 +433,10 @@
-
- // Delete removed or unused sync dictionaries.
- if (dic->removed() || dic->entries_size() == 0) {
-- for (int i = dictionary_index + 1; i < dictionaries_size(); ++i) {
-- mutable_dictionaries()->SwapElements(i - 1, i);
-+ for (int i = dictionary_index + 1; i < user_dictionary_storage_base.dictionaries_size(); ++i) {
-+ user_dictionary_storage_base.mutable_dictionaries()->SwapElements(i - 1, i);
- }
-- mutable_dictionaries()->RemoveLast();
-+ user_dictionary_storage_base.mutable_dictionaries()->RemoveLast();
- continue;
- }
-
-@@ -445,7 +445,7 @@
- kDictionaryNameConvertedFromSyncableDictionary;
- int index = 0;
- while (UserDictionaryUtil::ValidateDictionaryName(
-- *this, new_dictionary_name)
-+ this->user_dictionary_storage_base, new_dictionary_name)
- != UserDictionaryCommandStatus::USER_DICTIONARY_COMMAND_SUCCESS) {
- ++index;
- new_dictionary_name = Util::StringPrintf(
-@@ -456,7 +456,7 @@
- dic->set_syncable(false);
- }
-
-- DCHECK_EQ(0, CountSyncableDictionaries(*this));
-+ DCHECK_EQ(0, CountSyncableDictionaries(this->user_dictionary_storage_base));
-
- return true;
- }
-@@ -487,7 +487,7 @@
- bool UserDictionaryStorage::IsValidDictionaryName(const string &name) {
- UserDictionaryCommandStatus::Status status =
- UserDictionaryUtil::ValidateDictionaryName(
-- UserDictionaryStorage::default_instance(), name);
-+ user_dictionary::UserDictionaryStorage::default_instance(), name);
-
- // Update last_error_type_.
- switch (status) {
---- /src/dictionary/user_dictionary_storage.h
-+++ /src/dictionary/user_dictionary_storage.h
-@@ -72,13 +72,15 @@
- class Mutex;
- class ProcessMutex;
-
--// Inherit from ProtocolBuffer
--// TODO(hidehiko): Get rid of this implementation.
--class UserDictionaryStorage : public user_dictionary::UserDictionaryStorage {
-+class UserDictionaryStorage {
- public:
- typedef user_dictionary::UserDictionary UserDictionary;
- typedef user_dictionary::UserDictionary::Entry UserDictionaryEntry;
-
-+ // Instance of base class generated by Protocol Buffers compiler.
-+ // Regular inheritance strongly discouraged.
-+ user_dictionary::UserDictionaryStorage user_dictionary_storage_base;
-+
- enum UserDictionaryStorageErrorType {
- USER_DICTIONARY_STORAGE_NO_ERROR = 0, // default
- FILE_NOT_EXISTS,
---- /src/dictionary/user_dictionary_storage_test.cc
-+++ /src/dictionary/user_dictionary_storage_test.cc
-@@ -118,13 +118,13 @@
- const size_t kDictionariesSize = 3;
- uint64 id[kDictionariesSize];
-
-- const size_t dict_size = storage.dictionaries_size();
-+ const size_t dict_size = storage.user_dictionary_storage_base.dictionaries_size();
-
- for (size_t i = 0; i < kDictionariesSize; ++i) {
- EXPECT_TRUE(storage.CreateDictionary(
- "test" + std::to_string(static_cast<uint32>(i)),
- &id[i]));
-- EXPECT_EQ(i + 1 + dict_size, storage.dictionaries_size());
-+ EXPECT_EQ(i + 1 + dict_size, storage.user_dictionary_storage_base.dictionaries_size());
- }
-
- for (size_t i = 0; i < kDictionariesSize; ++i) {
-@@ -133,7 +133,7 @@
- }
-
- for (size_t i = 0; i < kDictionariesSize; ++i) {
-- EXPECT_EQ(storage.mutable_dictionaries(i + dict_size),
-+ EXPECT_EQ(storage.user_dictionary_storage_base.mutable_dictionaries(i + dict_size),
- storage.GetUserDictionary(id[i]));
- EXPECT_EQ(NULL, storage.GetUserDictionary(id[i] + 1));
- }
-@@ -165,7 +165,7 @@
- EXPECT_FALSE(storage.DeleteDictionary(0));
-
- EXPECT_TRUE(storage.DeleteDictionary(id[1]));
-- EXPECT_EQ(kDictionariesSize + dict_size - 1, storage.dictionaries_size());
-+ EXPECT_EQ(kDictionariesSize + dict_size - 1, storage.user_dictionary_storage_base.dictionaries_size());
- }
-
- TEST_F(UserDictionaryStorageTest, DeleteTest) {
-@@ -174,7 +174,7 @@
-
- // repeat 10 times
- for (int i = 0; i < 10; ++i) {
-- storage.Clear();
-+ storage.user_dictionary_storage_base.Clear();
- std::vector<uint64> ids(100);
- for (size_t i = 0; i < ids.size(); ++i) {
- EXPECT_TRUE(storage.CreateDictionary(
-@@ -191,10 +191,10 @@
- alive.push_back(ids[i]);
- }
-
-- EXPECT_EQ(alive.size(), storage.dictionaries_size());
-+ EXPECT_EQ(alive.size(), storage.user_dictionary_storage_base.dictionaries_size());
-
- for (size_t i = 0; i < alive.size(); ++i) {
-- EXPECT_EQ(alive[i], storage.dictionaries(i).id());
-+ EXPECT_EQ(alive[i], storage.user_dictionary_storage_base.dictionaries(i).id());
- }
- }
- }
-@@ -268,7 +268,7 @@
- const size_t entry_size = Util::Random(100) + 1;
- for (size_t j = 0; j < entry_size; ++j) {
- UserDictionaryStorage::UserDictionary *dic =
-- storage1.mutable_dictionaries(i);
-+ storage1.user_dictionary_storage_base.mutable_dictionaries(i);
- UserDictionaryStorage::UserDictionaryEntry *entry =
- dic->add_entries();
- entry->set_key(GenRandomString(10));
-@@ -288,7 +288,7 @@
- EXPECT_TRUE(storage2.Load());
- }
-
-- EXPECT_EQ(storage1.DebugString(), storage2.DebugString());
-+ EXPECT_EQ(storage1.user_dictionary_storage_base.DebugString(), storage2.user_dictionary_storage_base.DebugString());
- }
- }
-
-@@ -352,7 +352,7 @@
- uint64 dict_id = 0;
- ASSERT_TRUE(storage.CreateDictionary(data.dictionary_name, &dict_id));
- UserDictionaryStorage::UserDictionary *dict =
-- storage.mutable_dictionaries(storage.GetUserDictionaryIndex(dict_id));
-+ storage.user_dictionary_storage_base.mutable_dictionaries(storage.GetUserDictionaryIndex(dict_id));
- dict->set_syncable(data.is_sync_dictionary);
- dict->set_removed(data.is_removed_dictionary);
- if (data.has_normal_entry) {
-@@ -369,7 +369,7 @@
- entry->set_removed(true);
- }
- }
-- EXPECT_EQ(9, UserDictionaryStorage::CountSyncableDictionaries(storage));
-+ EXPECT_EQ(9, UserDictionaryStorage::CountSyncableDictionaries(storage.user_dictionary_storage_base));
-
- ASSERT_TRUE(storage.ConvertSyncDictionariesToNormalDictionaries());
-
-@@ -385,12 +385,12 @@
- { true, kDictionaryNameConvertedFromSyncableDictionary },
- };
-
-- EXPECT_EQ(0, UserDictionaryStorage::CountSyncableDictionaries(storage));
-- ASSERT_EQ(arraysize(expected_data), storage.dictionaries_size());
-+ EXPECT_EQ(0, UserDictionaryStorage::CountSyncableDictionaries(storage.user_dictionary_storage_base));
-+ ASSERT_EQ(arraysize(expected_data), storage.user_dictionary_storage_base.dictionaries_size());
- for (size_t i = 0; i < arraysize(expected_data); ++i) {
- SCOPED_TRACE(Util::StringPrintf("verify %d", static_cast<int>(i)));
- const ExpectedData &expected = expected_data[i];
-- const UserDictionaryStorage::UserDictionary &dict = storage.dictionaries(i);
-+ const UserDictionaryStorage::UserDictionary &dict = storage.user_dictionary_storage_base.dictionaries(i);
-
- EXPECT_EQ(expected.dictionary_name, dict.name());
- EXPECT_FALSE(dict.syncable());
-@@ -404,42 +404,42 @@
- }
-
- // Test duplicated dictionary name.
-- storage.Clear();
-+ storage.user_dictionary_storage_base.Clear();
- {
- uint64 dict_id = 0;
- storage.CreateDictionary(
- UserDictionaryStorage::default_sync_dictionary_name(), &dict_id);
- storage.CreateDictionary(
- kDictionaryNameConvertedFromSyncableDictionary, &dict_id);
-- ASSERT_EQ(2, storage.dictionaries_size());
-+ ASSERT_EQ(2, storage.user_dictionary_storage_base.dictionaries_size());
- UserDictionaryStorage::UserDictionary *dict;
-- dict = storage.mutable_dictionaries(0);
-+ dict = storage.user_dictionary_storage_base.mutable_dictionaries(0);
- dict->set_syncable(true);
- dict->add_entries()->set_key("0");
-- dict = storage.mutable_dictionaries(1);
-+ dict = storage.user_dictionary_storage_base.mutable_dictionaries(1);
- dict->set_syncable(false);
- dict->add_entries()->set_key("1");
- }
- ASSERT_TRUE(storage.ConvertSyncDictionariesToNormalDictionaries());
-- EXPECT_EQ(0, UserDictionaryStorage::CountSyncableDictionaries(storage));
-- EXPECT_EQ(2, storage.dictionaries_size());
-+ EXPECT_EQ(0, UserDictionaryStorage::CountSyncableDictionaries(storage.user_dictionary_storage_base));
-+ EXPECT_EQ(2, storage.user_dictionary_storage_base.dictionaries_size());
- EXPECT_EQ(Util::StringPrintf("%s_1",
- kDictionaryNameConvertedFromSyncableDictionary),
-- storage.dictionaries(0).name());
-+ storage.user_dictionary_storage_base.dictionaries(0).name());
- EXPECT_EQ(kDictionaryNameConvertedFromSyncableDictionary,
-- storage.dictionaries(1).name());
-+ storage.user_dictionary_storage_base.dictionaries(1).name());
- }
-
- TEST_F(UserDictionaryStorageTest, AddToAutoRegisteredDictionary) {
- {
- UserDictionaryStorage storage(GetUserDictionaryFile());
-- EXPECT_EQ(0, storage.dictionaries_size());
-+ EXPECT_EQ(0, storage.user_dictionary_storage_base.dictionaries_size());
- EXPECT_TRUE(storage.AddToAutoRegisteredDictionary(
- "key1", "value1", UserDictionary::NOUN));
-- EXPECT_EQ(1, storage.dictionaries_size());
-- EXPECT_EQ(1, storage.dictionaries(0).entries_size());
-+ EXPECT_EQ(1, storage.user_dictionary_storage_base.dictionaries_size());
-+ EXPECT_EQ(1, storage.user_dictionary_storage_base.dictionaries(0).entries_size());
- const UserDictionaryStorage::UserDictionaryEntry &entry1 =
-- storage.dictionaries(0).entries(0);
-+ storage.user_dictionary_storage_base.dictionaries(0).entries(0);
- EXPECT_EQ("key1", entry1.key());
- EXPECT_EQ("value1", entry1.value());
- EXPECT_EQ(UserDictionary::NOUN, entry1.pos());
-@@ -447,10 +447,10 @@
-
- EXPECT_TRUE(storage.AddToAutoRegisteredDictionary(
- "key2", "value2", UserDictionary::NOUN));
-- EXPECT_EQ(1, storage.dictionaries_size());
-- EXPECT_EQ(2, storage.dictionaries(0).entries_size());
-+ EXPECT_EQ(1, storage.user_dictionary_storage_base.dictionaries_size());
-+ EXPECT_EQ(2, storage.user_dictionary_storage_base.dictionaries(0).entries_size());
- const UserDictionaryStorage::UserDictionaryEntry &entry2 =
-- storage.dictionaries(0).entries(1);
-+ storage.user_dictionary_storage_base.dictionaries(0).entries(1);
- EXPECT_EQ("key2", entry2.key());
- EXPECT_EQ("value2", entry2.value());
- EXPECT_EQ(UserDictionary::NOUN, entry2.pos());
-@@ -474,7 +474,7 @@
- {
- UserDictionaryStorage storage(GetUserDictionaryFile());
- {
-- UserDictionary *dictionary = storage.add_dictionaries();
-+ UserDictionary *dictionary = storage.user_dictionary_storage_base.add_dictionaries();
- dictionary->set_id(kDummyDictionaryId);
- UserDictionary::Entry *entry = dictionary->add_entries();
- entry->set_key("key");
---- /src/dictionary/user_dictionary_test.cc
-+++ /src/dictionary/user_dictionary_test.cc
-@@ -334,9 +334,9 @@
- std::istringstream is(contents);
- CHECK(is.good());
-
-- storage->Clear();
-+ storage->user_dictionary_storage_base.Clear();
- UserDictionaryStorage::UserDictionary *dic
-- = storage->add_dictionaries();
-+ = storage->user_dictionary_storage_base.add_dictionaries();
- CHECK(dic);
-
- string line;
-@@ -389,7 +389,7 @@
- {
- UserDictionaryStorage storage("");
- UserDictionaryTest::LoadFromString(kUserDictionary0, &storage);
-- dic->Load(storage);
-+ dic->Load(storage.user_dictionary_storage_base);
- }
-
- // A normal lookup operation.
-@@ -425,7 +425,7 @@
- {
- UserDictionaryStorage storage("");
- LoadFromString(kUserDictionary1, &storage);
-- dic->Load(storage);
-+ dic->Load(storage.user_dictionary_storage_base);
- }
-
- // A normal lookup again.
-@@ -450,7 +450,7 @@
- {
- UserDictionaryStorage storage("");
- LoadFromString(kUserDictionary0, &storage);
-- dic->Load(storage);
-+ dic->Load(storage.user_dictionary_storage_base);
- }
-
- // A normal lookup operation.
-@@ -480,7 +480,7 @@
- {
- UserDictionaryStorage storage("");
- LoadFromString(kUserDictionary1, &storage);
-- dic->Load(storage);
-+ dic->Load(storage.user_dictionary_storage_base);
- }
-
- // A normal lookup.
-@@ -504,7 +504,7 @@
- {
- UserDictionaryStorage storage("");
- LoadFromString(kUserDictionary0, &storage);
-- dic->Load(storage);
-+ dic->Load(storage.user_dictionary_storage_base);
- }
-
- // A normal lookup operation.
-@@ -540,7 +540,7 @@
- uint64 id = 0;
- EXPECT_TRUE(storage.CreateDictionary("test", &id));
- UserDictionaryStorage::UserDictionary *dic =
-- storage.mutable_dictionaries(0);
-+ storage.user_dictionary_storage_base.mutable_dictionaries(0);
-
- // "名詞"
- UserDictionaryStorage::UserDictionaryEntry *entry =
-@@ -555,7 +555,7 @@
- entry->set_value("suggest_only");
- entry->set_pos(user_dictionary::UserDictionary::SUGGESTION_ONLY);
-
-- user_dic->Load(storage);
-+ user_dic->Load(storage.user_dictionary_storage_base);
- }
-
- // "suggestion_only" should not be looked up.
-@@ -577,7 +577,7 @@
- {
- UserDictionaryStorage storage("");
- UserDictionaryTest::LoadFromString(kUserDictionary0, &storage);
-- dic->Load(storage);
-+ dic->Load(storage.user_dictionary_storage_base);
- }
-
- TestLookupPrefixHelper(nullptr, 0, "start", 4, *dic);
-@@ -612,7 +612,7 @@
- uint64 id = 0;
- EXPECT_TRUE(storage.CreateDictionary("test", &id));
- UserDictionaryStorage::UserDictionary *dic =
-- storage.mutable_dictionaries(0);
-+ storage.user_dictionary_storage_base.mutable_dictionaries(0);
- for (size_t j = 0; j < 10000; ++j) {
- UserDictionaryStorage::UserDictionaryEntry *entry =
- dic->add_entries();
-@@ -681,15 +681,15 @@
- UserDictionaryStorage storage(filename);
- EXPECT_TRUE(storage.Load());
- int index = 0;
-- EXPECT_EQ(1, storage.dictionaries_size());
-- EXPECT_EQ(100, storage.dictionaries(index).entries_size());
-+ EXPECT_EQ(1, storage.user_dictionary_storage_base.dictionaries_size());
-+ EXPECT_EQ(100, storage.user_dictionary_storage_base.dictionaries(index).entries_size());
- for (int i = 0; i < 100; ++i) {
- EXPECT_EQ("key" + std::to_string(i),
-- storage.dictionaries(index).entries(i).key());
-+ storage.user_dictionary_storage_base.dictionaries(index).entries(i).key());
- EXPECT_EQ("value" + std::to_string(i),
-- storage.dictionaries(index).entries(i).value());
-+ storage.user_dictionary_storage_base.dictionaries(index).entries(i).value());
- EXPECT_EQ(user_dictionary::UserDictionary::NOUN,
-- storage.dictionaries(index).entries(i).pos());
-+ storage.user_dictionary_storage_base.dictionaries(index).entries(i).pos());
- }
- }
-
-@@ -722,12 +722,12 @@
- {
- UserDictionaryStorage storage(filename);
- EXPECT_TRUE(storage.Load());
-- EXPECT_EQ(1, storage.dictionaries_size());
-- EXPECT_EQ(1, storage.dictionaries(0).entries_size());
-- EXPECT_EQ("key", storage.dictionaries(0).entries(0).key());
-- EXPECT_EQ("value", storage.dictionaries(0).entries(0).value());
-+ EXPECT_EQ(1, storage.user_dictionary_storage_base.dictionaries_size());
-+ EXPECT_EQ(1, storage.user_dictionary_storage_base.dictionaries(0).entries_size());
-+ EXPECT_EQ("key", storage.user_dictionary_storage_base.dictionaries(0).entries(0).key());
-+ EXPECT_EQ("value", storage.user_dictionary_storage_base.dictionaries(0).entries(0).value());
- EXPECT_EQ(user_dictionary::UserDictionary::NOUN,
-- storage.dictionaries(0).entries(0).pos());
-+ storage.user_dictionary_storage_base.dictionaries(0).entries(0).pos());
- }
- }
-
-@@ -746,7 +746,7 @@
- uint64 id = 0;
- EXPECT_TRUE(storage.CreateDictionary("test", &id));
- UserDictionaryStorage::UserDictionary *dic =
-- storage.mutable_dictionaries(0);
-+ storage.user_dictionary_storage_base.mutable_dictionaries(0);
- for (size_t j = 0; j < 10000; ++j) {
- UserDictionaryStorage::UserDictionaryEntry *entry =
- dic->add_entries();
-@@ -770,7 +770,7 @@
-
- suppression_dictionary_->Lock();
- EXPECT_TRUE(suppression_dictionary_->IsLocked());
-- user_dic->Load(storage);
-+ user_dic->Load(storage.user_dictionary_storage_base);
- EXPECT_FALSE(suppression_dictionary_->IsLocked());
-
- for (size_t j = 0; j < 10; ++j) {
-@@ -782,11 +782,11 @@
-
- // Remove suppression entry
- {
-- storage.Clear();
-+ storage.user_dictionary_storage_base.Clear();
- uint64 id = 0;
- EXPECT_TRUE(storage.CreateDictionary("test", &id));
- UserDictionaryStorage::UserDictionary *dic =
-- storage.mutable_dictionaries(0);
-+ storage.user_dictionary_storage_base.mutable_dictionaries(0);
- for (size_t j = 0; j < 10000; ++j) {
- UserDictionaryStorage::UserDictionaryEntry *entry =
- dic->add_entries();
-@@ -798,7 +798,7 @@
- }
-
- suppression_dictionary_->Lock();
-- user_dic->Load(storage);
-+ user_dic->Load(storage.user_dictionary_storage_base);
- EXPECT_FALSE(suppression_dictionary_->IsLocked());
-
- for (size_t j = 0; j < 10; ++j) {
-@@ -825,7 +825,7 @@
- uint64 id = 0;
- EXPECT_TRUE(storage.CreateDictionary("test", &id));
- UserDictionaryStorage::UserDictionary *dic =
-- storage.mutable_dictionaries(0);
-+ storage.user_dictionary_storage_base.mutable_dictionaries(0);
-
- for (size_t j = 0; j < 10; ++j) {
- UserDictionaryStorage::UserDictionaryEntry *entry =
-@@ -845,7 +845,7 @@
- entry->set_pos(user_dictionary::UserDictionary::SUGGESTION_ONLY);
- }
-
-- user_dic->Load(storage);
-+ user_dic->Load(storage.user_dictionary_storage_base);
- }
-
- {
-@@ -878,7 +878,7 @@
- UserDictionaryStorage storage("");
-
- {
-- UserDictionaryStorage::UserDictionary *dic1 = storage.add_dictionaries();
-+ UserDictionaryStorage::UserDictionary *dic1 = storage.user_dictionary_storage_base.add_dictionaries();
- CHECK(dic1);
- UserDictionaryStorage::UserDictionaryEntry *entry;
- entry = dic1->add_entries();
-@@ -893,7 +893,7 @@
- entry->set_pos(user_dictionary::UserDictionary::NOUN);
- }
- {
-- UserDictionaryStorage::UserDictionary *dic2 = storage.add_dictionaries();
-+ UserDictionaryStorage::UserDictionary *dic2 = storage.user_dictionary_storage_base.add_dictionaries();
- CHECK(dic2);
- UserDictionaryStorage::UserDictionaryEntry *entry;
- entry = dic2->add_entries();
-@@ -912,7 +912,7 @@
- entry->set_value("value5");
- entry->set_pos(user_dictionary::UserDictionary::NOUN);
- }
-- dic->Load(storage);
-+ dic->Load(storage.user_dictionary_storage_base);
-
- EXPECT_INTEGER_STATS("UserRegisteredWord", 5);
- }
-@@ -925,7 +925,7 @@
- {
- UserDictionaryStorage storage("");
- UserDictionaryTest::LoadFromString(kUserDictionary0, &storage);
-- dic->Load(storage);
-+ dic->Load(storage.user_dictionary_storage_base);
- }
-
- // Entry is in user dictionary but has no comment.
---- /src/gui/word_register_dialog/word_register_dialog.cc
-+++ /src/gui/word_register_dialog/word_register_dialog.cc
-@@ -298,7 +298,7 @@
- }
-
- UserDictionary *dic =
-- session_->mutable_storage()->mutable_dictionaries(index);
-+ session_->mutable_storage()->user_dictionary_storage_base.mutable_dictionaries(index);
- CHECK(dic);
-
- if (dic->name() != DictionarycomboBox->currentText().toStdString()) {
---- /src/prediction/user_history_predictor.cc
-+++ /src/prediction/user_history_predictor.cc
-@@ -291,23 +291,23 @@
- return false;
- }
-
-- if (!ParseFromString(input)) {
-+ if (!user_history_base.ParseFromString(input)) {
- LOG(ERROR) << "ParseFromString failed. message looks broken";
- return false;
- }
-
-- VLOG(1) << "Loaded user histroy, size=" << entries_size();
-+ VLOG(1) << "Loaded user histroy, size=" << user_history_base.entries_size();
- return true;
- }
-
- bool UserHistoryStorage::Save() const {
-- if (entries_size() == 0) {
-+ if (user_history_base.entries_size() == 0) {
- LOG(WARNING) << "etries size is 0. Not saved";
- return false;
- }
-
- string output;
-- if (!AppendToString(&output)) {
-+ if (!user_history_base.AppendToString(&output)) {
- LOG(ERROR) << "AppendToString failed";
- return false;
- }
-@@ -494,12 +494,12 @@
- return false;
- }
-
-- for (size_t i = 0; i < history.entries_size(); ++i) {
-- dic_->Insert(EntryFingerprint(history.entries(i)),
-- history.entries(i));
-+ for (size_t i = 0; i < history.user_history_base.entries_size(); ++i) {
-+ dic_->Insert(EntryFingerprint(history.user_history_base.entries(i)),
-+ history.user_history_base.entries(i));
- }
-
-- VLOG(1) << "Loaded user histroy, size=" << history.entries_size();
-+ VLOG(1) << "Loaded user histroy, size=" << history.user_history_base.entries_size();
-
- return true;
- }
-@@ -521,13 +521,13 @@
-
- UserHistoryStorage history(filename);
- for (const DicElement *elm = tail; elm != nullptr; elm = elm->prev) {
-- history.add_entries()->CopyFrom(elm->value);
-+ history.user_history_base.add_entries()->CopyFrom(elm->value);
- }
-
- // Updates usage stats here.
- UsageStats::SetInteger(
- "UserHistoryPredictorEntrySize",
-- static_cast<int>(history.entries_size()));
-+ static_cast<int>(history.user_history_base.entries_size()));
-
- if (!history.Save()) {
- LOG(ERROR) << "UserHistoryStorage::Save() failed";
---- /src/prediction/user_history_predictor.h
-+++ /src/prediction/user_history_predictor.h
-@@ -61,11 +61,15 @@
- class UserHistoryPredictorSyncer;
-
- // Added serialization method for UserHistory.
--class UserHistoryStorage : public mozc::user_history_predictor::UserHistory {
-+class UserHistoryStorage {
- public:
- explicit UserHistoryStorage(const string &filename);
- ~UserHistoryStorage();
-
-+ // Instance of base class generated by Protocol Buffers compiler.
-+ // Regular inheritance strongly discouraged.
-+ mozc::user_history_predictor::UserHistory user_history_base;
-+
- // Loads from encrypted file.
- bool Load();
-
---- /src/prediction/user_history_predictor_test.cc
-+++ /src/prediction/user_history_predictor_test.cc
-@@ -2222,7 +2222,7 @@
-
- UserHistoryStorage storage1(filename);
-
-- UserHistoryPredictor::Entry *entry = storage1.add_entries();
-+ UserHistoryPredictor::Entry *entry = storage1.user_history_base.add_entries();
- CHECK(entry);
- entry->set_key("key");
- entry->set_key("value");
-@@ -2230,7 +2230,7 @@
- UserHistoryStorage storage2(filename);
- storage2.Load();
-
-- EXPECT_EQ(storage1.DebugString(), storage2.DebugString());
-+ EXPECT_EQ(storage1.user_history_base.DebugString(), storage2.user_history_base.DebugString());
- FileUtil::Unlink(filename);
- }
-
---- /src/rewriter/usage_rewriter_test.cc
-+++ /src/rewriter/usage_rewriter_test.cc
-@@ -312,7 +312,7 @@
- // Load mock data
- {
- UserDictionaryStorage storage("");
-- UserDictionaryStorage::UserDictionary *dic = storage.add_dictionaries();
-+ UserDictionaryStorage::UserDictionary *dic = storage.user_dictionary_storage_base.add_dictionaries();
-
- UserDictionaryStorage::UserDictionaryEntry *entry = dic->add_entries();
- entry->set_key("うま");
-@@ -320,7 +320,7 @@
- entry->set_pos(user_dictionary::UserDictionary::NOUN);
- entry->set_comment("アルパカコメント");
-
-- user_dictionary_->Load(storage);
-+ user_dictionary_->Load(storage.user_dictionary_storage_base);
- }
-
- // Emulates the conversion of key="うま".
diff --git a/app-i18n/mozc/mozc-2.23.2815.102.ebuild b/app-i18n/mozc/mozc-2.23.2815.102.ebuild
index 3964c794c42..08be8f8c45a 100644
--- a/app-i18n/mozc/mozc-2.23.2815.102.ebuild
+++ b/app-i18n/mozc/mozc-2.23.2815.102.ebuild
@@ -25,6 +25,7 @@ if [[ "${PV}" == "9999" ]]; then
else
SRC_URI="https://github.com/google/${PN}/archive/${MOZC_GIT_REVISION}.tar.gz -> ${P}.tar.gz
https://github.com/hiroyuki-komatsu/japanese-usage-dictionary/archive/${JAPANESE_USAGE_DICTIONARY_GIT_REVISION}.tar.gz -> japanese-usage-dictionary-${JAPANESE_USAGE_DICTIONARY_DATE}.tar.gz
+ https://dev.gentoo.org/~juippis/distfiles/tmp/mozc-2.23.2815.102-protobuf_generated_classes_no_inheritance.patch
fcitx4? ( https://download.fcitx-im.org/fcitx-mozc/fcitx-mozc-${FCITX_PATCH_VERSION}.patch )"
fi
@@ -111,7 +112,7 @@ src_prepare() {
eapply -p2 "${FILESDIR}/${PN}-2.23.2815.102-python-3_4.patch"
eapply -p2 "${FILESDIR}/${PN}-2.23.2815.102-system_libraries.patch"
eapply -p2 "${FILESDIR}/${PN}-2.23.2815.102-gcc-8.patch"
- eapply -p2 "${FILESDIR}/${PN}-2.23.2815.102-protobuf_generated_classes_no_inheritance.patch"
+ eapply -p2 "${DISTDIR}/${PN}-2.23.2815.102-protobuf_generated_classes_no_inheritance.patch"
eapply -p2 "${FILESDIR}/${PN}-2.23.2815.102-environmental_variables.patch"
eapply -p2 "${FILESDIR}/${PN}-2.23.2815.102-reiwa.patch"
eapply -p2 "${FILESDIR}/${PN}-2.23.2815.102-server_path_check.patch"
diff --git a/app-i18n/mozc/mozc-9999.ebuild b/app-i18n/mozc/mozc-9999.ebuild
index bfc9bcea950..b93a912f62e 100644
--- a/app-i18n/mozc/mozc-9999.ebuild
+++ b/app-i18n/mozc/mozc-9999.ebuild
@@ -25,6 +25,7 @@ if [[ "${PV}" == "9999" ]]; then
else
SRC_URI="https://github.com/google/${PN}/archive/${MOZC_GIT_REVISION}.tar.gz -> ${P}.tar.gz
https://github.com/hiroyuki-komatsu/japanese-usage-dictionary/archive/${JAPANESE_USAGE_DICTIONARY_GIT_REVISION}.tar.gz -> japanese-usage-dictionary-${JAPANESE_USAGE_DICTIONARY_DATE}.tar.gz
+ https://dev.gentoo.org/~juippis/distfiles/tmp/mozc-2.23.2815.102-protobuf_generated_classes_no_inheritance.patch
fcitx4? ( https://download.fcitx-im.org/fcitx-mozc/fcitx-mozc-${FCITX_PATCH_VERSION}.patch )"
fi
@@ -111,7 +112,7 @@ src_prepare() {
eapply -p2 "${FILESDIR}/${PN}-2.23.2815.102-python-3_4.patch"
eapply -p2 "${FILESDIR}/${PN}-2.23.2815.102-system_libraries.patch"
eapply -p2 "${FILESDIR}/${PN}-2.23.2815.102-gcc-8.patch"
- eapply -p2 "${FILESDIR}/${PN}-2.23.2815.102-protobuf_generated_classes_no_inheritance.patch"
+ eapply -p2 "${DISTDIR}/${PN}-2.23.2815.102-protobuf_generated_classes_no_inheritance.patch"
eapply -p2 "${FILESDIR}/${PN}-2.23.2815.102-environmental_variables.patch"
eapply -p2 "${FILESDIR}/${PN}-2.23.2815.102-reiwa.patch"
eapply -p2 "${FILESDIR}/${PN}-2.23.2815.102-server_path_check.patch"
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: app-i18n/mozc/, app-i18n/mozc/files/
@ 2023-08-21 20:15 Sam James
0 siblings, 0 replies; 7+ messages in thread
From: Sam James @ 2023-08-21 20:15 UTC (permalink / raw
To: gentoo-commits
commit: 7ef7e506b561a041e9ae1a66cb0a0a4ba6e009cd
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Mon Aug 21 20:14:53 2023 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Aug 21 20:15:02 2023 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7ef7e506
app-i18n/mozc: fix build w/ new abseil
Closes: https://bugs.gentoo.org/912776
Signed-off-by: Sam James <sam <AT> gentoo.org>
app-i18n/mozc/files/mozc-2.28.5029.102-abseil.patch | 15 +++++++++++++++
app-i18n/mozc/mozc-2.28.5029.102.ebuild | 1 +
2 files changed, 16 insertions(+)
diff --git a/app-i18n/mozc/files/mozc-2.28.5029.102-abseil.patch b/app-i18n/mozc/files/mozc-2.28.5029.102-abseil.patch
new file mode 100644
index 000000000000..08421910d098
--- /dev/null
+++ b/app-i18n/mozc/files/mozc-2.28.5029.102-abseil.patch
@@ -0,0 +1,15 @@
+https://bugs.gentoo.org/912776
+Adapted from https://src.fedoraproject.org/rpms/mozc/raw/aa3cba136c9a28e176d246f450465d3a8a4e8533/f/mozc-build-new-abseil.patch
+--- a/src/base/init_mozc.cc
++++ b/src/base/init_mozc.cc
+@@ -87,7 +87,10 @@ std::string GetLogFilePathFromProgramName(const std::string &program_name) {
+ void ParseCommandLineFlags(int argc, char **argv) {
+ absl::flags_internal::ParseCommandLineImpl(
+ argc, argv,
++ #if defined(ABSL_LTS_RELEASE_VERSION) && ABSL_LTS_RELEASE_VERSION < 20230802
++ // Abseil 20230802.0 does not use ArgvListAction
+ absl::flags_internal::ArgvListAction::kRemoveParsedArgs,
++ #endif
+ // Suppress help messages invoked by --help and others.
+ // Use UsageFlagsAction::kHandleUsage to enable it.
+ absl::flags_internal::UsageFlagsAction::kIgnoreUsage,
diff --git a/app-i18n/mozc/mozc-2.28.5029.102.ebuild b/app-i18n/mozc/mozc-2.28.5029.102.ebuild
index ee6de0134b29..a6790b3d1213 100644
--- a/app-i18n/mozc/mozc-2.28.5029.102.ebuild
+++ b/app-i18n/mozc/mozc-2.28.5029.102.ebuild
@@ -118,6 +118,7 @@ SITEFILE="50${PN}-gentoo.el"
PATCHES=(
"${WORKDIR}"/mozc-2.28.5029.102-patches
+ "${FILESDIR}"/mozc-2.28.5029.102-abseil.patch
)
python_check_deps() {
^ permalink raw reply related [flat|nested] 7+ messages in thread
end of thread, other threads:[~2023-08-21 20:15 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-08-16 17:03 [gentoo-commits] repo/gentoo:master commit in: app-i18n/mozc/, app-i18n/mozc/files/ Mike Gilbert
-- strict thread matches above, loose matches on Subject: below --
2023-08-21 20:15 Sam James
2020-11-15 15:31 Joonas Niilola
2020-01-17 19:09 Mike Gilbert
2018-06-13 14:36 Mike Gilbert
2018-06-13 14:36 Mike Gilbert
2017-09-28 17:18 Mike Gilbert
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox