mozc: bump to 2.26.4451.1 (#6116)

* mozc: bump to 2.26.4451.1

* Replace patch with patchset
This commit is contained in:
hanya
2021-08-12 03:36:06 +09:00
committed by GitHub
parent c0e2a15b8a
commit 977e201520
4 changed files with 43 additions and 1327 deletions

View File

@@ -1,21 +1,18 @@
SUMMARY="Japanese input method editor"
DESCRIPTION="A Japanese Input Method Editor (IME) designed for multi-platform. \
This is open source version."
This is open source version. \
Mozcdic-ut dictionary is contained which adds over 1,000,000 entries \
to mozc dictionary."
HOMEPAGE="https://github.com/google/mozc"
COPYRIGHT="2010-2018 Google Inc."
LICENSE="BSD (3-clause)"
REVISION="4"
COPYRIGHT="2010-2021 Google Inc.
2021 Utumi Hirosi"
LICENSE="BSD (3-clause)
Apache v2"
REVISION="1"
SOURCE_URI="https://github.com/hanya/mozc/releases/download/v$portVersion/mozc-v$portVersion.tar.bz2"
CHECKSUM_SHA256="15785beb91e8ab78728bc85c1e5d8a8a6e17aa64a3c5399339d200679bbcad6a"
CHECKSUM_SHA256="745a8d91bbdfb6eab44e22f89b58add79b012e994ffdb233e2468d7accc73ec3"
SOURCE_DIR="mozc"
PATCHES="mozc-$portVersion.patchset"
if [ "$effectiveTargetArchitecture" = x86 ]; then
PATCHES+="
mozc-$portVersion-x86.patch"
fi
zinniaTomoeVersion="0.6.0-20080911"
SOURCE_URI_2="https://downloads.sourceforge.net/zinnia/zinnia-tomoe-$zinniaTomoeVersion.tar.bz2"
CHECKSUM_SHA256_2="fd1a264b8aeea0ebec59e8c8765864a9543a75fb2dba349745bb3a3587790927"
ARCHITECTURES="!x86_gcc2 x86 x86_64"
SECONDARY_ARCHITECTURES="x86"
@@ -39,9 +36,10 @@ BUILD_PREREQUIRES="
cmd:ninja
cmd:pkg_config$secondaryArchSuffix
cmd:protoc$secondaryArchSuffix
cmd:python2
cmd:python3
cmd:which
cmd:xres
six_python3
"
if [ "$targetArchitecture" = x86_gcc2 ]; then
BUILD_PREREQUIRES+="
@@ -53,22 +51,22 @@ BUILD()
{
cd src
cat third_party/mozcdic-ut/mozcdic-ut-20210725.txt >> \
$sourceDir/src/data/dictionary_oss/dictionary00.txt
GYP_DEFINES="document_dir=$dataDir/mozc \
zinnia_model_file=$dataDir/mozc/zinnia/handwriting-ja.model \
zinnia_tomoe_dir=$sourceDir2/zinnia-tomoe-$zinniaTomoeVersion \
enable_gtk_renderer=0 \
target_x86_gcc2=$targetArchitecture" \
$portPackageLinksDir/cmd~python2/bin/python2 build_mozc.py gyp \
$portPackageLinksDir/cmd~python3/bin/python3 build_mozc.py gyp \
--target_platform=Linux --variant=Haiku --noqt \
--server_dir=$dataDir/mozc
$portPackageLinksDir/cmd~python2/bin/python2 build_mozc.py build \
$portPackageLinksDir/cmd~python3/bin/python3 build_mozc.py build \
-c Release \
server/server.gyp:mozc_server \
emacs/emacs.gyp:mozc_emacs_helper \
input_method/input_method.gyp:mozc \
haiku_gui/haiku_gui.gyp:mozc_tool_haiku \
zinnia_model/zinnia_model.gyp:zinnia_model
haiku_gui/haiku_gui.gyp:mozc_tool_haiku
}
INSTALL()
@@ -81,7 +79,6 @@ else
InputMethodDir=$addOnsDir/input_server/methods
fi
mkdir -p $MozcDataDir
mkdir -p $MozcDataDir/zinnia
mkdir -p $MozcDataDir/images
mkdir -p $dataDir/locale/catalogs/x-vnd.Mozc-InputMethod
mkdir -p $dataDir/locale/catalogs/x-vnd.Mozc-MozcTool
@@ -93,8 +90,6 @@ if [ "$targetArchitecture" = x86_gcc2 ]; then
fi
cp $MozcOutDir/mozc_server $MozcDataDir/mozc_server
cp $MozcOutDir/mozc_tool_haiku $MozcDataDir/mozc_tool
cp $MozcOutDir/handwriting-ja.model \
$MozcDataDir/zinnia/handwriting-ja.model
cp $MozcOutDir/mozc_emacs_helper $MozcDataDir/mozc_emacs_helper
cp src/data/installer/credits_en.html $MozcDataDir/credits_en.html
cp src/data/images/product_icon_32bpp-128.png \
@@ -110,5 +105,5 @@ TEST()
{
cd src
# Some tests fails with job > 1
python2 build_mozc.py runtests -c Release --test_jobs 1
python3 build_mozc.py runtests -c Release --test_jobs 1
}

View File

@@ -1,167 +0,0 @@
diff --git a/src/base/port.h b/src/base/port.h
index ec4139b5..d90e7485 100644
--- a/src/base/port.h
+++ b/src/base/port.h
@@ -96,6 +96,9 @@ using uint16 = uint16_t;
using uint32 = uint32_t;
using uint64 = uint64_t;
#else // OS_HAIKU
+#if __HAIKU_ARCH == x86
+#include <SupportDefs.h>
+#else
using int8 = int8_t;
using int16 = int16_t;
using int32 = int32_t;
@@ -108,6 +111,7 @@ using uint32 = uint32_t;
#ifndef uint64
using uint64 = __haiku_uint64;
#endif
+#endif // __HAIKU_ARCH_ABI
#endif // OS_HAIKU
#endif // OS_WIN
using char32 = uint32;
diff --git a/src/converter/candidate_filter.cc b/src/converter/candidate_filter.cc
index 5c5a8e7b..f659fd6c 100644
--- a/src/converter/candidate_filter.cc
+++ b/src/converter/candidate_filter.cc
@@ -418,9 +418,9 @@ CandidateFilter::ResultType CandidateFilter::FilterCandidateInternal(
}
}
- const int64 top_cost = std::max(kMinCost, top_candidate_->cost);
+ const int64 top_cost = std::max(kMinCost, (int)top_candidate_->cost);
const int64 top_structure_cost =
- std::max(kMinCost, top_candidate_->structure_cost);
+ std::max(kMinCost, (int)top_candidate_->structure_cost);
// If candidate size < 3, don't filter candidate aggressively
// TOOD(taku): This is a tentative workaround for the case where
diff --git a/src/converter/immutable_converter.cc b/src/converter/immutable_converter.cc
index 23e941df..1b96a0f8 100644
--- a/src/converter/immutable_converter.cc
+++ b/src/converter/immutable_converter.cc
@@ -480,7 +480,7 @@ bool ImmutableConverterImpl::ResegmentArabicNumberAndSuffix(
// do -1 so that resegmented nodes are boosted
// over compound node.
- const int32 wcost = std::max(compound_node->wcost / 2 - 1, 0);
+ const int32 wcost = std::max(compound_node->wcost / 2 - 1, (long int)0);
Node *number_node = lattice->NewNode();
CHECK(number_node);
@@ -557,7 +557,7 @@ bool ImmutableConverterImpl::ResegmentPrefixAndArabicNumber(
// do -1 so that resegmented nodes are boosted
// over compound node.
- const int32 wcost = std::max(compound_node->wcost / 2 - 1, 0);
+ const int32 wcost = std::max(compound_node->wcost / 2 - 1, (long int)0);
Node *prefix_node = lattice->NewNode();
CHECK(prefix_node);
@@ -1690,10 +1690,10 @@ void ImmutableConverterImpl::InsertFirstSegmentToCandidates(
// cost penalty based on the cost diff.
const Segment &first_segment = segments->conversion_segment(0);
const int base_cost_diff = std::max(
- 0, (first_segment.candidate(0).cost -
+ (long int)0, (first_segment.candidate(0).cost -
first_segment.candidate(only_first_segment_candidate_pos).cost));
const int base_wcost_diff = std::max(
- 0, (first_segment.candidate(0).wcost -
+ (long int)0, (first_segment.candidate(0).wcost -
first_segment.candidate(only_first_segment_candidate_pos).wcost));
for (size_t i = only_first_segment_candidate_pos;
i < first_segment.candidates_size();) {
diff --git a/src/gui/character_pad/character_palette.cc b/src/gui/character_pad/character_palette.cc
index ee2a4f3a..a40e50cb 100644
--- a/src/gui/character_pad/character_palette.cc
+++ b/src/gui/character_pad/character_palette.cc
@@ -333,7 +333,7 @@ void CharacterPalette::showUnicodeTableByRange(const UnicodeRange &range) {
for (char32 ucs4 = range.first; ucs4 <= range.last; ++ucs4) {
const char32 ucs4s[] = { ucs4 };
QTableWidgetItem *item =
- new QTableWidgetItem(QString::fromUcs4(ucs4s, arraysize(ucs4s)));
+ new QTableWidgetItem(QString::fromUcs4((const char32_t*)ucs4s, arraysize(ucs4s)));
item->setTextAlignment(Qt::AlignCenter);
tableWidget->setItem(ucs4 / kHexBase - offset, ucs4 % kHexBase, item);
tableWidget->setEditTriggers(QAbstractItemView::NoEditTriggers);
diff --git a/src/session/session_handler.cc b/src/session/session_handler.cc
index e32f9c43..fc69e5be 100644
--- a/src/session/session_handler.cc
+++ b/src/session/session_handler.cc
@@ -196,7 +196,7 @@ void SessionHandler::Init(
config::ConfigHandler::GetConfig(config_.get());
// allow [2..128] sessions
- max_session_size_ = std::max(2, std::min(FLAGS_max_session_size, 128));
+ max_session_size_ = std::max((int32)2, std::min(FLAGS_max_session_size, (int32)128));
session_map_.reset(new SessionMap(max_session_size_));
if (!engine_) {
@@ -626,7 +626,7 @@ bool SessionHandler::CreateSession(commands::Command *command) {
// prevent DOS attack
// don't allow CreateSession in very short period.
const int create_session_minimum_interval =
- std::max(0, std::min(FLAGS_create_session_min_interval, 10));
+ std::max((int32)0, std::min(FLAGS_create_session_min_interval, (int32)10));
uint64 current_time = Clock::GetTime();
if (last_create_session_time_ != 0 &&
@@ -754,11 +754,11 @@ bool SessionHandler::Cleanup(commands::Command *command) {
// allow [1..600] sec. default: 300
const uint64 create_session_timeout =
suspend_time +
- std::max(1, std::min(FLAGS_last_create_session_timeout, 600));
+ std::max((int32)1, std::min(FLAGS_last_create_session_timeout, (int32)600));
// allow [10..7200] sec. default 3600
const uint64 last_command_timeout =
- suspend_time + std::max(10, std::min(FLAGS_last_command_timeout, 7200));
+ suspend_time + std::max((int32)10, std::min(FLAGS_last_command_timeout, (int32)7200));
std::vector<SessionID> remove_ids;
for (SessionElement *element =
diff --git a/src/session/session_watch_dog.cc b/src/session/session_watch_dog.cc
index ad6571b3..7cfe7c02 100644
--- a/src/session/session_watch_dog.cc
+++ b/src/session/session_watch_dog.cc
@@ -67,7 +67,7 @@ SessionWatchDog::SessionWatchDog(int32 interval_sec)
: interval_sec_(interval_sec),
client_(NULL), cpu_stats_(NULL), event_(new UnnamedEvent) {
// allow [1..600].
- interval_sec_ = std::max(1, std::min(interval_sec_, 600));
+ interval_sec_ = std::max((int32)1, std::min(interval_sec_, (int32)600));
DCHECK(event_->IsAvailable())
<< "Unnamed event is not available";
}
@@ -128,13 +128,13 @@ void SessionWatchDog::Run() {
DCHECK_GE(number_of_processors, 1);
// the first (interval_sec_ - 60) sec: -> Do nothing
- const int32 idle_interval_msec = std::max(0, (interval_sec_ - 60)) * 1000;
+ const int32 idle_interval_msec = std::max((int32)0, (interval_sec_ - (int32)60)) * 1000;
// last 60 sec: -> check CPU usage
- const int32 cpu_check_interval_msec = std::min(60, interval_sec_) * 1000;
+ const int32 cpu_check_interval_msec = std::min((int32)60, interval_sec_) * 1000;
// for every 5 second, get CPU load percentage
- const int32 cpu_check_duration_msec = std::min(5, interval_sec_) * 1000;
+ const int32 cpu_check_duration_msec = std::min((int32)5, interval_sec_) * 1000;
std::fill(cpu_loads, cpu_loads + arraysize(cpu_loads), 0.0);
diff --git a/src/usage_stats/usage_stats.cc b/src/usage_stats/usage_stats.cc
index 0880bd5e..65fb65a4 100644
--- a/src/usage_stats/usage_stats.cc
+++ b/src/usage_stats/usage_stats.cc
@@ -174,8 +174,8 @@ void UsageStats::UpdateTiming(const string &name, uint32 val) {
stats.set_num_timings(stats.num_timings() + 1);
stats.set_total_time(stats.total_time() + val);
stats.set_avg_time(stats.total_time() / stats.num_timings());
- stats.set_min_time(std::min(stats.min_time(), val));
- stats.set_max_time(std::max(stats.max_time(), val));
+ stats.set_min_time(std::min(stats.min_time(), (google::protobuf::uint32)val));
+ stats.set_max_time(std::max(stats.max_time(), (google::protobuf::uint32)val));
} else {
stats.set_name(name);
stats.set_type(Stats::TIMING);

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,25 @@
From 7dade1410b1475b82beeea746c1eaff0723671f3 Mon Sep 17 00:00:00 2001
From: hanya <hanya.runo@gmail.com>
Date: Tue, 10 Aug 2021 18:06:18 +0900
Subject: [PATCH] Support mmap on Haiku
---
src/third_party/abseil-cpp/absl/base/config.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/third_party/abseil-cpp/absl/base/config.h b/src/third_party/abseil-cpp/absl/base/config.h
index 9544996..f878679 100644
--- a/src/third_party/abseil-cpp/absl/base/config.h
+++ b/src/third_party/abseil-cpp/absl/base/config.h
@@ -372,7 +372,7 @@ static_assert(ABSL_INTERNAL_INLINE_NAMESPACE_STR[0] != 'h' ||
#elif defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) || \
defined(__ros__) || defined(__native_client__) || defined(__asmjs__) || \
defined(__wasm__) || defined(__Fuchsia__) || defined(__sun) || \
- defined(__ASYLO__) || defined(__myriad2__)
+ defined(__ASYLO__) || defined(__myriad2__) || defined(__HAIKU__)
#define ABSL_HAVE_MMAP 1
#endif
--
2.30.2