Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/inputmethod/mozc-server inputmethod/mozc-server: fix b...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/77434600f44c
branches:  trunk
changeset: 434582:77434600f44c
user:      taca <taca%pkgsrc.org@localhost>
date:      Fri Jun 19 05:45:30 2020 +0000

description:
inputmethod/mozc-server: fix build problem

Fix build problem applying from https://github.com/google/mozc/issues/460.

diffstat:

 inputmethod/mozc-server/distinfo                                                           |   16 +-
 inputmethod/mozc-server/patches/patch-dictionary_user__dictionary.cc                       |   15 +
 inputmethod/mozc-server/patches/patch-dictionary_user__dictionary__session.cc              |  204 +++++++++
 inputmethod/mozc-server/patches/patch-dictionary_user__dictionary__session__test.cc        |   66 +++
 inputmethod/mozc-server/patches/patch-dictionary_user__dictionary__storage.cc              |  197 +++++++++
 inputmethod/mozc-server/patches/patch-dictionary_user__dictionary__storage.h               |   25 +
 inputmethod/mozc-server/patches/patch-dictionary_user__dictionary__storage__test.cc        |  176 ++++++++
 inputmethod/mozc-server/patches/patch-dictionary_user__dictionary__test.cc                 |  212 ++++++++++
 inputmethod/mozc-server/patches/patch-gui_word__register__dialog_word__register__dialog.cc |   14 +-
 inputmethod/mozc-server/patches/patch-prediction_user__history__predictor.cc               |   64 ++-
 inputmethod/mozc-server/patches/patch-prediction_user__history__predictor.h                |   23 +
 inputmethod/mozc-server/patches/patch-prediction_user__history__predictor__test.cc         |   24 +
 inputmethod/mozc-server/patches/patch-rewriter_usage__rewriter__test.cc                    |   24 +
 13 files changed, 1054 insertions(+), 6 deletions(-)

diffs (truncated from 1155 to 300 lines):

diff -r a4e96724f008 -r 77434600f44c inputmethod/mozc-server/distinfo
--- a/inputmethod/mozc-server/distinfo  Thu Jun 18 21:45:24 2020 +0000
+++ b/inputmethod/mozc-server/distinfo  Fri Jun 19 05:45:30 2020 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.21 2017/12/30 14:51:42 tsutsui Exp $
+$NetBSD: distinfo,v 1.22 2020/06/19 05:45:30 taca Exp $
 
 SHA1 (mozc-2.20.2673.102.tar.xz) = 9cedf4d392593e04755fa44afd79cd40bb80b9d1
 RMD160 (mozc-2.20.2673.102.tar.xz) = 723fef550d88c5a4dc33f2ec9c8d7ee694e60d64
@@ -25,6 +25,13 @@
 SHA1 (patch-build__tools_util.py) = 5ca614adf2453fcc33c18cda74c0d9b2e4f6bc21
 SHA1 (patch-client_client.cc) = f1eb1860c41a97c82a338f74acdcf0ed3477b6da
 SHA1 (patch-config_stats__config__util__test.cc) = 3514f04a921908795c03d0e8685135297dc9e2af
+SHA1 (patch-dictionary_user__dictionary.cc) = 34147edfd4d0c09637ab285584b4fad4e7ee95ff
+SHA1 (patch-dictionary_user__dictionary__session.cc) = 13270d72fcdd11a3d7fd6992613a8b562f7e51d0
+SHA1 (patch-dictionary_user__dictionary__session__test.cc) = 2c3fb20f3bd8c4f7e870e978f51a6e707d4a366d
+SHA1 (patch-dictionary_user__dictionary__storage.cc) = d2ac32d6606b835d93422e925bb1b82e62b46ab8
+SHA1 (patch-dictionary_user__dictionary__storage.h) = df3da7bf5a31f030d0202051befb70cf7afac519
+SHA1 (patch-dictionary_user__dictionary__storage__test.cc) = 1f11ecc89326af675f252ead82bcd4afb65cec2e
+SHA1 (patch-dictionary_user__dictionary__test.cc) = 5ca305cae59163f1e1779e77e608f3087aae0190
 SHA1 (patch-gui_config__dialog_config__dialog.cc) = de2750a6bf99c4e38983cf5322adae8c46ca45d6
 SHA1 (patch-gui_config__dialog_keybinding__editor.cc) = 529e902c146907d3a91181bad3822bbbec69b6b7
 SHA1 (patch-gui_dictionary__tool_dictionary__tool.cc) = cae617cc8e324b0f93adc1e76632a018530cd2c7
