Import of pkgsrc-2016Q3

This commit is contained in:
2016-10-14 07:49:11 +02:00
committed by Lionel Sambuc
parent 9d819b6d54
commit 1242aa1e36
35952 changed files with 949749 additions and 377083 deletions

View File

@@ -1,13 +1,14 @@
# $NetBSD: Makefile,v 1.23 2015/07/31 13:07:05 ryoon Exp $
# $NetBSD: Makefile,v 1.27 2016/08/03 10:23:00 adam Exp $
PKGNAME= ${DISTNAME:S/mozc-/mozc-server-/}
PKGREVISION= 1
INSTALLATION_DIRS+= libexec
do-build:
cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} \
${PYTHONBIN} build_mozc.py build -c ${MOZC_BUILD_MODE} \
${_MAKE_JOBS} \
${PYTHONBIN} build_mozc.py build \
-c ${MOZC_BUILD_MODE} \
server/server.gyp:mozc_server
do-install:

View File

@@ -1,4 +1,4 @@
# $NetBSD: Makefile.common,v 1.19 2015/07/31 13:07:05 ryoon Exp $
# $NetBSD: Makefile.common,v 1.25 2016/07/09 13:03:52 wiz Exp $
# used by inputmethod/ibus-mozc/Makefile
# used by inputmethod/mozc-elisp/Makefile
# used by inputmethod/mozc-server/Makefile
@@ -7,27 +7,23 @@
# used by inputmethod/uim-mozc/Makefile
#
DISTNAME= mozc-2.17.2106.102
DISTNAME= mozc-2.17.2313.102
CATEGORIES= inputmethod
MASTER_SITES= ${MASTER_SITE_GITHUB:=google/}
GITHUB_PROJECT= mozc
GITHUB_TAG= 3648b9bf06d5d9b36bed2425640bfd18ae05b588
MASTER_SITES= ${MASTER_SITE_LOCAL}
EXTRACT_SUFX= .tar.xz
MAINTAINER= ryoon@NetBSD.org
HOMEPAGE= https://github.com/google/mozc/
COMMENT= Japanese inputmethod Mozc engine for IBus
LICENSE= modified-bsd
USAGE_DICT= usage_dict-rev10.txt
UIM_MOZC= uim-mozc-318.0562676
DISTFILES+= ${DISTNAME}-${GITHUB_TAG}${EXTRACT_SUFX} \
${USAGE_DICT} \
UIM_MOZC= uim-mozc-321.3ea28b1
DISTFILES+= ${DISTNAME}${EXTRACT_SUFX} \
${UIM_MOZC}.tar.xz
SITES.${USAGE_DICT}= ${MASTER_SITE_LOCAL}
SITES.${UIM_MOZC}.tar.xz= ${MASTER_SITE_SOURCEFORGE:=pnsft-aur/}
EXTRACT_USING= bsdtar
WRKSRC= ${WRKDIR}/mozc-${GITHUB_TAG}/src
WRKSRC= ${WRKDIR}/${DISTNAME}/src
DISTINFO_FILE= ${.CURDIR}/../../inputmethod/mozc-server/distinfo
PATCHDIR= ${.CURDIR}/../../inputmethod/mozc-server/patches
@@ -35,19 +31,10 @@ PATCHDIR= ${.CURDIR}/../../inputmethod/mozc-server/patches
BUILD_DEPENDS+= ${PYPKGPREFIX}-gyp-[0-9]*:../../devel/gyp
BUILD_DEPENDS+= ninja-build-[0-9]*:../../devel/ninja-build
PYTHON_VERSIONS_INCOMPATIBLE= 33 # py-gyp
USE_LANGUAGES= c c++
# nullptr requires -std=c++11, and -std=c++11 requires gcc 4.6 or later
GCC_REQD+= 4.6
CXXFLAGS+= -std=c++03
USE_TOOLS+= gmake pkg-config
FIND_PREFIX:= GYPDIR=${PYPKGPREFIX}-gyp
#FIND_PREFIX:= NINJADIR=ninja
.include "../../mk/find-prefix.mk"
OPENSSL_CFLAGS= -I${BUILDLINK_PREFIX.openssl}/include
OPENSSL_INC= -I${BUILDLINK_PREFIX.openssl}/include
OPENSSL_LDFLAGS= -L${BUILDLINK_PREFIX.openssl}/lib -lssl -lcrypto
@@ -70,25 +57,19 @@ SUBST_VARS.gyp+= PREFIX QTDIR
ALL_ENV+= LINK=${CXX}
.include "../../mk/bsd.prefs.mk"
.if ${OPSYS} == "NetBSD"
OSDEST= bsd
.elif ${OPSYS} == "Linux"
OSDEST= linux
.endif
OPSYSVARS+= OSDEST
OSDEST.Linux= linux
OSDEST.NetBSD= bsd
MOZC_BUILD_MODE= Release # or Debug
pre-configure:
mkdir -p ${WRKSRC}/third_party/japanese_usage_dictionary
cp ${WRKDIR}/${USAGE_DICT} \
${WRKSRC}/third_party/japanese_usage_dictionary/usage_dict.txt
do-configure:
cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} \
GYP_DEFINES="use_libprotobuf=1" \
${PYTHONBIN} build_mozc.py \
gyp \
--gypdir=${GYPDIR}/bin
--gypdir=${LOCALBASE}/bin
.include "../../devel/glib2/buildlink3.mk"
.include "../../devel/protobuf/buildlink3.mk"

View File

