1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-15 03:14:23 +00:00

Update to 2.20.2677.102.

This commit is contained in:
Hiroki Sato 2017-01-01 06:47:00 +00:00
parent 5d00a87a2f
commit 18557054a1
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=430243
24 changed files with 23 additions and 749 deletions

View File

@ -2,8 +2,8 @@
# $FreeBSD$
PORTNAME= mozc
PORTVERSION= 2.17.2322.102
PORTREVISION= 3
PORTVERSION= 2.20.2677.102.01
DISTVERSIONPREFIX= v
CATEGORIES= japanese
MAINTAINER= hrs@FreeBSD.org
@ -15,15 +15,15 @@ LICENSE_FILE= ${WRKSRC}/LICENSE
BUILD_DEPENDS= ninja:devel/ninja \
gyp:devel/py-gyp
EXTRACT_DEPENDS=${PYTHON_CMD}:${PYTHON_PORTSDIR}
LIB_DEPENDS= libprotobuf.so:devel/protobuf \
LIB_DEPENDS= libprotobuf.so.11:devel/protobuf \
libzinnia.so:japanese/zinnia
RUN_DEPENDS= xdg-open:devel/xdg-utils
USE_GITHUB= yes
GH_TUPLE= google:${PORTNAME}:9b4c9e0 \
GH_TUPLE= hrs-allbsd:${PORTNAME}:${DISTVERSIONPREFIX}${DISTVERSION} \
hiroyuki-komatsu:japanese-usage-dictionary:e5b3425:udic
USES= compiler:c++11-lang pkgconfig iconv:wchar_t gmake \
USES= compiler:c++11-lang pkgconfig gmake \
tar:bzip2 python:2.7,build shebangfix
SHEBANG_FILES= src/build_mozc.py
BUILD_WRKSRC= ${WRKSRC}/src
@ -44,10 +44,13 @@ LICENSE_FILE_NAISTL= ${WRKSRC}/src/data/dictionary_oss/README.txt
LICENSE_DISTFILES_NAISTL=${DISTNAME}${EXTRACT_SUFX}
.elif ${BUILD_MOZC_LIST:Mmozc_tool} == "mozc_tool"
USE_GNOME= glib20 gtk20
USE_QT4= corelib gui qmake_build moc_build rcc_build uic_build
USE_QT5= core gui widgets
.elif ${BUILD_MOZC_LIST:Mibus_mozc} == "ibus_mozc"
USES+= gettext-runtime
USE_XORG= xcb
USE_GNOME= glib20 gtk20
USE_GNOME= cairo gdkpixbuf2 glib20 gtk20
LIB_DEPENDS+= libfontconfig.so:x11-fonts/fontconfig \
libfreetype.so:print/freetype2
.elif ${BUILD_MOZC_LIST:Mmozc_el} == "mozc_el"
USE_EMACS= yes
.elif ${BUILD_MOZC_LIST:Mfcitx_mozc}
@ -94,8 +97,6 @@ BUILD_MOZC_CMD_BUILD= ${BUILD_MOZC_CMD} build -c ${BUILD_MODE} ${_MAKE_JOBS}
BUILD_GYP_CMD= ${SETENV} ${MAKE_ENV} ${LOCALBASE}/bin/gyp
post-patch:
${REINPLACE_CMD} 's,-liconv,${ICONV_LIB},g' \
${BUILD_WRKSRC}/gui/qt_libraries.gypi
${FIND} ${BUILD_WRKSRC} \( -name '*.gyp' -o -name '*.gypi' \) -exec \
${REINPLACE_CMD} "s,'python','${PYTHON_CMD}',g" {} \;
.if ${BUILD_MOZC_LIST:Mfcitx_mozc} == "fcitx_mozc"
@ -133,8 +134,8 @@ GYP_DEFINES+= use_libibus=0 \
MASTER_SITES+= LOCAL/kuriyama:zipcode
DISTFILES+= \
ken_all-20160428.zip:zipcode \
jigyosyo-20160428.zip:zipcode
ken_all-20161031.zip:zipcode \
jigyosyo-20161031.zip:zipcode
PLIST_FILES+= bin/mozc \
bin/mozc_server \
@ -146,9 +147,10 @@ post-extract-mozc_server:
${UNZIP_NATIVE_CMD} -L -d ${BUILD_WRKSRC}/data/dictionary_oss \
${DISTDIR}/$$F; \
done
@cd ${BUILD_WRKSRC}/data/dictionary_oss && \
${PYTHON_CMD} ${BUILD_WRKSRC}/dictionary/gen_zip_code_seed.py \
--zip_code=ken_all.csv --jigyosyo=jigyosyo.csv \
cd ${BUILD_WRKSRC}/data/dictionary_oss && \
${SETENV} PYTHONPATH=${BUILD_WRKSRC} \
${PYTHON_CMD} ${BUILD_WRKSRC}/dictionary/gen_zip_code_seed.py \
--zip_code=ken_all.csv --jigyosyo=jigyosyo.csv \
>> dictionary09.txt
${MV} ${WRKSRC_udic}/usage_dict.txt \
${BUILD_WRKSRC}/third_party/japanese_usage_dictionary
@ -303,15 +305,7 @@ do-install-uim_mozc:
.endif
# fcitx_mozc
.if ${BUILD_MOZC_LIST:Mfcitx_mozc} == "fcitx_mozc" || make(makesum)
PATCH_SITES= http://download.fcitx-im.org/fcitx-mozc/
PATCHFILES= fcitx-mozc-2.17.2313.102.1.patch
.endif
.if ${BUILD_MOZC_LIST:Mfcitx_mozc} == "fcitx_mozc"
PATCH_DIST_STRIP=-p1
EXTRA_PATCHES= ${PATCHDIR}/extra-patch-src-unix-fcitx-eim.cc \
${PATCHDIR}/extra-patch-src-unix-fcitx-surrounding_text_util.cc
GYP_OPTIONS+= --noqt
GYP_DEFINES+= use_libibus=0 \
enable_gtk_renderer=0
@ -338,11 +332,6 @@ PLIST_FILES+= lib/fcitx/fcitx-mozc.so \
share/locale/zh_TW/LC_MESSAGES/fcitx-mozc.mo
PLIST_DIRS+= %%DATADIR%%/icon ${DATADIR_REL}
post-extract-fcitx_mozc:
${RM} ${BUILD_WRKSRC}/unix/fcitx/fcitx.gyp
post-extract: post-extract-fcitx_mozc
do-build-fcitx_mozc:
${BUILD_MOZC_CMD_BUILD} unix/fcitx/fcitx.gyp:fcitx-mozc

