Import of pkgsrc-2013Q2

This commit is contained in:
2013-09-26 17:14:40 +02:00
commit 785076ae39
74991 changed files with 4380255 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
Mozc is a Japanese Input Method Editor (IME) designed for multi-platform
such as Chromium OS, Windows, Mac and Linux. This open-source
project originates from Google Japanese Input.
This package is dictionary server for mozc client, such as ibus-mozc.

View File

@@ -0,0 +1,17 @@
# $NetBSD: Makefile,v 1.9 2013/06/06 12:54:38 wiz Exp $
PKGNAME= ${DISTNAME:S/mozc-/mozc-server-/}
PKGREVISION= 3
INSTALLATION_DIRS+= libexec
do-build:
cd ${WRKSRC} && env ${MAKE_ENV} \
${PYTHONBIN} build_mozc.py build -c ${MOZC_BUILD_MODE} ${_MAKE_JOBS} \
server/server.gyp:mozc_server
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/out_${OSDEST}/${MOZC_BUILD_MODE}/mozc_server \
${DESTDIR}${PREFIX}/libexec/mozc_server
.include "../../inputmethod/mozc-server/Makefile.common"

View File

@@ -0,0 +1,80 @@
# $NetBSD: Makefile.common,v 1.1 2013/04/29 09:52:16 ryoon Exp $
# used by inputmethod/ibus-mozc/Makefile
# used by inputmethod/mozc-elisp/Makefile
# used by inputmethod/mozc-server/Makefile
# used by inputmethod/mozc-tool/Makefile
#
DISTNAME= mozc-1.10.1390.102
CATEGORIES= inputmethod
MASTER_SITES= http://mozc.googlecode.com/files/
EXTRACT_SUFX= .tar.bz2
MAINTAINER= ryoon@NetBSD.org
HOMEPAGE= http://code.google.com/p/mozc/
COMMENT= Japanese inputmethod Mozc engine for IBus
LICENSE= modified-bsd
DISTINFO_FILE= ${.CURDIR}/../../inputmethod/mozc-server/distinfo
PATCHDIR= ${.CURDIR}/../../inputmethod/mozc-server/patches
BUILD_DEPENDS+= ${PYPKGPREFIX}-gyp-[0-9]*:../../devel/gyp
USE_LANGUAGES= c c++
USE_TOOLS+= gmake pkg-config
FIND_PREFIX:= GYPDIR=${PYPKGPREFIX}-gyp
.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
OPENSSL_LIBS= -lssl -lcrypto
SUBST_CLASSES+= gyp
SUBST_STAGE.gyp= pre-configure
SUBST_MESSAGE.gyp= Fix gyp defaults
SUBST_FILES.gyp+= base/base.gyp
SUBST_FILES.gyp+= base/process.cc
SUBST_FILES.gyp+= handwriting/zinnia_handwriting.cc
SUBST_FILES.gyp+= unix/ibus/gen_mozc_xml.py
SUBST_FILES.gyp+= gui/qt_rcc.gypi
SUBST_FILES.gyp+= gui/qt_moc.gypi
SUBST_FILES.gyp+= gui/qt_uic.gypi
SUBST_FILES.gyp+= gui/qt_libraries.gypi
SUBST_FILES.gyp+= base/const.h
SUBST_FILES.gyp+= build_mozc.py
SUBST_FILES.gyp+= protobuf/genproto.gypi
SUBST_VARS.gyp+= OPENSSL_CFLAGS OPENSSL_INC OPENSSL_LDFLAGS OPENSSL_LIBS
SUBST_VARS.gyp+= PREFIX QTDIR
# To disable flock(1) in link stage.
ALL_ENV+= LINK=${CXX}
.include "../../mk/bsd.prefs.mk"
.if ${OPSYS} == "NetBSD"
OSDEST= bsd
.elif ${OPSYS} == "Linux"
OSDEST= linux
.endif
MOZC_BUILD_MODE= Release # or Debug
do-configure:
cd ${WRKSRC} && env ${MAKE_ENV} \
GYP_DEFINES="use_libprotobuf=1" \
${PYTHONBIN} build_mozc.py gyp --os=${LOWER_OPSYS} && \
${PYTHONBIN} build_mozc.py build_tools -c ${MOZC_BUILD_MODE} ${_MAKE_JOBS}
.include "../../devel/glib2/buildlink3.mk"
.include "../../devel/protobuf/buildlink3.mk"
# gmock is not used yet...
#.include "../../devel/gmock/buildlink3.mk"
.include "../../inputmethod/ibus/buildlink3.mk"
.include "../../inputmethod/zinnia/buildlink3.mk"
.include "../../x11/gtk2/buildlink3.mk"
.include "../../x11/qt4-libs/buildlink3.mk"
.include "../../lang/python/tool.mk"
.include "../../mk/bsd.pkg.mk"

View File

@@ -0,0 +1,2 @@
@comment $NetBSD: PLIST,v 1.2 2013/04/29 09:22:04 ryoon Exp $
libexec/mozc_server

View File