@@ -1,49 +1,45 @@
$NetBSD: distinfo,v 1.14 2015/07/31 13:07:05 ryoon Exp $
$NetBSD: distinfo,v 1.19 2016/05/16 11:51:49 ryoon Exp $
SHA1 (mozc-2.17.2106.102-3648b9bf06d5d9b36bed2425640bfd18ae05b588.tar.gz) = cc9c59329fee015a4149686f103a5554a0e085ff
RMD160 (mozc-2.17.2106.102-3648b9bf06d5d9b36bed2425640bfd18ae05b588.tar.gz) = b40e1c9b62ef6ee4d953add8ab3beed1ee2c4056
Size (mozc-2.17.2106.102-3648b9bf06d5d9b36bed2425640bfd18ae05b588.tar.gz) = 59324198 bytes
SHA1 (uim-mozc-318.0562676.tar.xz) = 5cd298aaac5afd7ff8882453e3e8fa698c2c5aa1
RMD160 (uim-mozc-318.0562676.tar.xz) = 7b93efa2ed2710d5098b1b6b81c0fd195645857b
Size (uim-mozc-318.0562676.tar.xz) = 24316 bytes
SHA1 (usage_dict-rev10.txt) = 174fd3073422deb5f7b3740b1c8ea6d52a077c25
RMD160 (usage_dict-rev10.txt) = 2c70d0c6c46bff422108e3ce617a6eebc311843d
Size (usage_dict-rev10.txt) = 219146 bytes
SHA1 (patch-base_base.gyp) = 437fa7ef6c84448a2a8fb049af773ab9df64dc81
SHA1 (patch-base_cpu__stats.cc) = cda8bbcbc963d8ed635435375cc80ee5e7ca2191
SHA1 (patch-base_iconv.cc) = 1bf65dfc6152bf152cbe2714835a61436df2a48b
SHA1 (patch-base_logging.cc) = 96ee9d1426ef1cf946a00fb15c9754603ab15bb8
SHA1 (patch-base_mutex.cc) = aed8588d4ff7b057fed072097ef09ddbc2696d31
SHA1 (patch-base_mutex.h) = 6c3c8f0845f0fdad815c4877026894000d5eac2c
SHA1 (patch-base_password__manager.cc) = f16982447f54e397d1aa103260d8f4d10aa76f96
SHA1 (patch-base_process.cc) = abdd6a955e87506972e7f71fd4bc3a300f49b304
SHA1 (patch-base_run__level.cc) = ead96536246093bd3d44f59a80085da2f39904e8
SHA1 (patch-base_system__util.cc) = f3ef575a15cd518fe7d29264b39f775ccf502802
SHA1 (patch-base_util.cc) = c473cb595535075b53c9c235fc28f5e7da26d087
SHA1 (patch-build__mozc.py) = 2e5448bb1bc07cdf9410ce1adf918416a1302db4
SHA1 (mozc-2.17.2313.102.tar.xz) = c4a010b0a5ca47b589af4dbd1c4056e26989286a
RMD160 (mozc-2.17.2313.102.tar.xz) = 59eabd43ec34926750c00e184eefd1a4dff98b48
SHA512 (mozc-2.17.2313.102.tar.xz) = 96492296d168496c3c21228c7b374aa3dc55d42399455cd52eab06d8ea4ed2a25d34dabb484de98edd55db2a8b4321158bfd0cb9be68a2216e1ed5e239aae3fb
Size (mozc-2.17.2313.102.tar.xz) = 47600492 bytes
SHA1 (uim-mozc-321.3ea28b1.tar.xz) = 22b7c2a5b0a7fef778ee72ebe5873a75e879d26b
RMD160 (uim-mozc-321.3ea28b1.tar.xz) = 30d160d02a39065e4bc34968fbe6232018b0b202
SHA512 (uim-mozc-321.3ea28b1.tar.xz) = b28f4d207a52c208694371dbc550ac5022a29c5870b8d856bca8052106d8be88ab8d066bdc6d895ac6fa9f350ce6be16d638603e46058f9528691f97cb86d054
Size (uim-mozc-321.3ea28b1.tar.xz) = 24400 bytes
SHA1 (patch-base_clock.cc) = 996d2ca52301d53ff0b23b1d1ee8a7370621782a
SHA1 (patch-base_cpu__stats.cc) = c5c22b9aecadfc92832f990115879ef4625d6b37
SHA1 (patch-base_logging.cc) = 2a119d02f959da09792af142e2cd6d1341750333
SHA1 (patch-base_mutex.cc) = 0aaf0e317b2110008d1e331eff760ea532fbe0c0
SHA1 (patch-base_mutex.h) = cf12a1574d28dd612820578560a76b3b8ab6e27d
SHA1 (patch-base_password__manager.cc) = 4883771e3942864d26a5c7c6f3b8fce6bf61c9f0
SHA1 (patch-base_port.h) = 89ff9a614a86cb53c7047c244fb491a7bce3e64c
SHA1 (patch-base_process.cc) = b6a9cbb24a481364f3fea1c900f6d455a2e55d10
SHA1 (patch-base_run__level.cc) = 3475e4a8ce01237fd9abda86f6f495def0e42d3b
SHA1 (patch-base_system__util.cc) = 6ea56e6a8c05ff705e702a475f3eefce57d3ab94
SHA1 (patch-build__mozc.py) = 72740d9adbd8728ad88affe30f5201f71805111c
SHA1 (patch-build__tools_mozc__version.py) = a6ff8a82b1328086b7d758f73a7d3c31e87bccc9
SHA1 (patch-build__tools_util.py) = 6416884ba288d60eb8e558e8c5de7ef6e538b82e
SHA1 (patch-client_client.cc) = 7ca43dde3f207331005599653c6520667e3ca93c
SHA1 (patch-config_stats__config__util__test.cc) = db51e6619c5c04ac8fa50890825206ea922dccf2
SHA1 (patch-gui_base_locale__util.cc) = 7d1e9cf3c2c36590298496471a97b8c32010a30b
SHA1 (patch-gui_config__dialog_config__dialog.cc) = aae18b7ea36fd5ff5758625875a04634ffdfd68a
SHA1 (patch-gui_config__dialog_keybinding__editor.cc) = 00a6e4bb2c07e3340e188f108f0285a3aa2aceb9
SHA1 (patch-build__tools_util.py) = c7daafd5ee0f8f5dcb1130a6d230f9821c3a3a12
SHA1 (patch-client_client.cc) = 014ab13164e17a490896303bd2ad2eab2589eae9
SHA1 (patch-config_stats__config__util__test.cc) = 0d1fc3b9050f489a615dd0ad42c41faf2096c282
SHA1 (patch-gui_base_locale__util.cc) = 67159274882110f2e54953ab5d059c8357aeadec
SHA1 (patch-gui_config__dialog_config__dialog.cc) = 643f777be01c29070d317a179caf3b646a95033a
SHA1 (patch-gui_config__dialog_keybinding__editor.cc) = 462ff2b33303c63709d72ff5cfabc5fe2f4e383a
SHA1 (patch-gui_dictionary__tool_dictionary__tool.cc) = 3652713857d03f847108952f2994ee44bfe62608
SHA1 (patch-gui_gui.gyp) = 82377e902935e1fccb79056fa94dd4ad4f8ff29d
SHA1 (patch-gui_qt__libraries.gypi) = e92be78947dcf66211c80169b864b7c9d057b3db
SHA1 (patch-gui_word__register__dialog_word__register__dialog.cc) = 34a7cd2a99a0082f490c3f623c7c6a856c984f8b
SHA1 (patch-gyp_common.gypi) = 64d8c387f5afbce02b30a42b27ade76f75224f05
SHA1 (patch-handwriting_handwriting.gyp) = 0261aef287b34f4a3c8424fb1af44720ae00a85c
SHA1 (patch-handwriting_zinnia.gyp) = d09ac17d17dabdbfdcb7c623193a5c72dbcacfbc
SHA1 (patch-handwriting_zinnia__handwriting.cc) = dd9363f470bf4a27fed40602f02127cb130042b2
SHA1 (patch-gui_word__register__dialog_word__register__dialog.cc) = bd9db643c207f9810d33d596e050453c18593497
SHA1 (patch-gyp_common.gypi) = bad5e98e6a110e4b04a8c2f8dcb813d9ccf626e5
SHA1 (patch-handwriting_zinnia.gyp) = 8e0a5d398124666000c3fb84c50616460ddb5b33
SHA1 (patch-handwriting_zinnia__handwriting.cc) = 8d7950a9c98408df9e78550515aa9471eb277bbf
SHA1 (patch-ipc_ipc__path__manager.cc) = c96fbac6d1d81ddd7f999c30bdc2539ee2df2564
SHA1 (patch-ipc_ipc__path__manager__test.cc) = 90ea81daef93dc1ad5cee792ced26a9a2939fbdf
SHA1 (patch-ipc_named__event.cc) = 92283261e7580569587e43156f13567b593c9a32
SHA1 (patch-ipc_unix__ipc.cc) = d821deb2f38bf77bf6b364eb31d419c0a86c1a7f
SHA1 (patch-ipc_unix__ipc.cc) = 112397bc3fb6b04a816677f891f75e4c67eb59c1
SHA1 (patch-net_net.gyp) = 937b28ad663605373d6b772097318b17dbea2eea
SHA1 (patch-protobuf_protobuf.gyp) = 35059f0e24a9d47ca5224a892de84890d72acdf4
SHA1 (patch-session_session.cc) = 0562f8646dc6f68e180d8ae98f00eeb0364fc473
SHA1 (patch-session_session__converter__interface.h) = 93bda6e51b9a9ac7146aa23ac0aa28bb017a4465
SHA1 (patch-session_session__test.cc) = a256caec45a45f4eaab0555ecc18cea09c417d95
SHA1 (patch-unix_ibus_gen__mozc__xml.py) = 566d567ae4f911766309e035697a23350f24bbf5
SHA1 (patch-session_session.cc) = 21ce71225ea6885bff7160aed832974ef34876f2
SHA1 (patch-session_session__test.cc) = a3e208c37078b223d4ea0fb6fb8a603f2f5fee19
SHA1 (patch-third__party_protobuf_post__process__dist.sh) = 790c167c3c62a1f8360d130accf7ed7280baf9b5
SHA1 (patch-unix_ibus_gen__mozc__xml.py) = 1ac5fb40b774dc751c2d01a13ca55b6a995eed34
SHA1 (patch-unix_ibus_ibus.gyp) = 2fc9309216270846f7ce33d1854d9d76e65e6e96

View File