@@ -32,7 +39,7 @@
 SHA1 (patch-gui_qt__moc.gypi) = e3d42e61b35012cda10da13aa03cee67786e171c
 SHA1 (patch-gui_qt__rcc.gypi) = d38a849fe8e81672eb441a41936f454d8e45ff5c
 SHA1 (patch-gui_qt__uic.gypi) = 7dd69ee109e81f0e70f2866b77555412518b4844
-SHA1 (patch-gui_word__register__dialog_word__register__dialog.cc) = 6e247fcab5d570b733365b57c5a5d72a021dd16f
+SHA1 (patch-gui_word__register__dialog_word__register__dialog.cc) = 213b087d4cd5f22ee2b202963a7b7b3325baafb0
 SHA1 (patch-gyp_common.gypi) = 13cd5010a6f3ed314a94248144657955f8bbbe72
 SHA1 (patch-gyp_directories.gypi) = 6504d8b43f83be3908b39a5e51598c2aba0dffd9
 SHA1 (patch-handwriting_zinnia.gyp) = b59e546cb9b8b91dcd627885e1853e8ba8dead46
@@ -42,7 +49,10 @@
 SHA1 (patch-ipc_named__event.cc) = 92283261e7580569587e43156f13567b593c9a32
 SHA1 (patch-ipc_unix__ipc.cc) = 25107c2e84844ecaa3445efb48cc3f2795579dec
 SHA1 (patch-net_net.gyp) = 61353724533f9239f4c58fa37f0a8fb2eb5552c3
-SHA1 (patch-prediction_user__history__predictor.cc) = 14e7a899c1c27108169de6571746d5fe4841630a
+SHA1 (patch-prediction_user__history__predictor.cc) = 66cf79206663d35f64a0cbee63be04c8faa99903
+SHA1 (patch-prediction_user__history__predictor.h) = 50ee05871b01864b71e4682f712c3eb662b0be94
+SHA1 (patch-prediction_user__history__predictor__test.cc) = 7fbcbfcb6bcaa236bc94fd8a9c1cd97051ffa222
+SHA1 (patch-rewriter_usage__rewriter__test.cc) = 0ceba47a833574d4eeac3e38ed2fca5ba5ba0c0c
 SHA1 (patch-session_session.cc) = 773017ac54e79239f6734a124f457b0b81bb1ced
 SHA1 (patch-session_session__test.cc) = 99165b29555844a40d30cf5554cc5c66773b70ed
 SHA1 (patch-third__party_protobuf_post__process__dist.sh) = 8adc79d5d7eed3cbf406ebcfbd5832b7a050ced6
