public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: app-i18n/mozc/files/, app-i18n/mozc/
@ 2017-10-05 18:57 Mike Gilbert
  0 siblings, 0 replies; 12+ messages in thread
From: Mike Gilbert @ 2017-10-05 18:57 UTC (permalink / raw
  To: gentoo-commits

commit:     2e39fb4302b42981b5eee984cdccc933a44692b1
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Thu Oct  5 18:24:51 2017 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Thu Oct  5 18:57:10 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2e39fb43

app-i18n/mozc: Disable check for jsoncpp.pc with USE="-test".

Bug: https://bugs.gentoo.org/633458

 .../mozc-2.20.2673.102-system_libraries.patch      | 254 +++++++++++++++++----
 app-i18n/mozc/mozc-2.20.2673.102.ebuild            |   2 +
 app-i18n/mozc/mozc-9999.ebuild                     |   2 +
 3 files changed, 210 insertions(+), 48 deletions(-)

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
index dd6e57717d1..2b2828b7999 100644
--- 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
@@ -1,12 +1,26 @@
+--- /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,31 +31,25 @@
+@@ -31,32 +31,57 @@
    'targets': [
      {
        'target_name': 'jsoncpp',
 -      'type': 'static_library',
-+      'type': 'none',
-       'variables': {
+-      'variables': {
 -        'jsoncpp_root': '<(third_party_dir)/jsoncpp',
 -        'jsoncpp_srcs': [
 -          '<(jsoncpp_root)/src/lib_json/json_reader.cpp',
@@ -14,11 +28,61 @@
 -          '<(jsoncpp_root)/src/lib_json/json_writer.cpp',
 -        ],
 -        'jsoncpp_include_dirs': ['<(jsoncpp_root)/include'],
-         'jsoncpp_additional_macros': ['JSON_USE_EXCEPTION=0'],
-       },
+-        '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',
@@ -26,24 +90,14 @@
 -      '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)',
-+          ],
-+        }
-       },
+-      'all_dependent_settings': {
+-        'defines': [
+-          '<@(jsoncpp_additional_macros)',
+-        ],
+-      },
      },
    ],
+ }
 --- /src/net/jsoncpp.h
 +++ /src/net/jsoncpp.h
 @@ -35,7 +35,7 @@
@@ -57,26 +111,32 @@
  
 --- /src/testing/testing.gyp
 +++ /src/testing/testing.gyp
-@@ -53,14 +53,12 @@
+@@ -53,76 +53,111 @@
    '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.
-         ],
+-      '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 @@
-           }],
-         ],
-       },
+-        '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',
@@ -100,34 +160,132 @@
 -      'defines': [
 -        '<@(gtest_defines)',
 -      ],