@@ -1,13 +0,0 @@
$NetBSD: patch-base_base.gyp,v 1.5 2014/11/07 23:28:36 ryoon Exp $
--- base/base.gyp.orig 2014-11-03 05:13:02.000000000 +0000
+++ base/base.gyp
@@ -78,7 +78,7 @@
# shared among *host* binaries and *target* binaries. This means that
# you should implement *host* binaries by using limited libraries
# which are also available on NDK.
- ['OS=="linux" and target_platform!="Android" and '
+ ['OS=="netbsd" or (OS=="linux" and target_platform!="Android") and '
'not (target_platform=="NaCl" and _toolset=="target")', {
'defines': [
'HAVE_LIBRT=1',

View File

@@ -0,0 +1,22 @@
$NetBSD: patch-base_clock.cc,v 1.1 2016/05/16 11:51:49 ryoon Exp $
--- base/clock.cc.orig 2016-05-15 08:11:10.000000000 +0000
+++ base/clock.cc
@@ -124,7 +124,7 @@ class ClockImpl : public ClockInterface
mach_timebase_info(&timebase_info);
return static_cast<uint64>(
1.0e9 * timebase_info.denom / timebase_info.numer);
-#elif defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NACL)
+#elif defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NACL) || defined(OS_NETBSD)
return 1000000uLL;
#else // platforms (OS_WIN, OS_MACOSX, OS_LINUX, ...)
#error "Not supported platform"
@@ -141,7 +141,7 @@ class ClockImpl : public ClockInterface
return static_cast<uint64>(timestamp.QuadPart);
#elif defined(OS_MACOSX)
return static_cast<uint64>(mach_absolute_time());
-#elif defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NACL)
+#elif defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NACL) || defined(OS_NETBSD)
uint64 sec;
uint32 usec;
GetTimeOfDay(&sec, &usec);

View File

@@ -1,20 +1,20 @@
$NetBSD: patch-base_cpu__stats.cc,v 1.1 2013/04/29 09:52:16 ryoon Exp $
$NetBSD: patch-base_cpu__stats.cc,v 1.2 2016/05/16 11:51:49 ryoon Exp $
--- base/cpu_stats.cc.orig 2012-08-31 05:37:06.000000000 +0000
--- base/cpu_stats.cc.orig 2016-05-15 08:11:10.000000000 +0000
+++ base/cpu_stats.cc
@@ -123,13 +123,13 @@ float CPUStats::GetSystemCPULoad() {
#endif // OS_MACOSX
-#ifdef OS_LINUX
+#if defined(OS_LINUX) || defined(OS_NETBSD)
-#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NACL)
+#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NACL) || defined(OS_NETBSD)
// NOT IMPLEMENTED
// TODO(taku): implement Linux version
// can take the info from /proc/stats
const uint64 total_times = 0;
const uint64 cpu_times = 0;
-#endif // OS_LINUX
+#endif // OS_LINUX || OS_NETBSD
-#endif // OS_LINUX || OS_ANDROID || OS_NACL
+#endif // OS_LINUX || OS_ANDROID || OS_NACL || OS_NETBSD
return UpdateCPULoad(total_times,
cpu_times,
@@ -22,13 +22,13 @@ $NetBSD: patch-base_cpu__stats.cc,v 1.1 2013/04/29 09:52:16 ryoon Exp $
TimeValueTToInt64(task_times_info.system_time);
#endif // OS_MACOSX
-#ifdef OS_LINUX
+#if defined(OS_LINUX) || defined(OS_NETBSD)
-#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NACL)
+#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NACL) || defined(OS_NETBSD)
// not implemented
const uint64 total_times = 0;
const uint64 cpu_times = 0;
-#endif // OS_LINUX
+#endif // OS_LINUX || OS_NETBSD
-#endif // OS_LINUX || OS_ANDROID || OS_NACL
+#endif // OS_LINUX || OS_ANDROID || OS_NACL || OS_NETBSD
return UpdateCPULoad(total_times,
cpu_times,
@@ -36,11 +36,11 @@ $NetBSD: patch-base_cpu__stats.cc,v 1.1 2013/04/29 09:52:16 ryoon Exp $
return static_cast<size_t>(basic_info.avail_cpus);
#endif // OS_MACOSX
-#ifdef OS_LINUX
+#if defined(OS_LINUX) || defined(OS_NETBSD)
-#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NACL)
+#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NACL) || defined(OS_NETBSD)
// Not implemented
return 1;
-#endif // OS_LINUX
+#endif // OS_LINUX || OS_NETBSD
+#endif // OS_LINUX || OS_ANDROID || OS_NACL || OS_NETBSD
}
} // namespace mozc

View File

@@ -1,16 +0,0 @@
$NetBSD: patch-base_iconv.cc,v 1.1 2013/04/29 09:52:17 ryoon Exp $
--- base/iconv.cc.orig 2012-08-31 05:37:06.000000000 +0000
+++ base/iconv.cc
@@ -53,7 +53,11 @@ bool IconvHelper(iconv_t ic, const strin
size_t olen_org = olen;
iconv(ic, 0, &ilen, 0, &olen); // reset iconv state
while (ilen != 0) {
+#if defined(OS_NETBSD)
+ if (iconv(ic, (const char **)(&ibuf), &ilen, &obuf, &olen)
+#else
if (iconv(ic, reinterpret_cast<char **>(&ibuf), &ilen, &obuf, &olen)
+#endif
== static_cast<size_t>(-1)) {
return false;
}

View File

@@ -1,10 +1,10 @@
$NetBSD: patch-base_logging.cc,v 1.3 2013/09/15 12:30:23 joerg Exp $
$NetBSD: patch-base_logging.cc,v 1.4 2016/05/16 11:51:49 ryoon Exp $
--- base/logging.cc.orig 2013-08-28 05:26:13.000000000 +0000
--- base/logging.cc.orig 2016-05-15 08:11:10.000000000 +0000
+++ base/logging.cc
@@ -61,6 +61,10 @@
#include "base/system_util.h"
#include "base/util.h"
#include "base/mutex.h"
#include "base/singleton.h"
+#if defined(OS_NETBSD)
+#include <lwp.h>
@@ -13,22 +13,22 @@ $NetBSD: patch-base_logging.cc,v 1.3 2013/09/15 12:30:23 joerg Exp $
DEFINE_bool(colored_log, true, "Enables colored log messages on tty devices");
DEFINE_bool(logtostderr,
false,
@@ -110,7 +114,7 @@ string Logging::GetLogMessageHeader() {
@@ -102,7 +106,7 @@ string Logging::GetLogMessageHeader() {
"%4.4d-%2.2d-%2.2d %2.2d:%2.2d:%2.2d %u "
#if defined(__native_client__)
#if defined(OS_NACL)
"%p",
-#elif defined(OS_LINUX)
+#elif defined(OS_LINUX) || defined(OS_NETBSD)
"%lu",
#elif defined(OS_MACOSX) && defined(__LP64__)
"%llu",
@@ -137,6 +141,9 @@ string Logging::GetLogMessageHeader() {
@@ -129,6 +133,9 @@ string Logging::GetLogMessageHeader() {
::getpid(),
// pthread_self() returns __nc_basic_thread_data*.
static_cast<void*>(pthread_self())
+#elif defined(OS_NETBSD)
+ ::getpid(),
+ (unsigned long)_lwp_self()
+ ::getpid(),
+ (unsigned long)_lwp_self()
#else // = OS_LINUX
::getpid(),
// It returns unsigned long.

View File

@@ -1,26 +1,26 @@
$NetBSD: patch-base_mutex.cc,v 1.3 2013/09/07 18:42:14 ryoon Exp $
$NetBSD: patch-base_mutex.cc,v 1.4 2016/05/16 11:51:49 ryoon Exp $
--- base/mutex.cc.orig 2013-08-28 05:26:13.000000000 +0000
--- base/mutex.cc.orig 2016-05-15 08:11:10.000000000 +0000
+++ base/mutex.cc
@@ -61,7 +61,7 @@ namespace mozc {
@@ -53,7 +53,7 @@ namespace mozc {
// Wrapper for Windows InterlockedCompareExchange
namespace {
-#ifdef OS_LINUX
+#if defined(OS_LINUX) || defined(OS_NETBSD)
-#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NACL)
+#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NACL) || defined(OS_NETBSD)
// Linux doesn't provide InterlockedCompareExchange-like function.
inline int InterlockedCompareExchange(volatile int *target,
int new_value,
@@ -80,7 +80,7 @@ inline int InterlockedCompareExchange(vo
@@ -72,7 +72,7 @@ inline int InterlockedCompareExchange(vo
pthread_mutex_unlock(&lock);
return result;
}
-#endif // OS_LINUX
+#endif // OS_LINUX || OS_NETBSD
-#endif // OS_LINUX || OS_ANDROID || OS_NACL
+#endif // OS_LINUX || OS_ANDROID || OS_NACL || OS_NETBSD
// Use OSAtomicCompareAndSwapInt on Mac OSX
// http://developer.apple.com/iphone/library/documentation/
@@ -93,7 +93,7 @@ inline int InterlockedCompareExchange(vo
@@ -85,7 +85,7 @@ inline int InterlockedCompareExchange(vo
return OSAtomicCompareAndSwapInt(old_value, new_value, target)
? old_value : *target;
}
@@ -29,12 +29,12 @@ $NetBSD: patch-base_mutex.cc,v 1.3 2013/09/07 18:42:14 ryoon Exp $
} // namespace
@@ -300,7 +300,7 @@ Mutex::Mutex() {
@@ -183,7 +183,7 @@ Mutex::Mutex() {
// 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_NETBSD)
pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
#elif defined(OS_LINUX)
#elif defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NACL)
pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE_NP);

View File

@@ -1,9 +1,9 @@
$NetBSD: patch-base_mutex.h,v 1.1 2013/04/29 09:52:17 ryoon Exp $
$NetBSD: patch-base_mutex.h,v 1.2 2016/05/16 11:51:49 ryoon Exp $
* First chunk, NetBSD ILP32 ports seem to require larger mutex array size.
* I am not sure.
--- base/mutex.h.orig 2013-03-29 04:33:43.000000000 +0000
--- base/mutex.h.orig 2016-05-15 08:11:10.000000000 +0000
+++ base/mutex.h
@@ -50,8 +50,8 @@ namespace mozc {
// To remove dependencies against plafrom specific headers such as
@@ -16,14 +16,3 @@ $NetBSD: patch-base_mutex.h,v 1.1 2013/04/29 09:52:17 ryoon Exp $
#define MOZC_MUTEX_PTR_ARRAYSIZE 11
#define MOZC_RW_MUTEX_PTR_ARRAYSIZE 32
#else
@@ -60,6 +60,10 @@ namespace mozc {
#define MOZC_RW_MUTEX_PTR_ARRAYSIZE 12
#endif
+#if defined(__FreeBSD__) || defined(OS_NETBSD)
+#define PTHREAD_MUTEX_RECURSIVE_VALUE PTHREAD_MUTEX_RECURSIVE
+#endif
+
class LOCKABLE Mutex {
public:
Mutex();

View File

@@ -1,13 +1,16 @@
$NetBSD: patch-base_password__manager.cc,v 1.2 2014/01/19 01:18:50 ryoon Exp $
$NetBSD: patch-base_password__manager.cc,v 1.3 2016/05/16 11:51:49 ryoon Exp $
--- base/password_manager.cc.orig 2014-01-06 07:10:31.000000000 +0000
--- base/password_manager.cc.orig 2016-05-15 08:11:10.000000000 +0000
+++ base/password_manager.cc
@@ -264,7 +264,7 @@ bool WinMacPasswordManager::RemovePasswo
@@ -264,9 +264,9 @@ bool WinMacPasswordManager::RemovePasswo
// We use plain text file for password storage on Linux. If you port this module
// to other Linux distro, you might want to implement a new password manager
// which adopts some secure mechanism such like gnome-keyring.
-#if defined OS_LINUX
+#if defined(OS_LINUX) || defined(OS_NETBSD)
-#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NACL)
+#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NACL) || defined(OS_NETBSD)
typedef PlainPasswordManager DefaultPasswordManager;
#endif
-#endif // OS_LINUX || OS_ANDROID || OS_NACL
+#endif // OS_LINUX || OS_ANDROID || OS_NACL || OS_NETBSD
// Windows or Mac
#if (defined(OS_WIN) || defined(OS_MACOSX))

View File

@@ -0,0 +1,25 @@
$NetBSD: patch-base_port.h,v 1.3 2016/05/16 11:51:49 ryoon Exp $
--- base/port.h.orig 2016-05-15 08:11:10.000000000 +0000
+++ base/port.h
@@ -56,6 +56,10 @@
#endif // !OS_ANDROID && !OS_NACL
#endif // OS_LINUX
+#ifdef OS_NETBSD
+#define MOZC_OS_DEFINED
+#endif // OS_NETBSD
+
#ifndef MOZC_OS_DEFINED
#error "OS_XXX (e.g., OS_WIN) must be defined."
#endif // !MOZC_OS_DEFINED
@@ -157,4 +161,9 @@ static const int64 kint64max = (( int6
#define AS_STRING(x) AS_STRING_INTERNAL(x)
#define AS_STRING_INTERNAL(x) #x
+// gcc>=46 has nullptr, otherwise use __null instead.
+#if __cplusplus < 201103L && !defined(__clang__) && defined(__GNUC__) && __GNUC__ * 1000 + __GNUC__MINOR__ < 4006
+#define nullptr __null
+#endif
+
#endif // MOZC_BASE_PORT_H_

View File

@@ -1,65 +1,71 @@
$NetBSD: patch-base_process.cc,v 1.3 2013/09/07 18:42:14 ryoon Exp $
$NetBSD: patch-base_process.cc,v 1.4 2016/05/16 11:51:49 ryoon Exp $
--- base/process.cc.orig 2013-08-28 05:26:13.000000000 +0000
--- base/process.cc.orig 2016-05-15 08:11:10.000000000 +0000
+++ base/process.cc
@@ -46,7 +46,7 @@
@@ -46,12 +46,12 @@
#include "base/mac_process.h"
#endif // OS_MACOSX
-#ifdef OS_LINUX
+#if defined(OS_LINUX) || defined(OS_NETBSD)
-#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NACL)
+#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NACL) || defined(OS_NETBSD)
#include <fcntl.h>
#include <signal.h>
#include <spawn.h> // for posix_spawn().
@@ -121,12 +121,12 @@ bool Process::OpenBrowser(const string &
#include <sys/types.h>
-#endif // OS_LINUX || OS_ANDROID || OS_NACL
+#endif // OS_LINUX || OS_ANDROID || OS_NACL || OS_NETBSD
#include <cstdlib>
#include <memory>
@@ -125,12 +125,12 @@ bool Process::OpenBrowser(const string &
return ShellExecuteInSystemDir(L"open", wurl.c_str(), NULL, SW_SHOW);
#endif
-#ifdef OS_LINUX
-#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NACL)
- static const char kBrowserCommand[] = "/usr/bin/xdg-open";
+#if defined(OS_LINUX) || defined(OS_NETBSD)
+#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NACL) || defined(OS_NETBSD)
+ static const char kBrowserCommand[] = "@PREFIX@/bin/xdg-open";
// xdg-open which uses kfmclient or gnome-open internally works both on KDE
// and GNOME environments.
return SpawnProcess(kBrowserCommand, url);
-#endif // LINUX
+#endif // OS_LINUX || OS_NETBSD
-#endif // OS_LINUX || OS_ANDROID || OS_NACL
+#endif // OS_LINUX || OS_ANDROID || OS_NACL || OS_NETBSD
#ifdef OS_MACOSX
return MacProcess::OpenBrowserForMac(url);
@@ -205,7 +205,7 @@ bool Process::SpawnProcess(const string
@@ -209,7 +209,7 @@ bool Process::SpawnProcess(const string
}
#endif
-#ifdef OS_LINUX
+#if defined(OS_LINUX) || defined(OS_NETBSD)
-#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NACL)
+#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NACL) || defined(OS_NETBSD)
// Do not call posix_spawn() for obviously bad path.
if (!S_ISREG(statbuf.st_mode)) {
LOG(ERROR) << "Not a regular file: " << path;
@@ -228,7 +228,7 @@ bool Process::SpawnProcess(const string
@@ -232,7 +232,7 @@ bool Process::SpawnProcess(const string
// (www.gnu.org/software/libc/manual/html_node/Heap-Consistency-Checking.html)
const int kOverwrite = 0; // Do not overwrite.
::setenv("MALLOC_CHECK_", "2", kOverwrite);
-#endif // OS_LINUX
+#endif // OS_LINUX || OS_NETBSD
-#endif // OS_LINUX || OS_ANDROID || OS_NACL
+#endif // OS_LINUX || OS_ANDROID || OS_NACL || OS_NETBSD
pid_t tmp_pid = 0;
// Spawn new process.
@@ -399,7 +399,7 @@ bool Process::LaunchErrorMessageDialog(c
@@ -403,7 +403,7 @@ bool Process::LaunchErrorMessageDialog(c
}
#endif // OS_WIN
-#ifdef OS_LINUX
+#if defined(OS_LINUX) || defined(OS_NETBSD)
-#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NACL)
+#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NACL) || defined(OS_NETBSD)
const char kMozcTool[] = "mozc_tool";
const string arg = "--mode=error_message_dialog --error_type=" + error_type;
size_t pid = 0;
@@ -407,7 +407,7 @@ bool Process::LaunchErrorMessageDialog(c
@@ -411,7 +411,7 @@ bool Process::LaunchErrorMessageDialog(c
LOG(ERROR) << "cannot launch " << kMozcTool;
return false;
}
-#endif // OS_LINUX
+#endif // OS_LINUX || OS_NETBSD
-#endif // OS_LINUX || OS_ANDROID || OS_NACL
+#endif // OS_LINUX || OS_ANDROID || OS_NACL || OS_NETBSD
return true;
}

View File

@@ -1,17 +1,17 @@
$NetBSD: patch-base_run__level.cc,v 1.3 2014/11/07 23:28:36 ryoon Exp $
$NetBSD: patch-base_run__level.cc,v 1.4 2016/05/16 11:51:49 ryoon Exp $
--- base/run_level.cc.orig 2014-11-03 05:13:02.000000000 +0000
--- base/run_level.cc.orig 2016-05-15 08:11:10.000000000 +0000
+++ base/run_level.cc
@@ -38,10 +38,10 @@
#include <unistd.h>
#endif // OS_MACOSX
-#ifdef OS_LINUX
+#if defined(OS_LINUX) || defined(OS_NETBSD)
-#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NACL)
+#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NACL) || defined(OS_NETBSD)
#include <unistd.h>
#include <sys/types.h>
-#endif // OS_LINUX
+#endif // OS_LINUX || OS_NETBSD
-#endif // OS_LINUX || OS_ANDROID || OS_NACL
+#endif // OS_LINUX || OS_ANDROID || OS_NACL || OS_NETBSD
#include "base/const.h"
#include "base/logging.h"

View File

@@ -1,70 +1,56 @@
$NetBSD: patch-base_system__util.cc,v 1.3 2013/09/07 18:42:14 ryoon Exp $
$NetBSD: patch-base_system__util.cc,v 1.4 2016/05/16 11:51:49 ryoon Exp $
--- base/system_util.cc.orig 2013-08-28 05:26:13.000000000 +0000
--- base/system_util.cc.orig 2016-05-15 08:11:10.000000000 +0000
+++ base/system_util.cc
@@ -421,14 +421,14 @@ string SystemUtil::GetServerDirectory()
@@ -372,11 +372,11 @@ string SystemUtil::GetServerDirectory()
#elif defined(OS_MACOSX)
return MacUtil::GetServerDirectory();
-#elif defined(OS_LINUX)
+#elif defined(OS_LINUX) || defined(OS_NETBSD)
-#elif defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NACL)
+#elif defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NACL) || defined(OS_NETBSD)
#if defined(MOZC_SERVER_DIRECTORY)
return MOZC_SERVER_DIRECTORY;
#else
- return "/usr/lib/mozc";
+ return "@PREFIX@/libexec";
+ return "@PREFIX@/lib/mozc";
#endif // MOZC_SERVER_DIRECTORY
-#endif // OS_WIN, OS_MACOSX, OS_LINUX
+#endif // OS_WIN, OS_MACOSX, OS_LINUX, OS_NETBSD
}
string SystemUtil::GetServerPath() {
@@ -493,7 +493,7 @@ string SystemUtil::GetUserNameAsString()
#endif // OS_WIN, OS_MACOSX, OS_LINUX, ...
@@ -450,7 +450,7 @@ string SystemUtil::GetUserNameAsString()
return ppw->pw_name;
#else // OS_ANDROID
- // OS_MACOSX or OS_LINUX
+ // OS_MACOSX or OS_LINUX, OS_NETBSD
- // OS_MACOSX, OS_LINUX or OS_NACL
+ // OS_MACOSX, OS_LINUX, OS_NACL or OS_NETBSD
struct passwd pw, *ppw;
char buf[1024];
CHECK_EQ(0, getpwuid_r(geteuid(), &pw, buf, sizeof(buf), &ppw));
@@ -653,7 +653,7 @@ string GetSessionIdString() {
@@ -610,7 +610,7 @@ string GetSessionIdString() {
#endif // OS_WIN
string SystemUtil::GetDesktopNameAsString() {
-#ifdef OS_LINUX
+#if defined(OS_LINUX) || defined(OS_NETBSD)
-#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NACL)
+#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NACL) || defined(OS_NETBSD)
const char *display = getenv("DISPLAY");
if (display == NULL) {
return "";
@@ -683,7 +683,7 @@ string SystemUtil::GetDesktopNameAsStrin
}
return (session_id + "." + window_station_name + "." + desktop_name);
-#endif // OS_LINUX, OS_MACOSX, OS_WIN
+#endif // OS_LINUX, OS_MACOSX, OS_WIN, OS_NETBSD
}
#ifdef OS_WIN
@@ -858,7 +858,7 @@ bool SystemUtil::IsPlatformSupported() {
@@ -691,7 +691,7 @@ bool SystemUtil::IsPlatformSupported() {
#if defined(OS_MACOSX)
// TODO(yukawa): support Mac.
return true;
-#elif defined(OS_LINUX)
+#elif defined(OS_LINUX) || defined(OS_NETBSD)
-#elif defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NACL)
+#elif defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NACL) || defined(OS_NETBSD)
// TODO(yukawa): support Linux.
return true;
#elif defined(OS_WIN)
@@ -1157,10 +1157,13 @@ string SystemUtil::GetOSVersionString()
#elif defined(OS_LINUX)
@@ -930,10 +930,13 @@ string SystemUtil::GetOSVersionString()
#elif defined(OS_LINUX) || defined(OS_NACL)
const string ret = "Linux";
return ret;
-#else // !OS_WIN && !OS_MACOSX && !OS_LINUX
+#elif defined(OS_NETBSD)
+ const string ret = "NetBSD";
+ return ret;
+#else // !OS_WIN && !OS_MACOSX && !OS_LINUX && !OS_NETBSD
#else // !OS_WIN && !OS_MACOSX && !OS_LINUX
const string ret = "Unknown";
return ret;
-#endif // OS_WIN, OS_MACOSX, OS_LINUX
@@ -72,12 +58,21 @@ $NetBSD: patch-base_system__util.cc,v 1.3 2013/09/07 18:42:14 ryoon Exp $
}
bool SystemUtil::MacOSVersionIsGreaterOrEqual(int32 major,
@@ -1204,7 +1207,7 @@ uint64 SystemUtil::GetTotalPhysicalMemor
@@ -977,7 +980,7 @@ uint64 SystemUtil::GetTotalPhysicalMemor
return 0;
}
return total_memory;
-#elif defined(OS_LINUX)
+#elif defined(OS_LINUX) || defined(OS_NETBSD)
-#elif defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NACL)
+#elif defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NACL) || defined(OS_NETBSD)
#if defined(_SC_PAGESIZE) && defined(_SC_PHYS_PAGES)
const long page_size = sysconf(_SC_PAGESIZE);
const long number_of_phyisical_pages = sysconf(_SC_PHYS_PAGES);
@@ -992,7 +995,7 @@ uint64 SystemUtil::GetTotalPhysicalMemor
#endif // defined(_SC_PAGESIZE) && defined(_SC_PHYS_PAGES)
#else // !(defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX))
#error "unknown platform"
-#endif // OS_WIN, OS_MACOSX, OS_LINUX
+#endif // OS_WIN, OS_MACOSX, OS_LINUX, OS_NETBSD
}
bool SystemUtil::IsLittleEndian() {

View File

@@ -1,32 +0,0 @@
$NetBSD: patch-base_util.cc,v 1.3 2013/09/07 18:42:14 ryoon Exp $
--- base/util.cc.orig 2013-08-28 05:26:13.000000000 +0000
+++ base/util.cc
@@ -1087,15 +1087,15 @@ class ClockImpl : public Util::ClockInte
mach_timebase_info(&timebase_info);
return static_cast<uint64>(
1.0e9 * timebase_info.denom / timebase_info.numer);
-#elif defined(OS_LINUX)
+#elif defined(OS_LINUX) || defined(OS_NETBSD)
#if defined(HAVE_LIBRT)
return 1000000000uLL;
#else // HAVE_LIBRT
return 1000000uLL;
#endif // HAVE_LIBRT
-#else // platforms (OS_WIN, OS_MACOSX, OS_LINUX, ...)
+#else // platforms (OS_WIN, OS_MACOSX, OS_LINUX, OS_NETBSD ...)
#error "Not supported platform"
-#endif // platforms (OS_WIN, OS_MACOSX, OS_LINUX, ...)
+#endif // platforms (OS_WIN, OS_MACOSX, OS_LINUX, OS_NETBSD ...)
}
virtual uint64 GetTicks() {
@@ -1107,7 +1107,7 @@ class ClockImpl : public Util::ClockInte
return static_cast<uint64>(timestamp.QuadPart);
#elif defined(OS_MACOSX)
return static_cast<uint64>(mach_absolute_time());
-#elif defined(OS_LINUX)
+#elif defined(OS_LINUX) || defined(OS_NETBSD)
#if defined(HAVE_LIBRT)
struct timespec timestamp;
if (-1 == clock_gettime(CLOCK_REALTIME, &timestamp)) {

View File

@@ -1,16 +1,16 @@
$NetBSD: patch-build__mozc.py,v 1.7 2015/01/06 10:30:54 ryoon Exp $
$NetBSD: patch-build__mozc.py,v 1.8 2016/05/16 11:51:49 ryoon Exp $
--- build_mozc.py.orig 2014-11-03 05:13:03.000000000 +0000
--- build_mozc.py.orig 2016-05-15 08:11:10.000000000 +0000
+++ build_mozc.py
@@ -60,6 +60,7 @@ from build_tools.util import FindFileFro
from build_tools.util import GetNumberOfProcessors
@@ -58,6 +58,7 @@ from build_tools.util import GetNumberOf
from build_tools.util import GetRelPath
from build_tools.util import IsLinux
+from build_tools.util import IsNetBSD
from build_tools.util import IsMac
+from build_tools.util import IsNetBSD
from build_tools.util import IsWindows
from build_tools.util import PrintErrorAndExit
@@ -121,6 +122,8 @@ def GetBuildShortBaseName(options, targe
from build_tools.util import RemoveDirectoryRecursively
@@ -123,6 +124,8 @@ def GetBuildShortBaseName(options, targe
build_base = 'out_mac'
elif target_platform == 'Linux':
build_base = 'out_linux'
@@ -19,31 +19,29 @@ $NetBSD: patch-build__mozc.py,v 1.7 2015/01/06 10:30:54 ryoon Exp $
elif target_platform == 'Android':
build_base = 'out_android'
elif target_platform == 'NaCl':
@@ -219,6 +222,14 @@ def GetGypFileNames(options):
if not PkgExists('ibus-1.0 >= 1.4.1'):
logging.info('removing ibus.gyp.')
gyp_file_names.remove('%s/unix/ibus/ibus.gyp' % SRC_DIR)
@@ -223,6 +226,12 @@ def GetGypFileNames(options):
elif options.target_platform == 'Android':
# Add Android Mozc gyp scripts.
gyp_file_names.extend(glob.glob('%s/android/*/*.gyp' % SRC_DIR))
+ elif options.target_platform == 'NetBSD':
+ gyp_file_names.extend(glob.glob('%s/unix/*/*.gyp' % SRC_DIR))
+ # Add ibus.gyp if ibus version is >=1.4.1.
+ if not PkgExists('ibus-1.0 >= 1.4.1'):
+ logging.info('removing ibus.gyp.')
+ gyp_file_names.remove('%s/unix/ibus/ibus.gyp' % SRC_DIR)
+ elif options.target_platform == 'ChromeOS':
+ gyp_file_names.extend(glob.glob('%s/unix/ibus/*.gyp' % SRC_DIR))
elif options.target_platform == 'NaCl':
# Add chrome NaCl Mozc gyp scripts.
gyp_file_names.append('%s/chrome/nacl/nacl_extension.gyp' % SRC_DIR)
@@ -314,6 +325,8 @@ def AddTargetPlatformOption(parser):
gyp_file_names.sort()
return gyp_file_names
@@ -318,6 +327,8 @@ def AddTargetPlatformOption(parser):
# If you want Android build, specify "Android".
if IsLinux():
default_target = 'Linux'
+ elif IsNetBSD():
+ if IsNetBSD():
+ default_target = 'NetBSD'
elif IsWindows():
default_target = 'Windows'
elif IsMac():
@@ -511,6 +524,14 @@ def ExpandMetaTarget(options, meta_targe
@@ -497,6 +508,12 @@ def ExpandMetaTarget(options, meta_targe
SRC_DIR + '/gui/gui.gyp:mozc_tool']
if PkgExists('ibus-1.0 >= 1.4.1'):
targets.append(SRC_DIR + '/unix/ibus/ibus.gyp:ibus_mozc')
@@ -53,30 +51,10 @@ $NetBSD: patch-build__mozc.py,v 1.7 2015/01/06 10:30:54 ryoon Exp $
+ SRC_DIR + '/gui/gui.gyp:mozc_tool']
+ if PkgExists('ibus-1.0 >= 1.4.1'):
+ targets.append(SRC_DIR + '/unix/ibus/ibus.gyp:ibus_mozc')
+ elif target_platform == 'ChromeOS':
+ targets.append(SRC_DIR + '/unix/ibus/ibus.gyp:ibus_mozc')
elif target_platform == 'Mac':
targets = [SRC_DIR + '/mac/mac.gyp:DiskImage']
elif target_platform == 'Windows':
@@ -536,7 +557,7 @@ def ParseBuildOptions(args=None, values=
"""Parses command line options for the build command."""
parser = optparse.OptionParser(usage='Usage: %prog build [options]')
AddCommonOptions(parser)
- if IsLinux():
+ if IsLinux() or IsNetBSD():
default_build_concurrency = GetNumberOfProcessors() * 2
parser.add_option('--jobs', '-j', dest='jobs',
default=('%d' % default_build_concurrency),
@@ -565,7 +586,7 @@ def ParseRunTestsOptions(args=None, valu
parser = optparse.OptionParser(
usage='Usage: %prog runtests [options] [test_targets] [-- build options]')
AddCommonOptions(parser)
- if IsLinux():
+ if IsLinux() or IsNetBSD():
default_build_concurrency = GetNumberOfProcessors() * 2
parser.add_option('--jobs', '-j', dest='jobs',
default=('%d' % default_build_concurrency),
@@ -788,7 +809,8 @@ def GypMain(options, unused_args, _):
@@ -753,7 +770,8 @@ def GypMain(options, unused_args, _):
gyp_options.extend(['-D', 'channel_dev=1'])
def SetCommandLineForFeature(option_name, windows=False, mac=False,
@@ -86,39 +64,34 @@ $NetBSD: patch-build__mozc.py,v 1.7 2015/01/06 10:30:54 ryoon Exp $
"""Updates an option like '--enable_foober' and add a -D argument for gyp.
This function ensures an option like '--enable_foober' exists and it has a
@@ -810,6 +832,8 @@ def GypMain(options, unused_args, _):
@@ -775,6 +793,8 @@ def GypMain(options, unused_args, _):
option on Android platform.
nacl: A boolean which replesents the default value of the target
option on NaCl.
+ netbsd: boolean which replesents the default value of the target option
+ on NetBSD platform.
+ netbsd: A boolean which replesents the default value of the target option
+ on NetBSD platform.
Raises:
ValueError: An error occurred when 'option_name' is empty.
@@ -822,6 +846,7 @@ def GypMain(options, unused_args, _):
@@ -786,6 +806,7 @@ def GypMain(options, unused_args, _):
default_enabled = {'Windows': windows,
'Mac': mac,
'Linux': linux,
+ 'NetBSD': netbsd,
'Android': android,
+ 'NetBSD' : netbsd,
'NaCl': nacl}[options.target_platform]
enable_option_name = 'enable_%s' % option_name
enabled = options.ensure_value(enable_option_name, default_enabled)
@@ -833,10 +858,12 @@ def GypMain(options, unused_args, _):
@@ -798,6 +819,7 @@ def GypMain(options, unused_args, _):
SetCommandLineForFeature(option_name='cloud_handwriting',
linux=is_official_dev,
+ netbsd=is_official_dev,
+ netbsd=is_official_dev,
windows=is_official_dev,
mac=is_official_dev)
SetCommandLineForFeature(option_name='http_client',
linux=is_official,
+ netbsd=is_official,
windows=is_official,
mac=is_official,
android=is_official,
@@ -874,7 +901,8 @@ def GypMain(options, unused_args, _):
@@ -825,7 +847,8 @@ def GypMain(options, unused_args, _):
else:
gyp_options.extend(['-D', 'use_zinnia=NO'])
gyp_options.extend(['-D', 'use_dynamically_linked_qt=0'])
- if (options.target_platform == 'Linux' and
+ if ((options.target_platform == 'Linux' or
@@ -126,7 +99,7 @@ $NetBSD: patch-build__mozc.py,v 1.7 2015/01/06 10:30:54 ryoon Exp $
'%s/unix/ibus/ibus.gyp' % SRC_DIR in gyp_file_names):
gyp_options.extend(['-D', 'use_libibus=1'])
@@ -907,7 +935,7 @@ def GypMain(options, unused_args, _):
@@ -857,7 +880,7 @@ def GypMain(options, unused_args, _):
# command for pkg-config. Here we catch the environment variable
# and use the specified command instead of actual pkg-config
# command.
@@ -135,38 +108,12 @@ $NetBSD: patch-build__mozc.py,v 1.7 2015/01/06 10:30:54 ryoon Exp $
gyp_options.extend(['-D', 'pkg_config_command=%s' % GetPkgConfigCommand()])
else:
gyp_options.extend(['-D', 'pkg_config_command='])
@@ -1045,6 +1073,25 @@ def BuildOnMac(options, targets, origina
'-parallelizeTargets',
'BUILD_WITH_GYP=1'])
+def BuildOnBSD(options, targets, unused_original_directory_name):
+ """Build the targets on BSD."""
+ target_names = []
+ for target in targets:
+ (unused_gyp_file_name, target_name) = (
+ CanonicalTargetToGypFileAndTargetName(target))
+ target_names.append(target_name)
+
+ ninja = 'ninja'
+ if hasattr(options, 'android_device'):
+ # Only for android testing.
+ os.environ['ANDROID_DEVICES'] = options.android_device
+
+ short_basename = GetBuildShortBaseName(options,
+ GetMozcVersion().GetTargetPlatform())
+ make_command = ninja
+ build_args = ['-j %s' % options.jobs,
+ '-C', '%s/%s' % (short_basename, options.configuration)]
+ RunOrDie([make_command] + build_args + target_names)
def BuildOnWindows(targets):
"""Build the target on Windows."""
@@ -1072,6 +1119,8 @@ def BuildMain(options, targets, original
BuildOnMac(options, targets, original_directory_name)
elif IsLinux():
BuildOnLinux(options, targets, original_directory_name)
+ elif IsNetBSD():
+ BuildOnBSD(options, targets, original_directory_name)
elif IsWindows():
BuildOnWindows(targets)
else:
@@ -1282,7 +1305,7 @@ def CleanBuildFilesAndDirectories(option
GetMozcVersion().GetTargetPlatform())
if target_platform:
directory_names.append(target_platform)
- if IsLinux():
+ if IsLinux() or IsNetBSD():
# Remove auto-generated files.
file_names.append(os.path.join(SRC_DIR, 'android', 'AndroidManifest.xml'))
file_names.append(os.path.join(

View File

@@ -1,14 +1,16 @@
$NetBSD: patch-build__tools_util.py,v 1.3 2013/09/07 18:42:14 ryoon Exp $
$NetBSD: patch-build__tools_util.py,v 1.4 2016/05/16 11:51:49 ryoon Exp $
--- build_tools/util.py.orig 2013-08-28 05:25:59.000000000 +0000
--- build_tools/util.py.orig 2016-05-15 08:11:10.000000000 +0000
+++ build_tools/util.py
@@ -56,6 +56,9 @@ def IsLinux():
"""Returns true if the platform is Linux."""
@@ -59,6 +59,11 @@ def IsLinux():
return os.name == 'posix' and os.uname()[0] == 'Linux'
+def IsNetBSD():
+ """Returns true if the platform is NetBSD."""
+ return os.name == 'posix' and os.uname()[0] == 'NetBSD'
+
+
def GetNumberOfProcessors():
"""Returns the number of CPU cores available.

View File

@@ -1,22 +1,22 @@
$NetBSD: patch-client_client.cc,v 1.1 2013/04/29 09:52:17 ryoon Exp $
$NetBSD: patch-client_client.cc,v 1.2 2016/05/16 11:51:49 ryoon Exp $
--- client/client.cc.orig 2013-03-29 04:33:44.000000000 +0000
--- client/client.cc.orig 2016-05-15 08:11:10.000000000 +0000
+++ client/client.cc
@@ -950,7 +950,7 @@ bool Client::LaunchTool(const string &mo
return false;
@@ -891,7 +891,7 @@ bool Client::LaunchTool(const string &mo
}
-#if defined(OS_WIN) || defined(OS_LINUX)
+#if defined(OS_WIN) || defined(OS_LINUX) || defined(OS_NETBSD)
#if defined(OS_WIN) || defined(OS_LINUX) || defined(OS_ANDROID)\
- || defined(OS_NACL)
+ || defined(OS_NACL) || defined(OS_NETBSD)
string arg = "--mode=" + mode;
if (!extra_arg.empty()) {
arg += " ";
@@ -960,7 +960,7 @@ bool Client::LaunchTool(const string &mo
@@ -901,7 +901,7 @@ bool Client::LaunchTool(const string &mo
LOG(ERROR) << "Cannot execute: " << kMozcTool << " " << arg;
return false;
}
-#endif // OS_WIN || OS_LINUX
+#endif // OS_WIN || OS_LINUX || OS_NETBSD
-#endif // OS_WIN || OS_LINUX || OS_ANDROID || OS_NACL
+#endif // OS_WIN || OS_LINUX || OS_ANDROID || OS_NACL || OS_NETBSD
// TODO(taku): move MacProcess inside SpawnMozcProcess.
// TODO(taku): support extra_arg.

View File

@@ -1,20 +1,18 @@
$NetBSD: patch-config_stats__config__util__test.cc,v 1.1 2013/04/29 09:52:17 ryoon Exp $
$NetBSD: patch-config_stats__config__util__test.cc,v 1.2 2016/05/16 11:51:49 ryoon Exp $
--- config/stats_config_util_test.cc.orig 2012-08-31 05:36:42.000000000 +0000
--- config/stats_config_util_test.cc.orig 2016-05-15 08:11:10.000000000 +0000
+++ config/stats_config_util_test.cc
@@ -708,13 +708,13 @@ TEST(StatsConfigUtilTestAndroid, Default
@@ -696,11 +696,11 @@ TEST(StatsConfigUtilTestAndroid, Default
}
#endif // OS_ANDROID
-#ifdef OS_LINUX
+#if defined(OS_LINUX) || defined(OS_NETBSD)
#ifndef OS_ANDROID
-#if defined(OS_LINUX) || defined(OS_NACL)
+#if defined(OS_LINUX) || defined(OS_NACL) || defined(OS_NETBSD)
TEST(StatsConfigUtilTestLinux, DefaultValueTest) {
EXPECT_FALSE(StatsConfigUtil::IsEnabled());
}
#endif // OS_ANDROID
-#endif // OS_LINUX
+#endif // OS_LINUX || OS_NETBSD
-#endif // OS_LINUX || OS_NACL
+#endif // OS_LINUX || OS_NACL || OS_NETBSD
#else // !GOOGLE_JAPANESE_INPUT_BUILD
TEST(StatsConfigUtilTestNonOfficialBuild, DefaultValueTest) {

View File

@@ -1,20 +1,17 @@
$NetBSD: patch-gui_base_locale__util.cc,v 1.2 2013/07/20 04:34:53 ryoon Exp $
$NetBSD: patch-gui_base_locale__util.cc,v 1.3 2016/05/16 11:51:49 ryoon Exp $
--- gui/base/locale_util.cc.orig 2013-07-17 02:38:10.000000000 +0000
--- gui/base/locale_util.cc.orig 2016-05-15 08:11:11.000000000 +0000
+++ gui/base/locale_util.cc
@@ -121,9 +121,9 @@ QString GetUILocaleName() {
@@ -125,7 +125,7 @@ QString GetUILocaleName() {
return result;
#else // OS_MACOSX
- // return system locale on Linux
+ // return system locale on Linux or NetBSD
return QLocale::system().name();
-#endif // OS_LINUX
+#endif // OS_LINUX || OS_NETBSD
#endif // OS_LINUX
}
// sicnce Qtranslator and QFont must be available until
@@ -206,7 +206,7 @@ TranslationDataImpl::TranslationDataImpl
@@ -204,7 +204,7 @@ TranslationDataImpl::TranslationDataImpl
qApp->installEventFilter(&window_title_modifier_);
#endif // MOZC_SHOW_BUILD_NUMBER_ON_TITLE

View File

@@ -1,8 +1,8 @@
$NetBSD: patch-gui_config__dialog_config__dialog.cc,v 1.4 2014/01/19 01:18:50 ryoon Exp $
$NetBSD: patch-gui_config__dialog_config__dialog.cc,v 1.5 2016/05/16 11:51:49 ryoon Exp $
--- gui/config_dialog/config_dialog.cc.orig 2014-01-06 07:10:44.000000000 +0000
--- gui/config_dialog/config_dialog.cc.orig 2016-05-15 08:11:11.000000000 +0000
+++ gui/config_dialog/config_dialog.cc
@@ -94,21 +94,21 @@ ConfigDialog::ConfigDialog()
@@ -100,21 +100,21 @@ ConfigDialog::ConfigDialog()
setWindowTitle(tr("Mozc Preferences"));
#endif // OS_MACOSX
@@ -28,7 +28,7 @@ $NetBSD: patch-gui_config__dialog_config__dialog.cc,v 1.4 2014/01/19 01:18:50 ry
#endif // NO_LOGGING
#ifndef ENABLE_CLOUD_HANDWRITING
@@ -323,7 +323,7 @@ ConfigDialog::ConfigDialog()
@@ -324,7 +324,7 @@ ConfigDialog::ConfigDialog()
dictionaryPreloadingAndUACLabel->setVisible(false);
#endif // OS_WIN
@@ -37,7 +37,7 @@ $NetBSD: patch-gui_config__dialog_config__dialog.cc,v 1.4 2014/01/19 01:18:50 ry
// On Linux, disable all fields for UsageStats
usageStatsLabel->setEnabled(false);
usageStatsLabel->setVisible(false);
@@ -333,7 +333,7 @@ ConfigDialog::ConfigDialog()
@@ -334,7 +334,7 @@ ConfigDialog::ConfigDialog()
usageStatsMessage->setVisible(false);
usageStatsCheckBox->setEnabled(false);
usageStatsCheckBox->setVisible(false);
@@ -46,21 +46,3 @@ $NetBSD: patch-gui_config__dialog_config__dialog.cc,v 1.4 2014/01/19 01:18:50 ry
Reload();
@@ -409,7 +409,7 @@ bool ConfigDialog::Update() {
}
-#if defined(OS_WIN)
+#if defined(OS_WIN) || defined(OS_LINUX) || defined(OS_NETBSD)
if ((initial_preedit_method_ !=
static_cast<int>(config.preedit_method())) ||
(initial_use_keyboard_to_change_preedit_method_ !=
@@ -421,7 +421,7 @@ bool ConfigDialog::Update() {
initial_use_keyboard_to_change_preedit_method_ =
config.use_keyboard_to_change_preedit_method();
}
-#endif // OS_WIN
+#endif // OS_WIN, OS_LINUX or OS_NETBSD
#ifdef OS_WIN
if (initial_use_mode_indicator_ != config.use_mode_indicator()) {

View File

@@ -1,8 +1,8 @@
$NetBSD: patch-gui_config__dialog_keybinding__editor.cc,v 1.1 2013/04/29 09:52:17 ryoon Exp $
$NetBSD: patch-gui_config__dialog_keybinding__editor.cc,v 1.2 2016/05/16 11:51:49 ryoon Exp $
--- gui/config_dialog/keybinding_editor.cc.orig 2012-08-31 05:37:09.000000000 +0000
--- gui/config_dialog/keybinding_editor.cc.orig 2016-05-15 08:11:11.000000000 +0000
+++ gui/config_dialog/keybinding_editor.cc
@@ -33,7 +33,7 @@
@@ -37,7 +37,7 @@
#include <windows.h>
#include <imm.h>
#include <ime.h>
@@ -11,7 +11,7 @@ $NetBSD: patch-gui_config__dialog_keybinding__editor.cc,v 1.1 2013/04/29 09:52:1
#define XK_MISCELLANY
#include <X11/keysymdef.h>
#endif
@@ -121,7 +121,7 @@ const WinVirtualKeyEntry kWinVirtualKeyM
@@ -125,7 +125,7 @@ const WinVirtualKeyEntry kWinVirtualKeyM
{ VK_DBE_DBCSCHAR, "Hankaku/Zenkaku" }, // Zenkaku/hankaku
// { VK_KANJI, "Kanji" }, // Do not support Kanji
};
@@ -20,7 +20,7 @@ $NetBSD: patch-gui_config__dialog_keybinding__editor.cc,v 1.1 2013/04/29 09:52:1
struct LinuxVirtualKeyEntry {
uint16 virtual_key;
const char *mozc_key_name;
@@ -390,7 +390,7 @@ KeyBindingFilter::KeyState KeyBindingFil
@@ -394,7 +394,7 @@ KeyBindingFilter::KeyState KeyBindingFil
return Encode(result);
}
}
@@ -29,12 +29,12 @@ $NetBSD: patch-gui_config__dialog_keybinding__editor.cc,v 1.1 2013/04/29 09:52:1
const uint16 virtual_key = key_event.nativeVirtualKey();
// The XKB defines three types of logical key code: "xkb::Hiragana",
@@ -500,7 +500,7 @@ bool KeyBindingFilter::eventFilter(QObje
@@ -504,7 +504,7 @@ bool KeyBindingFilter::eventFilter(QObje
KeyBindingEditor::KeyBindingEditor(QWidget *parent, QWidget *trigger_parent)
: QDialog(parent), trigger_parent_(trigger_parent) {
setupUi(this);
-#ifdef OS_LINUX
+#if defined(OS_LINUX) || defined(OS_NETBSD)
// Workaround for the issue http://code.google.com/p/mozc/issues/detail?id=9
// Workaround for the issue https://github.com/google/mozc/issues/9
// Seems that even after clicking the button for the keybinding dialog,
// the edit is not raised. This might be a bug of setFocusProxy.

View File

@@ -1,13 +0,0 @@
$NetBSD: patch-gui_gui.gyp,v 1.3 2015/07/31 13:07:05 ryoon Exp $
--- gui/gui.gyp.orig 2015-06-07 07:16:23.000000000 +0000
+++ gui/gui.gyp
@@ -387,7 +387,7 @@
'../protocol/protocol.gyp:commands_proto',
],
}],
- ['use_libzinnia==1 and OS=="linux"', {
+ ['use_libzinnia==1 and (OS=="linux" or OS=="netbsd")', {
'defines': [
'USE_LIBZINNIA',
],

View File

@@ -1,8 +1,8 @@
$NetBSD: patch-gui_word__register__dialog_word__register__dialog.cc,v 1.2 2013/07/20 04:34:53 ryoon Exp $
$NetBSD: patch-gui_word__register__dialog_word__register__dialog.cc,v 1.3 2016/05/16 11:51:49 ryoon Exp $
--- gui/word_register_dialog/word_register_dialog.cc.orig 2013-07-17 02:38:14.000000000 +0000
--- gui/word_register_dialog/word_register_dialog.cc.orig 2016-05-15 08:11:11.000000000 +0000
+++ gui/word_register_dialog/word_register_dialog.cc
@@ -81,9 +81,9 @@ QString GetEnv(const char *envname) {
@@ -90,9 +90,9 @@ QString GetEnv(const char *envname) {
}
return "";
#endif // OS_WIN
@@ -10,7 +10,7 @@ $NetBSD: patch-gui_word__register__dialog_word__register__dialog.cc,v 1.2 2013/0
+#if defined(OS_MACOSX) || defined(OS_LINUX) || defined(OS_NETBSD)
return ::getenv(envname);
-#endif // OS_MACOSX or OS_LINUX
+#endif // OS_MACOSX or OS_LINUX or OS_NETBSD
+#endif // OS_MACOSX, OS_LINUX or OS_NETBSD
// TODO(team): Support other platforms.
return "";
}

View File

@@ -1,6 +1,6 @@
$NetBSD: patch-gyp_common.gypi,v 1.7 2015/07/31 13:07:05 ryoon Exp $
$NetBSD: patch-gyp_common.gypi,v 1.8 2016/05/16 11:51:49 ryoon Exp $
--- gyp/common.gypi.orig 2015-06-07 07:16:23.000000000 +0000
--- gyp/common.gypi.orig 2016-05-15 08:11:11.000000000 +0000
+++ gyp/common.gypi
@@ -158,7 +158,7 @@
'compiler_host': 'clang',
@@ -20,16 +20,7 @@ $NetBSD: patch-gyp_common.gypi,v 1.7 2015/07/31 13:07:05 ryoon Exp $
# Represents the directory where the source code of protobuf is
# extracted. This value is ignored when 'use_libprotobuf' is 1.
@@ -300,7 +300,7 @@
['channel_dev==1', {
'defines': ['CHANNEL_DEV'],
}],
- ['OS=="linux"', {
+ ['OS=="linux" or OS=="netbsd"', {
'ldflags': [
'<@(linux_ldflags)',
],
@@ -523,7 +523,7 @@
@@ -415,7 +415,7 @@
},
},
'conditions': [
@@ -38,7 +29,7 @@ $NetBSD: patch-gyp_common.gypi,v 1.7 2015/07/31 13:07:05 ryoon Exp $
'cflags': [
'<@(debug_extra_cflags)',
],
@@ -589,7 +589,7 @@
@@ -481,7 +481,7 @@
},
},
'conditions': [
@@ -47,7 +38,16 @@ $NetBSD: patch-gyp_common.gypi,v 1.7 2015/07/31 13:07:05 ryoon Exp $
'cflags': [
'<@(release_extra_cflags)',
],
@@ -814,6 +814,22 @@
@@ -578,7 +578,7 @@
['channel_dev==1', {
'defines': ['CHANNEL_DEV'],
}],
- ['OS=="linux"', {
+ ['OS=="linux" or OS=="netbsd"', {
'ldflags': [
'<@(linux_ldflags)',
],
@@ -807,6 +807,22 @@
}],
],
}],

View File

@@ -1,19 +0,0 @@
$NetBSD: patch-handwriting_handwriting.gyp,v 1.3 2014/01/19 01:18:50 ryoon Exp $
--- handwriting/handwriting.gyp.orig 2014-01-06 07:10:31.000000000 +0000
+++ handwriting/handwriting.gyp
@@ -43,12 +43,12 @@
'zinnia.gyp:zinnia',
],
'conditions': [
- ['target_platform=="Linux" and use_libzinnia==1', {
+ ['(target_platform=="Linux" or target_platform=="NetBSD") and use_libzinnia==1', {
'defines': [
'USE_LIBZINNIA',
],
}],
- ['target_platform=="Linux" and use_libzinnia==1 and zinnia_model_file!=""', {
+ ['(target_platform=="Linux" or target_platform=="NetBSD") and use_libzinnia==1 and zinnia_model_file!=""', {
'defines': [
'MOZC_ZINNIA_MODEL_FILE="<(zinnia_model_file)"',
],

View File

@@ -1,13 +1,13 @@
$NetBSD: patch-handwriting_zinnia.gyp,v 1.1 2014/01/19 01:18:50 ryoon Exp $
$NetBSD: patch-handwriting_zinnia.gyp,v 1.2 2016/05/16 11:51:49 ryoon Exp $
--- handwriting/zinnia.gyp.orig 2014-01-06 07:10:31.000000000 +0000
--- handwriting/zinnia.gyp.orig 2016-05-15 08:11:11.000000000 +0000
+++ handwriting/zinnia.gyp
@@ -48,7 +48,7 @@
'-Wno-type-limits',
],
'conditions': [
- ['OS=="linux"', {
+ ['OS=="linux" or OS=="netbsd"', {
'conditions': [
['use_libzinnia==1', {
'link_settings': {
@@ -80,7 +80,7 @@
'VERSION="0.06"',
],
}],
- ['target_platform=="Linux" or target_platform=="Mac"', {
+ ['target_platform=="Linux" or target_platform=="Mac" or target_platform=="NetBSD"', {
'defines': [
'HAVE_CONFIG_H=1'
],

View File

@@ -1,15 +1,15 @@
$NetBSD: patch-handwriting_zinnia__handwriting.cc,v 1.2 2013/07/20 04:34:53 ryoon Exp $
$NetBSD: patch-handwriting_zinnia__handwriting.cc,v 1.3 2016/05/16 11:51:49 ryoon Exp $
* Not confirmed yet.
--- handwriting/zinnia_handwriting.cc.orig 2013-07-17 02:38:04.000000000 +0000
--- handwriting/zinnia_handwriting.cc.orig 2016-05-15 08:11:11.000000000 +0000
+++ handwriting/zinnia_handwriting.cc
@@ -57,7 +57,7 @@ string ZinniaHandwriting::GetModelFileNa
const char kModelFile[] = MOZC_ZINNIA_MODEL_FILE;
#else
@@ -59,7 +59,7 @@ string ZinniaHandwriting::GetModelFileNa
return FileUtil::JoinPath(MacUtil::GetResourcesDirectory(), kModelFile);
#elif defined(OS_LINUX)
const char kModelFile[] =
- "/usr/share/tegaki/models/zinnia/handwriting-ja.model";
+ "@PREFIX@/share/tegaki/models/zinnia/handwriting-ja.model";
#endif // MOZC_ZINNIA_MODEL_FILE
return kModelFile;
#else
const char kModelFile[] = "handwriting-ja.model";

View File

@@ -1,13 +1,13 @@
$NetBSD: patch-ipc_unix__ipc.cc,v 1.3 2013/09/07 18:42:14 ryoon Exp $
$NetBSD: patch-ipc_unix__ipc.cc,v 1.4 2016/05/16 11:51:49 ryoon Exp $
--- ipc/unix_ipc.cc.orig 2013-08-28 05:25:59.000000000 +0000
--- ipc/unix_ipc.cc.orig 2016-05-15 08:11:11.000000000 +0000
+++ ipc/unix_ipc.cc
@@ -28,7 +28,7 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// skip all if non-Linux or Android.
-#if defined(OS_LINUX) && !defined(OS_ANDROID)
+#if (defined(OS_LINUX) && !defined(OS_ANDROID)) || defined(OS_NETBSD)
// OS_LINUX only. Note that OS_ANDROID/OS_NACL don't reach here.
-#if defined(OS_LINUX)
+#if defined(OS_LINUX) || defined(OS_NETBSD)
#include "ipc/ipc.h"

View File

@@ -1,13 +1,34 @@
$NetBSD: patch-session_session.cc,v 1.3 2013/09/07 18:42:14 ryoon Exp $
$NetBSD: patch-session_session.cc,v 1.4 2016/05/16 11:51:49 ryoon Exp $
--- session/session.cc.orig 2013-08-28 05:26:12.000000000 +0000
--- session/session.cc.orig 2016-05-15 08:11:12.000000000 +0000
+++ session/session.cc
@@ -1139,7 +1139,7 @@ void Session::UpdateOperationPreferences
@@ -232,9 +232,9 @@ void Session::InitContext(ImeContext *co
context->SetConfig(&context->GetConfig());
-#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NACL)
+#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NACL) || defined(OS_NETBSD)
context->mutable_converter()->set_use_cascading_window(false);
-#endif // OS_LINUX || OS_ANDROID || OS_NACL
+#endif // OS_LINUX || OS_ANDROID || OS_NACL || OS_NETBSD
}
@@ -961,14 +961,14 @@ void Session::UpdatePreferences(commands
config.selection_shortcut());
}
// Cascading Window.
-#ifndef OS_LINUX
+#if !defined(OS_LINUX) && !defined(OS_NETBSD)
-#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NACL)
+#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NACL) || defined(OS_NETBSD)
context_->mutable_converter()->set_use_cascading_window(false);
-#else // OS_LINUX || OS_ANDROID || OS_NACL
+#else // OS_LINUX || OS_ANDROID || OS_NACL || OS_NETBSD
if (config.has_use_cascading_window()) {
operation_preferences.use_cascading_window = config.use_cascading_window();
context_->mutable_converter()->set_use_cascading_window(
config.use_cascading_window());
}
-#endif // OS_LINUX || OS_ANDROID || OS_NACL
+#endif // OS_LINUX || OS_ANDROID || OS_NACL || OS_NETBSD
}
bool Session::IMEOn(commands::Command *command) {

View File

@@ -1,13 +0,0 @@
$NetBSD: patch-session_session__converter__interface.h,v 1.1 2013/04/29 09:52:18 ryoon Exp $
--- session/session_converter_interface.h.orig 2012-08-31 05:36:43.000000000 +0000
+++ session/session_converter_interface.h
@@ -68,7 +68,7 @@ struct OperationPreferences {
bool use_cascading_window;
string candidate_shortcuts;
OperationPreferences() {
-#ifdef OS_LINUX
+#if defined(OS_LINUX) || defined(OS_NETBSD)
// TODO(komatsu): Move this logic to the client code.
use_cascading_window = false;
#else

View File

@@ -1,40 +1,69 @@
$NetBSD: patch-session_session__test.cc,v 1.1 2013/04/29 09:52:18 ryoon Exp $
$NetBSD: patch-session_session__test.cc,v 1.2 2016/05/16 11:51:49 ryoon Exp $
--- session/session_test.cc.orig 2013-03-29 04:33:26.000000000 +0000
--- session/session_test.cc.orig 2016-05-15 08:11:12.000000000 +0000
+++ session/session_test.cc
@@ -2361,7 +2361,7 @@ TEST_F(SessionTest, OutputAllCandidateWo
@@ -2136,11 +2136,11 @@ TEST_F(SessionTest, UpdatePreferences) {
const size_t cascading_cand_size =
command.output().candidates().candidate_size();
-#if defined(OS_LINUX) || defined(OS_ANDROID) || OS_NACL
+#if defined(OS_LINUX) || defined(OS_ANDROID) || OS_NACL || defined(OS_NETBSD)
EXPECT_EQ(no_cascading_cand_size, cascading_cand_size);
-#else // defined(OS_LINUX) || defined(OS_ANDROID) || OS_NACL
+#else // defined(OS_LINUX) || defined(OS_ANDROID) || OS_NACL || defined(OS_NETBSD)
EXPECT_GT(no_cascading_cand_size, cascading_cand_size);
-#endif // defined(OS_LINUX) || defined(OS_ANDROID) || OS_NACL
+#endif // defined(OS_LINUX) || defined(OS_ANDROID) || OS_NACL || defined(OS_NETBSD)
command.Clear();
session->ConvertCancel(&command);
@@ -2330,7 +2330,7 @@ TEST_F(SessionTest, OutputAllCandidateWo
EXPECT_EQ(0, output.all_candidate_words().focused_index());
EXPECT_EQ(commands::CONVERSION, output.all_candidate_words().category());
-#ifdef OS_LINUX
+#if defined(OS_LINUX) || defined(OS_NETBSD)
-#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NACL)
+#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NACL) || defined(OS_NETBSD)
// Cascading window is not supported on Linux, so the size of
// candidate words is different from other platform.
// TODO(komatsu): Modify the client for Linux to explicitly change
@@ -2377,7 +2377,7 @@ TEST_F(SessionTest, OutputAllCandidateWo
@@ -2340,13 +2340,13 @@ TEST_F(SessionTest, OutputAllCandidateWo
// "" (t13n), "" (t13n), "" (t13n),
// "アイウエオ" (t13n) ]
EXPECT_EQ(9, output.all_candidate_words().candidates_size());
-#else // OS_LINUX || OS_ANDROID || OS_NACL
+#else // OS_LINUX || OS_ANDROID || OS_NACL || OS_NETBSD
// [ "あいうえお", "アイウエオ", "アイウエオ" (t13n), "あいうえお" (t13n),
// "aiueo" (t13n), "AIUEO" (t13n), "Aieuo" (t13n),
// "" (t13n), "" (t13n), "" (t13n),
// "アイウエオ" (t13n) ]
EXPECT_EQ(11, output.all_candidate_words().candidates_size());
-#endif // OS_LINUX
+#endif // OS_LINUX || OS_NETBSD
-#endif // OS_LINUX || OS_ANDROID || OS_NACL
+#endif // OS_LINUX || OS_ANDROID || OS_NACL || OS_NETBSD
}
command.Clear();
@@ -2389,7 +2389,7 @@ TEST_F(SessionTest, OutputAllCandidateWo
@@ -2358,7 +2358,7 @@ TEST_F(SessionTest, OutputAllCandidateWo
EXPECT_EQ(1, output.all_candidate_words().focused_index());
EXPECT_EQ(commands::CONVERSION, output.all_candidate_words().category());
-#ifdef OS_LINUX
+#if defined(OS_LINUX) || defined(OS_NETBSD)
-#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NACL)
+#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NACL) || defined(OS_NETBSD)
// Cascading window is not supported on Linux, so the size of
// candidate words is different from other platform.
// TODO(komatsu): Modify the client for Linux to explicitly change
@@ -2405,7 +2405,7 @@ TEST_F(SessionTest, OutputAllCandidateWo
@@ -2368,13 +2368,13 @@ TEST_F(SessionTest, OutputAllCandidateWo
// "" (t13n), "" (t13n), "" (t13n),
// "アイウエオ" (t13n) ]
EXPECT_EQ(9, output.all_candidate_words().candidates_size());
-#else // OS_LINUX || OS_ANDROID || OS_NACL
+#else // OS_LINUX || OS_ANDROID || OS_NACL || OS_NETBSD
// [ "あいうえお", "アイウエオ",
// "aiueo" (t13n), "AIUEO" (t13n), "Aieuo" (t13n),
// "" (t13n), "" (t13n), "" (t13n),
// "アイウエオ" (t13n) ]
EXPECT_EQ(11, output.all_candidate_words().candidates_size());
-#endif // OS_LINUX
+#endif // OS_LINUX || OS_NETBSD
-#endif // OS_LINUX || OS_ANDROID || OS_NACL
+#endif // OS_LINUX || OS_ANDROID || OS_NACL || OS_NETBSD
}
}

View File

@@ -0,0 +1,13 @@
$NetBSD: patch-third__party_protobuf_post__process__dist.sh,v 1.3 2016/05/16 11:51:49 ryoon Exp $
--- third_party/protobuf/post_process_dist.sh.orig 2016-05-15 08:11:12.000000000 +0000
+++ third_party/protobuf/post_process_dist.sh
@@ -15,7 +15,7 @@
# non-testdata .txt files are converted to Windows-style line endings.
# 5) Cleans up after itself.
-if [ "$1" == "" ]; then
+if [ "$1" = "" ]; then
echo "USAGE: $1 DISTFILE" >&2
exit 1
fi

View File

@@ -1,53 +1,15 @@
$NetBSD: patch-unix_ibus_gen__mozc__xml.py,v 1.6 2014/06/15 13:08:34 ryoon Exp $
$NetBSD: patch-unix_ibus_gen__mozc__xml.py,v 1.7 2016/05/16 11:51:49 ryoon Exp $
* Fix for pkgsrc installation.
--- unix/ibus/gen_mozc_xml.py.orig 2014-05-21 10:49:56.000000000 +0000
--- unix/ibus/gen_mozc_xml.py.orig 2016-05-15 08:11:12.000000000 +0000
+++ unix/ibus/gen_mozc_xml.py
@@ -93,6 +93,22 @@ IBUS_ENGINES_PROPS = {
'longname': ['%(product_name)s'],
'layout': ['default'],
},
+ 'NetBSD': {
+ # DO NOT change the engine name 'mozc-jp'. The names is referenced by
+ # unix/ibus/mozc_engine.cc.
+ 'name': ['mozc-jp'],
+ 'longname': ['%(product_name)s'],
+ 'layout': ['jp'],
+ },
+ # On NetBSD (IBus >= 1.5), we use special label 'default' for the keyboard
+ # layout.
+ 'NetBSD-IBus1.5': {
+ # DO NOT change the engine name 'mozc-jp'. The names is referenced by
+ # unix/ibus/mozc_engine.cc.
+ 'name': ['mozc-jp'],
+ 'longname': ['%(product_name)s'],
+ 'layout': ['default'],
+ },
}
# A dictionary from --branding to a product name which is embedded into the
@@ -209,7 +225,7 @@ def main():
@@ -170,7 +170,7 @@ def main():
(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("@PREFIX@/libexec", 'mozc_tool'))
setup_arg.append('--mode=config_dialog')
if IsIBus15OrGreater(options):
# A tentative workaround against IBus 1.5
@@ -219,6 +235,14 @@ def main():
platform = 'Linux'
common_props = IBUS_ENGINE_COMMON_PROPS
+ if platform == 'NetBSD':
+ setup_arg.append(os.path.join("@PREFIX@/libexec", 'mozc_tool'))
+ setup_arg.append('--mode=config_dialog')
+ if IsIBus15OrGreater(options):
+ # A tentative workaround against IBus 1.5
+ platform = 'NetBSD-IBus1.5'
+ common_props = IBUS_1_5_ENGINE_COMMON_PROPS
+
param_dict = {'product_name': PRODUCT_NAMES[options.branding],
'ibus_mozc_path': options.ibus_mozc_path,
'ibus_mozc_icon_path': options.ibus_mozc_icon_path}
param_dict = {