View File

@ -1,13 +1,11 @@
TIMESTAMP = 1481723411
SHA256 (ken_all-20160428.zip) = dd732957ca98dcad8c68aaa89447d77bd9201f26a19241f2531cb3f4ba2296f0
SIZE (ken_all-20160428.zip) = 1684351
SHA256 (jigyosyo-20160428.zip) = b95ed393343ed85363e8e7e14725af5e0b0586e60289a386fdba288e0e36f040
SIZE (jigyosyo-20160428.zip) = 752471
SHA256 (google-mozc-2.17.2322.102-9b4c9e0_GH0.tar.gz) = b7f57c4bfbff9a7e657de4f8213bac2f8d3cc454076463ddc66e32ebcf7bf795
SIZE (google-mozc-2.17.2322.102-9b4c9e0_GH0.tar.gz) = 57248995
TIMESTAMP = 1483252889
SHA256 (ken_all-20161031.zip) = a363eefa9867c497b12bf5a603f64426af7bd938733c2925dd2747150d2cdd42
SIZE (ken_all-20161031.zip) = 1685061
SHA256 (jigyosyo-20161031.zip) = 1a8d9cf30421a5bdfbccb6e3d9fc4f141895821ac0275425a60ad858e38c2a43
SIZE (jigyosyo-20161031.zip) = 754418
SHA256 (hrs-allbsd-mozc-v2.20.2677.102.01_GH0.tar.gz) = 31e254b21d17c3e070252ae33686e7c3960a05521fac7a60ac7e9bf1a5be1505
SIZE (hrs-allbsd-mozc-v2.20.2677.102.01_GH0.tar.gz) = 37574885
SHA256 (hiroyuki-komatsu-japanese-usage-dictionary-e5b3425_GH0.tar.gz) = 2af954cd844c6a3113449d7dca37e36b769ecb2b49d3a54318a3bdee1a75af56
SIZE (hiroyuki-komatsu-japanese-usage-dictionary-e5b3425_GH0.tar.gz) = 71050
SHA256 (e-kato-macuim-v0.6.16.2.1_GH0.tar.gz) = ae999a2f02379bd049484a22684c37be5eb1f4db9763fa79885c4981502336e9
SIZE (e-kato-macuim-v0.6.16.2.1_GH0.tar.gz) = 324549
SHA256 (fcitx-mozc-2.17.2313.102.1.patch) = 52a7ed450f075eca3f4d468390ef59f9a439e0ac74327639802a7f11caa1a2c2
SIZE (fcitx-mozc-2.17.2313.102.1.patch) = 140531

View File