@@ -0,0 +1,52 @@
$NetBSD: distinfo,v 1.1 2013/04/29 09:52:16 ryoon Exp $
SHA1 (mozc-1.10.1390.102.tar.bz2) = d6ae2cf93eeecad93565f4bb9b51a32ce94ac9d6
RMD160 (mozc-1.10.1390.102.tar.bz2) = 430aba0d282525bf6e760c276de3ed596e8f8608
Size (mozc-1.10.1390.102.tar.bz2) = 57879881 bytes
SHA1 (patch-DEPS) = 266c19178c08d610f1cd3b8c8ab905697a889ff7
SHA1 (patch-base_base.gyp) = 03ad0f11f392d24b6b40cafa0a80741bddd4708c
SHA1 (patch-base_const.h) = 30f4fcccc5ba9bdb969697b807ec548d53fd6c60
SHA1 (patch-base_cpu__stats.cc) = cda8bbcbc963d8ed635435375cc80ee5e7ca2191
SHA1 (patch-base_crash__report__handler.cc) = 210d3750b5252f19e030c1b235d8e8b65ea38fab
SHA1 (patch-base_iconv.cc) = 1bf65dfc6152bf152cbe2714835a61436df2a48b
SHA1 (patch-base_logging.cc) = 56036110c3c2ba21e6fcb35ea2faac83896f4a83
SHA1 (patch-base_mutex.cc) = 0fe135b4e6f15017c59a13ba7c4019123559c31b
SHA1 (patch-base_mutex.h) = 6c3c8f0845f0fdad815c4877026894000d5eac2c
SHA1 (patch-base_password__manager.cc) = cb11b9b707ab0c361c969eefd4d7c805c0b4b06a
SHA1 (patch-base_process.cc) = fcdc1e078023c330f172409f0e26203411b4b0e1
SHA1 (patch-base_run__level.cc) = 8aa169a8be51674898906740cb8f6103b99021b4
SHA1 (patch-base_system__util.cc) = c01144fdee9fd9e2a19c7014316377b1e88dafd8
SHA1 (patch-base_thread.h) = b0560c13b2670dc645f3587cfd56ecab0a7fe850
SHA1 (patch-base_util.cc) = 57a59d9c6c721d28b8de3203f8b5dea71bc54664
SHA1 (patch-build__mozc.py) = 9106a7c8b3000eba582aec065e777b2311c86bda
SHA1 (patch-build__tools_mozc__version.py) = 47460ca750d8d28652c5c55e5df9b786af4d33c7
SHA1 (patch-build__tools_util.py) = de5e8be9b06b1a26a79314c469024dd2dd3fb119
SHA1 (patch-client_client.cc) = 7ca43dde3f207331005599653c6520667e3ca93c
SHA1 (patch-config_stats__config__util__test.cc) = db51e6619c5c04ac8fa50890825206ea922dccf2
SHA1 (patch-gui_base_locale__util.cc) = a501c01d20bb633f8dda9752c7c2175a64b84e91
SHA1 (patch-gui_config__dialog_config__dialog.cc) = c26c735ebe49c27a0aa170ee01a11b9dce6dad08
SHA1 (patch-gui_config__dialog_keybinding__editor.cc) = 00a6e4bb2c07e3340e188f108f0285a3aa2aceb9
SHA1 (patch-gui_config__dialog_keymap__editor.cc) = c2439e59756a6c10cfad21d0998952912a2379bd
SHA1 (patch-gui_dictionary__tool_dictionary__tool.cc) = d08cc3a91794d0f8eb59a105d0c94eb3f02c0133
SHA1 (patch-gui_gui.gyp) = a27d0a0a3fb6893a691450917cf2798ace1647ed
SHA1 (patch-gui_qt__libraries.gypi) = 9faaac9b9fc891050e27b4be0fd899265f4a1173
SHA1 (patch-gui_word__register__dialog_word__register__dialog.cc) = eca90653e3276509818690355246841211c95171
SHA1 (patch-gui_zinnia.gyp) = 0eaad35b829d2c25e751ce6e99207781306934d5
SHA1 (patch-gyp_common.gypi) = c79b7602fa4ed286eace10707ca4bbe8df7115fc
SHA1 (patch-handwriting_handwriting.gyp) = 3084cc6615d89b24bcf074717f102642100bb587
SHA1 (patch-handwriting_zinnia__handwriting.cc) = 9f6a857571a6d13f722d0503e232943d8dd2915e
SHA1 (patch-ipc_ipc__path__manager.cc) = 6e92a71e1a616525120760397467955de1cd6156
SHA1 (patch-ipc_ipc__path__manager__test.cc) = 29c4cd860c8261346bd5c20b214f967134049800
SHA1 (patch-ipc_named__event.cc) = 92283261e7580569587e43156f13567b593c9a32
SHA1 (patch-ipc_unix__ipc.cc) = bfb07eda02415cd1d4ce9303d960d614458476a5
SHA1 (patch-languages_chewing_chewing.gyp) = 26fa18398911609a53cff003943436f003772e64
SHA1 (patch-languages_hangul_hangul.gyp) = 685964cd31e91c96f0d41e729441b17ed9ac24f8
SHA1 (patch-net_net.gyp) = 937b28ad663605373d6b772097318b17dbea2eea
SHA1 (patch-protobuf_genproto.gypi) = ccab78f72fbf0cd58ef043637e38f7eba9a3b183
SHA1 (patch-protobuf_protobuf.gyp) = 247c16bf86287ce2b57da2653be17929692c3710
SHA1 (patch-session_session.cc) = 485c434a0bf7119f247494bf14f3856573475e11
SHA1 (patch-session_session__converter__interface.h) = 93bda6e51b9a9ac7146aa23ac0aa28bb017a4465
SHA1 (patch-session_session__test.cc) = a256caec45a45f4eaab0555ecc18cea09c417d95
SHA1 (patch-third__party_gyp_buildbot_buildbot__run.py) = 21375df1c6c19233c66b24da4dc23ddad5515b72
SHA1 (patch-unix_ibus_gen__mozc__xml.py) = 978d883a41a5dd823f94d22d62202b5210c1207e
SHA1 (patch-unix_ibus_mozc__engine.cc) = 0ae1220c1253c4d5d0d5eb97e584c12ea38b5c96

View File

@@ -0,0 +1,17 @@
$NetBSD: patch-DEPS,v 1.1 2013/04/29 09:52:16 ryoon Exp $
--- DEPS.orig 2013-03-29 04:33:25.000000000 +0000
+++ DEPS
@@ -88,6 +88,12 @@ deps_os = {
Var("zinnia_revision"),
},
"unix": {
+ "netbsd": {
+ "src/third_party/clang/scripts":
+ "https://src.chromium.org/chrome/trunk/src/tools/clang/scripts@" +
+ Var("clang_helper_in_chromium_revision"),
+ },
+}
"src/third_party/clang/scripts":
"https://src.chromium.org/chrome/trunk/src/tools/clang/scripts@" +
Var("clang_helper_in_chromium_revision"),

View File

@@ -0,0 +1,42 @@
$NetBSD: patch-base_base.gyp,v 1.1 2013/04/29 09:52:16 ryoon Exp $
--- base/base.gyp.orig 2013-03-29 04:33:43.000000000 +0000
+++ base/base.gyp
@@ -85,7 +85,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',
@@ -262,23 +262,23 @@
],
}
}],
- ['OS=="linux" and target_platform!="Android" and '
+ ['OS=="netbsd" or (OS=="linux" and target_platform!="Android") and '
'not (target_platform=="NaCl" and _toolset=="target")', {
'cflags': [
- '<!@(<(pkg_config_command) --cflags-only-other openssl)',
+ '@OPENSSL_CFLAGS@',
],
'defines': [
'HAVE_OPENSSL=1',
],
'include_dirs': [
- '<!@(<(pkg_config_command) --cflags-only-I openssl)',
+ '@OPENSSL_INC@',
],
'link_settings': {
'ldflags': [
- '<!@(<(pkg_config_command) --libs-only-L openssl)',
+ '@OPENSSL_LDFLAGS@',
],
'libraries': [
- '<!@(<(pkg_config_command) --libs-only-l openssl)',
+ '@OPENSSL_LIBS@',
],
},
}],

View File

@@ -0,0 +1,13 @@
$NetBSD: patch-base_const.h,v 1.1 2013/04/29 09:52:16 ryoon Exp $
--- base/const.h.orig 2012-08-31 05:37:06.000000000 +0000
+++ base/const.h
@@ -146,7 +146,7 @@ const char kMozcTool[] = "mozc_tool";
#ifdef MOZC_SERVER_DIRECTORY
const char kMozcServerDirectory[] = MOZC_SERVER_DIRECTORY;
#else
-const char kMozcServerDirectory[] = "/usr/lib/mozc";
+const char kMozcServerDirectory[] = "@PREFIX@/libexec";
#endif // MOZC_SERVER_DIRECTORY
#ifdef OS_ANDROID
#ifndef MOZC_ANDROID_APPLICATION_ID

View File

@@ -0,0 +1,46 @@
$NetBSD: patch-base_cpu__stats.cc,v 1.1 2013/04/29 09:52:16 ryoon Exp $
--- base/cpu_stats.cc.orig 2012-08-31 05:37:06.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)
// 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
return UpdateCPULoad(total_times,
cpu_times,
@@ -178,11 +178,11 @@ float CPUStats::GetCurrentProcessCPULoad
TimeValueTToInt64(task_times_info.system_time);
#endif // OS_MACOSX
-#ifdef OS_LINUX
+#if defined(OS_LINUX) || defined(OS_NETBSD)
// not implemented
const uint64 total_times = 0;
const uint64 cpu_times = 0;
-#endif // OS_LINUX
+#endif // OS_LINUX || OS_NETBSD
return UpdateCPULoad(total_times,
cpu_times,
@@ -210,9 +210,9 @@ size_t CPUStats::GetNumberOfProcessors()
return static_cast<size_t>(basic_info.avail_cpus);
#endif // OS_MACOSX
-#ifdef OS_LINUX
+#if defined(OS_LINUX) || defined(OS_NETBSD)
// Not implemented
return 1;
-#endif // OS_LINUX
+#endif // OS_LINUX || OS_NETBSD
}
} // namespace mozc