-       'all_dependent_settings': {
-         'defines': [
-           '<@(gtest_defines)',
-         ],
+-      'all_dependent_settings': {
+-        'defines': [
+-          '<@(gtest_defines)',
+-        ],
 -        'include_dirs': [
 -          '<(gmock_dir)/include',
 -          '<(gtest_dir)/include',
 -        ],
 -      },
--      'conditions': [
+       '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',
++        ['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
index a5b640dac27..017f643d86c 100644
--- a/app-i18n/mozc/mozc-2.20.2673.102.ebuild
+++ b/app-i18n/mozc/mozc-2.20.2673.102.ebuild
@@ -156,7 +156,9 @@ src_configure() {
 		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=1)
 	gyp_arguments+=(-D enable_gtk_renderer=$(usex renderer 1 0))

diff --git a/app-i18n/mozc/mozc-9999.ebuild b/app-i18n/mozc/mozc-9999.ebuild
index 686839da1c0..75b207ea2ec 100644
--- a/app-i18n/mozc/mozc-9999.ebuild
+++ b/app-i18n/mozc/mozc-9999.ebuild
@@ -156,7 +156,9 @@ src_configure() {
 		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=1)
 	gyp_arguments+=(-D enable_gtk_renderer=$(usex renderer 1 0))


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: app-i18n/mozc/files/, app-i18n/mozc/
@ 2017-11-01 20:54 Mike Gilbert
  0 siblings, 0 replies; 12+ messages in thread
From: Mike Gilbert @ 2017-11-01 20:54 UTC (permalink / raw
  To: gentoo-commits

commit:     710a10897f53040823ee971c316aad4ca49ed65e
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Wed Nov  1 12:45:31 2017 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Wed Nov  1 20:54:19 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=710a1089

app-i18n/mozc: Delete old versions (1.10.1390.102-r1, 1.13.1651.102, 2.16.2037.102).

 app-i18n/mozc/Manifest                             |  10 -
 .../files/mozc-1.10.1390.102-drop-Werror.patch     |  12 -
 .../files/mozc-1.13.1651.102-gtk-renderer.patch    |  13 -
 app-i18n/mozc/files/mozc-ibus-1.5.4.patch          | 299 ---------------------
 app-i18n/mozc/metadata.xml                         |   6 +-
 app-i18n/mozc/mozc-1.10.1390.102-r1.ebuild         | 176 ------------
 app-i18n/mozc/mozc-1.13.1651.102.ebuild            | 181 -------------
 app-i18n/mozc/mozc-2.16.2037.102.ebuild            | 230 ----------------
 8 files changed, 2 insertions(+), 925 deletions(-)

diff --git a/app-i18n/mozc/Manifest b/app-i18n/mozc/Manifest
index 03af05380cd..c6ed7c5ef6f 100644
--- a/app-i18n/mozc/Manifest
+++ b/app-i18n/mozc/Manifest
@@ -1,13 +1,3 @@
-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 48624369 SHA256 004cb773d335e7e1075cf20fd9e713f6dcf6d158d75077bcb95358a116ad3cca SHA512 ad7a78b03b29847057625fd5422c03ac8fc5755c5e85c66fd6e80f81be719dd56bf1349a1d745797118deed239641512789687b4f9ffe49bab1bc966385229ae WHIRLPOOL f78140126a950eb28548c6ef8b20ec5599e04ac1de7d22d2b0ba00cc2471d43ec9823996e399f9025cfcbc7b50a3ecdbd3283463acb423b65089f56c96cc88db
-DIST protobuf-2.5.0.tar.bz2 1866763 SHA256 13bfc5ae543cf3aa180ac2485c0bc89495e3ae711fc6fab4f8ffe90dfb4bb677 SHA512 5994b3669808b82fef5c860ecad36358c0767f84acac877e7bfcf722e59d972835a955714149bdd4158fbd1328a51d01397a563991d26475351ee72be48142ee WHIRLPOOL 7e6786e1f20bf253d0e386a95c2bbfe1b443f484d492f97552cadcea62c24461436aa88130e3ff20b4dc9f352c101458cb8c03686f1cc4e6e2133b6e78f5b70d

diff --git a/app-i18n/mozc/files/mozc-1.10.1390.102-drop-Werror.patch b/app-i18n/mozc/files/mozc-1.10.1390.102-drop-Werror.patch
deleted file mode 100644
index e254f38b874..00000000000
--- a/app-i18n/mozc/files/mozc-1.10.1390.102-drop-Werror.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff --git a/gyp/common.gypi b/gyp/common.gypi
-index 6c176ff..3613b1b 100755
---- a/gyp/common.gypi
-+++ b/gyp/common.gypi
-@@ -58,7 +58,6 @@
-     # warning_cflags will be shared with Mac and Linux.
-     'warning_cflags': [
-       '-Wall',
--      '-Werror',
-       '-Wno-char-subscripts',
-       '-Wno-sign-compare',
-       '-Wno-deprecated-declarations',

diff --git a/app-i18n/mozc/files/mozc-1.13.1651.102-gtk-renderer.patch b/app-i18n/mozc/files/mozc-1.13.1651.102-gtk-renderer.patch
deleted file mode 100644
index bff0822a602..00000000000
--- a/app-i18n/mozc/files/mozc-1.13.1651.102-gtk-renderer.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-diff --git a/unix/ibus/mozc_engine.cc b/unix/ibus/mozc_engine.cc
-index e256ea4..534262e 100755
---- a/unix/ibus/mozc_engine.cc
-+++ b/unix/ibus/mozc_engine.cc
-@@ -250,8 +250,6 @@ MozcEngine::MozcEngine()
- #ifdef ENABLE_GTK_RENDERER
-       gtk_candidate_window_handler_(new GtkCandidateWindowHandler(
-           new renderer::RendererClient())),
--#else
--      gtk_candidate_window_handler_(NULL),
- #endif  // ENABLE_GTK_RENDERER
-       ibus_candidate_window_handler_(new IBusCandidateWindowHandler()),
-       preedit_method_(config::Config::ROMAN) {

diff --git a/app-i18n/mozc/files/mozc-ibus-1.5.4.patch b/app-i18n/mozc/files/mozc-ibus-1.5.4.patch
deleted file mode 100644
index 619b1d25150..00000000000
--- a/app-i18n/mozc/files/mozc-ibus-1.5.4.patch
+++ /dev/null
@@ -1,299 +0,0 @@
-Index: engine_interface.h
-===================================================================
---- unix/ibus/engine_interface.h	(revision 177)
-+++ unix/ibus/engine_interface.h	(working copy)
-@@ -106,6 +106,11 @@
-                                  gint y,
-                                  gint w,
-                                  gint h) = 0;
-+
-+  // The interface function for the "set-content-type" signal
-+  virtual void SetContentType(IBusEngine *engine,
-+                              guint purpose,
-+                              guint hints) = 0;
- };
- 
- }  // namespace ibus
-Index: engine_registrar.cc
-===================================================================
---- unix/ibus/engine_registrar.cc	(revision 177)
-+++ unix/ibus/engine_registrar.cc	(working copy)
-@@ -63,7 +63,9 @@
-   engine_class->reset = Reset;
-   engine_class->set_capabilities = SetCapabilities;
-   engine_class->set_cursor_location = SetCursorLocation;
--
-+#if defined(MOZC_ENABLE_IBUS_INPUT_PURPOSE)
-+  engine_class->set_content_type = SetContentType;
-+#endif  // MOZC_ENABLE_IBUS_INPUT_PURPOSE
-   return true;
- }
- 
-@@ -87,6 +89,9 @@
-   engine_class->reset = NULL;
-   engine_class->set_capabilities = NULL;
-   engine_class->set_cursor_location = NULL;
-+#if defined(MOZC_ENABLE_IBUS_INPUT_PURPOSE)
-+  engine_class->set_content_type = NULL;
-+#endif  // MOZC_ENABLE_IBUS_INPUT_PURPOSE
- 
-   mozc::ibus::EngineInterface *previous = g_engine;
-   g_engine = NULL;
-@@ -179,5 +184,12 @@
-   g_engine->SetCursorLocation(engine, x, y, w, h);
- }
- 
-+void EngineRegistrar::SetContentType(
-+    IBusEngine *engine,
-+    guint purpose,
-+    guint hints) {
-+  g_engine->SetContentType(engine, purpose, hints);
-+}
-+
- }  // namespace ibus
- }  // namespace mozc
-Index: engine_registrar.h
-===================================================================
---- unix/ibus/engine_registrar.h	(revision 177)
-+++ unix/ibus/engine_registrar.h	(working copy)
-@@ -84,6 +84,9 @@
-                                 gint y,
-                                 gint w,
-                                 gint h);
-+  static void SetContentType(IBusEngine *engine,
-+                             guint purpose,
-+                             guint hints);
- };
- 
- }  // namespace ibus
-Index: ibus_header.h
-===================================================================
---- unix/ibus/ibus_header.h	(revision 177)
-+++ unix/ibus/ibus_header.h	(working copy)
-@@ -36,5 +36,10 @@
- #error "ibus-mozc now requires IBus>=1.4.1"
- #endif  // libibus (<1.4.1)
- 
-+#if IBUS_CHECK_VERSION(1, 5, 4)
-+#if !defined(MOZC_ENABLE_IBUS_INPUT_PURPOSE)
-+#define MOZC_ENABLE_IBUS_INPUT_PURPOSE
-+#endif  // !MOZC_ENABLE_IBUS_INPUT_PURPOSE
-+#endif  // libibus(>=1.5.4)
- 
- #endif  // MOZC_UNIX_IBUS_IBUS_HEADER_H_
-Index: mozc_engine.cc
-===================================================================
---- unix/ibus/mozc_engine.cc	(revision 177)
-+++ unix/ibus/mozc_engine.cc	(working copy)
-@@ -372,6 +372,7 @@
- 
- void MozcEngine::FocusOut(IBusEngine *engine) {
-   GetCandidateWindowHandler(engine)->Hide(engine);
-+  property_handler_->ResetContentType(engine);
- 
-   // Do not call SubmitSession or RevertSession. Preedit string will commit on
-   // Focus Out event automatically by ibus_engine_update_preedit_text_with_mode
-@@ -397,6 +398,11 @@
-   VLOG(2) << "keyval: " << keyval
-           << ", keycode: " << keycode
-           << ", modifiers: " << modifiers;
-+  if (property_handler_->IsDisabled()) {
-+    // It is each enginze's responsibility for ignoreing keyevents on
-+    // the password field on the locked screen since IBus 1.5.4.
-+    return FALSE;
-+  }
- 
-   // Send current caret location to mozc_server to manage suggest window
-   // position.
-@@ -501,6 +507,18 @@
-   // Do nothing
- }
- 
-+void MozcEngine::SetContentType(IBusEngine *engine,
-+                                guint purpose,
-+                                guint hints) {
-+  const bool prev_disabled =
-+      property_handler_->IsDisabled();
-+  property_handler_->UpdateContentType(engine);
-+  if (!prev_disabled && property_handler_->IsDisabled()) {
-+    // Make sure on-going composition is reverted.
-+    RevertSession(engine);
-+  }
-+}
-+
- GType MozcEngine::GetType() {
-   static GType type = 0;
- 
-Index: mozc_engine.h
-===================================================================
---- unix/ibus/mozc_engine.h	(revision 177)
-+++ unix/ibus/mozc_engine.h	(working copy)
-@@ -99,6 +99,9 @@
-                          gint y,
-                          gint w,
-                          gint h);
-+  void SetContentType(IBusEngine *engine,
-+                      guint purpose,
-+                      guint hints);
- 
-   // Returns the GType which this class represents.
-   static GType GetType();
-Index: property_handler.cc
-===================================================================
---- unix/ibus/property_handler.cc	(revision 177)
-+++ unix/ibus/property_handler.cc	(working copy)
-@@ -61,6 +61,19 @@
- bool IsMozcToolAvailable() {
-   return FileUtil::FileExists(SystemUtil::GetToolPath());
- }
-+
-+bool GetDisabled(IBusEngine *engine) {
-+  bool disabled = false;
-+#if defined(MOZC_ENABLE_IBUS_INPUT_PURPOSE)
-+  guint purpose = IBUS_INPUT_PURPOSE_FREE_FORM;
-+  guint hints = IBUS_INPUT_HINT_NONE;
-+  ibus_engine_get_content_type(engine, &purpose, &hints);
-+  disabled = (purpose == IBUS_INPUT_PURPOSE_PASSWORD ||
-+              purpose == IBUS_INPUT_PURPOSE_PIN);
-+#endif  // MOZC_ENABLE_IBUS_INPUT_PURPOSE
-+  return disabled;
-+}
-+
- }  // namespace
- 
- PropertyHandler::PropertyHandler(MessageTranslatorInterface *translator,
-@@ -71,7 +84,8 @@
-       client_(client),
-       translator_(translator),
-       original_composition_mode_(kMozcEngineInitialCompositionMode),
--      is_activated_(true) {
-+      is_activated_(true),
-+      is_disabled_(false) {
- 
-   AppendCompositionPropertyToPanel();
- #ifndef OS_CHROMEOS
-@@ -105,6 +119,7 @@
- 
- void PropertyHandler::Register(IBusEngine *engine) {
-   ibus_engine_register_properties(engine, prop_root_);
-+  UpdateContentType(engine);
- }
- 
- // TODO(nona): do not use kMozcEngine*** directory.
-@@ -228,8 +243,34 @@
-   ibus_prop_list_append(prop_root_, prop_mozc_tool_);
- }
- 
-+void PropertyHandler::UpdateContentTypeImpl(IBusEngine *engine,
-+                                            bool disabled) {
-+  const bool prev_is_disabled = is_disabled_;
-+  is_disabled_ = disabled;
-+  if (prev_is_disabled == is_disabled_) {
-+    return;
-+  }
-+  const commands::CompositionMode visible_mode = 
-+      (prev_is_disabled && !is_disabled_ && IsActivated())
-+          ? original_composition_mode_ : 
-+            kMozcEnginePropertyIMEOffState->composition_mode;
-+  UpdateCompositionModeIcon(engine, visible_mode);
-+}
-+
-+void PropertyHandler::ResetContentType(IBusEngine *engine) {
-+  UpdateContentTypeImpl(engine, false);
-+}
-+
-+void PropertyHandler::UpdateContentType(IBusEngine *engine) {
-+  UpdateContentTypeImpl(engine, GetDisabled(engine));
-+}
-+
- void PropertyHandler::Update(IBusEngine *engine,
-                              const commands::Output &output) {
-+  if (IsDisabled()) {
-+    return;
-+  }
-+
-   if (output.has_status() &&
-       (output.status().activated() != is_activated_ ||
-        output.status().mode() != original_composition_mode_)) {
-@@ -325,6 +366,10 @@
-                                               const gchar *property_name,
-                                               guint property_state) {
- #ifndef OS_CHROMEOS
-+  if (IsDisabled()) {
-+    return;
-+  }
-+
-   if (prop_mozc_tool_) {
-     for (guint prop_index = 0; ; ++prop_index) {
-       IBusProperty *prop = ibus_prop_list_get(
-@@ -371,9 +416,13 @@
- }
- 
- bool PropertyHandler::IsActivated() const {
--  return is_activated_;
-+  return is_activated_ && !IsDisabled();
- }
- 
-+bool PropertyHandler::IsDisabled() const {
-+  return is_disabled_;
-+}
-+
- commands::CompositionMode PropertyHandler::GetOriginalCompositionMode() const {
-   return original_composition_mode_;
- }
-Index: property_handler.h
-===================================================================
---- unix/ibus/property_handler.h	(revision 177)
-+++ unix/ibus/property_handler.h	(working copy)
-@@ -54,14 +54,19 @@
-   virtual ~PropertyHandler();
- 
-   virtual void Register(IBusEngine *engine);
-+  virtual void ResetContentType(IBusEngine *engine);
-+  virtual void UpdateContentType(IBusEngine *engine);
-   virtual void Update(IBusEngine *engine, const commands::Output &output);
-   virtual void ProcessPropertyActivate(IBusEngine *engine,
-                                        const gchar *property_name,
-                                        guint property_state);
-   virtual bool IsActivated() const;
-+  virtual bool IsDisabled() const;
-   virtual commands::CompositionMode GetOriginalCompositionMode() const;
- 
-  private:
-+  void UpdateContentTypeImpl(IBusEngine *engine, bool disabled);
-+
-   // Appends composition properties into panel
-   void AppendCompositionPropertyToPanel();
-   // Appends tool properties into panel
-@@ -79,6 +84,7 @@
-   scoped_ptr<MessageTranslatorInterface> translator_;
-   commands::CompositionMode original_composition_mode_;
-   bool is_activated_;
-+  bool is_disabled_;
- };
- 
- }  // namespace ibus
-Index: property_handler_interface.h
-===================================================================
---- unix/ibus/property_handler_interface.h	(revision 177)
-+++ unix/ibus/property_handler_interface.h	(working copy)
-@@ -45,6 +45,9 @@
-   // Registers current properties into engine.
-   virtual void Register(IBusEngine *engine) ABSTRACT;
- 
-+  virtual void ResetContentType(IBusEngine *engine) ABSTRACT;
-+  virtual void UpdateContentType(IBusEngine *engine) ABSTRACT;
-+
-   // Update properties.
-   virtual void Update(IBusEngine *engine,
-                       const commands::Output &output) ABSTRACT;
-@@ -55,6 +58,9 @@
-   // Returns if IME is activated or not.
-   virtual bool IsActivated() const ABSTRACT;
- 
-+  // Returns if IME is forcesully disabled, e.g. on a password field.
-+  virtual bool IsDisabled() const ABSTRACT;
-+
-   // Returns original composition mode before.
-   virtual commands::CompositionMode GetOriginalCompositionMode() const ABSTRACT;
- };

diff --git a/app-i18n/mozc/metadata.xml b/app-i18n/mozc/metadata.xml
index f5031cbbd25..5b85ef8a79d 100644
--- a/app-i18n/mozc/metadata.xml
+++ b/app-i18n/mozc/metadata.xml
@@ -10,10 +10,9 @@
 		<name>Cjk</name>
 	</maintainer>
 	<longdescription lang="en">
-Mozc is a Japanese Input Method Editor (IME) designed for multi-platform such as Chromium OS, Windows, Mac and Linux. This open-source project originates from Google Japanese Input.
-</longdescription>
+		Mozc is a subset of Google Japanese Input (Google 日本語入力) released in open-source form.
+	</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>
@@ -22,7 +21,6 @@ Mozc is a Japanese Input Method Editor (IME) designed for multi-platform such as
 		<flag name="renderer">Enable native candidate window</flag>
 	</use>
 	<upstream>
-		<remote-id type="sourceforge">jsoncpp</remote-id>
 		<remote-id type="github">google/mozc</remote-id>
 	</upstream>
 </pkgmetadata>

diff --git a/app-i18n/mozc/mozc-1.10.1390.102-r1.ebuild b/app-i18n/mozc/mozc-1.10.1390.102-r1.ebuild
deleted file mode 100644
index 7aa21965a5f..00000000000
--- a/app-i18n/mozc/mozc-1.10.1390.102-r1.ebuild
+++ /dev/null
@@ -1,176 +0,0 @@
-# Copyright 1999-2017 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI="5"
-PYTHON_COMPAT=( python2_7 )
-inherit elisp-common eutils multilib multiprocessing python-single-r1 toolchain-funcs
-
-DESCRIPTION="The Mozc engine for IBus Framework"
-HOMEPAGE="https://github.com/google/mozc"
-
-PROTOBUF_VER="2.5.0"
-GMOCK_VER="1.6.0"
-GTEST_VER="1.6.0"
-JSONCPP_VER="0.6.0-rc2"
-MOZC_URL="https://mozc.googlecode.com/files/${P}.tar.bz2"
-PROTOBUF_URL="https://protobuf.googlecode.com/files/protobuf-${PROTOBUF_VER}.tar.bz2"
-GMOCK_URL="https://googlemock.googlecode.com/files/gmock-${GMOCK_VER}.zip"
-GTEST_URL="https://googletest.googlecode.com/files/gtest-${GTEST_VER}.zip"
-JSONCPP_URL="mirror://sourceforge/jsoncpp/jsoncpp-src-${JSONCPP_VER}.tar.gz"
-SRC_URI="${MOZC_URL} ${PROTOBUF_URL}
-	test? ( ${GMOCK_URL} ${GTEST_URL} ${JSONCPP_URL} )"
-
-LICENSE="BSD ipadic public-domain unicode"
-SLOT="0"
-KEYWORDS="~amd64 ~x86"
-IUSE="emacs +ibus +qt4 renderer test"
-REQUIRED_USE="${PYTHON_REQUIRED_USE}"
-
-RDEPEND="dev-libs/glib:2
-	dev-libs/openssl:0=
-	x11-libs/libxcb
-	emacs? ( virtual/emacs )
-	ibus? ( >=app-i18n/ibus-1.4.1 )
-	renderer? ( x11-libs/gtk+:2 )
-	qt4? (
-		dev-qt/qtgui:4
-		app-i18n/zinnia
-	)
-	${PYTHON_DEPS}"
-DEPEND="${RDEPEND}
-	virtual/pkgconfig"
-
-BUILDTYPE="${BUILDTYPE:-Release}"
-
-RESTRICT="test"
-
-SITEFILE=50${PN}-gentoo.el
-
-src_unpack() {
-	unpack $(basename ${MOZC_URL})
-
-	cd "${S}"/protobuf
-	unpack $(basename ${PROTOBUF_URL})
-	mv protobuf-${PROTOBUF_VER} files || die
-
-	if use test; then
-		cd "${S}"/third_party
-		unpack $(basename ${GMOCK_URL}) $(basename ${GTEST_URL}) \
-			$(basename ${JSONCPP_URL})
-		mv gmock-${GMOCK_VER} gmock || die
-		mv gtest-${GTEST_VER} gtest || die
-		mv jsoncpp-src-${JSONCPP_VER} jsoncpp || die
-	fi
-}
-
-src_prepare() {
-	epatch "${FILESDIR}"/${P}-drop-Werror.patch
-	epatch "${FILESDIR}"/${PN}-ibus-1.5.4.patch
-	epatch_user
-}
-
-src_configure() {
-	local myconf="--server_dir=/usr/$(get_libdir)/mozc"
-
-	if ! use qt4 ; then
-		myconf+=" --noqt"
-		export GYP_DEFINES="use_libzinnia=0"
-	fi
-
-	if ! use renderer ; then
-		export GYP_DEFINES="${GYP_DEFINES} enable_gtk_renderer=0"
-	fi
-
-	# export GYP_DEFINES="${GYP_DEFINES} use_libprotobuf=1"
-
-	"${PYTHON}" build_mozc.py gyp ${myconf} || die "gyp failed"
-}
-
-src_compile() {
-	tc-export CC CXX AR AS RANLIB LD
-
-	local my_makeopts=$(makeopts_jobs)
-	# This is for a safety. -j without a number, makeopts_jobs returns 999.
-	local myjobs=-j${my_makeopts/999/1}
-
-	local mytarget="server/server.gyp:mozc_server"
-	use emacs && mytarget="${mytarget} unix/emacs/emacs.gyp:mozc_emacs_helper"
-	use ibus && mytarget="${mytarget} unix/ibus/ibus.gyp:ibus_mozc"
-	use renderer && mytarget="${mytarget} renderer/renderer.gyp:mozc_renderer"
-	if use qt4 ; then
-		export QTDIR="${EPREFIX}/usr"
-		mytarget="${mytarget} gui/gui.gyp:mozc_tool"
-	fi
-
-	V=1 "${PYTHON}" build_mozc.py build_tools -c "${BUILDTYPE}" ${myjobs} || die
-	V=1 "${PYTHON}" build_mozc.py build -c "${BUILDTYPE}" ${mytarget} ${myjobs} || die
-
-	if use emacs ; then
-		elisp-compile unix/emacs/*.el || die
-	fi
-}
-
-src_test() {
-	tc-export CC CXX AR AS RANLIB LD
-	V=1 "${PYTHON}" build_mozc.py runtests -c "${BUILDTYPE}" || die
-}
-
-src_install() {
-	if use emacs ; then
-		dobin "out_linux/${BUILDTYPE}/mozc_emacs_helper" || die
-		elisp-install ${PN} unix/emacs/*.{el,elc} || die
-		elisp-site-file-install "${FILESDIR}/${SITEFILE}" ${PN} || die
-	fi
-
-	if use ibus ; then
-		exeinto /usr/libexec || die
-		newexe "out_linux/${BUILDTYPE}/ibus_mozc" ibus-engine-mozc || die
-		insinto /usr/share/ibus/component || die
-		doins "out_linux/${BUILDTYPE}/obj/gen/unix/ibus/mozc.xml" || die
-		insinto /usr/share/ibus-mozc || die
-		(
-			cd data/images/unix
-			newins ime_product_icon_opensource-32.png product_icon.png || die
-			for f in ui-*
-			do
-				newins ${f} ${f/ui-} || die
-			done
-		)
-
-	fi
-
-	exeinto "/usr/$(get_libdir)/mozc" || die
-	doexe "out_linux/${BUILDTYPE}/mozc_server" || die
-
-	if use qt4 ; then
-		exeinto "/usr/$(get_libdir)/mozc" || die
-		doexe "out_linux/${BUILDTYPE}/mozc_tool" || die
-	fi
-
-	if use renderer ; then
-		exeinto "/usr/$(get_libdir)/mozc" || die
-		doexe "out_linux/${BUILDTYPE}/mozc_renderer" || die
-	fi
-}
-
-pkg_postinst() {
-	if use emacs ; then
-		elisp-site-regen
-		elog "You can use mozc-mode via LEIM (Library of Emacs Input Method)."
-		elog "Write the following settings into your init file (~/.emacs.d/init.el"
-		elog "or ~/.emacs) in order to use mozc-mode by default, or you can call"
-		elog "\`set-input-method' and set \"japanese-mozc\" anytime you have loaded"
-		elog "mozc.el"
-		elog
-		elog "  (require 'mozc)"
-		elog "  (set-language-environment \"Japanese\")"
-		elog "  (setq default-input-method \"japanese-mozc\")"
-		elog
-		elog "Having the above settings, just type C-\\ which is bound to"
-		elog "\`toggle-input-method' by default."
-	fi
-}
-
-pkg_postrm() {
-	use emacs && elisp-site-regen
-}

diff --git a/app-i18n/mozc/mozc-1.13.1651.102.ebuild b/app-i18n/mozc/mozc-1.13.1651.102.ebuild
deleted file mode 100644
index 6fa63db9ed9..00000000000
--- a/app-i18n/mozc/mozc-1.13.1651.102.ebuild
+++ /dev/null
@@ -1,181 +0,0 @@
-# Copyright 1999-2017 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI="5"
-PYTHON_COMPAT=( python2_7 )
-inherit elisp-common eutils multilib multiprocessing python-single-r1 toolchain-funcs
-
-DESCRIPTION="The Mozc engine for IBus Framework"
-HOMEPAGE="https://github.com/google/mozc"
-
-PROTOBUF_VER="2.5.0"
-GMOCK_VER="1.6.0"
-GTEST_VER="1.6.0"
-JSONCPP_VER="0.6.0-rc2"
-GYP_DATE="20140602"
-MOZC_URL="https://mozc.googlecode.com/files/${P}.tar.bz2"
-PROTOBUF_URL="https://protobuf.googlecode.com/files/protobuf-${PROTOBUF_VER}.tar.bz2"
-GMOCK_URL="https://googlemock.googlecode.com/files/gmock-${GMOCK_VER}.zip"
-GTEST_URL="https://googletest.googlecode.com/files/gtest-${GTEST_VER}.zip"
-JSONCPP_URL="mirror://sourceforge/jsoncpp/jsoncpp-src-${JSONCPP_VER}.tar.gz"
-GYP_URL="https://dev.gentoo.org/~naota/files/gyp-${GYP_DATE}.tar.bz2"
-SRC_URI="${MOZC_URL} ${PROTOBUF_URL} ${GYP_URL}
-	test? ( ${GMOCK_URL} ${GTEST_URL} ${JSONCPP_URL} )"
-
-LICENSE="BSD ipadic public-domain unicode"
-SLOT="0"
-KEYWORDS="~amd64 ~x86"
-IUSE="emacs +ibus +qt4 renderer test"
-REQUIRED_USE="${PYTHON_REQUIRED_USE}"
-
-RDEPEND="dev-libs/glib:2
-	dev-libs/openssl:0=
-	>=dev-libs/protobuf-2.5.0
-	x11-libs/libxcb
-	emacs? ( virtual/emacs )
-	ibus? ( >=app-i18n/ibus-1.4.1 )
-	renderer? ( x11-libs/gtk+:2 )
-	qt4? (
-		dev-qt/qtgui:4
-		app-i18n/zinnia
-	)
-	${PYTHON_DEPS}"
-DEPEND="${RDEPEND}
-	virtual/pkgconfig"
-
-BUILDTYPE="${BUILDTYPE:-Release}"
-
-RESTRICT="test"
-
-SITEFILE=50${PN}-gentoo.el
-
-src_unpack() {
-	unpack $(basename ${MOZC_URL})
-
-	unpack $(basename ${GYP_URL})
-	mv gyp-${GYP_DATE}/* "${S}"/third_party/gyp || die
-
-	cd "${S}"/protobuf
-	unpack $(basename ${PROTOBUF_URL})
-	mv protobuf-${PROTOBUF_VER} files || die
-
-	if use test; then
-		cd "${S}"/third_party
-		unpack $(basename ${GMOCK_URL}) $(basename ${GTEST_URL}) \
-			$(basename ${JSONCPP_URL})
-		mv gmock-${GMOCK_VER} gmock || die
-		mv gtest-${GTEST_VER} gtest || die
-		mv jsoncpp-src-${JSONCPP_VER} jsoncpp || die
-	fi
-}
-
-src_prepare() {
-	epatch "${FILESDIR}"/${P}-gtk-renderer.patch
-	epatch_user
-}
-
-src_configure() {
-	local myconf="--server_dir=/usr/$(get_libdir)/mozc"
-
-	if ! use qt4 ; then
-		myconf+=" --noqt"
-		export GYP_DEFINES="use_libzinnia=0"
-	fi
-
-	if ! use renderer ; then
-		export GYP_DEFINES="${GYP_DEFINES} enable_gtk_renderer=0"
-	fi
-
-	export GYP_DEFINES="${GYP_DEFINES} use_libprotobuf=1"
-
-	"${PYTHON}" build_mozc.py gyp ${myconf} || die "gyp failed"
-}
-
-src_compile() {
-	tc-export CC CXX AR AS RANLIB LD
-
-	local my_makeopts=$(makeopts_jobs)
-	# This is for a safety. -j without a number, makeopts_jobs returns 999.
-	local myjobs=-j${my_makeopts/999/1}
-
-	local mytarget="server/server.gyp:mozc_server"
-	use emacs && mytarget="${mytarget} unix/emacs/emacs.gyp:mozc_emacs_helper"
-	use ibus && mytarget="${mytarget} unix/ibus/ibus.gyp:ibus_mozc"
-	use renderer && mytarget="${mytarget} renderer/renderer.gyp:mozc_renderer"
-	if use qt4 ; then
-		export QTDIR="${EPREFIX}/usr"
-		mytarget="${mytarget} gui/gui.gyp:mozc_tool"
-	fi
-
-	V=1 "${PYTHON}" build_mozc.py build_tools -c "${BUILDTYPE}" ${myjobs} || die
-	V=1 "${PYTHON}" build_mozc.py build -c "${BUILDTYPE}" ${mytarget} ${myjobs} || die
-
-	if use emacs ; then
-		elisp-compile unix/emacs/*.el || die
-	fi
-}
-
-src_test() {
-	tc-export CC CXX AR AS RANLIB LD
-	V=1 "${PYTHON}" build_mozc.py runtests -c "${BUILDTYPE}" || die
-}
-
-src_install() {
-	if use emacs ; then
-		dobin "out_linux/${BUILDTYPE}/mozc_emacs_helper" || die
-		elisp-install ${PN} unix/emacs/*.{el,elc} || die
-		elisp-site-file-install "${FILESDIR}/${SITEFILE}" ${PN} || die
-	fi
-
-	if use ibus ; then
-		exeinto /usr/$(get_libdir)/ibus-mozc || die
-		newexe "out_linux/${BUILDTYPE}/ibus_mozc" ibus-engine-mozc || die
-		insinto /usr/share/ibus/component || die
-		doins "out_linux/${BUILDTYPE}/obj/gen/unix/ibus/mozc.xml" || die
-		insinto /usr/share/ibus-mozc || die
-		(
-			cd data/images/unix
-			newins ime_product_icon_opensource-32.png product_icon.png || die
-			for f in ui-*
-			do
-				newins ${f} ${f/ui-} || die
-			done
-		)
-
-	fi
-
-	exeinto "/usr/$(get_libdir)/mozc" || die
-	doexe "out_linux/${BUILDTYPE}/mozc_server" || die
-
-	if use qt4 ; then
-		exeinto "/usr/$(get_libdir)/mozc" || die
-		doexe "out_linux/${BUILDTYPE}/mozc_tool" || die
-	fi
-
-	if use renderer ; then
-		exeinto "/usr/$(get_libdir)/mozc" || die
-		doexe "out_linux/${BUILDTYPE}/mozc_renderer" || die
-	fi
-}
-
-pkg_postinst() {
-	if use emacs ; then
-		elisp-site-regen
-		elog "You can use mozc-mode via LEIM (Library of Emacs Input Method)."
-		elog "Write the following settings into your init file (~/.emacs.d/init.el"
-		elog "or ~/.emacs) in order to use mozc-mode by default, or you can call"
-		elog "\`set-input-method' and set \"japanese-mozc\" anytime you have loaded"
-		elog "mozc.el"
-		elog
-		elog "  (require 'mozc)"
-		elog "  (set-language-environment \"Japanese\")"
-		elog "  (setq default-input-method \"japanese-mozc\")"
-		elog
-		elog "Having the above settings, just type C-\\ which is bound to"
-		elog "\`toggle-input-method' by default."
-	fi
-}
-
-pkg_postrm() {
-	use emacs && elisp-site-regen
-}

diff --git a/app-i18n/mozc/mozc-2.16.2037.102.ebuild b/app-i18n/mozc/mozc-2.16.2037.102.ebuild
deleted file mode 100644
index cb43400250d..00000000000
--- a/app-i18n/mozc/mozc-2.16.2037.102.ebuild
+++ /dev/null
@@ -1,230 +0,0 @@
-# Copyright 1999-2017 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI="5"
-PYTHON_COMPAT=( python2_7 )
-PLOCALES="de ja zh_CN zh_TW"
-inherit elisp-common eutils l10n multilib multiprocessing python-single-r1 toolchain-funcs
-
-DESCRIPTION="The Mozc engine for IBus Framework"
-HOMEPAGE="https://github.com/google/mozc"
-
-PROTOBUF_VER="2.5.0"
-GMOCK_VER="1.6.0"
-GTEST_VER="1.6.0"
-JSONCPP_VER="0.6.0-rc2"
-GYP_DATE="20140602"
-JAPANESE_USAGE_DICT_VER="10"
-FCITX_PATCH_VER="2"
-FCITX_PATCH="fcitx-mozc-${PV}.${FCITX_PATCH_VER}.patch"
-MOZC_URL="https://dev.gentoo.org/~naota/files/${P}.tar.bz2"
-PROTOBUF_URL="https://protobuf.googlecode.com/files/protobuf-${PROTOBUF_VER}.tar.bz2"
-GMOCK_URL="https://googlemock.googlecode.com/files/gmock-${GMOCK_VER}.zip"
-GTEST_URL="https://googletest.googlecode.com/files/gtest-${GTEST_VER}.zip"
-JSONCPP_URL="mirror://sourceforge/jsoncpp/jsoncpp-src-${JSONCPP_VER}.tar.gz"
-GYP_URL="https://dev.gentoo.org/~naota/files/gyp-${GYP_DATE}.tar.bz2"
-JAPANESE_USAGE_DICT_URL="https://dev.gentoo.org/~naota/files/japanese-usage-dictionary-${JAPANESE_USAGE_DICT_VER}.tar.bz2"
-FCITX_PATCH_URL="http://download.fcitx-im.org/fcitx-mozc/${FCITX_PATCH}"
-SRC_URI="${MOZC_URL} ${PROTOBUF_URL} ${GYP_URL} ${JAPANESE_USAGE_DICT_URL}
-	fcitx? ( ${FCITX_PATCH_URL} )
-	test? ( ${GMOCK_URL} ${GTEST_URL} ${JSONCPP_URL} )"
-
-LICENSE="BSD ipadic public-domain unicode"
-SLOT="0"
-KEYWORDS="~amd64 ~x86"
-IUSE="emacs fcitx +ibus +qt4 renderer test"
-REQUIRED_USE="${PYTHON_REQUIRED_USE}"
-
-RDEPEND="app-i18n/tegaki-zinnia-japanese
-	dev-libs/glib:2
-	>=dev-libs/protobuf-2.5.0
-	x11-libs/libxcb
-	emacs? ( virtual/emacs )
-	fcitx? ( app-i18n/fcitx )
-	ibus? (
-		>=app-i18n/ibus-1.4.1
-		qt4? ( app-i18n/ibus-qt )
-	)
-	renderer? ( x11-libs/gtk+:2 )
-	qt4? (
-		dev-qt/qtgui:4
-		app-i18n/zinnia
-	)
-	${PYTHON_DEPS}"
-DEPEND="${RDEPEND}
-	dev-util/ninja
-	virtual/pkgconfig"
-
-BUILDTYPE="${BUILDTYPE:-Release}"
-
-RESTRICT="test"
-
-SITEFILE=50${PN}-gentoo.el
-
-src_unpack() {
-	unpack $(basename ${MOZC_URL})
-
-	unpack $(basename ${GYP_URL})
-	unpack $(basename ${JAPANESE_USAGE_DICT_URL})
-	mv gyp-${GYP_DATE} "${S}"/third_party/gyp || die
-	mv japanese-usage-dictionary-${JAPANESE_USAGE_DICT_VER} "${S}"/third_party/japanese_usage_dictionary || die
-
-	cd "${S}"/protobuf
-	unpack $(basename ${PROTOBUF_URL})
-	mv protobuf-${PROTOBUF_VER} files || die
-
-	if use test; then
-		cd "${S}"/third_party
-		unpack $(basename ${GMOCK_URL}) $(basename ${GTEST_URL}) \
-			$(basename ${JSONCPP_URL})
-		mv gmock-${GMOCK_VER} gmock || die
-		mv gtest-${GTEST_VER} gtest || die
-		mv jsoncpp-src-${JSONCPP_VER} jsoncpp || die
-	fi
-}
-
-src_prepare() {
-	# verbose build
-	sed -i -e "/RunOrDie(\[make_command\]/s/build_args/build_args + [\"-v\"]/" \
-		build_mozc.py || die
-	sed -i -e "s/<!(which clang)/$(tc-getCC)/" \
-		-e "s/<!(which clang++)/$(tc-getCXX)/" \
-		gyp/common.gypi || die
-	if use fcitx; then
-		EPATCH_OPTS="-p2" epatch "${DISTDIR}/${FCITX_PATCH}"
-	fi
-	epatch_user
-}
-
-src_configure() {
-	local myconf="--server_dir=/usr/$(get_libdir)/mozc"
-
-	if ! use qt4 ; then
-		myconf+=" --noqt"
-		export GYP_DEFINES="use_libzinnia=0"
-	fi
-
-	if ! use renderer ; then
-		export GYP_DEFINES="${GYP_DEFINES} enable_gtk_renderer=0"
-	fi
-
-	export GYP_DEFINES="${GYP_DEFINES} use_libprotobuf=1 compiler_target=gcc compiler_host=gcc"
-
-	tc-export CC CXX AR AS RANLIB LD NM
-
-	"${PYTHON}" build_mozc.py gyp -v ${myconf} || die "gyp failed"
-}
-
-src_compile() {
-	tc-export CC CXX AR AS RANLIB LD
-
-	local my_makeopts=$(makeopts_jobs)
-	# This is for a safety. -j without a number, makeopts_jobs returns 999.
-	local myjobs=-j${my_makeopts/999/1}
-
-	local mytarget="server/server.gyp:mozc_server"
-	use emacs && mytarget="${mytarget} unix/emacs/emacs.gyp:mozc_emacs_helper"
-	use fcitx && mytarget="${mytarget} unix/fcitx/fcitx.gyp:fcitx-mozc"
-	use ibus && mytarget="${mytarget} unix/ibus/ibus.gyp:ibus_mozc"
-	use renderer && mytarget="${mytarget} renderer/renderer.gyp:mozc_renderer"
-	if use qt4 ; then
-		export QTDIR="${EPREFIX}/usr"
-		mytarget="${mytarget} gui/gui.gyp:mozc_tool"
-	fi
-
-	# V=1 "${PYTHON}" build_mozc.py build_tools -c "${BUILDTYPE}" ${myjobs} || die
-	"${PYTHON}" build_mozc.py build -v -c "${BUILDTYPE}" ${mytarget} ${myjobs} || die
-
-	if use emacs ; then
-		elisp-compile unix/emacs/*.el || die
-	fi
-}
-
-src_test() {
-	tc-export CC CXX AR AS RANLIB LD
-	V=1 "${PYTHON}" build_mozc.py runtests -c "${BUILDTYPE}" || die
-}
-src_install() {
-	install_fcitx_locale() {
-		lang=$1
-		insinto "/usr/share/locale/${lang}/LC_MESSAGES/"
-		newins out_linux/${BUILDTYPE}/gen/unix/fcitx/po/${lang}.mo fcitx-mozc.mo
-	}
-
-	if use emacs ; then
-		dobin "out_linux/${BUILDTYPE}/mozc_emacs_helper" || die
-		elisp-install ${PN} unix/emacs/*.{el,elc} || die
-		elisp-site-file-install "${FILESDIR}/${SITEFILE}" ${PN} || die
-	fi
-
-	if use fcitx; then
-		exeinto /usr/$(get_libdir)/fcitx
-		doexe "out_linux/${BUILDTYPE}/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
-		(
-			cd data/images
-			newins product_icon_32bpp-128.png mozc.png
-			cd unix
-			for f in ui-* ; do
-				newins ${f} mozc-${f/ui-}
-			done
-		)
-		l10n_for_each_locale_do install_fcitx_locale
-	fi
-
-	if use ibus ; then
-		exeinto /usr/$(get_libdir)/ibus-mozc || die
-		newexe "out_linux/${BUILDTYPE}/ibus_mozc" ibus-engine-mozc || die
-		insinto /usr/share/ibus/component || die
-		doins "out_linux/${BUILDTYPE}/gen/unix/ibus/mozc.xml" || die
-		insinto /usr/share/ibus-mozc || die
-		(
-			cd data/images/unix
-			newins ime_product_icon_opensource-32.png product_icon.png || die
-			for f in ui-*
-			do
-				newins ${f} ${f/ui-} || die
-			done
-		)
-
-	fi
-
-	exeinto "/usr/$(get_libdir)/mozc" || die
-	doexe "out_linux/${BUILDTYPE}/mozc_server" || die
-
-	if use qt4 ; then
-		exeinto "/usr/$(get_libdir)/mozc" || die
-		doexe "out_linux/${BUILDTYPE}/mozc_tool" || die
-	fi
-
-	if use renderer ; then
-		exeinto "/usr/$(get_libdir)/mozc" || die
-		doexe "out_linux/${BUILDTYPE}/mozc_renderer" || die
-	fi
-}
-
-pkg_postinst() {
-	if use emacs ; then
-		elisp-site-regen
-		elog "You can use mozc-mode via LEIM (Library of Emacs Input Method)."
-		elog "Write the following settings into your init file (~/.emacs.d/init.el"
-		elog "or ~/.emacs) in order to use mozc-mode by default, or you can call"
-		elog "\`set-input-method' and set \"japanese-mozc\" anytime you have loaded"
-		elog "mozc.el"
-		elog
-		elog "  (require 'mozc)"
-		elog "  (set-language-environment \"Japanese\")"
-		elog "  (setq default-input-method \"japanese-mozc\")"
-		elog
-		elog "Having the above settings, just type C-\\ which is bound to"
-		elog "\`toggle-input-method' by default."
-	fi
-}
-
-pkg_postrm() {
-	use emacs && elisp-site-regen
-}


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: app-i18n/mozc/files/, app-i18n/mozc/
@ 2018-04-16 18:29 Mike Gilbert
  0 siblings, 0 replies; 12+ messages in thread
From: Mike Gilbert @ 2018-04-16 18:29 UTC (permalink / raw
  To: gentoo-commits

commit:     48b27d41776ecb1700b27b35f4b5b248aeae344d
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Mon Apr 16 17:22:04 2018 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Mon Apr 16 18:27:33 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=48b27d41

app-i18n/mozc: Update patch to apply again.

https://github.com/google/mozc/commit/4ed6d8dd06ff640895a2f4a21f2559a4c53936a4

 .../mozc-2.23.2815.102-system_libraries.patch      | 274 +++++++++++++++++++++
 app-i18n/mozc/mozc-9999.ebuild                     |   2 +-
 2 files changed, 275 insertions(+), 1 deletion(-)

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 00000000000..064b910c702
--- /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/mozc-9999.ebuild b/app-i18n/mozc/mozc-9999.ebuild
index 96d3d9bd6f2..e2a00716e05 100644
--- a/app-i18n/mozc/mozc-9999.ebuild
+++ b/app-i18n/mozc/mozc-9999.ebuild
@@ -98,7 +98,7 @@ src_unpack() {
 }
 
 src_prepare() {
-	eapply -p2 "${FILESDIR}/${PN}-2.20.2673.102-system_libraries.patch"
+	eapply -p2 "${FILESDIR}/${PN}-2.23.2815.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"
 


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: app-i18n/mozc/files/, app-i18n/mozc/
@ 2019-05-05 19:05 Mike Gilbert
  0 siblings, 0 replies; 12+ messages in thread
From: Mike Gilbert @ 2019-05-05 19:05 UTC (permalink / raw
  To: gentoo-commits

commit:     cf8c637056d4c4ef0853e469361d252438a54cb6
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Sun May  5 02:19:04 2019 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Sun May  5 19:04:01 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cf8c6370

app-i18n/mozc: Fix building with dev-libs/protobuf future version.

Fixes: https://bugs.gentoo.org/681702
Signed-off-by: Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache.Org>
Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>

 ...protobuf_generated_classes_no_inheritance.patch | 1039 ++++++++++++++++++++
 app-i18n/mozc/mozc-2.23.2815.102.ebuild            |    1 +
 app-i18n/mozc/mozc-9999.ebuild                     |    1 +
 3 files changed, 1041 insertions(+)

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
new file mode 100644
index 00000000000..2cd75728154
--- /dev/null
+++ b/app-i18n/mozc/files/mozc-2.23.2815.102-protobuf_generated_classes_no_inheritance.patch
@@ -0,0 +1,1039 @@
+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 21a1291f1ea..d4572c6e970 100644
--- a/app-i18n/mozc/mozc-2.23.2815.102.ebuild
+++ b/app-i18n/mozc/mozc-2.23.2815.102.ebuild
@@ -106,6 +106,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.23.2815.102-protobuf_generated_classes_no_inheritance.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 7876d9ed378..144d03b4d78 100644
--- a/app-i18n/mozc/mozc-9999.ebuild
+++ b/app-i18n/mozc/mozc-9999.ebuild
@@ -106,6 +106,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.23.2815.102-protobuf_generated_classes_no_inheritance.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] 12+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: app-i18n/mozc/files/, app-i18n/mozc/
@ 2019-12-29 19:33 Mike Gilbert
  0 siblings, 0 replies; 12+ messages in thread
From: Mike Gilbert @ 2019-12-29 19:33 UTC (permalink / raw
  To: gentoo-commits

commit:     fc7858caf393bf3d2c1463c0bf65c61b65bb7cab
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Mon Dec 23 20:35:11 2019 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Sun Dec 29 19:31:31 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fc7858ca

app-i18n/mozc: Fix server path check.

Signed-off-by: Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache.Org>
Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>

 .../mozc-2.23.2815.102-server_path_check.patch     | 95 ++++++++++++++++++++++
 app-i18n/mozc/mozc-2.23.2815.102.ebuild            |  1 +
 app-i18n/mozc/mozc-9999.ebuild                     |  1 +
 3 files changed, 97 insertions(+)

diff --git a/app-i18n/mozc/files/mozc-2.23.2815.102-server_path_check.patch b/app-i18n/mozc/files/mozc-2.23.2815.102-server_path_check.patch
new file mode 100644
index 00000000000..dd606e27fb5
--- /dev/null
+++ b/app-i18n/mozc/files/mozc-2.23.2815.102-server_path_check.patch
@@ -0,0 +1,95 @@
+https://github.com/google/mozc/issues/471
+
+--- /src/ipc/ipc_path_manager.cc
++++ /src/ipc/ipc_path_manager.cc
+@@ -332,9 +332,21 @@
+     return false;
+   }
+ 
++  // Expand symbolic links in the expected server path to avoid false negatives
++  // during comparisons of the expected server path and the actual server path.
++  string real_server_path = server_path;
++#ifndef OS_WIN
++  char real_server_path_[PATH_MAX];
++  if (realpath(server_path.c_str(), real_server_path_) == NULL) {
++    LOG(ERROR) << "realpath failed: " << strerror(errno);
++    return false;
++  }
++  real_server_path = real_server_path_;
++#endif
++
+   // compare path name
+   if (pid == server_pid_) {
+-    return (server_path == server_path_);
++    return (real_server_path == server_path_);
+   }
+ 
+   server_pid_ = 0;
+@@ -344,17 +356,17 @@
+   {
+     std::wstring expected_server_ntpath;
+     const std::map<string, std::wstring>::const_iterator it =
+-        expected_server_ntpath_cache_.find(server_path);
++        expected_server_ntpath_cache_.find(real_server_path);
+     if (it != expected_server_ntpath_cache_.end()) {
+       expected_server_ntpath = it->second;
+     } else {
+       std::wstring wide_server_path;
+-      Util::UTF8ToWide(server_path, &wide_server_path);
++      Util::UTF8ToWide(real_server_path, &wide_server_path);
+       if (WinUtil::GetNtPath(wide_server_path, &expected_server_ntpath)) {
+-        // Caches the relationship from |server_path| to
+-        // |expected_server_ntpath| in case |server_path| is renamed later.
++        // Caches the relationship from |real_server_path| to
++        // |expected_server_ntpath| in case |real_server_path| is renamed later.
+         // (This can happen during the updating).
+-        expected_server_ntpath_cache_[server_path] = expected_server_ntpath;
++        expected_server_ntpath_cache_[real_server_path] = expected_server_ntpath;
+       }
+     }
+ 
+@@ -371,9 +383,9 @@
+       return false;
+     }
+ 
+-    // Here we can safely assume that |server_path| (expected one) should be
++    // Here we can safely assume that |real_server_path| (expected one) should be
+     // the same to |server_path_| (actual one).
+-    server_path_ = server_path;
++    server_path_ = real_server_path;
+     server_pid_ = pid;
+   }
+ #endif  // OS_WIN
+@@ -399,7 +411,7 @@
+ #ifdef OS_LINUX
+   // load from /proc/<pid>/exe
+   char proc[128];
+-  char filename[512];
++  char filename[PATH_MAX];
+   snprintf(proc, sizeof(proc) - 1, "/proc/%u/exe", pid);
+   const ssize_t size = readlink(proc, filename, sizeof(filename) - 1);
+   if (size == -1) {
+@@ -412,18 +424,18 @@
+   server_pid_ = pid;
+ #endif  // OS_LINUX
+ 
+-  VLOG(1) << "server path: " << server_path << " " << server_path_;
+-  if (server_path == server_path_) {
++  VLOG(1) << "server path: " << real_server_path << " " << server_path_;
++  if (real_server_path == server_path_) {
+     return true;
+   }
+ 
+ #ifdef OS_LINUX
+-  if ((server_path + " (deleted)") == server_path_) {
+-    LOG(WARNING) << server_path << " on disk is modified";
++  if ((real_server_path + " (deleted)") == server_path_) {
++    LOG(WARNING) << real_server_path << " on disk is modified";
+     // If a user updates the server binary on disk during the server is running,
+     // "readlink /proc/<pid>/exe" returns a path with the " (deleted)" suffix.
+     // We allow the special case.
+-    server_path_ = server_path;
++    server_path_ = real_server_path;
+     return true;
+   }
+ #endif  // OS_LINUX

diff --git a/app-i18n/mozc/mozc-2.23.2815.102.ebuild b/app-i18n/mozc/mozc-2.23.2815.102.ebuild
index f2300b60324..425b785cbfa 100644
--- a/app-i18n/mozc/mozc-2.23.2815.102.ebuild
+++ b/app-i18n/mozc/mozc-2.23.2815.102.ebuild
@@ -110,6 +110,7 @@ src_prepare() {
 	eapply -p2 "${FILESDIR}/${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"
 	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 f1d9151c265..d7c66b558d9 100644
--- a/app-i18n/mozc/mozc-9999.ebuild
+++ b/app-i18n/mozc/mozc-9999.ebuild
@@ -110,6 +110,7 @@ src_prepare() {
 	eapply -p2 "${FILESDIR}/${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"
 	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] 12+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: app-i18n/mozc/files/, app-i18n/mozc/
@ 2019-12-29 19:33 Mike Gilbert
  0 siblings, 0 replies; 12+ messages in thread
From: Mike Gilbert @ 2019-12-29 19:33 UTC (permalink / raw
  To: gentoo-commits

commit:     e0f9705d877888eeb0615fb586d917f34ff48dd9
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Mon Dec 23 20:31:34 2019 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Sun Dec 29 19:31:29 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e0f9705d

app-i18n/mozc: Support environmental variables.

Signed-off-by: Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache.Org>
Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>

 ...ozc-2.23.2815.102-environmental_variables.patch | 132 +++++++++++++++++++++
 app-i18n/mozc/metadata.xml                         |   4 +-
 app-i18n/mozc/mozc-2.23.2815.102.ebuild            |  36 +++++-
 app-i18n/mozc/mozc-9999.ebuild                     |  36 +++++-
 4 files changed, 198 insertions(+), 10 deletions(-)

diff --git a/app-i18n/mozc/files/mozc-2.23.2815.102-environmental_variables.patch b/app-i18n/mozc/files/mozc-2.23.2815.102-environmental_variables.patch
new file mode 100644
index 00000000000..02e522a32e9
--- /dev/null
+++ b/app-i18n/mozc/files/mozc-2.23.2815.102-environmental_variables.patch
@@ -0,0 +1,132 @@
+https://github.com/google/mozc/issues/470
+
+--- /src/base/system_util.cc
++++ /src/base/system_util.cc
+@@ -208,28 +208,39 @@
+   dir_ = "/";
+   return;
+ #else  // MOZC_USE_PEPPER_FILE_IO
++  const char *configuration_directory_env;
+   string dir;
+ 
+ #ifdef OS_WIN
+-  DCHECK(SUCCEEDED(Singleton<LocalAppDataDirectoryCache>::get()->result()));
+-  dir = Singleton<LocalAppDataDirectoryCache>::get()->path();
++  configuration_directory_env = ::getenv("MOZC_CONFIGURATION_DIRECTORY");
++  if (configuration_directory_env) {
++    dir = configuration_directory_env;
++  } else {
++    DCHECK(SUCCEEDED(Singleton<LocalAppDataDirectoryCache>::get()->result()));
++    dir = Singleton<LocalAppDataDirectoryCache>::get()->path();
+ #ifdef GOOGLE_JAPANESE_INPUT_BUILD
+-  dir = FileUtil::JoinPath(dir, kCompanyNameInEnglish);
+-  FileUtil::CreateDirectory(dir);
++    dir = FileUtil::JoinPath(dir, kCompanyNameInEnglish);
++    FileUtil::CreateDirectory(dir);
+ #endif  // GOOGLE_JAPANESE_INPUT_BUILD
+-  dir = FileUtil::JoinPath(dir, kProductNameInEnglish);
++    dir = FileUtil::JoinPath(dir, kProductNameInEnglish);
++  }
+ 
+ #elif defined(OS_MACOSX)
+-  dir = MacUtil::GetApplicationSupportDirectory();
++  configuration_directory_env = ::getenv("MOZC_CONFIGURATION_DIRECTORY");
++  if (configuration_directory_env) {
++    dir = configuration_directory_env;
++  } else {
++    dir = MacUtil::GetApplicationSupportDirectory();
+ #ifdef GOOGLE_JAPANESE_INPUT_BUILD
+-  dir = FileUtil::JoinPath(dir, "Google");
+-  // The permission of ~/Library/Application Support/Google seems to be 0755.
+-  // TODO(komatsu): nice to make a wrapper function.
+-  ::mkdir(dir.c_str(), 0755);
+-  dir = FileUtil::JoinPath(dir, "JapaneseInput");
++    dir = FileUtil::JoinPath(dir, "Google");
++    // The permission of ~/Library/Application Support/Google seems to be 0755.
++    // TODO(komatsu): nice to make a wrapper function.
++    ::mkdir(dir.c_str(), 0755);
++    dir = FileUtil::JoinPath(dir, "JapaneseInput");
+ #else  //  GOOGLE_JAPANESE_INPUT_BUILD
+-  dir = FileUtil::JoinPath(dir, "Mozc");
++    dir = FileUtil::JoinPath(dir, "Mozc");
+ #endif  //  GOOGLE_JAPANESE_INPUT_BUILD
++  }
+ 
+ #elif defined(OS_ANDROID)
+   // For android, we do nothing here because user profile directory,
+@@ -237,14 +248,24 @@
+   // is injected from Java layer.
+ 
+ #else  // !OS_WIN && !OS_MACOSX && !OS_ANDROID
+-  char buf[1024];
+-  struct passwd pw, *ppw;
+-  const uid_t uid = geteuid();
+-  CHECK_EQ(0, getpwuid_r(uid, &pw, buf, sizeof(buf), &ppw))
+-      << "Can't get passwd entry for uid " << uid << ".";
+-  CHECK_LT(0, strlen(pw.pw_dir))
+-      << "Home directory for uid " << uid << " is not set.";
+-  dir = FileUtil::JoinPath(pw.pw_dir, ".mozc");
++  configuration_directory_env = ::getenv("MOZC_CONFIGURATION_DIRECTORY");
++  if (configuration_directory_env) {
++    dir = configuration_directory_env;
++  } else {
++    const char *home_env = ::getenv("HOME");
++    if (home_env) {
++      dir = FileUtil::JoinPath(home_env, ".mozc");
++    } else {
++      char buf[1024];
++      struct passwd pw, *ppw;
++      const uid_t uid = geteuid();
++      CHECK_EQ(0, getpwuid_r(uid, &pw, buf, sizeof(buf), &ppw))
++          << "Can't get passwd entry for uid " << uid << ".";
++      CHECK_LT(0, strlen(pw.pw_dir))
++          << "Home directory for uid " << uid << " is not set.";
++      dir = FileUtil::JoinPath(pw.pw_dir, ".mozc");
++    }
++  }
+ #endif  // !OS_WIN && !OS_MACOSX && !OS_ANDROID
+ 
+   FileUtil::CreateDirectory(dir);
+@@ -356,6 +377,10 @@
+ #endif  // OS_WIN
+ 
+ string SystemUtil::GetServerDirectory() {
++  const char *server_directory_env = ::getenv("MOZC_SERVER_DIRECTORY");
++  if (server_directory_env) {
++    return server_directory_env;
++  }
+ #ifdef OS_WIN
+   DCHECK(SUCCEEDED(Singleton<ProgramFilesX86Cache>::get()->result()));
+ #if defined(GOOGLE_JAPANESE_INPUT_BUILD)
+@@ -409,6 +434,10 @@
+ }
+ 
+ string SystemUtil::GetDocumentDirectory() {
++  const char *documents_directory_env = ::getenv("MOZC_DOCUMENTS_DIRECTORY");
++  if (documents_directory_env) {
++    return documents_directory_env;
++  }
+ #if defined(OS_MACOSX)
+   return GetServerDirectory();
+ #elif defined(MOZC_DOCUMENT_DIRECTORY)
+--- /src/handwriting/zinnia_handwriting.cc
++++ /src/handwriting/zinnia_handwriting.cc
+@@ -31,6 +31,7 @@
+ 
+ #include "handwriting/zinnia_handwriting.h"
+ 
++#include <cstdlib>
+ #include <memory>
+ #include <string>
+ 
+@@ -48,6 +49,10 @@
+ 
+ // static
+ string ZinniaHandwriting::GetModelFileName() {
++  const char *zinnia_model_file_env = ::getenv("MOZC_ZINNIA_MODEL_FILE");
++  if (zinnia_model_file_env) {
++    return zinnia_model_file_env;
++  }
+ #if defined(MOZC_BUILD)
+   return MOZC_ZINNIA_MODEL_FILE;
+ #else

diff --git a/app-i18n/mozc/metadata.xml b/app-i18n/mozc/metadata.xml
index 5b85ef8a79d..967561182ae 100644
--- a/app-i18n/mozc/metadata.xml
+++ b/app-i18n/mozc/metadata.xml
@@ -15,8 +15,8 @@
 	<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="handwriting-tegaki">Use handwriting recognition model from <pkg>app-i18n/tegaki-zinnia-japanese</pkg> by default</flag>
+		<flag name="handwriting-tomoe">Use handwriting recognition model from <pkg>app-i18n/zinnia-tomoe</pkg> by default</flag>
 		<flag name="ibus">Enable support for <pkg>app-i18n/ibus</pkg></flag>
 		<flag name="renderer">Enable native candidate window</flag>
 	</use>

diff --git a/app-i18n/mozc/mozc-2.23.2815.102.ebuild b/app-i18n/mozc/mozc-2.23.2815.102.ebuild
index d979ec182ec..f2300b60324 100644
--- a/app-i18n/mozc/mozc-2.23.2815.102.ebuild
+++ b/app-i18n/mozc/mozc-2.23.2815.102.ebuild
@@ -44,10 +44,10 @@ BDEPEND="${PYTHON_DEPS}
 	dev-util/gyp
 	dev-util/ninja
 	virtual/pkgconfig
-	emacs? ( >=app-editors/emacs-23.1:* )
+	emacs? ( app-editors/emacs:* )
 	fcitx4? ( sys-devel/gettext )"
 RDEPEND=">=dev-libs/protobuf-3.0.0:=
-	emacs? ( >=app-editors/emacs-23.1:* )
+	emacs? ( app-editors/emacs:* )
 	fcitx4? (
 		app-i18n/fcitx:4
 		virtual/libintl
@@ -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-environmental_variables.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"
@@ -304,9 +305,33 @@ src_install() {
 }
 
 pkg_postinst() {
+	elog
+	elog "ENVIRONMENTAL VARIABLES"
+	elog
+	elog "MOZC_SERVER_DIRECTORY"
+	elog "  Mozc server directory"
+	elog "  Value used by default: \"${EPREFIX}/usr/libexec/mozc\""
+	elog "MOZC_DOCUMENTS_DIRECTORY"
+	elog "  Mozc documents directory"
+	elog "  Value used by default: \"${EPREFIX}/usr/libexec/mozc/documents\""
+	elog "MOZC_CONFIGURATION_DIRECTORY"
+	elog "  Mozc configuration directory"
+	elog "  Value used by default: \"~/.mozc\""
+	if use gui; then
+		elog "MOZC_ZINNIA_MODEL_FILE"
+		elog "  Zinnia handwriting recognition model file"
+		if use handwriting-tegaki; then
+			elog "  Value used by default: \"${EPREFIX}/usr/share/tegaki/models/zinnia/handwriting-ja.model\""
+		elif use handwriting-tomoe; then
+			elog "  Value used by default: \"${EPREFIX}/usr/$(get_libdir)/zinnia/model/tomoe/handwriting-ja.model\""
+		fi
+		elog "  Potential values:"
+		elog "    \"${EPREFIX}/usr/share/tegaki/models/zinnia/handwriting-ja.model\""
+		elog "    \"${EPREFIX}/usr/$(get_libdir)/zinnia/model/tomoe/handwriting-ja.model\""
+	fi
+	elog
 	if use emacs; then
-		elisp-site-regen
-
+		elog
 		elog "USAGE IN EMACS"
 		elog
 		elog "mozc-mode is minor mode to input Japanese text using Mozc server."
@@ -324,6 +349,9 @@ pkg_postinst() {
 		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\"."
+		elog
+
+		elisp-site-regen
 	fi
 }
 

diff --git a/app-i18n/mozc/mozc-9999.ebuild b/app-i18n/mozc/mozc-9999.ebuild
index ceddd8af71a..f1d9151c265 100644
--- a/app-i18n/mozc/mozc-9999.ebuild
+++ b/app-i18n/mozc/mozc-9999.ebuild
@@ -44,10 +44,10 @@ BDEPEND="${PYTHON_DEPS}
 	dev-util/gyp
 	dev-util/ninja
 	virtual/pkgconfig
-	emacs? ( >=app-editors/emacs-23.1:* )
+	emacs? ( app-editors/emacs:* )
 	fcitx4? ( sys-devel/gettext )"
 RDEPEND=">=dev-libs/protobuf-3.0.0:=
-	emacs? ( >=app-editors/emacs-23.1:* )
+	emacs? ( app-editors/emacs:* )
 	fcitx4? (
 		app-i18n/fcitx:4
 		virtual/libintl
@@ -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-environmental_variables.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"
@@ -303,9 +304,33 @@ src_install() {
 }
 
 pkg_postinst() {
+	elog
+	elog "ENVIRONMENTAL VARIABLES"
+	elog
+	elog "MOZC_SERVER_DIRECTORY"
+	elog "  Mozc server directory"
+	elog "  Value used by default: \"${EPREFIX}/usr/libexec/mozc\""
+	elog "MOZC_DOCUMENTS_DIRECTORY"
+	elog "  Mozc documents directory"
+	elog "  Value used by default: \"${EPREFIX}/usr/libexec/mozc/documents\""
+	elog "MOZC_CONFIGURATION_DIRECTORY"
+	elog "  Mozc configuration directory"
+	elog "  Value used by default: \"~/.mozc\""
+	if use gui; then
+		elog "MOZC_ZINNIA_MODEL_FILE"
+		elog "  Zinnia handwriting recognition model file"
+		if use handwriting-tegaki; then
+			elog "  Value used by default: \"${EPREFIX}/usr/share/tegaki/models/zinnia/handwriting-ja.model\""
+		elif use handwriting-tomoe; then
+			elog "  Value used by default: \"${EPREFIX}/usr/$(get_libdir)/zinnia/model/tomoe/handwriting-ja.model\""
+		fi
+		elog "  Potential values:"
+		elog "    \"${EPREFIX}/usr/share/tegaki/models/zinnia/handwriting-ja.model\""
+		elog "    \"${EPREFIX}/usr/$(get_libdir)/zinnia/model/tomoe/handwriting-ja.model\""
+	fi
+	elog
 	if use emacs; then
-		elisp-site-regen
-
+		elog
 		elog "USAGE IN EMACS"
 		elog
 		elog "mozc-mode is minor mode to input Japanese text using Mozc server."
@@ -323,6 +348,9 @@ pkg_postinst() {
 		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\"."
+		elog
+
+		elisp-site-regen
 	fi
 }
 


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: app-i18n/mozc/files/, app-i18n/mozc/
@ 2020-12-27 18:39 Mike Gilbert
  0 siblings, 0 replies; 12+ messages in thread
From: Mike Gilbert @ 2020-12-27 18:39 UTC (permalink / raw
  To: gentoo-commits

commit:     a8d6f62a23fcd36032df86eb2e2093907852124e
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Thu Dec 24 00:00:00 2020 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Sun Dec 27 18:39:09 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a8d6f62a

app-i18n/mozc: Version bump (2.26.4220_p20201212102434_p20201219202429).

Signed-off-by: Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache.Org>
Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>

 app-i18n/mozc/Manifest                             |   3 +
 .../mozc-2.26.4220-environmental_variables.patch   |  89 +++++
 .../files/mozc-2.26.4220-server_path_check.patch   |  95 +++++
 .../files/mozc-2.26.4220-system_abseil-cpp.patch   | 407 +++++++++++++++++++++
 .../mozc/files/mozc-2.26.4220-system_gtest.patch   | 141 +++++++
 .../mozc/files/mozc-2.26.4220-system_jsoncpp.patch | 117 ++++++
 ...26.4220_p20201212102434_p20201219202429.ebuild} | 145 ++++----
 app-i18n/mozc/mozc-9999.ebuild                     | 137 +++----
 8 files changed, 1006 insertions(+), 128 deletions(-)

diff --git a/app-i18n/mozc/Manifest b/app-i18n/mozc/Manifest
index 72d8dc73f38..c9793aee241 100644
--- a/app-i18n/mozc/Manifest
+++ b/app-i18n/mozc/Manifest
@@ -1,4 +1,7 @@
 DIST fcitx-mozc-2.23.2815.102.1.patch 295112 BLAKE2B 709b84f6eaed16da38a173f40ae7cccff362fd167e6deb4090ae8a9ec522ac8e11ccff3c9ef6433907249af8c9eb4b7be12d2c05564cabd45c25e26764286ed3 SHA512 e0d4645df919838f0fe31a97bf6dd759c222a696f68133f7584d2c771f70734ea634a25bebb03a756221000d3552423207ee5163d75778dbf480b6e267ba4cd0
+DIST fcitx-mozc-2.26.4220-20201219202429.tar.gz 37174759 BLAKE2B 3f320523103ee7a35a763f6613889e282e8a654db8ef11b5a1168db12611387e300621f015977875ffec3c10c055e36b3cb525a1e8559013f3ac42bc5b0cc296 SHA512 823e64267aa69e4d30dd7408f946a54072994f9a2d68691a3d393b216a15e70fd28bcb24705f9d9f483a2291517c48c5a1aeda893d2315f9a1d9cd352fb3feb2
 DIST japanese-usage-dictionary-20120416091336.tar.gz 71051 BLAKE2B 08eecf0aa021e27a2813f58c2d37f1cec760448f6ae086ae7468b8a11575c6ef9f72f656cb4d53e0179b8a7b00f2d91ff51a0ad7825e078dcbac0810f1d8b3e1 SHA512 b7e997a979b6d50e49b9af5dc830ea4df0532f6ab1321b9ef14983f65bb54f1b2967375c82e07957ae7693ebbf43c9b56ecea6bfea8dd1fdaee444bd549d83a7
+DIST japanese-usage-dictionary-20180701040110.tar.gz 71285 BLAKE2B dfad056a1d5061b6764f583da15b9ad60a3c4421cee0430c4665d1c2779a64f9b31473c1746a3e2b9bda5167349432e51dcf7d4d48f75fde9543e9c16ff74c0d SHA512 68b4d3f52dd6cd4f00a8012a870b4f5929519cd69815b1729f3881d1f964802308f4aa101e236824b4c0f832183a9e8097437ed620403f2a652f126e7cdc1eb3
 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
+DIST mozc-2.26.4220-20201212102434.tar.gz 37106063 BLAKE2B 7d3c236809c8feb017f35e3f7a9b024ac34204f483c69913a2d1ae6b771054548f7f81afde35ed3a6887c9f7503584cee0fc646653fc7cde6fd015158de9c3d3 SHA512 9d87947b9b9256a3cc66cb23ab6caf4b6974142090b0d315c101bdc700fd289c259d09cb7f02f5f9e7462f48d652cd2d5b4822a645751fdcaed88b939520c429

diff --git a/app-i18n/mozc/files/mozc-2.26.4220-environmental_variables.patch b/app-i18n/mozc/files/mozc-2.26.4220-environmental_variables.patch
new file mode 100644
index 00000000000..dccdff76f15
--- /dev/null
+++ b/app-i18n/mozc/files/mozc-2.26.4220-environmental_variables.patch
@@ -0,0 +1,89 @@
+https://github.com/google/mozc/issues/470
+
+--- /src/base/system_util.cc
++++ /src/base/system_util.cc
+@@ -226,6 +226,11 @@
+ 
+ std::string UserProfileDirectoryImpl::GetUserProfileDirectory() const {
+ #if defined(OS_CHROMEOS)
++  const char *configuration_directory_env = Environ::GetEnv("MOZC_CONFIGURATION_DIRECTORY");
++  if (configuration_directory_env) {
++    return configuration_directory_env;
++  }
++
+   // TODO(toka): Must use passed in user profile dir which passed in. If mojo
+   // platform the user profile is determined on runtime.
+   // It's hack, the user profile dir should be passed in. Although the value in
+@@ -245,13 +250,23 @@
+ #elif defined(OS_IOS)
+   // OS_IOS block must be placed before __APPLE__ because both macros are
+   // currently defined on iOS.
+-  //
++
++  const char *configuration_directory_env = Environ::GetEnv("MOZC_CONFIGURATION_DIRECTORY");
++  if (configuration_directory_env) {
++    return configuration_directory_env;
++  }
++
+   // On iOS, use Caches directory instead of Application Spport directory
+   // because the support directory doesn't exist by default.  Also, it is backed
+   // up by iTunes and iCloud.
+   return FileUtil::JoinPath({MacUtil::GetCachesDirectory(), kProductPrefix});
+ 
+ #elif defined(OS_WIN)
++  const char *configuration_directory_env = Environ::GetEnv("MOZC_CONFIGURATION_DIRECTORY");
++  if (configuration_directory_env) {
++    return configuration_directory_env;
++  }
++
+   DCHECK(SUCCEEDED(Singleton<LocalAppDataDirectoryCache>::get()->result()));
+   std::string dir = Singleton<LocalAppDataDirectoryCache>::get()->path();
+ 
+@@ -263,6 +278,11 @@
+ 
+ 
+ #elif defined(__APPLE__)
++  const char *configuration_directory_env = Environ::GetEnv("MOZC_CONFIGURATION_DIRECTORY");
++  if (configuration_directory_env) {
++    return configuration_directory_env;
++  }
++
+   std::string dir = MacUtil::GetApplicationSupportDirectory();
+ # ifdef GOOGLE_JAPANESE_INPUT_BUILD
+   dir = FileUtil::JoinPath(dir, "Google");
+@@ -276,6 +296,11 @@
+ 
+ 
+ #elif defined(OS_LINUX)
++  const char *configuration_directory_env = Environ::GetEnv("MOZC_CONFIGURATION_DIRECTORY");
++  if (configuration_directory_env) {
++    return configuration_directory_env;
++  }
++
+   // 1. If "$HOME/.mozc" already exists,
+   //    use "$HOME/.mozc" for backward compatibility.
+   // 2. If $XDG_CONFIG_HOME is defined
+@@ -395,6 +420,11 @@
+ #endif  // OS_WIN
+ 
+ std::string SystemUtil::GetServerDirectory() {
++  const char *server_directory_env = Environ::GetEnv("MOZC_SERVER_DIRECTORY");
++  if (server_directory_env) {
++    return server_directory_env;
++  }
++
+ #ifdef OS_WIN
+   DCHECK(SUCCEEDED(Singleton<ProgramFilesX86Cache>::get()->result()));
+ # if defined(GOOGLE_JAPANESE_INPUT_BUILD)
+@@ -453,6 +483,11 @@
+ }
+ 
+ std::string SystemUtil::GetDocumentDirectory() {
++  const char *documents_directory_env = Environ::GetEnv("MOZC_DOCUMENTS_DIRECTORY");
++  if (documents_directory_env) {
++    return documents_directory_env;
++  }
++
+ #if defined(__APPLE__)
+   return GetServerDirectory();
+ #elif defined(MOZC_DOCUMENT_DIRECTORY)

diff --git a/app-i18n/mozc/files/mozc-2.26.4220-server_path_check.patch b/app-i18n/mozc/files/mozc-2.26.4220-server_path_check.patch
new file mode 100644
index 00000000000..8dbabeac003
--- /dev/null
+++ b/app-i18n/mozc/files/mozc-2.26.4220-server_path_check.patch
@@ -0,0 +1,95 @@
+https://github.com/google/mozc/issues/471
+
+--- /src/ipc/ipc_path_manager.cc
++++ /src/ipc/ipc_path_manager.cc
+@@ -340,9 +340,21 @@
+     return false;
+   }
+ 
++  // Expand symbolic links in the expected server path to avoid false negatives
++  // during comparisons of the expected server path and the actual server path.
++  string real_server_path = server_path;
++#ifndef OS_WIN
++  char real_server_path_[PATH_MAX];
++  if (realpath(server_path.c_str(), real_server_path_) == NULL) {
++    LOG(ERROR) << "realpath failed: " << strerror(errno);
++    return false;
++  }
++  real_server_path = real_server_path_;
++#endif
++
+   // compare path name
+   if (pid == server_pid_) {
+-    return (server_path == server_path_);
++    return (real_server_path == server_path_);
+   }
+ 
+   server_pid_ = 0;
+@@ -352,17 +364,17 @@
+   {
+     std::wstring expected_server_ntpath;
+     const std::map<string, std::wstring>::const_iterator it =
+-        expected_server_ntpath_cache_.find(server_path);
++        expected_server_ntpath_cache_.find(real_server_path);
+     if (it != expected_server_ntpath_cache_.end()) {
+       expected_server_ntpath = it->second;
+     } else {
+       std::wstring wide_server_path;
+-      Util::UTF8ToWide(server_path, &wide_server_path);
++      Util::UTF8ToWide(real_server_path, &wide_server_path);
+       if (WinUtil::GetNtPath(wide_server_path, &expected_server_ntpath)) {
+-        // Caches the relationship from |server_path| to
+-        // |expected_server_ntpath| in case |server_path| is renamed later.
++        // Caches the relationship from |real_server_path| to
++        // |expected_server_ntpath| in case |real_server_path| is renamed later.
+         // (This can happen during the updating).
+-        expected_server_ntpath_cache_[server_path] = expected_server_ntpath;
++        expected_server_ntpath_cache_[real_server_path] = expected_server_ntpath;
+       }
+     }
+ 
+@@ -379,9 +391,9 @@
+       return false;
+     }
+ 
+-    // Here we can safely assume that |server_path| (expected one) should be
++    // Here we can safely assume that |real_server_path| (expected one) should be
+     // the same to |server_path_| (actual one).
+-    server_path_ = server_path;
++    server_path_ = real_server_path;
+     server_pid_ = pid;
+   }
+ #endif  // OS_WIN
+@@ -406,7 +418,7 @@
+ #ifdef OS_LINUX
+   // load from /proc/<pid>/exe
+   char proc[128];
+-  char filename[512];
++  char filename[PATH_MAX];
+   absl::SNPrintF(proc, sizeof(proc) - 1, "/proc/%u/exe", pid);
+   const ssize_t size = readlink(proc, filename, sizeof(filename) - 1);
+   if (size == -1) {
+@@ -419,18 +431,18 @@
+   server_pid_ = pid;
+ #endif  // OS_LINUX
+ 
+-  VLOG(1) << "server path: " << server_path << " " << server_path_;
+-  if (server_path == server_path_) {
++  VLOG(1) << "server path: " << real_server_path << " " << server_path_;
++  if (real_server_path == server_path_) {
+     return true;
+   }
+ 
+ #ifdef OS_LINUX
+-  if ((server_path + " (deleted)") == server_path_) {
+-    LOG(WARNING) << server_path << " on disk is modified";
++  if ((real_server_path + " (deleted)") == server_path_) {
++    LOG(WARNING) << real_server_path << " on disk is modified";
+     // If a user updates the server binary on disk during the server is running,
+     // "readlink /proc/<pid>/exe" returns a path with the " (deleted)" suffix.
+     // We allow the special case.
+-    server_path_ = server_path;
++    server_path_ = real_server_path;
+     return true;
+   }
+ #endif  // OS_LINUX

diff --git a/app-i18n/mozc/files/mozc-2.26.4220-system_abseil-cpp.patch b/app-i18n/mozc/files/mozc-2.26.4220-system_abseil-cpp.patch
new file mode 100644
index 00000000000..33f72b8f7a6
--- /dev/null
+++ b/app-i18n/mozc/files/mozc-2.26.4220-system_abseil-cpp.patch
@@ -0,0 +1,407 @@
+https://github.com/google/mozc/issues/490
+
+--- /src/base/absl.gyp
++++ /src/base/absl.gyp
+@@ -28,119 +28,209 @@
+ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ 
+ {
+-  'variables': {
+-    'absl_srcdir': '<(DEPTH)/third_party/abseil-cpp/absl',
+-    'gen_absl_dir': '<(SHARED_INTERMEDIATE_DIR)/third_party/abseil-cpp/absl',
+-  },
++  'conditions': [
++    ['use_system_abseil_cpp==0', {
++      'variables': {
++        'absl_srcdir': '<(DEPTH)/third_party/abseil-cpp/absl',
++        'gen_absl_dir': '<(SHARED_INTERMEDIATE_DIR)/third_party/abseil-cpp/absl',
++      },
++    }],
++  ],
+   'targets': [
+     {
+       'target_name': 'absl_base',
+-      'type': 'static_library',
+       'toolsets': ['host', 'target'],
+-      'sources': [
+-        '<(absl_srcdir)/base/internal/cycleclock.cc',
+-        '<(absl_srcdir)/base/internal/low_level_alloc.cc',
+-        '<(absl_srcdir)/base/internal/raw_logging.cc',
+-        '<(absl_srcdir)/base/internal/spinlock.cc',
+-        '<(absl_srcdir)/base/internal/spinlock_wait.cc',
+-        '<(absl_srcdir)/base/internal/sysinfo.cc',
+-        '<(absl_srcdir)/base/internal/thread_identity.cc',
+-        '<(absl_srcdir)/base/internal/throw_delegate.cc',
+-        '<(absl_srcdir)/base/internal/unscaledcycleclock.cc',
+-        '<(absl_srcdir)/container/internal/raw_hash_set.cc',
+-        '<(absl_srcdir)/hash/internal/city.cc',
+-        '<(absl_srcdir)/hash/internal/hash.cc',
+-      ],
+-      'msvs_disabled_warnings': [
+-        # 'type' : forcing value to bool 'true' or 'false'
+-        # (performance warning)
+-        # http://msdn.microsoft.com/en-us/library/b6801kcy.aspx
+-        '4800',
++      'conditions': [
++        ['use_system_abseil_cpp==1', {
++          'type': 'none',
++          'all_dependent_settings': {
++            'link_settings': {
++              'libraries': [
++                '-labsl_base -labsl_city -labsl_hash -labsl_malloc_internal -labsl_raw_hash_set -labsl_raw_logging_internal -labsl_spinlock_wait -labsl_throw_delegate',
++              ],
++            },
++          },
++        }, {
++          'type': 'static_library',
++          'sources': [
++            # libabsl_base
++            '<(absl_srcdir)/base/internal/cycleclock.cc',
++            # libabsl_malloc_internal
++            '<(absl_srcdir)/base/internal/low_level_alloc.cc',
++            # libabsl_raw_logging_internal
++            '<(absl_srcdir)/base/internal/raw_logging.cc',
++            # libabsl_base
++            '<(absl_srcdir)/base/internal/spinlock.cc',
++            # libabsl_spinlock_wait
++            '<(absl_srcdir)/base/internal/spinlock_wait.cc',
++            # libabsl_base
++            '<(absl_srcdir)/base/internal/sysinfo.cc',
++            '<(absl_srcdir)/base/internal/thread_identity.cc',
++            # libabsl_throw_delegate
++            '<(absl_srcdir)/base/internal/throw_delegate.cc',
++            # libabsl_base
++            '<(absl_srcdir)/base/internal/unscaledcycleclock.cc',
++            # libabsl_raw_hash_set
++            '<(absl_srcdir)/container/internal/raw_hash_set.cc',
++            # libabsl_city
++            '<(absl_srcdir)/hash/internal/city.cc',
++            # libabsl_hash
++            '<(absl_srcdir)/hash/internal/hash.cc',
++          ],
++          'msvs_disabled_warnings': [
++            # 'type' : forcing value to bool 'true' or 'false'
++            # (performance warning)
++            # http://msdn.microsoft.com/en-us/library/b6801kcy.aspx
++            '4800',
++          ],
++        }],
+       ],
+     },
+     {
+       'target_name': 'absl_numeric',
+-      'type': 'static_library',
+       'toolsets': ['host', 'target'],
+-      'sources': [
+-        '<(absl_srcdir)/numeric/int128.cc',
+-      ],
+-      'dependencies': [
+-        'absl_base',
++      'conditions': [
++        ['use_system_abseil_cpp==1', {
++          'type': 'none',
++          'all_dependent_settings': {
++            'link_settings': {
++              'libraries': [
++                '-labsl_int128',
++              ],
++            },
++          },
++        }, {
++          'type': 'static_library',
++          'sources': [
++            # libabsl_int128
++            '<(absl_srcdir)/numeric/int128.cc',
++          ],
++          'dependencies': [
++            'absl_base',
++          ],
++        }],
+       ],
+     },
+     {
+       'target_name': 'absl_strings_internal',
+-      'type': 'static_library',
+       'toolsets': ['host', 'target'],
+-      'sources': [
+-        '<(absl_srcdir)/strings/internal/charconv_bigint.cc',
+-        '<(absl_srcdir)/strings/internal/charconv_parse.cc',
+-        '<(absl_srcdir)/strings/internal/escaping.cc',
+-        '<(absl_srcdir)/strings/internal/memutil.cc',
+-        '<(absl_srcdir)/strings/internal/str_format/arg.cc',
+-        '<(absl_srcdir)/strings/internal/str_format/bind.cc',
+-        '<(absl_srcdir)/strings/internal/str_format/extension.cc',
+-        '<(absl_srcdir)/strings/internal/str_format/float_conversion.cc',
+-        '<(absl_srcdir)/strings/internal/str_format/output.cc',
+-        '<(absl_srcdir)/strings/internal/str_format/parser.cc',
+-        '<(absl_srcdir)/strings/internal/utf8.cc',
+-      ],
+-      'dependencies': [
+-        'absl_base',
+-        'absl_numeric',
++      'conditions': [
++        ['use_system_abseil_cpp==1', {
++          'type': 'none',
++          'all_dependent_settings': {
++            'link_settings': {
++              'libraries': [
++                '-labsl_strings_internal',
++              ],
++            },
++          },
++        }, {
++          'type': 'static_library',
++          'sources': [
++            # libabsl_strings
++            '<(absl_srcdir)/strings/internal/charconv_bigint.cc',
++            '<(absl_srcdir)/strings/internal/charconv_parse.cc',
++            # libabsl_strings_internal
++            '<(absl_srcdir)/strings/internal/escaping.cc',
++            # libabsl_strings
++            '<(absl_srcdir)/strings/internal/memutil.cc',
++            # libabsl_str_format_internal
++            '<(absl_srcdir)/strings/internal/str_format/arg.cc',
++            '<(absl_srcdir)/strings/internal/str_format/bind.cc',
++            '<(absl_srcdir)/strings/internal/str_format/extension.cc',
++            '<(absl_srcdir)/strings/internal/str_format/float_conversion.cc',
++            '<(absl_srcdir)/strings/internal/str_format/output.cc',
++            '<(absl_srcdir)/strings/internal/str_format/parser.cc',
++            # libabsl_strings_internal
++            '<(absl_srcdir)/strings/internal/utf8.cc',
++          ],
++          'dependencies': [
++            'absl_base',
++            'absl_numeric',
++          ],
++        }],
+       ],
+     },
+     {
+       'target_name': 'absl_strings',
+-      'type': 'static_library',
+       'toolsets': ['host', 'target'],
+-      'sources': [
+-        '<(absl_srcdir)/strings/ascii.cc',
+-        '<(absl_srcdir)/strings/charconv.cc',
+-        '<(absl_srcdir)/strings/escaping.cc',
+-        '<(absl_srcdir)/strings/match.cc',
+-        '<(absl_srcdir)/strings/numbers.cc',
+-        '<(absl_srcdir)/strings/str_cat.cc',
+-        '<(absl_srcdir)/strings/str_replace.cc',
+-        '<(absl_srcdir)/strings/str_split.cc',
+-        '<(absl_srcdir)/strings/string_view.cc',
+-        '<(absl_srcdir)/strings/substitute.cc',
+-      ],
+-      'dependencies': [
+-        'absl_base',
+-        'absl_numeric',
+-        'absl_strings_internal',
++      'conditions': [
++        ['use_system_abseil_cpp==1', {
++          'type': 'none',
++          'all_dependent_settings': {
++            'link_settings': {
++              'libraries': [
++                '-labsl_str_format_internal -labsl_strings -labsl_strings_internal',
++              ],
++            },
++          },
++        }, {
++          'type': 'static_library',
++          'sources': [
++            # libabsl_strings
++            '<(absl_srcdir)/strings/ascii.cc',
++            '<(absl_srcdir)/strings/charconv.cc',
++            '<(absl_srcdir)/strings/escaping.cc',
++            '<(absl_srcdir)/strings/match.cc',
++            '<(absl_srcdir)/strings/numbers.cc',
++            '<(absl_srcdir)/strings/str_cat.cc',
++            '<(absl_srcdir)/strings/str_replace.cc',
++            '<(absl_srcdir)/strings/str_split.cc',
++            '<(absl_srcdir)/strings/string_view.cc',
++            '<(absl_srcdir)/strings/substitute.cc',
++          ],
++          'dependencies': [
++            'absl_base',
++            'absl_numeric',
++            'absl_strings_internal',
++          ],
++        }],
+       ],
+     },
+     {
+       'target_name': 'absl_time',
+-      'type': 'static_library',
+       'toolsets': ['host', 'target'],
+-      'sources': [
+-        '<(absl_srcdir)/time/civil_time.cc',
+-        '<(absl_srcdir)/time/clock.cc',
+-        '<(absl_srcdir)/time/duration.cc',
+-        '<(absl_srcdir)/time/format.cc',
+-        '<(absl_srcdir)/time/time.cc',
+-        '<(absl_srcdir)/time/internal/cctz/src/civil_time_detail.cc',
+-        '<(absl_srcdir)/time/internal/cctz/src/time_zone_fixed.cc',
+-        '<(absl_srcdir)/time/internal/cctz/src/time_zone_format.cc',
+-        '<(absl_srcdir)/time/internal/cctz/src/time_zone_if.cc',
+-        '<(absl_srcdir)/time/internal/cctz/src/time_zone_impl.cc',
+-        '<(absl_srcdir)/time/internal/cctz/src/time_zone_info.cc',
+-        '<(absl_srcdir)/time/internal/cctz/src/time_zone_libc.cc',
+-        '<(absl_srcdir)/time/internal/cctz/src/time_zone_lookup.cc',
+-        '<(absl_srcdir)/time/internal/cctz/src/time_zone_posix.cc',
+-        '<(absl_srcdir)/time/internal/cctz/src/zone_info_source.cc',
+-      ],
+-      'cflags': [
+-        '-Wno-error',
+-      ],
+-      'dependencies': [
+-        'absl_base',
+-        'absl_numeric',
+-        'absl_strings_internal',
++      'conditions': [
++        ['use_system_abseil_cpp==1', {
++          'type': 'none',
++          'all_dependent_settings': {
++            'link_settings': {
++              'libraries': [
++                '-labsl_civil_time -labsl_time -labsl_time_zone',
++              ],
++            },
++          },
++        }, {
++          'type': 'static_library',
++          'sources': [
++            # libabsl_time
++            '<(absl_srcdir)/time/civil_time.cc',
++            '<(absl_srcdir)/time/clock.cc',
++            '<(absl_srcdir)/time/duration.cc',
++            '<(absl_srcdir)/time/format.cc',
++            '<(absl_srcdir)/time/time.cc',
++            # libabsl_civil_time
++            '<(absl_srcdir)/time/internal/cctz/src/civil_time_detail.cc',
++            # libabsl_time_zone
++            '<(absl_srcdir)/time/internal/cctz/src/time_zone_fixed.cc',
++            '<(absl_srcdir)/time/internal/cctz/src/time_zone_format.cc',
++            '<(absl_srcdir)/time/internal/cctz/src/time_zone_if.cc',
++            '<(absl_srcdir)/time/internal/cctz/src/time_zone_impl.cc',
++            '<(absl_srcdir)/time/internal/cctz/src/time_zone_info.cc',
++            '<(absl_srcdir)/time/internal/cctz/src/time_zone_libc.cc',
++            '<(absl_srcdir)/time/internal/cctz/src/time_zone_lookup.cc',
++            '<(absl_srcdir)/time/internal/cctz/src/time_zone_posix.cc',
++            '<(absl_srcdir)/time/internal/cctz/src/zone_info_source.cc',
++          ],
++          'cflags': [
++            '-Wno-error',
++          ],
++          'dependencies': [
++            'absl_base',
++            'absl_numeric',
++            'absl_strings_internal',
++          ],
++        }],
+       ],
+     },
+   ],
+--- /src/config/config_test.gyp
++++ /src/config/config_test.gyp
+@@ -36,6 +36,7 @@
+         'config_handler_test.cc',
+       ],
+       'dependencies': [
++        '../base/absl.gyp:absl_base',
+         '../testing/testing.gyp:gtest_main',
+         '../testing/testing.gyp:mozctest',
+         'config.gyp:config_handler',
+@@ -80,6 +81,7 @@
+         'character_form_manager_test.cc',
+       ],
+       'dependencies': [
++        '../base/absl.gyp:absl_base',
+         '../testing/testing.gyp:gtest_main',
+         'config.gyp:character_form_manager',
+       ],
+--- /src/gyp/common.gypi
++++ /src/gyp/common.gypi
+@@ -194,7 +194,13 @@
+     'include_dirs': [
+       '<(abs_depth)',
+       '<(SHARED_INTERMEDIATE_DIR)',
+-      '<(absl_dir)',
++    ],
++    'conditions': [
++      ['use_system_abseil_cpp==0', {
++        'include_dirs': [
++          '<(absl_dir)',
++        ],
++      }],
+     ],
+     'mac_framework_headers': [],
+     'target_conditions': [
+--- /src/gyp/common_win.gypi
++++ /src/gyp/common_win.gypi
+@@ -307,10 +307,16 @@
+     'include_dirs': [
+       '<(abs_depth)',
+       '<(SHARED_INTERMEDIATE_DIR)',
+-      '<(absl_dir)',
+       '<@(msvs_includes)',
+       '<(wtl_dir)/include',
+     ],
++    'conditions': [
++      ['use_system_abseil_cpp==0', {
++        'include_dirs': [
++          '<(absl_dir)',
++        ],
++      }],
++    ],
+     'msvs_configuration_attributes': {
+       'CharacterSet': '<(win_char_set_unicode)',
+     },
+--- /src/gyp/defines.gypi
++++ /src/gyp/defines.gypi
+@@ -63,6 +63,10 @@
+     # use_libibus represents if ibus library is used or not.
+     # This option is only for Linux.
+     'use_libibus%': '0',
++
++    # use_system_abseil_cpp represents if system version or bundled version
++    # of abseil-cpp library is used.
++    'use_system_abseil_cpp%': '0',
+   },
+   'target_defaults': {
+     'defines': [
+--- /src/gyp/directories.gypi
++++ /src/gyp/directories.gypi
+@@ -31,7 +31,12 @@
+   'variables': {
+     # Top directory of third party libraries.
+     'third_party_dir': '<(DEPTH)/third_party',
+-    'absl_dir': '<(DEPTH)/third_party/abseil-cpp',
++
++    'conditions': [
++      ['use_system_abseil_cpp==0', {
++        'absl_dir': '<(DEPTH)/third_party/abseil-cpp',
++      }],
++    ],
+ 
+     # Top directory of additional third party libraries.
+     'ext_third_party_dir%': '<(abs_depth)/third_party',
+--- /src/session/session_test.gyp
++++ /src/session/session_test.gyp
+@@ -221,6 +221,7 @@
+         'internal/key_event_transformer_test.cc',
+       ],
+       'dependencies': [
++        '../base/absl.gyp:absl_base',
+         '../base/base.gyp:base',
+         '../converter/converter_base.gyp:converter_mock',
+         '../engine/engine.gyp:mock_converter_engine',
+--- /src/storage/storage_test.gyp
++++ /src/storage/storage_test.gyp
+@@ -41,6 +41,7 @@
+         'tiny_storage_test.cc',
+       ],
+       'dependencies': [
++        '../base/absl.gyp:absl_base',
+         '../testing/testing.gyp:gtest_main',
+         'storage.gyp:storage',
+       ],

diff --git a/app-i18n/mozc/files/mozc-2.26.4220-system_gtest.patch b/app-i18n/mozc/files/mozc-2.26.4220-system_gtest.patch
new file mode 100644
index 00000000000..47891fab9b4
--- /dev/null
+++ b/app-i18n/mozc/files/mozc-2.26.4220-system_gtest.patch
@@ -0,0 +1,141 @@
+https://github.com/google/mozc/issues/490
+
+--- /src/gyp/defines.gypi
++++ /src/gyp/defines.gypi
+@@ -67,6 +67,10 @@
+     # use_system_abseil_cpp represents if system version or bundled version
+     # of abseil-cpp library is used.
+     'use_system_abseil_cpp%': '0',
++
++    # use_system_gtest represents if system version or bundled version
++    # of gtest library is used.
++    'use_system_gtest%': '0',
+   },
+   'target_defaults': {
+     'defines': [
+--- /src/testing/testing.gyp
++++ /src/testing/testing.gyp
+@@ -59,54 +59,76 @@
+   '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',
+-      },
+-      '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-matchers.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_system_gtest==1', {
++          'type': 'none',
++          'variables': {
++            'gtest_defines': [
++              'GTEST_LANG_CXX11=1',
++              'GTEST_HAS_TR1_TUPLE=0',  # disable tr1 tuple in favor of C++11 tuple.
++            ],
++          },
++          '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',
++          },
++          '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-matchers.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/files/mozc-2.26.4220-system_jsoncpp.patch b/app-i18n/mozc/files/mozc-2.26.4220-system_jsoncpp.patch
new file mode 100644
index 00000000000..7ff132eaa59
--- /dev/null
+++ b/app-i18n/mozc/files/mozc-2.26.4220-system_jsoncpp.patch
@@ -0,0 +1,117 @@
+https://github.com/google/mozc/issues/490
+
+--- /src/gyp/defines.gypi
++++ /src/gyp/defines.gypi
+@@ -71,6 +71,10 @@
+     # use_system_gtest represents if system version or bundled version
+     # of gtest library is used.
+     'use_system_gtest%': '0',
++
++    # use_system_jsoncpp represents if system version or bundled version
++    # of jsoncpp library is used.
++    'use_system_jsoncpp%': '0',
+   },
+   'target_defaults': {
+     'defines': [
+--- /src/net/jsoncpp.gyp
++++ /src/net/jsoncpp.gyp
+@@ -31,32 +31,60 @@
+   '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_system_jsoncpp==1', {
++          'type': 'none',
++          'variables': {
++            'jsoncpp_additional_macros': [
++              'JSON_USE_EXCEPTION=0',
++              'MOZC_USE_SYSTEM_JSONCPP',
++            ],
++          },
++          '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,11 @@
+ // Mozc basically disables C++ exception.
+ #define JSON_USE_EXCEPTION 0
+ #endif  // !JSON_USE_EXCEPTION
++#ifdef MOZC_USE_SYSTEM_JSONCPP
++#include <json/json.h>
++#else
+ #include "third_party/jsoncpp/include/json/json.h"
++#endif
+ #define MOZC_JSONCPP_JSON_H_INCLUDED
+ #endif  // !MOZC_JSONCPP_JSON_H_INCLUDED
+ 

diff --git a/app-i18n/mozc/mozc-9999.ebuild b/app-i18n/mozc/mozc-2.26.4220_p20201212102434_p20201219202429.ebuild
similarity index 71%
copy from app-i18n/mozc/mozc-9999.ebuild
copy to app-i18n/mozc/mozc-2.26.4220_p20201212102434_p20201219202429.ebuild
index b93a912f62e..d6d44a3758f 100644
--- a/app-i18n/mozc/mozc-9999.ebuild
+++ b/app-i18n/mozc/mozc-2.26.4220_p20201212102434_p20201219202429.ebuild
@@ -12,10 +12,17 @@ if [[ "${PV}" == "9999" ]]; then
 	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=""
+	MOZC_GIT_REVISION="9ba59b64d53365c1fe93c1c245b4ec3e35bdadf0"
+	MOZC_DATE="${PV#*_p}"
+	MOZC_DATE="${MOZC_DATE%%_p*}"
+
+	FCITX_MOZC_GIT_REVISION="1ea089debc31ff216473369ad71c08318384ee06"
+	FCITX_MOZC_DATE="${PV#*_p}"
+	FCITX_MOZC_DATE="${FCITX_MOZC_DATE#*_p}"
+	FCITX_MOZC_DATE="${FCITX_MOZC_DATE%%_p*}"
+
+	JAPANESE_USAGE_DICTIONARY_GIT_REVISION="a4a66772e33746b91e99caceecced9a28507e925"
+	JAPANESE_USAGE_DICTIONARY_DATE="20180701040110"
 fi
 
 DESCRIPTION="Mozc - Japanese input method editor"
@@ -23,10 +30,9 @@ 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
+	SRC_URI="https://github.com/google/${PN}/archive/${MOZC_GIT_REVISION}.tar.gz -> ${PN}-${PV%%_p*}-${MOZC_DATE}.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 )"
+		fcitx4? ( https://github.com/fcitx/${PN}/archive/${FCITX_MOZC_GIT_REVISION}.tar.gz -> fcitx-${PN}-${PV%%_p*}-${FCITX_MOZC_DATE}.tar.gz )"
 fi
 
 # Mozc: BSD
@@ -35,31 +41,28 @@ fi
 # 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 )"
+KEYWORDS="~amd64 ~ppc64 ~x86"
+IUSE="debug emacs fcitx4 +gui ibus renderer test"
+REQUIRED_USE="|| ( emacs fcitx4 ibus )"
 RESTRICT="!test? ( test )"
 
-BDEPEND="${PYTHON_DEPS}
+BDEPEND="$(python_gen_any_dep 'dev-python/six[${PYTHON_USEDEP}]')
 	>=dev-libs/protobuf-3.0.0
 	dev-util/gyp
 	dev-util/ninja
 	virtual/pkgconfig
 	emacs? ( app-editors/emacs:* )
 	fcitx4? ( sys-devel/gettext )"
-RDEPEND=">=dev-libs/protobuf-3.0.0:=
-	emacs? ( app-editors/emacs:* )
+DEPEND=">=dev-cpp/abseil-cpp-20200923[cxx17(+)]
+	>=dev-libs/protobuf-3.0.0:=
 	fcitx4? (
 		app-i18n/fcitx:4
 		virtual/libintl
 	)
 	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
@@ -71,12 +74,34 @@ RDEPEND=">=dev-libs/protobuf-3.0.0:=
 		x11-libs/cairo
 		x11-libs/gtk+:2
 		x11-libs/pango
-	)"
-DEPEND="${RDEPEND}
+	)
 	test? (
 		>=dev-cpp/gtest-1.8.0
 		dev-libs/jsoncpp
 	)"
+RDEPEND=">=dev-cpp/abseil-cpp-20200923[cxx17(+)]
+	>=dev-libs/protobuf-3.0.0:=
+	emacs? ( app-editors/emacs:* )
+	fcitx4? (
+		app-i18n/fcitx:4
+		virtual/libintl
+	)
+	gui? (
+		dev-qt/qtcore:5
+		dev-qt/qtgui:5
+		dev-qt/qtwidgets:5
+	)
+	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
+	)"
 
 S="${WORKDIR}/${P}/src"
 
@@ -87,6 +112,10 @@ execute() {
 	"$@"
 }
 
+python_check_deps() {
+	has_version -b "dev-python/six[${PYTHON_USEDEP}]"
+}
+
 src_unpack() {
 	if [[ "${PV}" == "9999" ]]; then
 		git-r3_src_unpack
@@ -97,55 +126,48 @@ src_unpack() {
 			git-r3_checkout https://github.com/fcitx/mozc "${WORKDIR}/fcitx-mozc"
 		fi
 	else
-		unpack ${P}.tar.gz
+		unpack ${PN}-${PV%%_p*}-${MOZC_DATE}.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
+
+		if use fcitx4; then
+			unpack fcitx-${PN}-${PV%%_p*}-${FCITX_MOZC_DATE}.tar.gz
+			mv mozc-${FCITX_MOZC_GIT_REVISION} fcitx-${PN}
+		fi
 	fi
 }
 
 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 "${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"
-	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
+		cp -pr "${WORKDIR}/fcitx-mozc/src/unix/fcitx" unix || die
 	fi
 
+	pushd "${WORKDIR}/${P}" > /dev/null || die
+
+	eapply "${FILESDIR}/${PN}-2.26.4220-system_abseil-cpp.patch"
+	eapply "${FILESDIR}/${PN}-2.26.4220-system_gtest.patch"
+	eapply "${FILESDIR}/${PN}-2.26.4220-system_jsoncpp.patch"
+	eapply "${FILESDIR}/${PN}-2.26.4220-environmental_variables.patch"
+	eapply "${FILESDIR}/${PN}-2.26.4220-server_path_check.patch"
+
 	eapply_user
 
+	popd > /dev/null || die
+
 	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))
+	local readelf=($(tc-getREADELF))
 
 	# Use absolute paths. Non-absolute paths are mishandled by GYP.
 	ar[0]=$(type -P ${ar[0]})
@@ -163,6 +185,12 @@ src_prepare() {
 		-e "s:<!(which nm):${nm[@]}:" \
 		-e "s:<!(which readelf):${readelf[@]}:" \
 		-i gyp/common.gypi || die
+
+	# https://github.com/google/mozc/issues/489
+	sed \
+		-e "/'-lc++'/d" \
+		-e "/'-stdlib=libc++'/d" \
+		-i gyp/common.gypi || die
 }
 
 src_configure() {
@@ -182,23 +210,20 @@ src_configure() {
 		gyp_arguments+=(-D compiler_host=unknown -D compiler_target=unknown)
 	fi
 
+	gyp_arguments+=(-D debug_extra_cflags=)
+	gyp_arguments+=(-D release_extra_cflags=)
+
 	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 use_system_abseil_cpp=1)
+	gyp_arguments+=(-D use_system_gtest=$(usex test 1 0))
+	gyp_arguments+=(-D use_system_jsoncpp=$(usex test 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")
@@ -280,8 +305,8 @@ src_install() {
 		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-}"
+		for image in ../../fcitx-${PN}/src/data/images/unix/ui-*.png; do
+			newins "${image}" "mozc-${image#../../fcitx-${PN}/src/data/images/unix/ui-}"
 		done
 
 		local locale mo_file
@@ -322,18 +347,6 @@ pkg_postinst() {
 	elog "MOZC_CONFIGURATION_DIRECTORY"
 	elog "  Mozc configuration directory"
 	elog "  Value used by default: \"~/.mozc\""
-	if use gui; then
-		elog "MOZC_ZINNIA_MODEL_FILE"
-		elog "  Zinnia handwriting recognition model file"
-		if use handwriting-tegaki; then
-			elog "  Value used by default: \"${EPREFIX}/usr/share/tegaki/models/zinnia/handwriting-ja.model\""
-		elif use handwriting-tomoe; then
-			elog "  Value used by default: \"${EPREFIX}/usr/$(get_libdir)/zinnia/model/tomoe/handwriting-ja.model\""
-		fi
-		elog "  Potential values:"
-		elog "    \"${EPREFIX}/usr/share/tegaki/models/zinnia/handwriting-ja.model\""
-		elog "    \"${EPREFIX}/usr/$(get_libdir)/zinnia/model/tomoe/handwriting-ja.model\""
-	fi
 	elog
 	if use emacs; then
 		elog

diff --git a/app-i18n/mozc/mozc-9999.ebuild b/app-i18n/mozc/mozc-9999.ebuild
index b93a912f62e..020c3b03755 100644
--- a/app-i18n/mozc/mozc-9999.ebuild
+++ b/app-i18n/mozc/mozc-9999.ebuild
@@ -13,9 +13,16 @@ if [[ "${PV}" == "9999" ]]; then
 	EGIT_SUBMODULES=(src/third_party/japanese_usage_dictionary)
 else
 	MOZC_GIT_REVISION=""
+	MOZC_DATE="${PV#*_p}"
+	MOZC_DATE="${MOZC_DATE%%_p*}"
+
+	FCITX_MOZC_GIT_REVISION=""
+	FCITX_MOZC_DATE="${PV#*_p}"
+	FCITX_MOZC_DATE="${FCITX_MOZC_DATE#*_p}"
+	FCITX_MOZC_DATE="${FCITX_MOZC_DATE%%_p*}"
+
 	JAPANESE_USAGE_DICTIONARY_GIT_REVISION=""
 	JAPANESE_USAGE_DICTIONARY_DATE=""
-	FCITX_PATCH_VERSION=""
 fi
 
 DESCRIPTION="Mozc - Japanese input method editor"
@@ -23,10 +30,9 @@ 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
+	SRC_URI="https://github.com/google/${PN}/archive/${MOZC_GIT_REVISION}.tar.gz -> ${PN}-${PV%%_p*}-${MOZC_DATE}.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 )"
+		fcitx4? ( https://github.com/fcitx/${PN}/archive/${FCITX_MOZC_GIT_REVISION}.tar.gz -> fcitx-${PN}-${PV%%_p*}-${FCITX_MOZC_DATE}.tar.gz )"
 fi
 
 # Mozc: BSD
@@ -36,30 +42,27 @@ fi
 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 )"
+IUSE="debug emacs fcitx4 +gui ibus renderer test"
+REQUIRED_USE="|| ( emacs fcitx4 ibus )"
 RESTRICT="!test? ( test )"
 
-BDEPEND="${PYTHON_DEPS}
+BDEPEND="$(python_gen_any_dep 'dev-python/six[${PYTHON_USEDEP}]')
 	>=dev-libs/protobuf-3.0.0
 	dev-util/gyp
 	dev-util/ninja
 	virtual/pkgconfig
 	emacs? ( app-editors/emacs:* )
 	fcitx4? ( sys-devel/gettext )"
-RDEPEND=">=dev-libs/protobuf-3.0.0:=
-	emacs? ( app-editors/emacs:* )
+DEPEND=">=dev-cpp/abseil-cpp-20200923[cxx17(+)]
+	>=dev-libs/protobuf-3.0.0:=
 	fcitx4? (
 		app-i18n/fcitx:4
 		virtual/libintl
 	)
 	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
@@ -71,12 +74,34 @@ RDEPEND=">=dev-libs/protobuf-3.0.0:=
 		x11-libs/cairo
 		x11-libs/gtk+:2
 		x11-libs/pango
-	)"
-DEPEND="${RDEPEND}
+	)
 	test? (
 		>=dev-cpp/gtest-1.8.0
 		dev-libs/jsoncpp
 	)"
+RDEPEND=">=dev-cpp/abseil-cpp-20200923[cxx17(+)]
+	>=dev-libs/protobuf-3.0.0:=
+	emacs? ( app-editors/emacs:* )
+	fcitx4? (
+		app-i18n/fcitx:4
+		virtual/libintl
+	)
+	gui? (
+		dev-qt/qtcore:5
+		dev-qt/qtgui:5
+		dev-qt/qtwidgets:5
+	)
+	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
+	)"
 
 S="${WORKDIR}/${P}/src"
 
@@ -87,6 +112,10 @@ execute() {
 	"$@"
 }
 
+python_check_deps() {
+	has_version -b "dev-python/six[${PYTHON_USEDEP}]"
+}
+
 src_unpack() {
 	if [[ "${PV}" == "9999" ]]; then
 		git-r3_src_unpack
@@ -97,55 +126,48 @@ src_unpack() {
 			git-r3_checkout https://github.com/fcitx/mozc "${WORKDIR}/fcitx-mozc"
 		fi
 	else
-		unpack ${P}.tar.gz
+		unpack ${PN}-${PV%%_p*}-${MOZC_DATE}.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
+
+		if use fcitx4; then
+			unpack fcitx-${PN}-${PV%%_p*}-${FCITX_MOZC_DATE}.tar.gz
+			mv mozc-${FCITX_MOZC_GIT_REVISION} fcitx-${PN}
+		fi
 	fi
 }
 
 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 "${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"
-	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
+		cp -pr "${WORKDIR}/fcitx-mozc/src/unix/fcitx" unix || die
 	fi
 
+	pushd "${WORKDIR}/${P}" > /dev/null || die
+
+	eapply "${FILESDIR}/${PN}-2.26.4220-system_abseil-cpp.patch"
+	eapply "${FILESDIR}/${PN}-2.26.4220-system_gtest.patch"
+	eapply "${FILESDIR}/${PN}-2.26.4220-system_jsoncpp.patch"
+	eapply "${FILESDIR}/${PN}-2.26.4220-environmental_variables.patch"
+	eapply "${FILESDIR}/${PN}-2.26.4220-server_path_check.patch"
+
 	eapply_user
 
+	popd > /dev/null || die
+
 	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))
+	local readelf=($(tc-getREADELF))
 
 	# Use absolute paths. Non-absolute paths are mishandled by GYP.
 	ar[0]=$(type -P ${ar[0]})
@@ -163,6 +185,12 @@ src_prepare() {
 		-e "s:<!(which nm):${nm[@]}:" \
 		-e "s:<!(which readelf):${readelf[@]}:" \
 		-i gyp/common.gypi || die
+
+	# https://github.com/google/mozc/issues/489
+	sed \
+		-e "/'-lc++'/d" \
+		-e "/'-stdlib=libc++'/d" \
+		-i gyp/common.gypi || die
 }
 
 src_configure() {
@@ -182,23 +210,20 @@ src_configure() {
 		gyp_arguments+=(-D compiler_host=unknown -D compiler_target=unknown)
 	fi
 
+	gyp_arguments+=(-D debug_extra_cflags=)
+	gyp_arguments+=(-D release_extra_cflags=)
+
 	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 use_system_abseil_cpp=1)
+	gyp_arguments+=(-D use_system_gtest=$(usex test 1 0))
+	gyp_arguments+=(-D use_system_jsoncpp=$(usex test 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")
@@ -280,8 +305,8 @@ src_install() {
 		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-}"
+		for image in ../../fcitx-${PN}/src/data/images/unix/ui-*.png; do
+			newins "${image}" "mozc-${image#../../fcitx-${PN}/src/data/images/unix/ui-}"
 		done
 
 		local locale mo_file
@@ -322,18 +347,6 @@ pkg_postinst() {
 	elog "MOZC_CONFIGURATION_DIRECTORY"
 	elog "  Mozc configuration directory"
 	elog "  Value used by default: \"~/.mozc\""
-	if use gui; then
-		elog "MOZC_ZINNIA_MODEL_FILE"
-		elog "  Zinnia handwriting recognition model file"
-		if use handwriting-tegaki; then
-			elog "  Value used by default: \"${EPREFIX}/usr/share/tegaki/models/zinnia/handwriting-ja.model\""
-		elif use handwriting-tomoe; then
-			elog "  Value used by default: \"${EPREFIX}/usr/$(get_libdir)/zinnia/model/tomoe/handwriting-ja.model\""
-		fi
-		elog "  Potential values:"
-		elog "    \"${EPREFIX}/usr/share/tegaki/models/zinnia/handwriting-ja.model\""
-		elog "    \"${EPREFIX}/usr/$(get_libdir)/zinnia/model/tomoe/handwriting-ja.model\""
-	fi
 	elog
 	if use emacs; then
 		elog


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: app-i18n/mozc/files/, app-i18n/mozc/
@ 2022-01-29 15:20 Yixun Lan
  0 siblings, 0 replies; 12+ messages in thread
From: Yixun Lan @ 2022-01-29 15:20 UTC (permalink / raw
  To: gentoo-commits

commit:     da6212a99d181d54f22c73fb2a9b8a9a5df2d21b
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Wed Jan 12 00:00:00 2022 +0000
Commit:     Yixun Lan <dlan <AT> gentoo <DOT> org>
CommitDate: Sat Jan 29 15:18:35 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=da6212a9

app-i18n/mozc: Fix building with >=dev-libs/protobuf-3.18.0

Closes: https://bugs.gentoo.org/828527
Signed-off-by: Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache.Org>
Signed-off-by: Yixun Lan <dlan <AT> gentoo.org>

 app-i18n/mozc/files/mozc-2.23.2815.102-protobuf-3.18.patch  | 13 +++++++++++++
 ...zc-2.23.2815.102-r1.ebuild => mozc-2.23.2815.102.ebuild} |  7 ++++---
 2 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/app-i18n/mozc/files/mozc-2.23.2815.102-protobuf-3.18.patch b/app-i18n/mozc/files/mozc-2.23.2815.102-protobuf-3.18.patch
new file mode 100644
index 000000000000..15077bb1752a
--- /dev/null
+++ b/app-i18n/mozc/files/mozc-2.23.2815.102-protobuf-3.18.patch
@@ -0,0 +1,13 @@
+Fix building with Protocol Buffers >=3.18.
+
+--- /src/dictionary/user_dictionary_storage.cc
++++ /src/dictionary/user_dictionary_storage.cc
+@@ -108,7 +108,7 @@
+   // wants to use more than 512MB.
+   mozc::protobuf::io::IstreamInputStream zero_copy_input(&ifs);
+   mozc::protobuf::io::CodedInputStream decoder(&zero_copy_input);
+-  decoder.SetTotalBytesLimit(kDefaultTotalBytesLimit, -1);
++  decoder.SetTotalBytesLimit(kDefaultTotalBytesLimit);
+   if (!user_dictionary_storage_base.ParseFromCodedStream(&decoder)) {
+     LOG(ERROR) << "Failed to parse";
+     if (!decoder.ConsumedEntireMessage() || !ifs.eof()) {

diff --git a/app-i18n/mozc/mozc-2.23.2815.102-r1.ebuild b/app-i18n/mozc/mozc-2.23.2815.102.ebuild
similarity index 98%
rename from app-i18n/mozc/mozc-2.23.2815.102-r1.ebuild
rename to app-i18n/mozc/mozc-2.23.2815.102.ebuild
index 0d8162f9bcdb..88ce0b3c1c22 100644
--- a/app-i18n/mozc/mozc-2.23.2815.102-r1.ebuild
+++ b/app-i18n/mozc/mozc-2.23.2815.102.ebuild
@@ -1,4 +1,4 @@
-# Copyright 2010-2021 Gentoo Authors
+# Copyright 2010-2022 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI="7"
@@ -41,13 +41,13 @@ REQUIRED_USE="|| ( emacs fcitx4 ibus ) gui? ( ^^ ( handwriting-tegaki handwritin
 RESTRICT="!test? ( test )"
 
 BDEPEND="${PYTHON_DEPS}
-	<dev-libs/protobuf-3.19
+	>=dev-libs/protobuf-3.0.0
 	dev-util/gyp
 	dev-util/ninja
 	virtual/pkgconfig
 	emacs? ( app-editors/emacs:* )
 	fcitx4? ( sys-devel/gettext )"
-RDEPEND="<dev-libs/protobuf-3.19:=
+RDEPEND=">=dev-libs/protobuf-3.0.0:=
 	emacs? ( app-editors/emacs:* )
 	fcitx4? (
 		app-i18n/fcitx:4
@@ -113,6 +113,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 "${DISTDIR}/${PN}-2.23.2815.102-protobuf_generated_classes_no_inheritance.patch"
+	eapply -p2 "${FILESDIR}/${PN}-2.23.2815.102-protobuf-3.18.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] 12+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: app-i18n/mozc/files/, app-i18n/mozc/
@ 2023-09-25 17:22 Nick Sarnie
  0 siblings, 0 replies; 12+ messages in thread
From: Nick Sarnie @ 2023-09-25 17:22 UTC (permalink / raw
  To: gentoo-commits

commit:     7b7b4ffeec3bf8f7badb711a05a44865e9c7a341
Author:     Nick Sarnie <sarnex <AT> gentoo <DOT> org>
AuthorDate: Mon Sep 25 17:19:41 2023 +0000
Commit:     Nick Sarnie <sarnex <AT> gentoo <DOT> org>
CommitDate: Mon Sep 25 17:22:20 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7b7b4ffe

app-i18n/mozc: Fix build with new abseil

Closes: https://bugs.gentoo.org/912776
Closes: https://bugs.gentoo.org/913243

Signed-off-by: Nick Sarnie <sarnex <AT> gentoo.org>

 .../mozc-2.28.5029.102-abseil-20230802.0.patch     |  42 +++
 app-i18n/mozc/mozc-2.28.5029.102-r1.ebuild         | 399 +++++++++++++++++++++
 2 files changed, 441 insertions(+)

diff --git a/app-i18n/mozc/files/mozc-2.28.5029.102-abseil-20230802.0.patch b/app-i18n/mozc/files/mozc-2.28.5029.102-abseil-20230802.0.patch
new file mode 100644
index 000000000000..fcc1be4d4b8d
--- /dev/null
+++ b/app-i18n/mozc/files/mozc-2.28.5029.102-abseil-20230802.0.patch
@@ -0,0 +1,42 @@
+diff --git a/src/base/absl.gyp b/src/base/absl.gyp
+index 932f6ac..35e5a22 100644
+--- a/src/base/absl.gyp
++++ b/src/base/absl.gyp
+@@ -398,7 +398,7 @@
+           'all_dependent_settings': {
+             'link_settings': {
+               'libraries': [
+-                '-labsl_synchronization -labsl_flags -labsl_graphcycles_internal',
++                '-labsl_synchronization -labsl_flags -labsl_graphcycles_internal -labsl_string_view',
+               ],
+             },
+           },
+diff --git a/src/unix/fcitx/surrounding_text_util.cc b/src/unix/fcitx/surrounding_text_util.cc
+index b2d533c..76357cd 100644
+--- a/src/unix/fcitx/surrounding_text_util.cc
++++ b/src/unix/fcitx/surrounding_text_util.cc
+@@ -233,9 +233,9 @@ bool GetSurroundingText(FcitxInstance* instance,
+ 
+     const size_t selection_start = std::min(cursor_pos, anchor_pos);
+     const size_t selection_length = std::abs(info->relative_selected_length);
+-    info->preceding_text = Util::Utf8SubString(surrounding_text, 0, selection_start);
+-    info->selection_text = Util::Utf8SubString(surrounding_text, selection_start, selection_length);
+-    info->following_text = Util::Utf8SubString(surrounding_text, selection_start + selection_length);
++    info->preceding_text = std::string(Util::Utf8SubString(surrounding_text, 0, selection_start));
++    info->selection_text = std::string(Util::Utf8SubString(surrounding_text, selection_start, selection_length));
++    info->following_text = std::string(Util::Utf8SubString(surrounding_text, selection_start + selection_length));
+     return true;
+ }
+
+diff --git a/src/unix/fcitx/eim.cc b/src/unix/fcitx/eim.cc
+index 4da2e80..fc7a9ff 100644
+--- a/src/unix/fcitx/eim.cc
++++ b/src/unix/fcitx/eim.cc
+@@ -33,6 +33,7 @@
+ #include <fcitx/module.h>
+ #include <fcitx/keys.h>
+ #include <fcitx-config/xdg.h>
++#undef InvokeFunction
+ #include "fcitx_mozc.h"
+ #include "mozc_connection.h"
+ #include "mozc_response_parser.h

diff --git a/app-i18n/mozc/mozc-2.28.5029.102-r1.ebuild b/app-i18n/mozc/mozc-2.28.5029.102-r1.ebuild
new file mode 100644
index 000000000000..f9b3f38102d8
--- /dev/null
+++ b/app-i18n/mozc/mozc-2.28.5029.102-r1.ebuild
@@ -0,0 +1,399 @@
+# Copyright 2010-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="8"
+
+PYTHON_COMPAT=( python3_{10..11} )
+
+inherit desktop edo elisp-common multiprocessing python-any-r1 savedconfig toolchain-funcs xdg
+
+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="305e9a7374254148474d067c46d55a4ee6081837"
+	MOZC_DATE="${PV#*_p}"
+	MOZC_DATE="${MOZC_DATE%%_p*}"
+
+	FCITX_MOZC_GIT_REVISION="242b4f703cba27d4ff4dc123c713a478f964e001"
+	FCITX_MOZC_DATE="${PV#*_p}"
+	FCITX_MOZC_DATE="${FCITX_MOZC_DATE#*_p}"
+	FCITX_MOZC_DATE="${FCITX_MOZC_DATE%%_p*}"
+
+	JAPANESE_USAGE_DICTIONARY_GIT_REVISION="a4a66772e33746b91e99caceecced9a28507e925"
+	JAPANESE_USAGE_DICTIONARY_DATE="20180701040110"
+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 -> ${PN}-${PV%%_p*}-${MOZC_DATE}.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/~sam/distfiles/${CATEGORY}/${PN}/${PN}-2.28.5029.102-patches.tar.xz
+		fcitx4? ( https://github.com/fcitx/${PN}/archive/${FCITX_MOZC_GIT_REVISION}.tar.gz -> fcitx-${PN}-${PV%%_p*}-${FCITX_MOZC_DATE}.tar.gz )
+	"
+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 ~arm64 ~ppc64 ~x86"
+IUSE="debug emacs fcitx4 +gui ibus renderer test"
+REQUIRED_USE="|| ( emacs fcitx4 ibus )"
+RESTRICT="!test? ( test )"
+
+BDEPEND="
+	$(python_gen_any_dep 'dev-python/six[${PYTHON_USEDEP}]')
+	>=dev-libs/protobuf-3.0.0
+	dev-util/gyp
+	dev-util/ninja
+	virtual/pkgconfig
+	emacs? ( app-editors/emacs:* )
+	fcitx4? ( sys-devel/gettext )
+"
+DEPEND="
+	>=dev-cpp/abseil-cpp-20230802.0:=[cxx17(+)]
+	>=dev-libs/protobuf-3.0.0:=
+	fcitx4? (
+		app-i18n/fcitx:4
+		virtual/libintl
+	)
+	gui? (
+		dev-qt/qtcore:5
+		dev-qt/qtgui:5
+		dev-qt/qtwidgets:5
+	)
+	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
+	)
+	test? (
+		>=dev-cpp/gtest-1.8.0
+		dev-libs/jsoncpp
+	)"
+RDEPEND="
+	>=dev-cpp/abseil-cpp-20230802.0:=[cxx17(+)]
+	>=dev-libs/protobuf-3.0.0:=
+	emacs? ( app-editors/emacs:* )
+	fcitx4? (
+		app-i18n/fcitx:4
+		virtual/libintl
+	)
+	gui? (
+		dev-qt/qtcore:5
+		dev-qt/qtgui:5
+		dev-qt/qtwidgets:5
+	)
+	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
+	)
+"
+
+S="${WORKDIR}/${P}/src"
+
+SITEFILE="50${PN}-gentoo.el"
+
+PATCHES=(
+	"${WORKDIR}"/mozc-2.28.5029.102-patches
+	"${FILESDIR}"/mozc-2.28.5029.102-abseil.patch
+	"${FILESDIR}"/mozc-2.28.5029.102-abseil-20230802.0.patch
+)
+
+python_check_deps() {
+	python_has_version "dev-python/six[${PYTHON_USEDEP}]"
+}
+
+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 ${PN}-${PV%%_p*}-${MOZC_DATE}.tar.gz
+		mv mozc-${MOZC_GIT_REVISION} ${P} || die
+
+		unpack ${PN}-2.28.5029.102-patches.tar.xz
+
+		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
+
+		if use fcitx4; then
+			unpack fcitx-${PN}-${PV%%_p*}-${FCITX_MOZC_DATE}.tar.gz
+			mv mozc-${FCITX_MOZC_GIT_REVISION} fcitx-${PN} || die
+		fi
+	fi
+}
+
+src_prepare() {
+	if use fcitx4; then
+		cp -pr "${WORKDIR}/fcitx-mozc/src/unix/fcitx" unix || die
+	fi
+
+	pushd "${WORKDIR}/${P}" > /dev/null || die
+	default
+	popd > /dev/null || die
+
+	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 "${MAKEOPTS}" 999)', '-l$(makeopts_loadavg "${MAKEOPTS}" 0)', '-v'/" \
+		-i build_mozc.py || die
+
+	local ar=($(tc-getAR))
+	local cc=($(tc-getCC))
+	local cxx=($(tc-getCXX))
+	local ld=($(tc-getLD))
+	local nm=($(tc-getNM))
+	local readelf=($(tc-getREADELF))
+
+	# 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
+
+	# https://github.com/google/mozc/issues/489
+	sed \
+		-e "/'-lc++'/d" \
+		-e "/'-stdlib=libc++'/d" \
+		-i gyp/common.gypi || die
+
+	# bug #877765
+	restore_config mozcdic-ut.txt
+	if [[ -f /mozcdic-ut.txt && -s mozcdic-ut.txt ]]; then
+		einfo "mozcdic-ut.txt found. Adding to mozc dictionary..."
+		cat mozcdic-ut.txt >> "${WORKDIR}/${P}/src/data/dictionary_oss/dictionary00.txt" || die
+	fi
+}
+
+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 debug_extra_cflags=)
+	gyp_arguments+=(-D release_extra_cflags=)
+
+	gyp_arguments+=(-D use_fcitx=$(usex fcitx4 YES NO))
+	gyp_arguments+=(-D use_libibus=$(usex ibus 1 0))
+	gyp_arguments+=(-D use_libprotobuf=1)
+	gyp_arguments+=(-D use_system_abseil_cpp=1)
+	gyp_arguments+=(-D use_system_gtest=$(usex test 1 0))
+	gyp_arguments+=(-D use_system_jsoncpp=$(usex test 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 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
+
+	edo "${PYTHON}" build_mozc.py gyp \
+		--gypdir="${EPREFIX}/usr/bin" \
+		--server_dir="${EPREFIX}/usr/libexec/mozc" \
+		--verbose \
+		$(usex gui "" --noqt) \
+		-- "${gyp_arguments[@]}"
+}
+
+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
+
+	if use ibus; then
+		GYP_IBUS_FLAG="--use_gyp_for_ibus_build"
+	fi
+
+	edo "${PYTHON}" build_mozc.py build -c ${BUILD_TYPE} ${GYP_IBUS_FLAG} -v "${targets[@]}"
+
+	if use emacs; then
+		elisp-compile unix/emacs/*.el
+	fi
+}
+
+src_test() {
+	edo "${PYTHON}" build_mozc.py runtests -c ${BUILD_TYPE} --test_jobs 1
+}
+
+src_install() {
+	exeinto /usr/libexec/mozc
+	doexe out_linux/${BUILD_TYPE}/mozc_server
+
+	[[ -s mozcdic-ut.txt ]] && save_config mozcdic-ut.txt
+
+	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 ../../fcitx-${PN}/src/data/images/unix/ui-*.png; do
+			newins "${image}" "mozc-${image#../../fcitx-${PN}/src/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() {
+	elog
+	elog "ENVIRONMENTAL VARIABLES"
+	elog
+	elog "MOZC_SERVER_DIRECTORY"
+	elog "  Mozc server directory"
+	elog "  Value used by default: \"${EPREFIX}/usr/libexec/mozc\""
+	elog "MOZC_DOCUMENTS_DIRECTORY"
+	elog "  Mozc documents directory"
+	elog "  Value used by default: \"${EPREFIX}/usr/libexec/mozc/documents\""
+	elog "MOZC_CONFIGURATION_DIRECTORY"
+	elog "  Mozc configuration directory"
+	elog "  Value used by default: \"~/.mozc\""
+	elog
+	if use emacs; then
+		elog
+		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\"."
+		elog
+
+		elisp-site-regen
+	fi
+	xdg_pkg_postinst
+}
+
+pkg_postrm() {
+	if use emacs; then
+		elisp-site-regen
+	fi
+	xdg_pkg_postrm
+}


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: app-i18n/mozc/files/, app-i18n/mozc/
@ 2023-09-26 22:45 Nick Sarnie
  0 siblings, 0 replies; 12+ messages in thread
From: Nick Sarnie @ 2023-09-26 22:45 UTC (permalink / raw
  To: gentoo-commits

commit:     494dc91fdb70986d73ece89c1ee94c8a70b8dd85
Author:     Nick Sarnie <sarnex <AT> gentoo <DOT> org>
AuthorDate: Tue Sep 26 22:45:03 2023 +0000
Commit:     Nick Sarnie <sarnex <AT> gentoo <DOT> org>
CommitDate: Tue Sep 26 22:45:03 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=494dc91f

app-i18n/mozc: Fix build with -fcitx4

Closes: https://bugs.gentoo.org/914770

Signed-off-by: Nick Sarnie <sarnex <AT> gentoo.org>

 ...c-2.28.5029.102-abseil-20230802.0-fcitx4.patch} | 13 ----------
 .../mozc-2.28.5029.102-abseil-20230802.0.patch     | 29 ----------------------
 app-i18n/mozc/mozc-2.28.5029.102-r1.ebuild         |  1 +
 3 files changed, 1 insertion(+), 42 deletions(-)

diff --git a/app-i18n/mozc/files/mozc-2.28.5029.102-abseil-20230802.0.patch b/app-i18n/mozc/files/mozc-2.28.5029.102-abseil-20230802.0-fcitx4.patch
similarity index 74%
copy from app-i18n/mozc/files/mozc-2.28.5029.102-abseil-20230802.0.patch
copy to app-i18n/mozc/files/mozc-2.28.5029.102-abseil-20230802.0-fcitx4.patch
index fcc1be4d4b8d..b7ebce42348e 100644
--- a/app-i18n/mozc/files/mozc-2.28.5029.102-abseil-20230802.0.patch
+++ b/app-i18n/mozc/files/mozc-2.28.5029.102-abseil-20230802.0-fcitx4.patch
@@ -1,16 +1,3 @@
-diff --git a/src/base/absl.gyp b/src/base/absl.gyp
-index 932f6ac..35e5a22 100644
---- a/src/base/absl.gyp
-+++ b/src/base/absl.gyp
-@@ -398,7 +398,7 @@
-           'all_dependent_settings': {
-             'link_settings': {
-               'libraries': [
--                '-labsl_synchronization -labsl_flags -labsl_graphcycles_internal',
-+                '-labsl_synchronization -labsl_flags -labsl_graphcycles_internal -labsl_string_view',
-               ],
-             },
-           },
 diff --git a/src/unix/fcitx/surrounding_text_util.cc b/src/unix/fcitx/surrounding_text_util.cc
 index b2d533c..76357cd 100644
 --- a/src/unix/fcitx/surrounding_text_util.cc

diff --git a/app-i18n/mozc/files/mozc-2.28.5029.102-abseil-20230802.0.patch b/app-i18n/mozc/files/mozc-2.28.5029.102-abseil-20230802.0.patch
index fcc1be4d4b8d..5e134bd1f003 100644
--- a/app-i18n/mozc/files/mozc-2.28.5029.102-abseil-20230802.0.patch
+++ b/app-i18n/mozc/files/mozc-2.28.5029.102-abseil-20230802.0.patch
@@ -11,32 +11,3 @@ index 932f6ac..35e5a22 100644
                ],
              },
            },
-diff --git a/src/unix/fcitx/surrounding_text_util.cc b/src/unix/fcitx/surrounding_text_util.cc
-index b2d533c..76357cd 100644
---- a/src/unix/fcitx/surrounding_text_util.cc
-+++ b/src/unix/fcitx/surrounding_text_util.cc
-@@ -233,9 +233,9 @@ bool GetSurroundingText(FcitxInstance* instance,
- 
-     const size_t selection_start = std::min(cursor_pos, anchor_pos);
-     const size_t selection_length = std::abs(info->relative_selected_length);
--    info->preceding_text = Util::Utf8SubString(surrounding_text, 0, selection_start);
--    info->selection_text = Util::Utf8SubString(surrounding_text, selection_start, selection_length);
--    info->following_text = Util::Utf8SubString(surrounding_text, selection_start + selection_length);
-+    info->preceding_text = std::string(Util::Utf8SubString(surrounding_text, 0, selection_start));
-+    info->selection_text = std::string(Util::Utf8SubString(surrounding_text, selection_start, selection_length));
-+    info->following_text = std::string(Util::Utf8SubString(surrounding_text, selection_start + selection_length));
-     return true;
- }
-
-diff --git a/src/unix/fcitx/eim.cc b/src/unix/fcitx/eim.cc
-index 4da2e80..fc7a9ff 100644
---- a/src/unix/fcitx/eim.cc
-+++ b/src/unix/fcitx/eim.cc
-@@ -33,6 +33,7 @@
- #include <fcitx/module.h>
- #include <fcitx/keys.h>
- #include <fcitx-config/xdg.h>
-+#undef InvokeFunction
- #include "fcitx_mozc.h"
- #include "mozc_connection.h"
- #include "mozc_response_parser.h

diff --git a/app-i18n/mozc/mozc-2.28.5029.102-r1.ebuild b/app-i18n/mozc/mozc-2.28.5029.102-r1.ebuild
index f9b3f38102d8..df14388aa428 100644
--- a/app-i18n/mozc/mozc-2.28.5029.102-r1.ebuild
+++ b/app-i18n/mozc/mozc-2.28.5029.102-r1.ebuild
@@ -154,6 +154,7 @@ src_unpack() {
 src_prepare() {
 	if use fcitx4; then
 		cp -pr "${WORKDIR}/fcitx-mozc/src/unix/fcitx" unix || die
+		PATCHES+=( "${FILESDIR}"/mozc-2.28.5029.102-abseil-20230802.0-fcitx4.patch )
 	fi
 
 	pushd "${WORKDIR}/${P}" > /dev/null || die


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: app-i18n/mozc/files/, app-i18n/mozc/
@ 2024-01-14  0:41 Yixun Lan
  0 siblings, 0 replies; 12+ messages in thread
From: Yixun Lan @ 2024-01-14  0:41 UTC (permalink / raw
  To: gentoo-commits

commit:     7e91c004045f6c37ed9c6a6348153b96ee99736d
Author:     Yongxiang Liang <tanekliang <AT> gmail <DOT> com>
AuthorDate: Tue Jan  9 18:12:39 2024 +0000
Commit:     Yixun Lan <dlan <AT> gentoo <DOT> org>
CommitDate: Sun Jan 14 00:36:35 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7e91c004

app-i18n/mozc: add fcitx5 support

Closes: https://github.com/gentoo/gentoo/pull/34478
Signed-off-by: Yongxiang Liang <tanekliang <AT> gmail.com>
Signed-off-by: Yixun Lan <dlan <AT> gentoo.org>

 ...zc-2.28.5029.102-abseil-20230802.0-fcitx5.patch |  19 +
 app-i18n/mozc/metadata.xml                         |   1 +
 app-i18n/mozc/mozc-2.28.5029.102-r2.ebuild         | 466 +++++++++++++++++++++
 3 files changed, 486 insertions(+)

diff --git a/app-i18n/mozc/files/mozc-2.28.5029.102-abseil-20230802.0-fcitx5.patch b/app-i18n/mozc/files/mozc-2.28.5029.102-abseil-20230802.0-fcitx5.patch
new file mode 100644
index 000000000000..3ad06cf0e3a5
--- /dev/null
+++ b/app-i18n/mozc/files/mozc-2.28.5029.102-abseil-20230802.0-fcitx5.patch
@@ -0,0 +1,19 @@
+Adapted fcitx5 path from https://github.com/fcitx/mozc/commit/748ddfb45b7615283f1d40e03c23940750031ac1
+
+--- a/src/unix/fcitx5/surrounding_text_util.cc
++++ b/src/unix/fcitx5/surrounding_text_util.cc
+@@ -211,11 +211,11 @@
+   const size_t selection_start = std::min(cursor_pos, anchor_pos);
+   const size_t selection_length = std::abs(info->relative_selected_length);
+   info->preceding_text =
+-      Util::Utf8SubString(surrounding_text, 0, selection_start);
++      std::string(Util::Utf8SubString(surrounding_text, 0, selection_start));
+   info->selection_text =
+-      Util::Utf8SubString(surrounding_text, selection_start, selection_length);
++      std::string(Util::Utf8SubString(surrounding_text, selection_start, selection_length));
+   info->following_text =
+-      Util::Utf8SubString(surrounding_text, selection_start + selection_length);
++      std::string(Util::Utf8SubString(surrounding_text, selection_start + selection_length));
+   return true;
+ }
+ 

diff --git a/app-i18n/mozc/metadata.xml b/app-i18n/mozc/metadata.xml
index 7fd885c8d62f..7c3e52638ca1 100644
--- a/app-i18n/mozc/metadata.xml
+++ b/app-i18n/mozc/metadata.xml
@@ -11,6 +11,7 @@
 	</maintainer>
 	<use>
 		<flag name="fcitx4">Enable support for <pkg>app-i18n/fcitx</pkg> 4</flag>
+		<flag name="fcitx5">Enable support for <pkg>app-i18n/fcitx</pkg> 5</flag>
 		<flag name="gui">Install graphical user interface tool (mozc_tool)</flag>
 		<flag name="ibus">Enable support for <pkg>app-i18n/ibus</pkg></flag>
 		<flag name="renderer">Enable native candidate window</flag>

diff --git a/app-i18n/mozc/mozc-2.28.5029.102-r2.ebuild b/app-i18n/mozc/mozc-2.28.5029.102-r2.ebuild
new file mode 100644
index 000000000000..303b63160760
--- /dev/null
+++ b/app-i18n/mozc/mozc-2.28.5029.102-r2.ebuild
@@ -0,0 +1,466 @@
+# Copyright 2010-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="8"
+
+PYTHON_COMPAT=( python3_{10..11} )
+
+inherit desktop edo elisp-common multiprocessing python-any-r1 savedconfig toolchain-funcs xdg
+
+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="305e9a7374254148474d067c46d55a4ee6081837"
+	MOZC_DATE="${PV#*_p}"
+	MOZC_DATE="${MOZC_DATE%%_p*}"
+
+	FCITX_MOZC_GIT_REVISION="242b4f703cba27d4ff4dc123c713a478f964e001"
+	FCITX_MOZC_DATE="${PV#*_p}"
+	FCITX_MOZC_DATE="${FCITX_MOZC_DATE#*_p}"
+	FCITX_MOZC_DATE="${FCITX_MOZC_DATE%%_p*}"
+
+	JAPANESE_USAGE_DICTIONARY_GIT_REVISION="a4a66772e33746b91e99caceecced9a28507e925"
+	JAPANESE_USAGE_DICTIONARY_DATE="20180701040110"
+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 -> ${PN}-${PV%%_p*}-${MOZC_DATE}.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/~sam/distfiles/${CATEGORY}/${PN}/${PN}-2.28.5029.102-patches.tar.xz
+		fcitx4? ( https://github.com/fcitx/${PN}/archive/${FCITX_MOZC_GIT_REVISION}.tar.gz -> fcitx-${PN}-${PV%%_p*}-${FCITX_MOZC_DATE}.tar.gz )
+		fcitx5? ( https://github.com/fcitx/${PN}/archive/${FCITX_MOZC_GIT_REVISION}.tar.gz -> fcitx-${PN}-${PV%%_p*}-${FCITX_MOZC_DATE}.tar.gz )
+	"
+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 ~x86"
+IUSE="debug emacs fcitx4 fcitx5 +gui ibus renderer test"
+REQUIRED_USE="|| ( emacs fcitx4 fcitx5 ibus )"
+RESTRICT="!test? ( test )"
+
+BDEPEND="
+	$(python_gen_any_dep 'dev-python/six[${PYTHON_USEDEP}]')
+	>=dev-libs/protobuf-3.0.0
+	dev-util/gyp
+	app-alternatives/ninja
+	virtual/pkgconfig
+	emacs? ( app-editors/emacs:* )
+	fcitx4? ( sys-devel/gettext )
+	fcitx5? ( sys-devel/gettext )
+"
+DEPEND="
+	>=dev-cpp/abseil-cpp-20230802.0:=[cxx17(+)]
+	>=dev-libs/protobuf-3.0.0:=
+	fcitx4? (
+		app-i18n/fcitx:4
+		virtual/libintl
+	)
+	fcitx5? (
+		app-i18n/fcitx:5
+		app-i18n/libime
+		sys-devel/gettext
+		virtual/libintl
+	)
+	gui? (
+		dev-qt/qtcore:5
+		dev-qt/qtgui:5
+		dev-qt/qtwidgets:5
+	)
+	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
+	)
+	test? (
+		>=dev-cpp/gtest-1.8.0
+		dev-libs/jsoncpp
+	)"
+RDEPEND="
+	>=dev-cpp/abseil-cpp-20230802.0:=[cxx17(+)]
+	>=dev-libs/protobuf-3.0.0:=
+	emacs? ( app-editors/emacs:* )
+	fcitx4? (
+		app-i18n/fcitx:4
+		virtual/libintl
+	)
+	fcitx5? (
+		app-i18n/fcitx:5
+		app-i18n/libime
+		sys-devel/gettext
+		virtual/libintl
+	)
+	gui? (
+		dev-qt/qtcore:5
+		dev-qt/qtgui:5
+		dev-qt/qtwidgets:5
+	)
+	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
+	)
+"
+
+S="${WORKDIR}/${P}/src"
+
+SITEFILE="50${PN}-gentoo.el"
+
+PATCHES=(
+	"${WORKDIR}"/mozc-2.28.5029.102-patches
+	"${FILESDIR}"/mozc-2.28.5029.102-abseil.patch
+	"${FILESDIR}"/mozc-2.28.5029.102-abseil-20230802.0.patch
+)
+
+python_check_deps() {
+	python_has_version "dev-python/six[${PYTHON_USEDEP}]"
+}
+
+src_unpack() {
+	if [[ "${PV}" == "9999" ]]; then
+		git-r3_src_unpack
+
+		if use fcitx4 || use fcitx5; 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
+		if use fcitx5; then
+			cp -pr "${WORKDIR}"/fcitx{,5}-mozc || die
+		fi
+	else
+		unpack ${PN}-${PV%%_p*}-${MOZC_DATE}.tar.gz
+		mv mozc-${MOZC_GIT_REVISION} ${P} || die
+
+		unpack ${PN}-2.28.5029.102-patches.tar.xz
+
+		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
+
+		if use fcitx4 || use fcitx5; then
+			unpack fcitx-${PN}-${PV%%_p*}-${FCITX_MOZC_DATE}.tar.gz
+			if use fcitx4; then
+				cp -pr mozc-${FCITX_MOZC_GIT_REVISION} fcitx-${PN} || die
+			fi
+			if use fcitx5; then
+				cp -pr mozc-${FCITX_MOZC_GIT_REVISION} fcitx5-${PN} || die
+			fi
+			rm -r mozc-${FCITX_MOZC_GIT_REVISION} || die
+		fi
+	fi
+}
+
+src_prepare() {
+	if use fcitx4; then
+		cp -pr "${WORKDIR}/fcitx-mozc/src/unix/fcitx" unix || die
+		PATCHES+=( "${FILESDIR}"/mozc-2.28.5029.102-abseil-20230802.0-fcitx4.patch )
+	fi
+	if use fcitx5; then
+		cp -pr "${WORKDIR}/fcitx5-mozc/src/unix/fcitx5" unix || die
+		PATCHES+=( "${FILESDIR}"/mozc-2.28.5029.102-abseil-20230802.0-fcitx5.patch )
+	fi
+
+	pushd "${WORKDIR}/${P}" > /dev/null || die
+	default
+	popd > /dev/null || die
+
+	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 "${MAKEOPTS}" 999)', '-l$(makeopts_loadavg "${MAKEOPTS}" 0)', '-v'/" \
+		-i build_mozc.py || die
+
+	local ar=($(tc-getAR))
+	local cc=($(tc-getCC))
+	local cxx=($(tc-getCXX))
+	local ld=($(tc-getLD))
+	local nm=($(tc-getNM))
+	local readelf=($(tc-getREADELF))
+
+	# 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
+
+	# https://github.com/google/mozc/issues/489
+	sed \
+		-e "/'-lc++'/d" \
+		-e "/'-stdlib=libc++'/d" \
+		-i gyp/common.gypi || die
+
+	# bug #877765
+	restore_config mozcdic-ut.txt
+	if [[ -f /mozcdic-ut.txt && -s mozcdic-ut.txt ]]; then
+		einfo "mozcdic-ut.txt found. Adding to mozc dictionary..."
+		cat mozcdic-ut.txt >> "${WORKDIR}/${P}/src/data/dictionary_oss/dictionary00.txt" || die
+	fi
+}
+
+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 debug_extra_cflags=)
+	gyp_arguments+=(-D release_extra_cflags=)
+
+	gyp_arguments+=(-D use_fcitx=$(usex fcitx4 YES NO))
+	gyp_arguments+=(-D use_fcitx5=$(usex fcitx5 YES NO))
+	gyp_arguments+=(-D use_libibus=$(usex ibus 1 0))
+	gyp_arguments+=(-D use_libprotobuf=1)
+	gyp_arguments+=(-D use_system_abseil_cpp=1)
+	gyp_arguments+=(-D use_system_gtest=$(usex test 1 0))
+	gyp_arguments+=(-D use_system_jsoncpp=$(usex test 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 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
+
+	edo "${PYTHON}" build_mozc.py gyp \
+		--gypdir="${EPREFIX}/usr/bin" \
+		--server_dir="${EPREFIX}/usr/libexec/mozc" \
+		--verbose \
+		$(usex gui "" --noqt) \
+		-- "${gyp_arguments[@]}"
+}
+
+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 fcitx5; then
+		targets+=(unix/fcitx5/fcitx5.gyp:fcitx5-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
+
+	if use ibus; then
+		GYP_IBUS_FLAG="--use_gyp_for_ibus_build"
+	fi
+
+	edo "${PYTHON}" build_mozc.py build -c ${BUILD_TYPE} ${GYP_IBUS_FLAG} -v "${targets[@]}"
+
+	if use emacs; then
+		elisp-compile unix/emacs/*.el
+	fi
+}
+
+src_test() {
+	edo "${PYTHON}" build_mozc.py runtests -c ${BUILD_TYPE} --test_jobs 1
+}
+
+src_install() {
+	exeinto /usr/libexec/mozc
+	doexe out_linux/${BUILD_TYPE}/mozc_server
+
+	[[ -s mozcdic-ut.txt ]] && save_config mozcdic-ut.txt
+
+	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 ../../fcitx-${PN}/src/data/images/unix/ui-*.png; do
+			newins "${image}" "mozc-${image#../../fcitx-${PN}/src/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 fcitx5; then
+		exeinto /usr/$(get_libdir)/fcitx5
+		doexe out_linux/${BUILD_TYPE}/fcitx5-mozc.so
+
+		insinto /usr/share/fcitx5/addon
+		newins unix/fcitx5/mozc-addon.conf mozc.conf
+
+		insinto /usr/share/fcitx5/inputmethod
+		doins unix/fcitx5/mozc.conf
+
+		local orgfcitx5="org.fcitx.Fcitx5.fcitx-mozc"
+		newicon -s 128 data/images/product_icon_32bpp-128.png ${orgfcitx5}.png
+		newicon -s 128 data/images/product_icon_32bpp-128.png fcitx-mozc.png
+		newicon -s 32 data/images/unix/ime_product_icon_opensource-32.png ${orgfcitx5}.png
+		newicon -s 32 data/images/unix/ime_product_icon_opensource-32.png fcitx-mozc.png
+		for uiimg in ../../fcitx5-mozc/scripts/icons/ui-*.png; do
+			dimg=${uiimg#*ui-}
+			newicon -s 48 ${uiimg} ${orgfcitx5}-${dimg/_/-}
+			newicon -s 48 ${uiimg} fcitx-mozc-${dimg/_/-}
+		done
+
+		local locale mo_file
+		for mo_file in unix/fcitx5/po/*.po; do
+			locale="${mo_file##*/}"
+			locale="${locale%.po}"
+			msgfmt ${mo_file} -o ${mo_file/.po/.mo} || die
+			insinto /usr/share/locale/${locale}/LC_MESSAGES
+			newins "${mo_file/.po/.mo}" fcitx5-mozc.mo
+		done
+		msgfmt --xml -d unix/fcitx5/po/ --template unix/fcitx5/org.fcitx.Fcitx5.Addon.Mozc.metainfo.xml.in -o \
+			unix/fcitx5/org.fcitx.Fcitx5.Addon.Mozc.metainfo.xml || die
+		insinto /usr/share/metainfo
+		doins unix/fcitx5/org.fcitx.Fcitx5.Addon.Mozc.metainfo.xml
+	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() {
+	elog
+	elog "ENVIRONMENTAL VARIABLES"
+	elog
+	elog "MOZC_SERVER_DIRECTORY"
+	elog "  Mozc server directory"
+	elog "  Value used by default: \"${EPREFIX}/usr/libexec/mozc\""
+	elog "MOZC_DOCUMENTS_DIRECTORY"
+	elog "  Mozc documents directory"
+	elog "  Value used by default: \"${EPREFIX}/usr/libexec/mozc/documents\""
+	elog "MOZC_CONFIGURATION_DIRECTORY"
+	elog "  Mozc configuration directory"
+	elog "  Value used by default: \"~/.mozc\""
+	elog
+	if use emacs; then
+		elog
+		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\"."
+		elog
+
+		elisp-site-regen
+	fi
+	xdg_pkg_postinst
+}
+
+pkg_postrm() {
+	if use emacs; then
+		elisp-site-regen
+	fi
+	xdg_pkg_postrm
+}


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: app-i18n/mozc/files/, app-i18n/mozc/
@ 2024-08-28  4:47 WANG Xuerui
  0 siblings, 0 replies; 12+ messages in thread
From: WANG Xuerui @ 2024-08-28  4:47 UTC (permalink / raw
  To: gentoo-commits

commit:     1e9ac25ffe403b232e8f786b6d1b2fdad30c9ae5
Author:     WANG Xuerui <xen0n <AT> gentoo <DOT> org>
AuthorDate: Tue Aug 27 09:12:35 2024 +0000
Commit:     WANG Xuerui <xen0n <AT> gentoo <DOT> org>
CommitDate: Wed Aug 28 04:46:50 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1e9ac25f

app-i18n/mozc: revbump, require and fix build with abseil-cpp 20240116

Test suite passes on amd64.

Closes: https://bugs.gentoo.org/936819
Closes: https://github.com/gentoo/gentoo/pull/38301
Signed-off-by: WANG Xuerui <xen0n <AT> gentoo.org>

 .../files/mozc-2.28.5029.102-abseil-20240116.patch |  50 +++
 app-i18n/mozc/mozc-2.28.5029.102-r3.ebuild         | 467 +++++++++++++++++++++
 2 files changed, 517 insertions(+)

diff --git a/app-i18n/mozc/files/mozc-2.28.5029.102-abseil-20240116.patch b/app-i18n/mozc/files/mozc-2.28.5029.102-abseil-20240116.patch
new file mode 100644
index 000000000000..804b4d9ff3d4
--- /dev/null
+++ b/app-i18n/mozc/files/mozc-2.28.5029.102-abseil-20240116.patch
@@ -0,0 +1,50 @@
+Exported from my fork: https://github.com/xen0n/mozc, branch
+gentoo-2.28.5029.102.
+
+From: WANG Xuerui <xen0n@gentoo.org>
+Date: Tue, 27 Aug 2024 16:44:13 +0800
+Subject: [PATCH] fix build with abseil-cpp 20240116
+
+Signed-off-by: WANG Xuerui <xen0n@gentoo.org>
+--- a/src/base/absl.gyp
++++ b/src/base/absl.gyp
+@@ -128,7 +128,7 @@
+           'all_dependent_settings': {
+             'link_settings': {
+               'libraries': [
+-                '-labsl_flags -labsl_flags_internal -labsl_synchronization -labsl_flags_reflection -labsl_flags_marshalling',
++                '-labsl_flags_internal -labsl_raw_hash_set -labsl_city -labsl_hash -labsl_low_level_hash -labsl_synchronization -labsl_flags_reflection -labsl_flags_marshalling',
+               ],
+             },
+           },
+@@ -178,7 +178,7 @@
+           'all_dependent_settings': {
+             'link_settings': {
+               'libraries': [
+-                '-labsl_flags_commandlineflag_internal -labsl_flags_usage -labsl_flags_usage_internal -labsl_flags_internal -labsl_flags -labsl_flags_private_handle_accessor -labsl_flags_program_name -labsl_flags_parse',
++                '-labsl_flags_commandlineflag_internal -labsl_flags_usage -labsl_flags_usage_internal -labsl_flags_internal -labsl_flags_private_handle_accessor -labsl_flags_program_name -labsl_flags_parse',
+               ],
+             },
+           },
+@@ -398,7 +398,7 @@
+           'all_dependent_settings': {
+             'link_settings': {
+               'libraries': [
+-                '-labsl_synchronization -labsl_flags -labsl_graphcycles_internal -labsl_string_view',
++                '-labsl_synchronization -labsl_graphcycles_internal -labsl_string_view',
+               ],
+             },
+           },
+--- a/src/dictionary/file/codec.cc
++++ b/src/dictionary/file/codec.cc
+@@ -42,6 +42,10 @@
+ #include "dictionary/file/codec_interface.h"
+ #include "dictionary/file/codec_util.h"
+ #include "dictionary/file/section.h"
++#if defined(ABSL_LTS_RELEASE_VERSION) && ABSL_LTS_RELEASE_VERSION >= 20240116
++// Abseil 20240116.0 needs explicit inclusion for StrCat
++#include "absl/strings/str_cat.h"
++#endif
+ #include "absl/status/status.h"
+ 
+ namespace mozc {

diff --git a/app-i18n/mozc/mozc-2.28.5029.102-r3.ebuild b/app-i18n/mozc/mozc-2.28.5029.102-r3.ebuild
new file mode 100644
index 000000000000..880a0b720655
--- /dev/null
+++ b/app-i18n/mozc/mozc-2.28.5029.102-r3.ebuild
@@ -0,0 +1,467 @@
+# Copyright 2010-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="8"
+
+PYTHON_COMPAT=( python3_{10..12} )
+
+inherit desktop edo elisp-common multiprocessing python-any-r1 savedconfig toolchain-funcs xdg
+
+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="305e9a7374254148474d067c46d55a4ee6081837"
+	MOZC_DATE="${PV#*_p}"
+	MOZC_DATE="${MOZC_DATE%%_p*}"
+
+	FCITX_MOZC_GIT_REVISION="242b4f703cba27d4ff4dc123c713a478f964e001"
+	FCITX_MOZC_DATE="${PV#*_p}"
+	FCITX_MOZC_DATE="${FCITX_MOZC_DATE#*_p}"
+	FCITX_MOZC_DATE="${FCITX_MOZC_DATE%%_p*}"
+
+	JAPANESE_USAGE_DICTIONARY_GIT_REVISION="a4a66772e33746b91e99caceecced9a28507e925"
+	JAPANESE_USAGE_DICTIONARY_DATE="20180701040110"
+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 -> ${PN}-${PV%%_p*}-${MOZC_DATE}.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/~sam/distfiles/${CATEGORY}/${PN}/${PN}-2.28.5029.102-patches.tar.xz
+		fcitx4? ( https://github.com/fcitx/${PN}/archive/${FCITX_MOZC_GIT_REVISION}.tar.gz -> fcitx-${PN}-${PV%%_p*}-${FCITX_MOZC_DATE}.tar.gz )
+		fcitx5? ( https://github.com/fcitx/${PN}/archive/${FCITX_MOZC_GIT_REVISION}.tar.gz -> fcitx-${PN}-${PV%%_p*}-${FCITX_MOZC_DATE}.tar.gz )
+	"
+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 ~x86"
+IUSE="debug emacs fcitx4 fcitx5 +gui ibus renderer test"
+REQUIRED_USE="|| ( emacs fcitx4 fcitx5 ibus )"
+RESTRICT="!test? ( test )"
+
+BDEPEND="
+	dev-build/gyp
+	$(python_gen_any_dep 'dev-python/six[${PYTHON_USEDEP}]')
+	>=dev-libs/protobuf-3.0.0
+	app-alternatives/ninja
+	virtual/pkgconfig
+	emacs? ( app-editors/emacs:* )
+	fcitx4? ( sys-devel/gettext )
+	fcitx5? ( sys-devel/gettext )
+"
+DEPEND="
+	>=dev-cpp/abseil-cpp-20240116.0:=
+	>=dev-libs/protobuf-3.0.0:=
+	fcitx4? (
+		app-i18n/fcitx:4
+		virtual/libintl
+	)
+	fcitx5? (
+		app-i18n/fcitx:5
+		app-i18n/libime
+		sys-devel/gettext
+		virtual/libintl
+	)
+	gui? (
+		dev-qt/qtcore:5
+		dev-qt/qtgui:5
+		dev-qt/qtwidgets:5
+	)
+	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
+	)
+	test? (
+		>=dev-cpp/gtest-1.8.0
+		dev-libs/jsoncpp
+	)"
+RDEPEND="
+	>=dev-cpp/abseil-cpp-20230802.0:=[cxx17(+)]
+	>=dev-libs/protobuf-3.0.0:=
+	emacs? ( app-editors/emacs:* )
+	fcitx4? (
+		app-i18n/fcitx:4
+		virtual/libintl
+	)
+	fcitx5? (
+		app-i18n/fcitx:5
+		app-i18n/libime
+		sys-devel/gettext
+		virtual/libintl
+	)
+	gui? (
+		dev-qt/qtcore:5
+		dev-qt/qtgui:5
+		dev-qt/qtwidgets:5
+	)
+	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
+	)
+"
+
+S="${WORKDIR}/${P}/src"
+
+SITEFILE="50${PN}-gentoo.el"
+
+PATCHES=(
+	"${WORKDIR}"/mozc-2.28.5029.102-patches
+	"${FILESDIR}"/mozc-2.28.5029.102-abseil.patch
+	"${FILESDIR}"/mozc-2.28.5029.102-abseil-20230802.0.patch
+	"${FILESDIR}"/mozc-2.28.5029.102-abseil-20240116.patch
+)
+
+python_check_deps() {
+	python_has_version "dev-python/six[${PYTHON_USEDEP}]"
+}
+
+src_unpack() {
+	if [[ "${PV}" == "9999" ]]; then
+		git-r3_src_unpack
+
+		if use fcitx4 || use fcitx5; 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
+		if use fcitx5; then
+			cp -pr "${WORKDIR}"/fcitx{,5}-mozc || die
+		fi
+	else
+		unpack ${PN}-${PV%%_p*}-${MOZC_DATE}.tar.gz
+		mv mozc-${MOZC_GIT_REVISION} ${P} || die
+
+		unpack ${PN}-2.28.5029.102-patches.tar.xz
+
+		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
+
+		if use fcitx4 || use fcitx5; then
+			unpack fcitx-${PN}-${PV%%_p*}-${FCITX_MOZC_DATE}.tar.gz
+			if use fcitx4; then
+				cp -pr mozc-${FCITX_MOZC_GIT_REVISION} fcitx-${PN} || die
+			fi
+			if use fcitx5; then
+				cp -pr mozc-${FCITX_MOZC_GIT_REVISION} fcitx5-${PN} || die
+			fi
+			rm -r mozc-${FCITX_MOZC_GIT_REVISION} || die
+		fi
+	fi
+}
+
+src_prepare() {
+	if use fcitx4; then
+		cp -pr "${WORKDIR}/fcitx-mozc/src/unix/fcitx" unix || die
+		PATCHES+=( "${FILESDIR}"/mozc-2.28.5029.102-abseil-20230802.0-fcitx4.patch )
+	fi
+	if use fcitx5; then
+		cp -pr "${WORKDIR}/fcitx5-mozc/src/unix/fcitx5" unix || die
+		PATCHES+=( "${FILESDIR}"/mozc-2.28.5029.102-abseil-20230802.0-fcitx5.patch )
+	fi
+
+	pushd "${WORKDIR}/${P}" > /dev/null || die
+	default
+	popd > /dev/null || die
+
+	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 "${MAKEOPTS}" 999)', '-l$(makeopts_loadavg "${MAKEOPTS}" 0)', '-v'/" \
+		-i build_mozc.py || die
+
+	local ar=($(tc-getAR))
+	local cc=($(tc-getCC))
+	local cxx=($(tc-getCXX))
+	local ld=($(tc-getLD))
+	local nm=($(tc-getNM))
+	local readelf=($(tc-getREADELF))
+
+	# 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
+
+	# https://github.com/google/mozc/issues/489
+	sed \
+		-e "/'-lc++'/d" \
+		-e "/'-stdlib=libc++'/d" \
+		-i gyp/common.gypi || die
+
+	# bug #877765
+	restore_config mozcdic-ut.txt
+	if [[ -f /mozcdic-ut.txt && -s mozcdic-ut.txt ]]; then
+		einfo "mozcdic-ut.txt found. Adding to mozc dictionary..."
+		cat mozcdic-ut.txt >> "${WORKDIR}/${P}/src/data/dictionary_oss/dictionary00.txt" || die
+	fi
+}
+
+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 debug_extra_cflags=)
+	gyp_arguments+=(-D release_extra_cflags=)
+
+	gyp_arguments+=(-D use_fcitx=$(usex fcitx4 YES NO))
+	gyp_arguments+=(-D use_fcitx5=$(usex fcitx5 YES NO))
+	gyp_arguments+=(-D use_libibus=$(usex ibus 1 0))
+	gyp_arguments+=(-D use_libprotobuf=1)
+	gyp_arguments+=(-D use_system_abseil_cpp=1)
+	gyp_arguments+=(-D use_system_gtest=$(usex test 1 0))
+	gyp_arguments+=(-D use_system_jsoncpp=$(usex test 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 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
+
+	edo "${PYTHON}" build_mozc.py gyp \
+		--gypdir="${EPREFIX}/usr/bin" \
+		--server_dir="${EPREFIX}/usr/libexec/mozc" \
+		--verbose \
+		$(usex gui "" --noqt) \
+		-- "${gyp_arguments[@]}"
+}
+
+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 fcitx5; then
+		targets+=(unix/fcitx5/fcitx5.gyp:fcitx5-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
+
+	if use ibus; then
+		GYP_IBUS_FLAG="--use_gyp_for_ibus_build"
+	fi
+
+	edo "${PYTHON}" build_mozc.py build -c ${BUILD_TYPE} ${GYP_IBUS_FLAG} -v "${targets[@]}"
+
+	if use emacs; then
+		elisp-compile unix/emacs/*.el
+	fi
+}
+
+src_test() {
+	edo "${PYTHON}" build_mozc.py runtests -c ${BUILD_TYPE} --test_jobs 1
+}
+
+src_install() {
+	exeinto /usr/libexec/mozc
+	doexe out_linux/${BUILD_TYPE}/mozc_server
+
+	[[ -s mozcdic-ut.txt ]] && save_config mozcdic-ut.txt
+
+	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 ../../fcitx-${PN}/src/data/images/unix/ui-*.png; do
+			newins "${image}" "mozc-${image#../../fcitx-${PN}/src/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 fcitx5; then
+		exeinto /usr/$(get_libdir)/fcitx5
+		doexe out_linux/${BUILD_TYPE}/fcitx5-mozc.so
+
+		insinto /usr/share/fcitx5/addon
+		newins unix/fcitx5/mozc-addon.conf mozc.conf
+
+		insinto /usr/share/fcitx5/inputmethod
+		doins unix/fcitx5/mozc.conf
+
+		local orgfcitx5="org.fcitx.Fcitx5.fcitx-mozc"
+		newicon -s 128 data/images/product_icon_32bpp-128.png ${orgfcitx5}.png
+		newicon -s 128 data/images/product_icon_32bpp-128.png fcitx-mozc.png
+		newicon -s 32 data/images/unix/ime_product_icon_opensource-32.png ${orgfcitx5}.png
+		newicon -s 32 data/images/unix/ime_product_icon_opensource-32.png fcitx-mozc.png
+		for uiimg in ../../fcitx5-mozc/scripts/icons/ui-*.png; do
+			dimg=${uiimg#*ui-}
+			newicon -s 48 ${uiimg} ${orgfcitx5}-${dimg/_/-}
+			newicon -s 48 ${uiimg} fcitx-mozc-${dimg/_/-}
+		done
+
+		local locale mo_file
+		for mo_file in unix/fcitx5/po/*.po; do
+			locale="${mo_file##*/}"
+			locale="${locale%.po}"
+			msgfmt ${mo_file} -o ${mo_file/.po/.mo} || die
+			insinto /usr/share/locale/${locale}/LC_MESSAGES
+			newins "${mo_file/.po/.mo}" fcitx5-mozc.mo
+		done
+		msgfmt --xml -d unix/fcitx5/po/ --template unix/fcitx5/org.fcitx.Fcitx5.Addon.Mozc.metainfo.xml.in -o \
+			unix/fcitx5/org.fcitx.Fcitx5.Addon.Mozc.metainfo.xml || die
+		insinto /usr/share/metainfo
+		doins unix/fcitx5/org.fcitx.Fcitx5.Addon.Mozc.metainfo.xml
+	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() {
+	elog
+	elog "ENVIRONMENTAL VARIABLES"
+	elog
+	elog "MOZC_SERVER_DIRECTORY"
+	elog "  Mozc server directory"
+	elog "  Value used by default: \"${EPREFIX}/usr/libexec/mozc\""
+	elog "MOZC_DOCUMENTS_DIRECTORY"
+	elog "  Mozc documents directory"
+	elog "  Value used by default: \"${EPREFIX}/usr/libexec/mozc/documents\""
+	elog "MOZC_CONFIGURATION_DIRECTORY"
+	elog "  Mozc configuration directory"
+	elog "  Value used by default: \"~/.mozc\""
+	elog
+	if use emacs; then
+		elog
+		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\"."
+		elog
+
+		elisp-site-regen
+	fi
+	xdg_pkg_postinst
+}
+
+pkg_postrm() {
+	if use emacs; then
+		elisp-site-regen
+	fi
+	xdg_pkg_postrm
+}


^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2024-08-28  4:47 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-26 22:45 [gentoo-commits] repo/gentoo:master commit in: app-i18n/mozc/files/, app-i18n/mozc/ Nick Sarnie
  -- strict thread matches above, loose matches on Subject: below --
2024-08-28  4:47 WANG Xuerui
2024-01-14  0:41 Yixun Lan
2023-09-25 17:22 Nick Sarnie
2022-01-29 15:20 Yixun Lan
2020-12-27 18:39 Mike Gilbert
2019-12-29 19:33 Mike Gilbert
2019-12-29 19:33 Mike Gilbert
2019-05-05 19:05 Mike Gilbert
2018-04-16 18:29 Mike Gilbert
2017-11-01 20:54 Mike Gilbert
2017-10-05 18:57 Mike Gilbert

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox