summaryrefslogtreecommitdiff
path: root/app-i18n/mozc
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2018-07-14 21:03:06 +0100
committerV3n3RiX <venerix@redcorelinux.org>2018-07-14 21:03:06 +0100
commit8376ef56580626e9c0f796d5b85b53a0a1c7d5f5 (patch)
tree7681bbd4e8b05407772df40a4bf04cbbc8afc3fa /app-i18n/mozc
parent30a9caf154332f12ca60756e1b75d2f0e3e1822d (diff)
gentoo resync : 14.07.2018
Diffstat (limited to 'app-i18n/mozc')
-rw-r--r--app-i18n/mozc/Manifest11
-rw-r--r--app-i18n/mozc/files/50mozc-gentoo.el4
-rw-r--r--app-i18n/mozc/files/mozc-2.20.2673.102-tests_build.patch27
-rw-r--r--app-i18n/mozc/files/mozc-2.20.2673.102-tests_skipping.patch70
-rw-r--r--app-i18n/mozc/files/mozc-2.23.2815.102-gcc-8.patch22
-rw-r--r--app-i18n/mozc/files/mozc-2.23.2815.102-system_libraries.patch274
-rw-r--r--app-i18n/mozc/metadata.xml26
-rw-r--r--app-i18n/mozc/mozc-2.23.2815.102.ebuild323
-rw-r--r--app-i18n/mozc/mozc-9999.ebuild322
9 files changed, 1079 insertions, 0 deletions
diff --git a/app-i18n/mozc/Manifest b/app-i18n/mozc/Manifest
new file mode 100644
index 000000000000..4b2844394a75
--- /dev/null
+++ b/app-i18n/mozc/Manifest
@@ -0,0 +1,11 @@
+AUX 50mozc-gentoo.el 121 BLAKE2B 0cad49e4a5a04d1cbdcd063cfd5a06c14bf4bab47890bbc089d8bba9889abb5197bea2cfb912f638052f912d7aca51a7e71b743b4742fd90b9d5ab5a60779fe5 SHA512 2d67a6723374872717ab7132f02f4030f00ddecabb8a1fc20c9d69d64406dc2ba2a1109734378fae7b4718a8ae9601beff4b6f27cb43a280fa2e0f946da70685
+AUX mozc-2.20.2673.102-tests_build.patch 1037 BLAKE2B 8f3c0b3361371a994957a89f5b86020902262de65aef75f82e58fcfcea211b8a8d3c8418898781ac1de2a2c9bdc73ffc4cf68102122a22691d9592d5a02e6c62 SHA512 d99ee7edbb406e123b26ec186933608b42d36193b7bfe67232810c0fbd7a92bd8cfff26dc45eae4f020e82e9a8370cf2033c750250455585b6b3d88cc8c973ef
+AUX mozc-2.20.2673.102-tests_skipping.patch 2086 BLAKE2B a104d6a83b02b49e1208be1b39699b90ad419d8befa29ed0366f7cbc454fe9ce27361f21897a5c74dadfc2d9eb31a30d7237e20db8c1fb205b8e71b40f4a0e57 SHA512 4a2e5a35c5e65ebeb737f656d6efb313c660c2c7cf62abd5d9295fd16e2dffde21d069cd74fd0cfd2454cd7f7c9d136dfbadbf79832db8441c619ff37c7e4b0e
+AUX mozc-2.23.2815.102-gcc-8.patch 496 BLAKE2B 318fcda19cf4f7e95920b5df4f5638621bcae992891941fa6f220d4dac1b2eac0faeda7a857a587baed41b361608f20c4bbda0d9a69a60b823572482c6789f46 SHA512 9c2b0e9695f4cd050f0d5f35d0e23f22715b9c6e5607629c7dc023560a5191bd755497fe6fe5306789c00e68d5bd9b7179d5515c982967788fca432134b71cad
+AUX mozc-2.23.2815.102-system_libraries.patch 9064 BLAKE2B 0cdf732a1bbf16d4af1d6dee81aacf3f3cb1f1c00c6aeb0fc12dac9dcd8611124e388e5fc721eb9b9472e073515d7457b182ee7cfe466b83bf319d572ae55240 SHA512 2d5b06e855f8c1889367b9b672e3ec81a037bc592872e28319e0180a0dcd177cdff817775a1a0f74ebf48e0b7558cf3b67953120411be753c662c43f409b05ce
+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.tar.gz 47739041 BLAKE2B 045a8a4a07e09cf923b67824111cdf672febc30256a6aef951ae779a3f582b3860042750d766120e376898c63be5b4baea870798a192cee34b0d48647e1ec5e6 SHA512 a3face616ca89990bca52371dcc8003604ebe0e9633116a64550add070152b1bc4d9b21e9f102c5afa6f8b1aa11d8dbc4bafbcebfaf4a12a934f085f245d548f
+EBUILD mozc-2.23.2815.102.ebuild 9372 BLAKE2B 41e035e68e63f9306b821d9730fe7a327da3d8371e3b5260854a95e6a6058aeea847ff7dd125c0e2c40810bd270eebee1a473b23dc402419ab8dd8b3af609e91 SHA512 b2941a9bd7433af0ccb07276aac42c8039d605aa323500274eed340057bc692542cfed7dbc9129328b691e7e1919ced561f3194e50e96b0eae131646904c0abc
+EBUILD mozc-9999.ebuild 9212 BLAKE2B 94f5437f7b87ddb8afc9bb8ba5001c1ec416108536cb91a7ad206d85e45a0e4278fc02d3616eba1dd97361595fd2a23d265a1142a3e4d64f333551c10aaf0157 SHA512 a3efe0ce36f0f3bd2453f87005b8923a9123a47272a3b3ee80719da430459e2d35b3c05972b9c44ca611dc8ef4d1ef836e39deff10785f96aeee570217c93c9d
+MISC metadata.xml 1127 BLAKE2B 55c44374c1d0c03845435544fb8bcd254bfa59faa54e773110fe2a9bcfba0f6863a1f5c167e3ca7d2a1108e566ae4d7d4155a1a1994bef006bbde906265fffe1 SHA512 8d1ee79d5e359c746627cc10ddae170088dd1be8a69379f60969e588c0c6141fea80ebcba0183a91e786116e8937c14e76888c9232526244aab584ed4ef27a54
diff --git a/app-i18n/mozc/files/50mozc-gentoo.el b/app-i18n/mozc/files/50mozc-gentoo.el
new file mode 100644
index 000000000000..121c62249eb7
--- /dev/null
+++ b/app-i18n/mozc/files/50mozc-gentoo.el
@@ -0,0 +1,4 @@
+;;; app-i18n/ibus-mozc site-lisp configuration
+
+(add-to-list 'load-path "@SITELISP@")
+(autoload 'mozc-mode "mozc" nil t)
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 000000000000..b8b4477437f8
--- /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 000000000000..28c5486de50d
--- /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/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 000000000000..07514048e7a4
--- /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/files/mozc-2.23.2815.102-system_libraries.patch b/app-i18n/mozc/files/mozc-2.23.2815.102-system_libraries.patch
new file mode 100644
index 000000000000..064b910c7026
--- /dev/null
+++ b/app-i18n/mozc/files/mozc-2.23.2815.102-system_libraries.patch
@@ -0,0 +1,274 @@
+--- /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,66 +53,101 @@
+ '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',
++ ],
++ }],
+ ],
+ }],
+ ],
diff --git a/app-i18n/mozc/metadata.xml b/app-i18n/mozc/metadata.xml
new file mode 100644
index 000000000000..5b85ef8a79d9
--- /dev/null
+++ b/app-i18n/mozc/metadata.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>arfrever.fta@gmail.com</email>
+ <name>Arfrever Frehtes Taifersar Arahesis</name>
+ </maintainer>
+ <maintainer type="project">
+ <email>cjk@gentoo.org</email>
+ <name>Cjk</name>
+ </maintainer>
+ <longdescription lang="en">
+ Mozc is a subset of Google Japanese Input (Google 日本語入力) released in open-source form.
+ </longdescription>
+ <use>
+ <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>
+ </use>
+ <upstream>
+ <remote-id type="github">google/mozc</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/app-i18n/mozc/mozc-2.23.2815.102.ebuild b/app-i18n/mozc/mozc-2.23.2815.102.ebuild
new file mode 100644
index 000000000000..73baeb4cc28b
--- /dev/null
+++ b/app-i18n/mozc/mozc-2.23.2815.102.ebuild
@@ -0,0 +1,323 @@
+# 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="afb03ddfe72dde4cf2409863a3bfea160f7a66d8"
+ JAPANESE_USAGE_DICTIONARY_GIT_REVISION="e5b3425575734c323e1d947009dd74709437b684"
+ JAPANESE_USAGE_DICTIONARY_DATE="20120416091336"
+ FCITX_PATCH_VERSION="2.23.2815.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://gitlab.com/fcitx/mozc.git refs/heads/fcitx
+ git-r3_checkout https://gitlab.com/fcitx/mozc.git "${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.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"
+
+ 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_fcitx=$(usex fcitx4 YES NO))
+ gyp_arguments+=(-D use_fcitx5=NO)
+ 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
+}
diff --git a/app-i18n/mozc/mozc-9999.ebuild b/app-i18n/mozc/mozc-9999.ebuild
new file mode 100644
index 000000000000..b51359f01fb3
--- /dev/null
+++ b/app-i18n/mozc/mozc-9999.ebuild
@@ -0,0 +1,322 @@
+# 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=""
+ JAPANESE_USAGE_DICTIONARY_GIT_REVISION=""
+ JAPANESE_USAGE_DICTIONARY_DATE=""
+ FCITX_PATCH_VERSION=""
+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=""
+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://gitlab.com/fcitx/mozc.git refs/heads/fcitx
+ git-r3_checkout https://gitlab.com/fcitx/mozc.git "${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.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"
+
+ 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_fcitx=$(usex fcitx4 YES NO))
+ 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
+}