diff -r a4e96724f008 -r 77434600f44c inputmethod/mozc-server/patches/patch-dictionary_user__dictionary.cc
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/inputmethod/mozc-server/patches/patch-dictionary_user__dictionary.cc      Fri Jun 19 05:45:30 2020 +0000
@@ -0,0 +1,15 @@
+$NetBSD: patch-dictionary_user__dictionary.cc,v 1.1 2020/06/19 05:45:30 taca Exp $
+
+Fix from https://github.com/google/mozc/issues/460
+
+--- dictionary/user_dictionary.cc.orig 2017-11-02 13:32:47.000000000 +0000
++++ dictionary/user_dictionary.cc
+@@ -289,7 +289,7 @@ class UserDictionary::UserDictionaryRelo
+     }
+ 
+     auto_register_mode_ = false;
+-    dic_->Load(*(storage.get()));
++    dic_->Load(storage.get()->user_dictionary_storage_base);
+   }
+ 
+  private:
diff -r a4e96724f008 -r 77434600f44c inputmethod/mozc-server/patches/patch-dictionary_user__dictionary__session.cc
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/inputmethod/mozc-server/patches/patch-dictionary_user__dictionary__session.cc     Fri Jun 19 05:45:30 2020 +0000
@@ -0,0 +1,204 @@
+$NetBSD: patch-dictionary_user__dictionary__session.cc,v 1.1 2020/06/19 05:45:30 taca Exp $
+
+Fix from https://github.com/google/mozc/issues/460
+
+--- dictionary/user_dictionary_session.cc.orig 2017-11-02 13:32:47.000000000 +0000
++++ dictionary/user_dictionary_session.cc
+@@ -69,11 +69,11 @@ class UndoCreateDictionaryCommand : publ
+   }
+ 
+   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 @@ class UndoDeleteDictionaryCommand : publ
+     }
+ 
+     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 @@ class UndoDeleteDictionaryWithEnsuringNo
+   }
+ 
+   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 @@ class UndoRenameDictionaryCommand : publ
+   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 @@ class UndoAddEntryCommand : public UserD
+   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 @@ class UndoEditEntryCommand : public User
+   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 @@ class UndoDeleteEntryCommand : public Us
+   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 @@ class UndoImportFromStringCommand : publ
+   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 @@ UserDictionarySession::~UserDictionarySe
+ 
+ // 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 @@ UserDictionaryCommandStatus::Status User
+     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 @@ UserDictionarySession::DeleteDictionaryI
+   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 @@ UserDictionaryCommandStatus::Status User
+     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 @@ UserDictionaryCommandStatus::Status User
+     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 @@ UserDictionaryCommandStatus::Status User
+     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 @@ UserDictionaryCommandStatus::Status User
+     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 @@ UserDictionaryCommandStatus::Status User
+     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 @@ UserDictionarySession::ImportToNewDictio
+     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 @@ UserDictionarySession::ImportToNewDictio
+ 
+   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 @@ UserDictionarySession::ImportToNewDictio
+ }
+ 
+ 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 @@ bool UserDictionarySession::EnsureNonEmp
+   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::AddUndoComma
+ 
+ void UserDictionarySession::ClearDictionariesAndUndoHistory() {
+   ScopedUserDictionaryLocker l(storage_.get());
+-  storage_->clear_dictionaries();
++  storage_->user_dictionary_storage_base.clear_dictionaries();
+   ClearUndoHistory();
+ }
+ 
diff -r a4e96724f008 -r 77434600f44c inputmethod/mozc-server/patches/patch-dictionary_user__dictionary__session__test.cc
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/inputmethod/mozc-server/patches/patch-dictionary_user__dictionary__session__test.cc       Fri Jun 19 05:45:30 2020 +0000
@@ -0,0 +1,66 @@
+$NetBSD: patch-dictionary_user__dictionary__session__test.cc,v 1.1 2020/06/19 05:45:30 taca Exp $
+
+Fix from https://github.com/google/mozc/issues/460
+
+--- dictionary/user_dictionary_session_test.cc.orig    2017-11-02 13:32:47.000000000 +0000
++++ dictionary/user_dictionary_session_test.cc
+@@ -105,12 +105,12 @@ TEST_F(UserDictionarySessionTest, SaveAn
+ 
+   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());
+ 
+@@ -140,7 +140,7 @@ TEST_F(UserDictionarySessionTest, DISABL
+ 
+   // Create huge dummy data.
+   {



Home | Main Index | Thread Index | Old Index