View File

@@ -0,0 +1,13 @@
$NetBSD: patch-base_crash__report__handler.cc,v 1.1 2013/04/29 09:52:16 ryoon Exp $
--- base/crash_report_handler.cc.orig 2013-03-29 04:33:43.000000000 +0000
+++ base/crash_report_handler.cc
@@ -364,7 +364,7 @@ void CrashReportHandler::SetCriticalSect
}
} // namespace mozc
-#elif defined(OS_LINUX) // OS_WIN
+#elif defined(OS_LINUX) || defined(OS_NETBSD) // OS_WIN
namespace mozc {

View File

@@ -0,0 +1,16 @@
$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

@@ -0,0 +1,34 @@
$NetBSD: patch-base_logging.cc,v 1.1 2013/04/29 09:52:17 ryoon Exp $
--- base/logging.cc.orig 2013-03-29 04:33:43.000000000 +0000
+++ base/logging.cc
@@ -61,6 +61,10 @@
#include "base/system_util.h"
#include "base/util.h"
+#if defined(OS_NETBSD)
+#include <lwp.h>
+#endif
+
DEFINE_bool(colored_log, true, "Enables colored log messages on tty devices");
DEFINE_bool(logtostderr,
false,
@@ -110,7 +114,7 @@ string Logging::GetLogMessageHeader() {
"%4.4d-%2.2d-%2.2d %2.2d:%2.2d:%2.2d %u "
#if defined(__native_client__)
"%p",
-#elif defined(OS_LINUX)
+#elif defined(OS_LINUX) || defined (OS_NETBSD)
"%lu",
#else // = OS_WIN or OS_MACOSX
"%u",
@@ -131,6 +135,9 @@ string Logging::GetLogMessageHeader() {
::getpid(),
// pthread_self() returns __nc_basic_thread_data*.
static_cast<void*>(pthread_self())
+#elif defined(OS_NETBSD)
+ ::getpid(),
+ _lwp_self()
#else // = OS_LINUX
::getpid(),
// It returns unsigned long.

View File

@@ -0,0 +1,40 @@
$NetBSD: patch-base_mutex.cc,v 1.1 2013/04/29 09:52:17 ryoon Exp $
--- base/mutex.cc.orig 2013-03-29 04:33:43.000000000 +0000
+++ base/mutex.cc
@@ -61,7 +61,7 @@ namespace mozc {
// Wrapper for Windows InterlockedCompareExchange
namespace {
-#ifdef OS_LINUX
+#if defined(OS_LINUX) || 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
pthread_mutex_unlock(&lock);
return result;
}
-#endif // OS_LINUX
+#endif // OS_LINUX || OS_NETBSD
// Use OSAtomicCompareAndSwapInt on Mac OSX
// http://developer.apple.com/iphone/library/documentation/
@@ -91,7 +91,7 @@ inline int InterlockedCompareExchange(vo
int new_value,
int old_value) {
return OSAtomicCompareAndSwapInt(old_value, new_value, target)
- ? old_value : *target;
+ ? old_value : *target; || OS_NETBSD
}
#endif // OX_MACOSX
@@ -296,7 +296,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)
pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE_NP);

View File

@@ -0,0 +1,29 @@
$NetBSD: patch-base_mutex.h,v 1.1 2013/04/29 09:52:17 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
@@ -50,8 +50,8 @@ namespace mozc {
// To remove dependencies against plafrom specific headers such as
// <Windows.h> or <pthread.h>, we use an array of pointers as an opaque buffer
// where platform specific mutex structure will be placed.
-#if defined(OS_MACOSX)
-// Mac requires relatively large buffer for pthread mutex object.
+#if defined(OS_MACOSX) || defined(OS_NETBSD)
+// Mac and NetBSD requires relatively large buffer for pthread mutex object.
#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

@@ -0,0 +1,13 @@
$NetBSD: patch-base_password__manager.cc,v 1.1 2013/04/29 09:52:17 ryoon Exp $
--- base/password_manager.cc.orig 2012-08-31 05:37:06.000000000 +0000
+++ base/password_manager.cc
@@ -366,7 +366,7 @@ class DeprecatedMacPasswordManager : pub
// 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)
typedef PlainPasswordManager DefaultPasswordManager;
#endif

View File

@@ -0,0 +1,58 @@
$NetBSD: patch-base_process.cc,v 1.1 2013/04/29 09:52:17 ryoon Exp $
--- base/process.cc.orig 2013-03-29 04:33:43.000000000 +0000
+++ base/process.cc
@@ -46,7 +46,7 @@
#include "base/mac_process.h"
#endif // OS_MACOSX
-#ifdef OS_LINUX
+#if defined(OS_LINUX) || defined(OS_NETBSD)
#include <fcntl.h>
#include <signal.h>
#include <spawn.h> // for posix_spawn().
@@ -121,7 +121,7 @@ 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_NETBSD)
static const char kBrowserCommand[] = "/usr/bin/xdg-open";
// xdg-open which uses kfmclient or gnome-open internally works both on KDE
// and GNOME environments.
@@ -205,7 +205,7 @@ bool Process::SpawnProcess(const string
}
#endif
-#ifdef OS_LINUX
+#if defined(OS_LINUX) || 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
// (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
pid_t tmp_pid = 0;
// Spawn new process.
@@ -399,7 +399,7 @@ bool Process::LaunchErrorMessageDialog(c
}
#endif // OS_WIN
-#ifdef OS_LINUX
+#if defined(OS_LINUX) || 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
LOG(ERROR) << "cannot launch " << kMozcTool;
return false;
}
-#endif // OS_LINUX
+#endif // OS_LINUX || OS_NETBSD
return true;
}

View File

@@ -0,0 +1,17 @@
$NetBSD: patch-base_run__level.cc,v 1.1 2013/04/29 09:52:17 ryoon Exp $
--- base/run_level.cc.orig 2013-03-29 04:33:43.000000000 +0000
+++ base/run_level.cc
@@ -34,10 +34,10 @@
#include <aclapi.h>
#endif // OS_WIN
-#ifdef OS_LINUX
+#if defined(OS_LINUX) || defined(OS_NETBSD)
#include <unistd.h>
#include <sys/types.h>
-#endif // OS_LINUX
+#endif // OS_LINUX || OS_NETBSD
#include "base/const.h"
#include "base/logging.h"

View File

@@ -0,0 +1,50 @@
$NetBSD: patch-base_system__util.cc,v 1.1 2013/04/29 09:52:17 ryoon Exp $
--- base/system_util.cc.orig 2013-03-29 04:33:43.000000000 +0000
+++ base/system_util.cc
@@ -421,7 +421,7 @@ string SystemUtil::GetServerDirectory()
#elif defined(OS_MACOSX)
return MacUtil::GetServerDirectory();
-#elif defined(OS_LINUX)
+#elif defined(OS_LINUX) || defined(OS_NETBSD)
// TODO(mazda): Not to use hardcoded path.
return kMozcServerDirectory;
#endif // OS_WIN, OS_MACOSX, OS_LINUX
@@ -610,7 +610,7 @@ bool GetCurrentSessionId(DWORD *session_
#endif // OS_WIN
string SystemUtil::GetDesktopNameAsString() {
-#ifdef OS_LINUX
+#if defined(OS_LINUX) || defined(OS_NETBSD)
const char *display = getenv("DISPLAY");
if (display == NULL) {
return "";
@@ -809,7 +809,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)
// TODO(yukawa): support Linux.
return true;
#elif defined(OS_WIN)
@@ -1098,6 +1098,9 @@ string SystemUtil::GetOSVersionString()
#elif defined(OS_LINUX)
const string ret = "Linux";
return ret;
+#elif defined(OS_NETBSD)
+ const string ret = "NetBSD";
+ return ret;
#else // !OS_WIN && !OS_MACOSX && !OS_LINUX
const string ret = "Unknown";
return ret;
@@ -1145,7 +1148,7 @@ uint64 SystemUtil::GetTotalPhysicalMemor
return 0;
}
return total_memory;
-#elif defined(OS_LINUX)
+#elif defined(OS_LINUX) || 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);

View File

@@ -0,0 +1,14 @@
$NetBSD: patch-base_thread.h,v 1.1 2013/04/29 09:52:17 ryoon Exp $
--- base/thread.h.orig 2012-08-31 05:37:06.000000000 +0000
+++ base/thread.h
@@ -55,7 +55,8 @@
// Andorid NDK and NaCl don't support TLS.
#if defined(OS_LINUX) && !defined(OS_ANDROID) && \
- !defined(__native_client__) && (defined(__GNUC__) || defined(__clang__))
+ !defined(__native_client__) && (defined(__GNUC__) || defined(__clang__)) \
+ || defined(OS_NETBSD)
// GCC and Clang support TLS.
#define TLS_KEYWORD __thread
#define HAVE_TLS 1

View File

@@ -0,0 +1,22 @@
$NetBSD: patch-base_util.cc,v 1.1 2013/04/29 09:52:17 ryoon Exp $
--- base/util.cc.orig 2013-03-29 04:33:43.000000000 +0000
+++ base/util.cc
@@ -932,7 +932,7 @@ 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
@@ -952,7 +952,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

@@ -0,0 +1,242 @@
$NetBSD: patch-build__mozc.py,v 1.1 2013/04/29 09:52:17 ryoon Exp $
--- build_mozc.py.orig 2013-03-29 04:33:25.000000000 +0000
+++ build_mozc.py
@@ -62,6 +62,7 @@ from build_tools.util import GetRelPath
from build_tools.util import IsLinux
from build_tools.util import IsMac
from build_tools.util import IsWindows
+from build_tools.util import IsNetBSD
from build_tools.util import PrintErrorAndExit
from build_tools.util import RemoveDirectoryRecursively
from build_tools.util import RemoveFile
@@ -116,6 +117,8 @@ def GetBuildBaseName(options, target_pla
build_base = 'out_mac'
elif target_platform == 'Linux' or target_platform == 'ChromeOS':
build_base = 'out_linux'
+ elif target_platform == 'NetBSD':
+ build_base = 'out_bsd'
elif target_platform == 'Android':
build_base = 'out_android'
elif target_platform == 'NaCl':
@@ -219,6 +222,12 @@ 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)
+ 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':
@@ -266,6 +275,7 @@ def AddCommonOptions(parser):
help='Specifies the base directory of the built binaries.')
parser.add_option('--language', dest='language', default='japanese',
help='Specify the target language to build.')
+ parser.add_option('--os', dest='os', default='linux')
return parser
@@ -286,6 +296,8 @@ def AddTargetPlatformOption(parser):
# If you want Android build, specify "Android".
if IsLinux():
default_target = 'Linux'
+ elif IsNetBSD():
+ default_target = 'NetBSD'
elif IsWindows():
default_target = 'Windows'
elif IsMac():
@@ -423,7 +435,7 @@ def ParseGypOptions(args=None, values=No
use_zinnia_default = True
parser.add_option('--server_dir', dest='server_dir',
- default='/usr/lib/mozc',
+ default='@PREFIX@/libexec',
help='A path to the directory to be installed server '
'executable. This option is only available for Linux.')
@@ -477,6 +489,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')
+ elif target_platform == 'NetBSD':
+ targets = [SRC_DIR + '/server/server.gyp:mozc_server',
+ SRC_DIR + '/renderer/renderer.gyp:mozc_renderer',
+ 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':
@@ -505,7 +523,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),
@@ -525,7 +543,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),
@@ -673,6 +691,8 @@ def GypMain(options, unused_args):
command_line.extend(['-D', 'wix_dir=%s' % options.wix_dir])
else:
command_line.extend(['-D', 'use_wix=NO'])
+ if options.os:
+ command_line.extend(['-D', 'OS=%s' % options.os])
android_sdk_home = options.android_sdk_home
if version.GetTargetPlatform() == 'Android':
@@ -726,7 +746,7 @@ def GypMain(options, unused_args):
def SetCommandLineForFeature(option_name, windows=False, mac=False,
linux=False, chromeos=False, android=False,
- nacl=False):
+ nacl=False, netbsd=False):
"""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
@@ -750,6 +770,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.
Raises:
ValueError: An error occurred when 'option_name' is empty.
@@ -763,6 +785,7 @@ def GypMain(options, unused_args):
'Linux': linux,
'ChromeOS': chromeos,
'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)
@@ -776,14 +799,17 @@ def GypMain(options, unused_args):
SetCommandLineForFeature(option_name='webservice_infolist')
SetCommandLineForFeature(option_name='cloud_sync',
linux=is_official_dev,
+ netbsd=is_official_dev,
windows=is_official_dev,
mac=is_official_dev)
SetCommandLineForFeature(option_name='cloud_handwriting',
linux=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,
chromeos=False, # not supported.
@@ -796,6 +822,7 @@ def GypMain(options, unused_args):
android=True)
SetCommandLineForFeature(option_name='history_deletion',
linux=is_official_dev,
+ netbsd=is_official_dev,
windows=is_official_dev,
mac=is_official_dev)
@@ -829,7 +856,8 @@ def GypMain(options, unused_args):
command_line.extend(['-D', 'use_zinnia=NO'])
if ((options.target_platform == 'Linux' or
- options.target_platform == 'ChromeOS') and
+ options.target_platform == 'ChromeOS' or
+ options.target_platform == 'NetBSD') and
'%s/unix/ibus/ibus.gyp' % SRC_DIR in gyp_file_names):
command_line.extend(['-D', 'use_libibus=1'])
@@ -874,7 +902,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.
- if IsLinux():
+ if IsLinux() or IsNetBSD():
command_line.extend(['-D', 'pkg_config_command=%s' % GetPkgConfigCommand()])
else:
command_line.extend(['-D', 'pkg_config_command='])
@@ -1043,6 +1071,41 @@ 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)
+
+ make_command = os.getenv('BUILD_COMMAND', 'make')
+
+ envvars = [
+ 'CFLAGS',
+ 'CXXFLAGS',
+ 'CXX',
+ 'CC',
+ 'AR',
+ 'AS',
+ 'RANLIB',
+ 'LD',
+ ]
+ for envvar in envvars:
+ if envvar in os.environ:
+ os.environ[envvar] = os.getenv(envvar)
+
+ # set output directory
+ os.environ['builddir_name'] = 'out_bsd'
+
+ build_args = ['-j%s' % options.jobs,
+ 'MAKE_JOBS=%s' % options.jobs,
+ 'BUILDTYPE=%s' % options.configuration]
+ build_args.append('builddir_name=%s' %
+ GetBuildBaseName(options,
+ GetMozcVersion().GetTargetPlatform()))
+
+ RunOrDie([make_command] + build_args + target_names)
def BuildOnWindows(targets):
"""Build the target on Windows."""
@@ -1073,6 +1136,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:
@@ -1349,7 +1414,7 @@ def CleanBuildFilesAndDirectories(option
elif IsMac():
directory_names.extend(glob.glob(os.path.join(gyp_directory_name,
'*.xcodeproj')))
- elif IsLinux():
+ elif IsLinux() or IsNetBSD():
file_names.extend(glob.glob(os.path.join(gyp_directory_name,
'*.target.mk')))
file_names.extend(glob.glob(os.path.join(gyp_directory_name,
@@ -1397,6 +1462,10 @@ def CleanBuildFilesAndDirectories(option
elif IsWindows():
file_names.append('third_party/breakpad/breakpad.gyp')
+ directory_names.append('out_win')
+ elif IsNetBSD():
+ file_names.append('Makefile')
+ directory_names.append('out_bsd')
# Remove files.
for file_name in file_names:
RemoveFile(file_name)

View File

@@ -0,0 +1,12 @@
$NetBSD: patch-build__tools_mozc__version.py,v 1.1 2013/04/29 09:52:17 ryoon Exp $
--- build_tools/mozc_version.py.orig 2012-08-31 05:37:06.000000000 +0000
+++ build_tools/mozc_version.py
@@ -65,6 +65,7 @@ TARGET_PLATFORM_TO_DIGIT = {
'ChromeOS': '2',
'Android': '3',
'NaCl': '4',
+ 'NetBSD': '5',
}
VERSION_PROPERTIES = [

View File

@@ -0,0 +1,14 @@
$NetBSD: patch-build__tools_util.py,v 1.1 2013/04/29 09:52:17 ryoon Exp $
--- build_tools/util.py.orig 2013-03-29 04:33:44.000000000 +0000
+++ build_tools/util.py
@@ -56,6 +56,9 @@ def IsLinux():
"""Returns true if the platform is Linux."""
return os.name == 'posix' and os.uname()[0] == 'Linux'
+def IsNetBSD():
+ """Returns true if the platform is Linux."""
+ return os.name == 'posix' and os.uname()[0] == 'NetBSD'
def GetNumberOfProcessors():
"""Returns the number of CPU cores available.

View File

@@ -0,0 +1,22 @@
$NetBSD: patch-client_client.cc,v 1.1 2013/04/29 09:52:17 ryoon Exp $
--- client/client.cc.orig 2013-03-29 04:33:44.000000000 +0000
+++ client/client.cc
@@ -950,7 +950,7 @@ bool Client::LaunchTool(const string &mo
return false;
}
-#if defined(OS_WIN) || defined(OS_LINUX)
+#if defined(OS_WIN) || defined(OS_LINUX) || defined(OS_NETBSD)
string arg = "--mode=" + mode;
if (!extra_arg.empty()) {
arg += " ";
@@ -960,7 +960,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
// TODO(taku): move MacProcess inside SpawnMozcProcess.
// TODO(taku): support extra_arg.

View File

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

View File

@@ -0,0 +1,13 @@
$NetBSD: patch-gui_base_locale__util.cc,v 1.1 2013/04/29 09:52:17 ryoon Exp $
--- gui/base/locale_util.cc.orig 2013-03-29 04:34:04.000000000 +0000
+++ gui/base/locale_util.cc
@@ -207,7 +207,7 @@ TranslationDataImpl::TranslationDataImpl
qApp->installEventFilter(&window_title_modifier_);
#endif // MOZC_SHOW_BUILD_NUMBER_ON_TITLE
-#ifdef OS_LINUX
+#if defined(OS_LINUX) || defined(OS_NETBSD)
// Use system default messages.
// Even if the locale is not English nor Japanese, load translation
// file to translate common messages like "OK" and "Cancel".

View File

@@ -0,0 +1,57 @@
$NetBSD: patch-gui_config__dialog_config__dialog.cc,v 1.1 2013/04/29 09:52:17 ryoon Exp $
--- gui/config_dialog/config_dialog.cc.orig 2013-03-29 04:33:48.000000000 +0000
+++ gui/config_dialog/config_dialog.cc
@@ -96,21 +96,21 @@ ConfigDialog::ConfigDialog()
setWindowTitle(tr("Mozc Preferences"));
#endif // OS_MACOSX
-#if defined(OS_LINUX)
+#if defined(OS_LINUX) || defined(OS_NETBSD)
miscDefaultIMEWidget->setVisible(false);
miscAdministrationWidget->setVisible(false);
miscStartupWidget->setVisible(false);
-#endif // OS_LINUX
+#endif // OS_LINUX || OS_NETBSD
#ifdef NO_LOGGING
// disable logging options
miscLoggingWidget->setVisible(false);
-#if defined(OS_LINUX)
+#if defined(OS_LINUX) || defined(OS_NETBSD)
// The last "misc" tab has no valid configs on Linux
const int kMiscTabIndex = 6;
configDialogTabWidget->removeTab(kMiscTabIndex);
-#endif // OS_LINUX
+#endif // OS_LINUX || OS_NETBSD
#endif // NO_LOGGING
#ifndef ENABLE_CLOUD_SYNC
@@ -347,7 +347,7 @@ ConfigDialog::ConfigDialog()
dictionaryPreloadingAndUACLabel->setVisible(false);
#endif // OS_WIN
-#ifdef OS_LINUX
+#if defined(OS_LINUX) || defined(OS_NETBSD)
// On Linux, disable all fields for UsageStats
usageStatsLabel->setEnabled(false);
usageStatsLabel->setVisible(false);
@@ -357,7 +357,7 @@ ConfigDialog::ConfigDialog()
usageStatsMessage->setVisible(false);
usageStatsCheckBox->setEnabled(false);
usageStatsCheckBox->setVisible(false);
-#endif // OS_LINUX
+#endif // OS_LINUX || OS_NETBSD
webUsageDictionaryCheckBox->setVisible(false);
editWebServiceEntryButton->setVisible(false);
@@ -460,7 +460,7 @@ bool ConfigDialog::Update() {
}
-#if defined(OS_WIN) || defined(OS_LINUX)
+#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_ !=

View File

@@ -0,0 +1,40 @@
$NetBSD: patch-gui_config__dialog_keybinding__editor.cc,v 1.1 2013/04/29 09:52:17 ryoon Exp $
--- gui/config_dialog/keybinding_editor.cc.orig 2012-08-31 05:37:09.000000000 +0000
+++ gui/config_dialog/keybinding_editor.cc
@@ -33,7 +33,7 @@
#include <windows.h>
#include <imm.h>
#include <ime.h>
-#elif OS_LINUX
+#elif defined(OS_LINUX) || defined(OS_NETBSD)
#define XK_MISCELLANY
#include <X11/keysymdef.h>
#endif
@@ -121,7 +121,7 @@ const WinVirtualKeyEntry kWinVirtualKeyM
{ VK_DBE_DBCSCHAR, "Hankaku/Zenkaku" }, // Zenkaku/hankaku
// { VK_KANJI, "Kanji" }, // Do not support Kanji
};
-#elif OS_LINUX
+#elif defined(OS_LINUX) || defined(OS_NETBSD)
struct LinuxVirtualKeyEntry {
uint16 virtual_key;
const char *mozc_key_name;
@@ -390,7 +390,7 @@ KeyBindingFilter::KeyState KeyBindingFil
return Encode(result);
}
}
-#elif OS_LINUX
+#elif defined(OS_LINUX) || defined(OS_NETBSD)
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
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
// 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

@@ -0,0 +1,13 @@
$NetBSD: patch-gui_config__dialog_keymap__editor.cc,v 1.1 2013/04/29 09:52:17 ryoon Exp $
--- gui/config_dialog/keymap_editor.cc.orig 2013-03-29 04:33:49.000000000 +0000
+++ gui/config_dialog/keymap_editor.cc
@@ -449,7 +449,7 @@ bool KeyMapEditorDialog::Update() {
*keymap_table += invisible_keymap_table_;
if (new_ime_switch_keymap != ime_switch_keymap_) {
-#if defined(OS_WIN) || defined(OS_LINUX)
+#if defined(OS_WIN) || defined(OS_LINUX) || defined(OS_NETBSD)
QMessageBox::information(
this,
windowTitle(),

View File

@@ -0,0 +1,13 @@
$NetBSD: patch-gui_dictionary__tool_dictionary__tool.cc,v 1.1 2013/04/29 09:52:17 ryoon Exp $
--- gui/dictionary_tool/dictionary_tool.cc.orig 2013-03-29 04:34:06.000000000 +0000
+++ gui/dictionary_tool/dictionary_tool.cc
@@ -358,7 +358,7 @@ DictionaryTool::DictionaryTool(QWidget *
}
// main window
-#ifndef OS_LINUX
+#if !defined(OS_LINUX) || !defined(OS_NETBSD)
// For some reason setCentralWidget crashes the dictionary_tool on Linux
// TODO(taku): investigate the cause of the crashes
setCentralWidget(splitter_);

View File

@@ -0,0 +1,13 @@
$NetBSD: patch-gui_gui.gyp,v 1.1 2013/04/29 09:52:17 ryoon Exp $
--- gui/gui.gyp.orig 2012-08-31 05:36:43.000000000 +0000
+++ gui/gui.gyp
@@ -387,7 +387,7 @@
'../session/session_base.gyp:session_protocol',
],
}],
- ['use_libzinnia==1 and OS=="linux"', {
+ ['use_libzinnia==1 and (OS=="linux" or OS=="netbsd")', {
'defines': [
'USE_LIBZINNIA',
],

View File

@@ -0,0 +1,22 @@
$NetBSD: patch-gui_qt__libraries.gypi,v 1.1 2013/04/29 09:52:17 ryoon Exp $
--- gui/qt_libraries.gypi.orig 2013-03-29 04:33:25.000000000 +0000
+++ gui/qt_libraries.gypi
@@ -84,7 +84,7 @@
'$(SDKROOT)/System/Library/Frameworks/Carbon.framework',
]
}],
- ['OS=="linux"', {
+ ['OS=="linux" or OS=="netbsd"', {
'conditions': [
['qt_dir', {
'libraries': [
@@ -112,7 +112,7 @@
# Workarounds related with clang.
['clang==1', {
'conditions': [
- ['OS=="linux"', {
+ ['OS=="linux" or OS=="netbsd"', {
'cflags': [
# Temporal workaround against following false warning in Clang.
# http://lists.cs.uiuc.edu/pipermail/cfe-dev/2012-June/022477.html

View File

@@ -0,0 +1,13 @@
$NetBSD: patch-gui_word__register__dialog_word__register__dialog.cc,v 1.1 2013/04/29 09:52:17 ryoon Exp $
--- gui/word_register_dialog/word_register_dialog.cc.orig 2013-03-29 04:34:02.000000000 +0000
+++ gui/word_register_dialog/word_register_dialog.cc
@@ -82,7 +82,7 @@ QString GetEnv(const char *envname) {
}
return "";
#endif // OS_WIN
-#if defined(OS_MACOSX) || defined(OS_LINUX)
+#if defined(OS_MACOSX) || defined(OS_LINUX) || defined(OS_NETBSD)
return ::getenv(envname);
#endif // OS_MACOSX or OS_LINUX
// TODO(team): Support other platforms.

View File

@@ -0,0 +1,13 @@
$NetBSD: patch-gui_zinnia.gyp,v 1.1 2013/04/29 09:52:17 ryoon Exp $
--- gui/zinnia.gyp.orig 2012-08-31 05:36:43.000000000 +0000
+++ gui/zinnia.gyp
@@ -48,7 +48,7 @@
'-Wno-type-limits',
],
'conditions': [
- ['OS=="linux"', {
+ ['OS=="linux" or OS=="netbsd"', {
'conditions': [
['use_libzinnia==1', {
'link_settings': {

View File

@@ -0,0 +1,69 @@
$NetBSD: patch-gyp_common.gypi,v 1.1 2013/04/29 09:52:17 ryoon Exp $
--- gyp/common.gypi.orig 2013-03-29 04:33:42.000000000 +0000
+++ gyp/common.gypi
@@ -132,7 +132,7 @@
'conditions': [
# enable_gtk_renderer represents if mozc_renderer is supported on Linux
# or not.
- ['target_platform=="Linux" and language=="japanese"', {
+ ['(target_platform=="Linux" or target_platform=="NetBSD") and language=="japanese"', {
'enable_gtk_renderer%': 1,
}, { # else
'enable_gtk_renderer%': 0,
@@ -283,12 +283,12 @@
# additional suffix except for Japanese so that multiple
# converter processes can coexist. Note that Mozc on ChromeOS does
# not use IPC so this kind of special treatment is not required.
- ['language!="japanese" and target_platform=="Linux"', {
+ ['language!="japanese" and (target_platform=="Linux" or target_platform=="NetBSD")', {
'defines': [
'MOZC_LANGUAGE_SUFFIX_FOR_LINUX="_<(language)"',
],
}],
- ['OS=="linux"', {
+ ['OS=="linux" or OS=="netbsd"', {
'ldflags': [
'<@(linux_ldflags)',
],
@@ -447,7 +447,7 @@
},
},
'conditions': [
- ['OS=="linux"', {
+ ['OS=="linux" or OS=="netbsd"', {
'cflags': [
'<@(debug_extra_cflags)',
],
@@ -485,7 +485,7 @@
},
},
'conditions': [
- ['OS=="linux"', {
+ ['OS=="linux" or OS=="netbsd"', {
'cflags': [
'<@(release_extra_cflags)',
],
@@ -785,6 +785,22 @@
}],
],
}],
+ ['OS=="netbsd"', {
+ 'defines': [
+ 'OS_NETBSD',
+ 'MOZC_SERVER_DIRECTORY="<@(server_dir)"',
+ ],
+ 'cflags': [
+ '<@(gcc_cflags)',
+ '-fPIC',
+ '-fno-exceptions',
+ ],
+ 'cflags_cc': [
+ # We use deprecated <hash_map> and <hash_set> instead of upcoming
+ # <unordered_map> and <unordered_set>.
+ '-Wno-deprecated',
+ ],
+ }],
['OS=="mac"', {
'defines': [
'OS_MACOSX',

View File

@@ -0,0 +1,13 @@
$NetBSD: patch-handwriting_handwriting.gyp,v 1.1 2013/04/29 09:52:17 ryoon Exp $
--- handwriting/handwriting.gyp.orig 2013-03-29 04:33:25.000000000 +0000
+++ handwriting/handwriting.gyp
@@ -39,7 +39,7 @@
'../base/base.gyp:base',
'../gui/zinnia.gyp:zinnia',
],
- 'conditions': [['use_libzinnia==1 and OS=="linux"', {
+ 'conditions': [['use_libzinnia==1 and (OS=="linux" or OS=="netbsd")', {
'defines': [
'USE_LIBZINNIA',
],

View File

@@ -0,0 +1,15 @@
$NetBSD: patch-handwriting_zinnia__handwriting.cc,v 1.1 2013/04/29 09:52:17 ryoon Exp $
* Not confirmed yet.
--- handwriting/zinnia_handwriting.cc.orig 2012-08-31 05:37:06.000000000 +0000
+++ handwriting/zinnia_handwriting.cc
@@ -52,7 +52,7 @@ string GetModelFileName() {
#elif defined(USE_LIBZINNIA)
// On Linux, use the model for tegaki-zinnia.
const char kModelFile[] =
- "/usr/share/tegaki/models/zinnia/handwriting-ja.model";
+ "@PREFIX@/share/tegaki/models/zinnia/handwriting-ja.model";
return kModelFile;
#else
const char kModelFile[] = "handwriting-ja.model";

View File

@@ -0,0 +1,42 @@
$NetBSD: patch-ipc_ipc__path__manager.cc,v 1.1 2013/04/29 09:52:17 ryoon Exp $
--- ipc/ipc_path_manager.cc.orig 2013-03-29 04:33:26.000000000 +0000
+++ ipc/ipc_path_manager.cc
@@ -44,6 +44,11 @@
#endif // OS_MACOSX
#endif // OS_WIN
+#if defined(OS_NETBSD)
+#include <sys/param.h>
+#include <sys/sysctl.h>
+#endif
+
#include <cstdlib>
#include <map>
@@ -427,7 +432,24 @@ bool IPCPathManager::IsValidServer(uint3
return true;
}
-#ifdef OS_LINUX
+#if defined(OS_NETBSD)
+ int name[] = { CTL_KERN, KERN_PROC_ARGS, pid };
+ size_t data_len = 0;
+ if (sysctl(name, arraysize(name), NULL,
+ &data_len, NULL, 0) < 0) {
+ LOG(ERROR) << "sysctl KERN_PROC_ARGS failed";
+ return false;
+ }
+
+ server_path_.resize(data_len);
+ if (sysctl(name, arraysize(name), &server_path_[0],
+ &data_len, NULL, 0) < 0) {
+ LOG(ERROR) << "sysctl KERN_PROC_ARGS failed";
+ return false;
+ }
+#endif
+
+#if defined(OS_LINUX)
if ((server_path + " (deleted)") == server_path_) {
LOG(WARNING) << server_path << " on disk is modified";
// If a user updates the server binary on disk during the server is running,

View File

@@ -0,0 +1,13 @@
$NetBSD: patch-ipc_ipc__path__manager__test.cc,v 1.1 2013/04/29 09:52:17 ryoon Exp $
--- ipc/ipc_path_manager_test.cc.orig 2013-03-29 04:33:26.000000000 +0000
+++ ipc/ipc_path_manager_test.cc
@@ -103,7 +103,7 @@ TEST_F(IPCPathManagerTest, IPCPathManage
EXPECT_FALSE(manager->GetServerProductVersion().empty());
EXPECT_GT(manager->GetServerProcessId(), 0);
EXPECT_EQ(t.path(), path);
-#ifdef OS_LINUX
+#if defned(OS_LINUX) || defined(OS_NETBSD)
// On Linux, |path| should be abstract (see man unix(7) for details.)
ASSERT_FALSE(path.empty());
EXPECT_EQ('\0', path[0]);

View File

@@ -0,0 +1,15 @@
$NetBSD: patch-ipc_named__event.cc,v 1.1 2013/04/29 09:52:17 ryoon Exp $
* sem_open(..., 0) is not supported for NetBSD at least.
--- ipc/named_event.cc.orig 2012-08-31 05:37:07.000000000 +0000
+++ ipc/named_event.cc
@@ -337,7 +337,7 @@ int NamedEventListener::WaitEventOrProce
NamedEventNotifier::NamedEventNotifier(const char *name)
: sem_(SEM_FAILED) {
const string key_filename = NamedEventUtil::GetEventPath(name);
- sem_ = ::sem_open(key_filename.c_str(), 0);
+ sem_ = ::sem_open(key_filename.c_str(), O_CREAT);
if (sem_ == SEM_FAILED) {
LOG(ERROR) << "sem_open failed: " << ::strerror(errno);
}

View File

@@ -0,0 +1,45 @@
$NetBSD: patch-ipc_unix__ipc.cc,v 1.1 2013/04/29 09:52:17 ryoon Exp $
--- ipc/unix_ipc.cc.orig 2013-03-29 04:33:26.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)
#include "ipc/ipc.h"
@@ -127,7 +127,7 @@ bool IsPeerValid(int socket, pid_t *pid)
// sometimes doesn't support the getsockopt(sock, SOL_SOCKET, SO_PEERCRED)
// system call.
// TODO(yusukes): Add implementation for ARM Linux.
-#ifndef __arm__
+#if !defined(__arm__) && !defined(OS_NETBSD)
struct ucred peer_cred;
int peer_cred_len = sizeof(peer_cred);
if (getsockopt(socket, SOL_SOCKET, SO_PEERCRED,
@@ -145,6 +145,22 @@ bool IsPeerValid(int socket, pid_t *pid)
*pid = peer_cred.pid;
#endif // __arm__
+#if defined(OS_NETBSD)
+ struct unpcbid peer_cred;
+ int peer_cred_len = sizeof(peer_cred);
+ if (getsockopt(socket, 0, LOCAL_PEEREID,
+ reinterpret_cast<void *>(&peer_cred),
+ reinterpret_cast<socklen_t *>(&peer_cred_len)) < 0) {
+ LOG(ERROR) << "cannot get peer credential. Not a Unix socket?";
+ return false;
+ }
+
+ if (peer_cred.unp_euid!= ::geteuid()) {
+ LOG(WARNING) << "uid mismatch." << peer_cred.unp_euid << "!=" << ::geteuid();
+ return false;
+ }
+#endif
+
return true;
}

View File

@@ -0,0 +1,13 @@
$NetBSD: patch-languages_chewing_chewing.gyp,v 1.1 2013/04/29 09:52:18 ryoon Exp $
--- languages/chewing/chewing.gyp.orig 2012-08-31 05:36:42.000000000 +0000
+++ languages/chewing/chewing.gyp
@@ -55,7 +55,7 @@
},
],
'conditions': [
- ['OS=="linux"', {
+ ['OS=="linux" or OS=="netbsd"', {
'targets': [
{
'target_name': 'ibus_mozc_chewing',

View File

@@ -0,0 +1,13 @@
$NetBSD: patch-languages_hangul_hangul.gyp,v 1.1 2013/04/29 09:52:18 ryoon Exp $
--- languages/hangul/hangul.gyp.orig 2012-08-31 05:36:42.000000000 +0000
+++ languages/hangul/hangul.gyp
@@ -59,7 +59,7 @@
},
],
'conditions': [
- ['OS=="linux"', {
+ ['OS=="linux" or OS=="netbsd"', {
'targets': [
{
'target_name': 'ibus_mozc_hangul',

View File

@@ -0,0 +1,13 @@
$NetBSD: patch-net_net.gyp,v 1.1 2013/04/29 09:52:18 ryoon Exp $
--- net/net.gyp.orig 2013-03-29 04:33:42.000000000 +0000
+++ net/net.gyp
@@ -61,7 +61,7 @@
},
},
}],
- ['target_platform=="Linux"', {
+ ['target_platform=="Linux" or target_platform=="NetBSD"', {
# Enable libcurl
'cflags': [
'<!@(<(pkg_config_command) --cflags libcurl)',

View File

@@ -0,0 +1,28 @@
$NetBSD: patch-protobuf_genproto.gypi,v 1.1 2013/04/29 09:52:18 ryoon Exp $
--- protobuf/genproto.gypi.orig 2013-03-29 04:33:43.000000000 +0000
+++ protobuf/genproto.gypi
@@ -33,19 +33,19 @@
'wrapper_path': '<(DEPTH)/build_tools/protoc_wrapper.py',
},
'conditions': [
- ['target_platform!="linux"', {
+ ['target_platform!="Linux" and target_platform!="NetBSD"', {
'variables': {
- 'protoc_command%': '<(mozc_build_tools_dir)/protoc<(EXECUTABLE_SUFFIX)',
+ 'protoc_command%': '@PREFIX@/bin/protoc<(EXECUTABLE_SUFFIX)',
},
}, { # else
'conditions': [
['use_libprotobuf==0', {
'variables': {
- 'protoc_command%': '<(mozc_build_tools_dir)/protoc<(EXECUTABLE_SUFFIX)',
+ 'protoc_command%': '@PREFIX@/bin/protoc<(EXECUTABLE_SUFFIX)',
},
}, { # else
'variables': {
- 'protoc_command%': 'protoc<(EXECUTABLE_SUFFIX)',
+ 'protoc_command%': '@PREFIX@/bin/protoc<(EXECUTABLE_SUFFIX)',
},
}],
],

View File

@@ -0,0 +1,31 @@
$NetBSD: patch-protobuf_protobuf.gyp,v 1.1 2013/04/29 09:52:18 ryoon Exp $
--- protobuf/protobuf.gyp.orig 2013-03-29 04:33:43.000000000 +0000
+++ protobuf/protobuf.gyp
@@ -140,7 +140,7 @@
],
'conditions': [
# for gcc and clang
- ['OS=="linux" or OS=="mac"', {
+ ['OS=="linux" or OS=="mac" OS=="netbsd"', {
'cflags': [
'-Wno-conversion-null', # coded_stream.cc uses NULL to bool.
'-Wno-unused-function',
@@ -176,7 +176,7 @@
'.',
],
'conditions': [
- ['OS=="linux"', {
+ ['OS=="linux" or OS=="netbsd"', {
'conditions': [
['use_libprotobuf!=1', {
'cflags': [
@@ -212,7 +212,7 @@
},
'conditions': [
# use system-installed protoc on Linux
- ['OS!="linux"', {
+ ['OS!="linux" and OS!="netbsd"', {
'includes' : [
'../gyp/install_build_tool.gypi',
],

View File

@@ -0,0 +1,13 @@
$NetBSD: patch-session_session.cc,v 1.1 2013/04/29 09:52:18 ryoon Exp $
--- session/session.cc.orig 2013-03-29 04:33:25.000000000 +0000
+++ session/session.cc
@@ -1100,7 +1100,7 @@ void Session::UpdateOperationPreferences
}
// Cascading Window.
-#ifndef OS_LINUX
+#if !defined(OS_LINUX) or !defined(OS_NETBSD)
if (config.has_use_cascading_window()) {
operation_preferences.use_cascading_window = config.use_cascading_window();
}

View File

@@ -0,0 +1,13 @@
$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

@@ -0,0 +1,40 @@
$NetBSD: patch-session_session__test.cc,v 1.1 2013/04/29 09:52:18 ryoon Exp $
--- session/session_test.cc.orig 2013-03-29 04:33:26.000000000 +0000
+++ session/session_test.cc
@@ -2361,7 +2361,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)
// 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
// "" (t13n), "" (t13n), "" (t13n),
// "アイウエオ" (t13n) ]
EXPECT_EQ(11, output.all_candidate_words().candidates_size());
-#endif // OS_LINUX
+#endif // OS_LINUX || OS_NETBSD
}
command.Clear();
@@ -2389,7 +2389,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)
// 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
// "" (t13n), "" (t13n), "" (t13n),
// "アイウエオ" (t13n) ]
EXPECT_EQ(11, output.all_candidate_words().candidates_size());
-#endif // OS_LINUX
+#endif // OS_LINUX || OS_NETBSD
}
}

View File

@@ -0,0 +1,13 @@
$NetBSD: patch-third__party_gyp_buildbot_buildbot__run.py,v 1.1 2013/04/29 09:52:18 ryoon Exp $
--- third_party/gyp/buildbot/buildbot_run.py.orig 2012-02-23 21:18:54.000000000 +0000
+++ third_party/gyp/buildbot/buildbot_run.py
@@ -74,6 +74,8 @@ def GypBuild():
retcode += GypTestFormat('ninja')
retcode += GypTestFormat('scons')
retcode += GypTestFormat('make')
+ elif sys.platform == 'netbsd':
+ retcode += GypTestFormat('make')
elif sys.platform == 'darwin':
retcode += GypTestFormat('ninja')
retcode += GypTestFormat('xcode')

View File

@@ -0,0 +1,55 @@
$NetBSD: patch-unix_ibus_gen__mozc__xml.py,v 1.1 2013/04/29 09:52:18 ryoon Exp $
* Fix for pkgsrc installation.
--- unix/ibus/gen_mozc_xml.py.orig 2013-03-29 04:33:43.000000000 +0000
+++ unix/ibus/gen_mozc_xml.py
@@ -49,7 +49,7 @@ IBUS_COMPONENT_PROPS = {
'description': '%s Component',
# TODO(yusukes): Support Linux distributions other than Gentoo/ChromeOS.
# For example, Ubuntu uses /usr/lib/ibus-mozc/.
- 'exec': '/usr/libexec/ibus-engine-mozc --ibus',
+ 'exec': '@PREFIX@/libexec/ibus-engine-mozc --ibus',
# TODO(mazda): Generate the version number.
'version': '0.0.0.0',
'author': 'Google Inc.',
@@ -62,7 +62,7 @@ IBUS_COMPONENT_PROPS = {
IBUS_ENGINE_COMMON_PROPS = {
'description': '%s (Japanese Input Method)',
'language': 'ja',
- 'icon': '/usr/share/ibus-mozc/product_icon.png',
+ 'icon': '@PREFIX@/share/ibus-mozc/product_icon.png',
'rank': '80',
}
@@ -95,6 +95,13 @@ IBUS_ENGINES_PROPS = {
'longname': ['%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': ['%s'],
+ 'layout': ['jp'],
+ },
# On Chrome/Chromium OS, we provide three engines.
'ChromeOS': {
# DO NOT change the engine name 'mozc-jp'. The names is referenced by
@@ -228,7 +235,15 @@ def main():
platform = options.platform
common_props = IBUS_ENGINE_COMMON_PROPS
if platform == 'Linux':
- 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
+ platform = 'Linux-IBus1.5'
+ common_props = IBUS_1_5_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

View File

@@ -0,0 +1,15 @@
$NetBSD: patch-unix_ibus_mozc__engine.cc,v 1.1 2013/04/29 09:52:18 ryoon Exp $
* I am not sure.
--- unix/ibus/mozc_engine.cc.orig 2012-08-31 05:36:43.000000000 +0000
+++ unix/ibus/mozc_engine.cc
@@ -756,7 +756,7 @@ bool MozcEngine::ExecuteCallback(IBusEng
// on size_t, not uint32.
string selection_text;
const uint32 selection_start = min(cursor_pos, anchor_pos);
- const uint32 selection_length = abs(relative_selected_length);
+ const uint32 selection_length = ::abs(relative_selected_length);
Util::SubString(surrounding_text,
selection_start,
selection_length,