@ -1,12 +0,0 @@
--- src/unix/fcitx/eim.cc.orig 2014-08-31 06:48:00.000000000 +0900
+++ src/unix/fcitx/eim.cc 2014-08-31 06:48:11.000000000 +0900
@@ -176,7 +176,9 @@
// clear candidate table
FcitxCandidateWordReset(candList);
FcitxCandidateWordSetPageSize(candList, 9);
+#if 0
FcitxCandidateWordSetLayoutHint(candList, CLH_Vertical);
+#endif
FcitxCandidateWordSetChoose(candList, "\0\0\0\0\0\0\0\0\0\0");
FcitxMessagesAddMessageAtLast(preedit, MSG_TIPS, "%s [%s]", usage.first.c_str(), _("Press Escape to go back"));

View File

@ -1,28 +0,0 @@
--- src/unix/fcitx/surrounding_text_util.cc.orig 2014-08-31 07:02:14.000000000 +0900
+++ src/unix/fcitx/surrounding_text_util.cc 2014-08-31 07:03:49.000000000 +0900
@@ -32,7 +32,9 @@
#include <limits>
#include <string>
#include <fcitx/instance.h>
+#if 0
#include <fcitx/module/clipboard/fcitx-clipboard.h>
+#endif
#include "base/port.h"
#include "base/logging.h"
@@ -207,6 +209,7 @@
const string surrounding_text(str);
free(str);
+#if 0
if (cursor_pos == anchor_pos) {
const char* primary = NULL;
@@ -220,6 +223,7 @@
}
}
}
+#endif
if (!SurroundingTextUtil::GetSafeDelta(cursor_pos, anchor_pos,
&info->relative_selected_length)) {

View File

@ -1,21 +0,0 @@
--- src/unix/fcitx/fcitx_mozc.cc.orig 2016-05-14 21:54:58.149355000 +0900
+++ src/unix/fcitx/fcitx_mozc.cc 2016-05-14 21:54:58.170065000 +0900
@@ -440,6 +440,8 @@
boolean ToolMenuAction(struct _FcitxUIMenu *menu, int index)
{
string args;
+ size_t pid = 0;
+
switch(index) {
case 0:
args = "--mode=config_dialog";
@@ -460,7 +462,8 @@
args = "--mode=about_dialog";
break;
}
- mozc::Process::SpawnMozcProcess("mozc_tool", args);
+
+ mozc::Process::SpawnProcess(mozc::FileUtil::JoinPath(mozc::SystemUtil::GetToolPath(), "mozc_tool"), args, &pid);
return true;
}

View File

@ -1,80 +0,0 @@
--- src/base/flags.cc.orig 2016-03-13 11:22:55.000000000 +0900
+++ src/base/flags.cc 2016-05-24 02:06:01.861439000 +0900
@@ -36,6 +36,9 @@
#include <sstream>
#include <string>
#include <vector>
+#if defined(__GNUC__) && !defined(__clang__)
+#include <cstdlib>
+#endif
#include "base/port.h"
#include "base/singleton.h"
@@ -78,6 +81,59 @@
// function, compiler may warn of "unused function".
template <typename T> struct StrToNumberImpl;
+#if defined(__GNUC__) && !defined(__clang__)
+static int stoi(const std::string& s) {
+ std::istringstream str(s);
+ int i;
+ str >> i;
+ return i;
+}
+static long stol(const std::string& s) {
+ std::istringstream str(s);
+ long i;
+ str >> i;
+ return i;
+}
+static long long stoll(const std::string& s) {
+ std::istringstream str(s);
+ long long i;
+ str >> i;
+ return i;
+}
+static unsigned long stoul(const std::string& s) {
+ std::istringstream str(s);
+ unsigned long i;
+ str >> i;
+ return i;
+}
+static unsigned long long stoull(const std::string& s) {
+ std::istringstream str(s);
+ unsigned long long i;
+ str >> i;
+ return i;
+}
+template <> struct StrToNumberImpl<int> {
+ static int Do(const string &s) { return stoi(s); }
+};
+
+template <> struct StrToNumberImpl<long> { // NOLINT
+ static long Do(const string &s) { return stol(s); } // NOLINT
+};
+
+template <> struct StrToNumberImpl<long long> { // NOLINT
+ static long long Do(const string &s) { return stoll(s); } // NOLINT
+};
+
+template <> struct StrToNumberImpl<unsigned long> { // NOLINT
+ static unsigned long Do(const string &s) { return stoul(s); } // NOLINT
+};
+
+template <> struct StrToNumberImpl<unsigned long long> { // NOLINT
+ static unsigned long long Do(const string &s) { // NOLINT
+ return stoull(s);
+ }
+};
+#else
template <> struct StrToNumberImpl<int> {
static int Do(const string &s) { return std::stoi(s); }
};
@@ -99,6 +155,7 @@
return std::stoull(s);
}
};
+#endif
template <typename T> inline T StrToNumber(const string &s) {
return StrToNumberImpl<T>::Do(s);

View File

@ -1,19 +0,0 @@
--- src/base/base.gyp.orig 2015-02-17 18:02:46.000000000 +0900
+++ src/base/base.gyp 2015-02-17 18:03:44.000000000 +0900
@@ -154,6 +154,16 @@
'MOZC_SERVER_DIRECTORY="<(server_dir)"',
],
}],
+ ['target_platform=="Linux" and tool_dir!=""', {
+ 'defines': [
+ 'MOZC_TOOL_DIRECTORY="<(tool_dir)"',
+ ],
+ }],
+ ['target_platform=="Linux" and renderer_dir!=""', {
+ 'defines': [
+ 'MOZC_RENDERER_DIRECTORY="<(renderer_dir)"',
+ ],
+ }],
['target_platform=="Linux" and document_dir!=""', {
'defines': [
'MOZC_DOCUMENT_DIRECTORY="<(document_dir)"',

View File

@ -1,11 +0,0 @@
--- src/base/logging.cc.orig 2013-07-17 11:38:04.000000000 +0900
+++ src/base/logging.cc 2013-07-19 22:24:20.000000000 +0900
@@ -111,7 +111,7 @@
#if defined(__native_client__)
"%p",
#elif defined(OS_LINUX)
- "%lu",
+ "%p",
#elif defined(OS_MACOSX) && defined(__LP64__)
"%llu",
#else // OS_WIN or OS_MACOSX(32bit)

View File

@ -1,11 +0,0 @@
--- src/base/mutex.cc.orig 2013-03-29 13:33:43.000000000 +0900
+++ src/base/mutex.cc 2013-04-27 15:37:37.000000000 +0900
@@ -296,7 +296,7 @@
// PTHREAD_MUTEX_RECURSIVE_NP but Mac OS X 10.5 does not
pthread_mutexattr_t attr;
pthread_mutexattr_init(&attr);
-#if defined(OS_MACOSX)
+#if defined(OS_MACOSX) || defined(OS_FREEBSD)
pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
#elif defined(OS_LINUX)
pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE_NP);

View File

@ -1,11 +0,0 @@
--- src/base/process.cc.orig 2016-03-13 11:22:55.000000000 +0900
+++ src/base/process.cc 2016-05-10 21:54:57.488770000 +0900
@@ -126,7 +126,7 @@
#endif
#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NACL)
- static const char kBrowserCommand[] = "/usr/bin/xdg-open";
+ static const char kBrowserCommand[] = LOCALBASE "/bin/xdg-open";
// xdg-open which uses kfmclient or gnome-open internally works both on KDE
// and GNOME environments.
return SpawnProcess(kBrowserCommand, url);

View File

@ -1,26 +0,0 @@
--- src/base/system_util.cc.orig 2015-02-17 17:59:05.000000000 +0900
+++ src/base/system_util.cc 2015-02-17 18:01:50.000000000 +0900
@@ -407,7 +407,11 @@
if (server_path.empty()) {
return "";
}
+#ifdef MOZC_RENDERER_DIRECTORY
+ return FileUtil::JoinPath(MOZC_RENDERER_DIRECTORY "/", kMozcRenderer);
+#else
return FileUtil::JoinPath(server_path, kMozcRenderer);
+#endif
}
string SystemUtil::GetToolPath() {
@@ -416,7 +420,11 @@
if (server_path.empty()) {
return "";
}
+#ifdef MOZC_TOOL_DIRECTORY
+ return FileUtil::JoinPath(MOZC_TOOL_DIRECTORY "/", kMozcTool);
+#else
return FileUtil::JoinPath(server_path, kMozcTool);
+#endif
}
string SystemUtil::GetDocumentDirectory() {

View File

@ -1,74 +0,0 @@
--- src/build_mozc.py.orig 2016-03-13 11:22:55.000000000 +0900
+++ src/build_mozc.py 2016-05-11 00:18:16.131052000 +0900
@@ -354,6 +354,11 @@
parser.add_option('--version_file', dest='version_file',
help='use the specified version template file',
default='mozc_version_template.txt')
+ parser.add_option('--localbase', dest='localbase')
+ parser.add_option('--ldflags', dest='ldflags')
+ parser.add_option('--cflags', dest='cflags')
+ parser.add_option('--cflags_cc', dest='cflags_cc')
+ parser.add_option('--include_dirs', dest='include_dirs')
AddTargetPlatformOption(parser)
# Mac and Linux
@@ -368,6 +373,14 @@
default='',
help='A path to the directory where the server executable'
'is installed. This option is used only on Linux.')
+ parser.add_option('--renderer_dir', dest='renderer_dir',
+ default='',
+ help='A path to the directory where the renderer executable'
+ 'is installed. This option is used only on Linux.')
+ parser.add_option('--tool_dir', dest='tool_dir',
+ default='',
+ help='A path to the directory where the tool executable'
+ 'is installed. This option is used only on Linux.')
# Android
parser.add_option('--android_arch', dest='android_arch',
@@ -522,6 +535,11 @@
"""Parses command line options for the build command."""
parser = optparse.OptionParser(usage='Usage: %prog build [options]')
AddCommonOptions(parser)
+ if IsLinux():
+ default_build_concurrency = 1;
+ parser.add_option('--jobs', '-j', dest='jobs',
+ default=('%d' % default_build_concurrency),
+ metavar='N', help='run build jobs in parallel')
parser.add_option('--configuration', '-c', dest='configuration',
default='Debug', help='specify the build configuration.')
@@ -672,6 +690,17 @@
logging.info('Building GYP command line...')
gyp_options = ['--depth=.', '--include=%s/gyp/common.gypi' % SRC_DIR]
+ localbase = options.localbase or '/usr'
+ gyp_options.extend(['-D', 'localbase=%s' % localbase])
+
+ ldflags = options.ldflags or ''
+ gyp_options.extend(['-D', 'ldflags=%s' % ldflags])
+ cflags = options.cflags or ''
+ gyp_options.extend(['-D', 'cflags=%s' % cflags])
+ cflags_cc = options.cflags_cc or ''
+ gyp_options.extend(['-D', 'cflags_cc=%s' % cflags_cc])
+ include_dirs = options.include_dirs or ''
+ gyp_options.extend(['-D', 'include_dirs=%s' % include_dirs])
mozc_root = os.path.abspath(GetTopLevelSourceDirectoryName())
gyp_options.extend(['-D', 'abs_depth=%s' % mozc_root])
@@ -876,6 +905,14 @@
if options.server_dir:
gyp_options.extend([
'-D', 'server_dir=%s' % os.path.abspath(options.server_dir)])
+ if options.tool_dir:
+ gyp_options.extend([
+ '-D', 'tool_dir=%s' % os.path.abspath(options.tool_dir)])
+ if options.renderer_dir:
+ gyp_options.extend([
+ '-D', 'renderer_dir=%s' % os.path.abspath(options.renderer_dir)])
+
+
if generator == 'ninja':
gyp_options.extend(['--generator-output=.'])

View File

@ -1,11 +0,0 @@
--- src/build_tools/util.py.orig 2013-04-21 03:48:52.147271754 +0900
+++ src/build_tools/util.py 2013-04-21 04:07:17.415269142 +0900
@@ -54,7 +54,7 @@
def IsLinux():
"""Returns true if the platform is Linux."""
- return os.name == 'posix' and os.uname()[0] == 'Linux'
+ return os.name == 'posix' and ( os.uname()[0] == 'Linux' or os.uname()[0] == 'FreeBSD' )
def GetNumberOfProcessors():

View File

@ -1,11 +0,0 @@
--- src/gui/qt_libraries.gypi.orig 2016-05-14 21:36:24.268182000 +0900
+++ src/gui/qt_libraries.gypi 2016-05-14 21:36:59.852298000 +0900
@@ -84,7 +84,7 @@
'$(SDKROOT)/System/Library/Frameworks/Carbon.framework',
]
}],
- ['OS=="linux"', {
+ ['OS=="linux" or OS=="freebsd"', {
'conditions': [
['qt_dir', {
'libraries': [

View File

@ -1,14 +0,0 @@
--- src/gui/about_dialog/about_dialog.cc.orig 2013-03-29 13:33:58.000000000 +0900
+++ src/gui/about_dialog/about_dialog.cc 2013-04-27 15:16:49.000000000 +0900
@@ -121,7 +121,11 @@
SetLabelText(label_terms);
SetLabelText(label_credits);
+#ifdef OS_FREEBSD
+ product_image_.reset(new QImage(LOCALBASE "/share/mozc-tool/icons/product_logo.png"));
+#else
product_image_.reset(new QImage(":/product_logo.png"));
+#endif
}
void AboutDialog::paintEvent(QPaintEvent *event) {

View File

@ -1,150 +0,0 @@
--- src/gyp/common.gypi.orig 2016-03-13 11:22:55.000000000 +0900
+++ src/gyp/common.gypi 2016-05-11 00:09:18.009062000 +0900
@@ -109,7 +109,7 @@
],
# Libraries for GNU/Linux environment.
'linux_ldflags': [
- '-pthread',
+ '-lpthread',
],
# Extra defines
@@ -161,9 +161,9 @@
['target_platform=="Linux"', {
# enable_gtk_renderer represents if mozc_renderer is supported on Linux
# or not.
- 'compiler_target': 'clang',
+ 'compiler_target': '<(compiler_target)',
'compiler_target_version_int': 304, # Clang 3.4 or higher
- 'compiler_host': 'clang',
+ 'compiler_host': '<(compiler_host)',
'compiler_host_version_int': 304, # Clang 3.4 or higher
'enable_gtk_renderer%': 1,
}, { # else
@@ -208,6 +208,14 @@
# installed. This option is only for Linux.
'server_dir%': '/usr/lib/mozc',
+ # renderer_dir represents the directory where mozc_renderer is
+ # installed. This option is only for Linux.
+ 'renderer_dir%': '/usr/lib/mozc',
+
+ # tool_dir represents the directory where mozc_tool is
+ # installed. This option is only for Linux.
+ 'tool_dir%': '/usr/lib/mozc',
+
# Represents the directory where the source code of protobuf is
# extracted. This value is ignored when 'use_libprotobuf' is 1.
'protobuf_root': '<(third_party_dir)/protobuf',
@@ -415,7 +423,7 @@
},
},
'conditions': [
- ['OS=="linux"', {
+ ['OS=="linux" or OS=="freebsd"', {
'cflags': [
'<@(debug_extra_cflags)',
],
@@ -481,7 +489,7 @@
},
},
'conditions': [
- ['OS=="linux"', {
+ ['OS=="linux" or OS=="freebsd"', {
'cflags': [
'<@(release_extra_cflags)',
],
@@ -533,17 +541,20 @@
['compiler_target=="clang"', {
'cflags': [
'-Wtype-limits',
+ '<@(cflags)',
],
'cflags_cc': [
'-Wno-covered-switch-default',
'-Wno-unnamed-type-template-args',
'-Wno-c++11-narrowing',
- '-std=gnu++0x',
+ '-std=c++11',
+ '<@(cflags_cc)',
],
}],
- ['compiler_target=="clang" or compiler_target=="gcc"', {
+ ['compiler_host=="gcc"', {
'cflags_cc': [
- '-std=gnu++0x',
+ '-std=gnu++11',
+ '<@(cflags_cc)',
],
}],
],
@@ -553,17 +564,20 @@
['compiler_host=="clang"', {
'cflags': [
'-Wtype-limits',
+ '<@(cflags)',
],
'cflags_cc': [
'-Wno-covered-switch-default',
'-Wno-unnamed-type-template-args',
'-Wno-c++11-narrowing',
- '-std=gnu++0x',
+ '-std=c++11',
+ '<@(cflags_cc)',
],
}],
- ['compiler_host=="clang" or compiler_host=="gcc"', {
+ ['compiler_host=="gcc"', {
'cflags_cc': [
- '-std=gnu++0x',
+ '-std=gnu++11',
+ '<@(cflags_cc)',
],
}],
],
@@ -578,7 +592,7 @@
['channel_dev==1', {
'defines': ['CHANNEL_DEV'],
}],
- ['OS=="linux"', {
+ ['OS=="linux" or OS=="freebsd"', {
'ldflags': [
'<@(linux_ldflags)',
],
@@ -694,21 +708,34 @@
},
},
}],
- ['OS=="linux"', {
+ ['OS=="linux" or OS=="freebsd"', {
'cflags': [
'<@(warning_cflags)',
'-fPIC',
'-fno-exceptions',
+ '<@(cflags)',
],
'cflags_cc': [
# We use deprecated <hash_map> and <hash_set> instead of upcoming
# <unordered_map> and <unordered_set>.
'-Wno-deprecated',
+ '<@(cflags_cc)',
],
+ 'include_dirs': [
+ '<@(include_dirs)',
+ ],
+ 'ldflags': [
+ '<@(ldflags)',
+ '-fstack-protector',
+ ],
'conditions': [
['target_platform=="Linux"', {
# OS_LINUX is defined always (target and host).
- 'defines': ['OS_LINUX',],
+ 'defines': [
+ 'OS_LINUX',
+ 'OS_FREEBSD',
+ 'LOCALBASE="<@(localbase)"',
+ ],
}],
['target_platform=="Android"', {
'defines': ['NO_USAGE_REWRITER'],

View File

@ -1,11 +0,0 @@
--- src/ipc/ipc_path_manager.cc.orig 2013-03-29 13:33:26.000000000 +0900
+++ src/ipc/ipc_path_manager.cc 2013-04-27 15:21:52.000000000 +0900
@@ -276,7 +276,7 @@
*ipc_name = kIPCPrefix;
#endif // OS_WIN
-#ifdef OS_LINUX
+#if defined(OS_LINUX) && !defined(OS_FREEBSD)
// On Linux, use abstract namespace which is independent of the file system.
(*ipc_name)[0] = '\0';
#endif

View File

@ -1,89 +0,0 @@
--- src/ipc/unix_ipc.cc.orig 2013-03-29 13:33:26.000000000 +0900
+++ src/ipc/unix_ipc.cc 2013-04-27 15:23:08.000000000 +0900
@@ -41,6 +41,9 @@
#include <sys/time.h>
#include <sys/types.h>
#include <sys/un.h>
+#if defined(OS_MACOSX) || defined(OS_FREEBSD)
+#include <sys/ucred.h>
+#endif
#include <sys/wait.h>
#include <unistd.h>
@@ -123,6 +126,29 @@
bool IsPeerValid(int socket, pid_t *pid) {
*pid = 0;
+#if defined(OS_MACOSX) || defined(OS_FREEBSD)
+ // If the OS is MAC, we should validate the peer by using LOCAL_PEERCRED.
+ struct xucred peer_cred;
+ socklen_t peer_cred_len = sizeof(struct xucred);
+ if (::getsockopt(socket, 0, LOCAL_PEERCRED,
+ &peer_cred, &peer_cred_len) < 0) {
+ LOG(ERROR) << "cannot get peer credential. NOT a Unix socket?";
+ return false;
+ }
+ if (peer_cred.cr_version != XUCRED_VERSION) {
+ LOG(WARNING) << "credential version mismatch.";
+ return false;
+ }
+ if (peer_cred.cr_uid != ::geteuid()) {
+ LOG(WARNING) << "uid mismatch." << peer_cred.cr_uid << "!=" << ::geteuid();
+ return false;
+ }
+
+ // MacOS doesn't have cr_pid;
+ *pid = 0;
+#endif
+
+#if defined(OS_LINUX) && !defined(OS_FREEBSD)
// On ARM Linux, we do nothing and just return true since the platform
// sometimes doesn't support the getsockopt(sock, SOL_SOCKET, SO_PEERCRED)
// system call.
@@ -144,6 +170,7 @@
*pid = peer_cred.pid;
#endif // __arm__
+#endif
return true;
}
@@ -278,7 +305,12 @@
address.sun_family = AF_UNIX;
::memcpy(address.sun_path, server_address.data(), server_address_length);
address.sun_path[server_address_length] = '\0';
+#if defined(OS_MACOSX) || defined(OS_FREEBSD)
+ address.sun_len = SUN_LEN(&address);
+ const size_t sun_len = sizeof(address);
+#else
const size_t sun_len = sizeof(address.sun_family) + server_address_length;
+#endif
pid_t pid = 0;
if (::connect(socket_,
reinterpret_cast<const sockaddr*>(&address),
@@ -398,16 +430,21 @@
SO_REUSEADDR,
reinterpret_cast<char *>(&on),
sizeof(on));
+#if defined(OS_MACOSX) || defined(OS_FREEBSD)
+ addr.sun_len = SUN_LEN(&addr);
+ const size_t sun_len = sizeof(addr);
+#else
const size_t sun_len = sizeof(addr.sun_family) + server_address_.size();
- if (!IsAbstractSocket(server_address_)) {
- // Linux does not use files for IPC.
- ::chmod(server_address_.c_str(), 0600);
- }
+#endif
if (::bind(socket_, reinterpret_cast<sockaddr *>(&addr), sun_len) != 0) {
// The UNIX domain socket file (server_address_) already exists?
LOG(FATAL) << "bind() failed: " << strerror(errno);
return;
}
+ if (!IsAbstractSocket(server_address_)) {
+ // Linux does not use files for IPC.
+ ::chmod(server_address_.c_str(), 0600);
+ }
if (::listen(socket_, num_connections) < 0) {
LOG(FATAL) << "listen() failed: " << strerror(errno);

View File

@ -1,12 +0,0 @@
--- src/rewriter/calculator/calculator.cc.orig 2016-03-13 11:22:55.000000000 +0900
+++ src/rewriter/calculator/calculator.cc 2016-05-24 02:06:47.310077000 +0900
@@ -44,6 +44,9 @@
#include <map>
#include <string>
#include <vector>
+#if defined(__GNUC__) && !defined(__clang__)
+#include <cstdlib>
+#endif
#include "base/compiler_specific.h"
#include "base/logging.h"

View File

@ -1,49 +0,0 @@
--- src/server/mozc_server.cc.orig 2013-03-29 13:33:26.000000000 +0900
+++ src/server/mozc_server.cc 2013-04-27 15:18:29.000000000 +0900
@@ -32,6 +32,9 @@
#ifdef OS_WIN
#include <windows.h>
#endif
+#ifdef OS_FREEBSD
+#include <signal.h>
+#endif
#include <cstddef>
#include <string>
@@ -51,6 +54,23 @@
mozc::SessionServer *g_session_server = NULL;
}
+#ifdef OS_FREEBSD
+static void sig_func(int num)
+{
+ VLOG(1) << "signal " << num << " recieved.";
+ switch (num) {
+ case SIGINT:
+ case SIGHUP:
+ case SIGTERM:
+ if (g_session_server)
+ g_session_server->Terminate();
+ break;
+ default:
+ break;
+ }
+}
+#endif
+
namespace mozc {
namespace {
@@ -132,6 +152,12 @@
return -1;
}
+#ifdef OS_FREEBSD
+ ::signal(SIGINT, sig_func);
+ ::signal(SIGHUP, sig_func);
+ ::signal(SIGTERM, sig_func);
+#endif
+
#if defined(OS_WIN)
// On Windows, ShutdownSessionCallback is not called intentionally in order
// to avoid crashes oritinates from it. See b/2696087.

View File

@ -1,40 +0,0 @@
--- src/unix/ibus/gen_mozc_xml.py.orig 2016-03-13 11:22:55.000000000 +0900
+++ src/unix/ibus/gen_mozc_xml.py 2016-05-10 23:43:06.273350000 +0900
@@ -90,6 +90,7 @@
engines: A dictionary from a property name to a list of property values of
engines. For example, {'name': ['mozc-jp', 'mozc', 'mozc-dv']}.
"""
+ print '<?xml version="1.0" encoding="utf-8"?>'
print '<component>'
for key in component:
OutputXmlElement(param_dict, key, component[key])
@@ -164,13 +165,19 @@
parser.add_option('--server_dir', dest='server_dir', default='',
help='The absolute directory path to be installed the '
'server executable.')
+ parser.add_option('--renderer_dir', dest='renderer_dir', default='',
+ help='The absolute directory path to be installed the '
+ 'renderer executable.')
+ parser.add_option('--tool_dir', dest='tool_dir', default='',
+ help='The absolute directory path to be installed the '
+ 'tool executable.')
parser.add_option('--pkg_config_command', dest='pkg_config_command',
default='pkg-config',
help='The path to pkg-config command.')
(options, unused_args) = parser.parse_args()
setup_arg = []
- setup_arg.append(os.path.join(options.server_dir, 'mozc_tool'))
+ setup_arg.append(os.path.join(options.tool_dir, 'mozc_tool'))
setup_arg.append('--mode=config_dialog')
param_dict = {
@@ -181,7 +188,7 @@
engine_common_props = {
'description': '%(product_name)s (Japanese Input Method)',
- 'language': 'ja',
+ 'language': 'jpn',
'icon': '%(ibus_mozc_icon_path)s',
'rank': '80',
}

View File

@ -1,11 +0,0 @@
--- src/unix/ibus/ibus.gyp.orig 2015-02-17 18:04:40.000000000 +0900
+++ src/unix/ibus/ibus.gyp 2015-02-17 18:04:58.000000000 +0900
@@ -83,6 +83,8 @@
'./gen_mozc_xml.py',
'--branding=Mozc',
'--server_dir=<(server_dir)',
+ '--renderer_dir=<(renderer_dir)',
+ '--tool_dir=<(tool_dir)',
'--pkg_config_command=<(pkg_config_command)',
'--ibus_mozc_path=<(ibus_mozc_path)',
'--ibus_mozc_icon_path=<(ibus_mozc_icon_path)',

View File

@ -1,11 +0,0 @@
--- src/unix/ibus/mozc_engine.cc.orig 2014-08-31 03:35:19.000000000 +0900
+++ src/unix/ibus/mozc_engine.cc 2014-08-31 04:04:15.000000000 +0900
@@ -224,7 +224,7 @@
}
const size_t selection_start = min(cursor_pos, anchor_pos);
- const size_t selection_length = abs(info->relative_selected_length);
+ const size_t selection_length = ::abs(info->relative_selected_length);
Util::SubStringPiece(surrounding_text, 0, selection_start)
.CopyToString(&info->preceding_text);
Util::SubStringPiece(surrounding_text, selection_start, selection_length)

View File

@ -1,11 +0,0 @@
--- src/unix/ibus/path_util.cc.orig 2013-03-29 13:33:43.000000000 +0900
+++ src/unix/ibus/path_util.cc 2013-04-27 15:42:28.000000000 +0900
@@ -30,7 +30,7 @@
#include "unix/ibus/path_util.h"
namespace {
-const char kInstalledDirectory[] = "/usr/share/ibus-mozc";
+const char kInstalledDirectory[] = LOCALBASE "/share/ibus-mozc/icons";
}
namespace mozc {