pkgsrc-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
pkg/52689: pkgsrc/inputmethod/mozc-*: update to 2.20.2673.102
>Number: 52689
>Category: pkg
>Synopsis: pkgsrc/inputmethod/mozc-*: update to 2.20.2673.102
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: pkg-manager
>State: open
>Class: change-request
>Submitter-Id: net
>Arrival-Date: Thu Nov 02 15:35:01 +0000 2017
>Originator: Izumi Tsutsui
>Release: NetBSD 7.1
>Organization:
>Environment:
System: NetBSD 7.1
Architecture: i386
Machine: i386
>Description:
current pkgsrc/inputmethod/mozc-server (and other mozc package)
is 2.17.2313.102, but the latest version is 2.20.2673.102:
https://github.com/google/mozc/blob/master/docs/release_history.md
>How-To-Repeat:
See
http://cvsweb.netbsd.org/bsdweb.cgi/pkgsrc/inputmethod/mozc-server/Makefile.common#rev1.24
>Fix:
Updated pkgsrc/inputmethod/mozc-server files are attached as shar.
(also put to https://gist.github.com/tsutsui/8e042b373f9f5eb1b4f686369aa79b81
since some patches include UTF-8 chars)
Tested on NetBSD/i386 7.1 and confirmed working.
Also build (but not tested) on NetBSD/amd64 7.1.
Changes summary:
- mechanical changes to support 'target_platform="NetBSD"' etc.
as previous patches do
(XXX gyp_common.gypi needs review)
- handle ${PREFIX} in more places
(especially in patch-base_system__util.cc and patch-base_base.gyp
for MOZC_SERVER_DIRECTORY)
- set GCC_REQD=4.7
(XXX not sure which gcc version is actually necessary for c++11)
(XXX not sure if __null hack in patch-base_port.h is still worth)
- buildlink3 qt5-qtbase instead of qt4-libs
- fix COMMENT (remove "for IBus")
- add patch dumb comments
- private DISTFILE is available here:
http://teokurebsd.org/netbsd/packages/distfiles/mozc/mozc-2.20.2673.102.tar.xz
this is prepared by
% git clone https://github.com/google/mozc.git -b master --single-branch
% cd mozc
% git checkout 280e38fe3d9db4df52f0713acf2ca65898cd697a
% git submodule update --init --recursive
% cd ..
% mv mozc mozc-2.20.2673.102
% tar -cf mozc-2.20.2673.102.tar mozc-2.20.2673.102
% xz mozc-2.20.2673.102.tar
as mentioned in HOMEPAGE:
https://github.com/google/mozc/blob/master/docs/release_history.md#2192644102---2202673102--2016-10-20---2016-12-08
--- cut here ---
# This is a shell archive. Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file". Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
# mozc-server
# mozc-server/DESCR
# mozc-server/Makefile
# mozc-server/Makefile.common
# mozc-server/PLIST
# mozc-server/distinfo
# mozc-server/patches
# mozc-server/patches/patch-base_base.gyp
# mozc-server/patches/patch-base_clock.cc
# mozc-server/patches/patch-base_cpu__stats.cc
# mozc-server/patches/patch-base_logging.cc
# mozc-server/patches/patch-base_mutex.cc
# mozc-server/patches/patch-base_mutex.h
# mozc-server/patches/patch-base_password__manager.cc
# mozc-server/patches/patch-base_port.h
# mozc-server/patches/patch-base_process.cc
# mozc-server/patches/patch-base_run__level.cc
# mozc-server/patches/patch-base_system__util.cc
# mozc-server/patches/patch-base_thread.cc
# mozc-server/patches/patch-build__mozc.py
# mozc-server/patches/patch-build__tools_mozc__version.py
# mozc-server/patches/patch-build__tools_util.py
# mozc-server/patches/patch-client_client.cc
# mozc-server/patches/patch-config_stats__config__util__test.cc
# mozc-server/patches/patch-gui_config__dialog_config__dialog.cc
# mozc-server/patches/patch-gui_config__dialog_keybinding__editor.cc
# mozc-server/patches/patch-gui_dictionary__tool_dictionary__tool.cc
# mozc-server/patches/patch-gui_qt__libraries.gypi
# mozc-server/patches/patch-gui_qt__moc.gypi
# mozc-server/patches/patch-gui_qt__rcc.gypi
# mozc-server/patches/patch-gui_qt__uic.gypi
# mozc-server/patches/patch-gui_word__register__dialog_word__register__dialog.cc
# mozc-server/patches/patch-gyp_common.gypi
# mozc-server/patches/patch-gyp_directories.gypi
# mozc-server/patches/patch-handwriting_zinnia.gyp
# mozc-server/patches/patch-handwriting_zinnia__handwriting.cc
# mozc-server/patches/patch-ipc_ipc__path__manager.cc
# mozc-server/patches/patch-ipc_ipc__path__manager__test.cc
# mozc-server/patches/patch-ipc_named__event.cc
# mozc-server/patches/patch-ipc_unix__ipc.cc
# mozc-server/patches/patch-net_net.gyp
# mozc-server/patches/patch-session_session.cc
# mozc-server/patches/patch-session_session__test.cc
# mozc-server/patches/patch-third__party_protobuf_post__process__dist.sh
# mozc-server/patches/patch-unix_ibus_ibus.gyp
# mozc-server/patches/patch-unix_ibus_path__util.cc
#
echo c - mozc-server
mkdir -p mozc-server > /dev/null 2>&1
echo x - mozc-server/DESCR
sed 's/^X//' >mozc-server/DESCR << 'END-of-mozc-server/DESCR'
XMozc is a Japanese Input Method Editor (IME) designed for multi-platform
Xsuch as Chromium OS, Windows, Mac and Linux. This open-source
Xproject originates from Google Japanese Input.
X
XThis package is dictionary server for mozc client, such as ibus-mozc.
END-of-mozc-server/DESCR
echo x - mozc-server/Makefile
sed 's/^X//' >mozc-server/Makefile << 'END-of-mozc-server/Makefile'
X# $NetBSD: Makefile,v 1.33 2017/08/24 20:03:26 adam Exp $
X
XPKGNAME= ${DISTNAME:S/mozc-/mozc-server-/}
X
XINSTALLATION_DIRS+= libexec
X
Xdo-build:
X cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} \
X ${PYTHONBIN} build_mozc.py build \
X -c ${MOZC_BUILD_MODE} \
X server/server.gyp:mozc_server
X
Xdo-install:
X ${INSTALL_PROGRAM} ${WRKSRC}/out_${OSDEST}/${MOZC_BUILD_MODE}/mozc_server \
X ${DESTDIR}${PREFIX}/libexec/mozc_server
X
X.include "../../inputmethod/mozc-server/Makefile.common"
END-of-mozc-server/Makefile
echo x - mozc-server/Makefile.common
sed 's/^X//' >mozc-server/Makefile.common << 'END-of-mozc-server/Makefile.common'
X# $NetBSD: Makefile.common,v 1.25 2016/07/09 13:03:52 wiz Exp $
X# used by inputmethod/ibus-mozc/Makefile
X# used by inputmethod/mozc-elisp/Makefile
X# used by inputmethod/mozc-server/Makefile
X# used by inputmethod/mozc-tool/Makefile
X# used by inputmethod/mozc-renderer/Makefile
X# used by inputmethod/uim-mozc/Makefile
X#
X
XDISTNAME= mozc-2.20.2673.102
XCATEGORIES= inputmethod
XMASTER_SITES= ${MASTER_SITE_LOCAL}
XEXTRACT_SUFX= .tar.xz
X
XMAINTAINER= ryoon%NetBSD.org@localhost
XHOMEPAGE= https://github.com/google/mozc/
XCOMMENT= Japanese inputmethod Mozc engine
XLICENSE= modified-bsd
X
XUIM_MOZC= uim-mozc-321.3ea28b1
XDISTFILES+= ${DISTNAME}${EXTRACT_SUFX} \
X ${UIM_MOZC}.tar.xz
XSITES.${UIM_MOZC}.tar.xz= ${MASTER_SITE_SOURCEFORGE:=pnsft-aur/}
X
XEXTRACT_USING= bsdtar
XWRKSRC= ${WRKDIR}/${DISTNAME}/src
X
XDISTINFO_FILE= ${.CURDIR}/../../inputmethod/mozc-server/distinfo
XPATCHDIR= ${.CURDIR}/../../inputmethod/mozc-server/patches
X
XBUILD_DEPENDS+= ${PYPKGPREFIX}-gyp-[0-9]*:../../devel/gyp
XBUILD_DEPENDS+= ninja-build-[0-9]*:../../devel/ninja-build
X
XUSE_LANGUAGES= c c++
X
XUSE_TOOLS+= gmake pkg-config
XGCC_REQD+= 4.7 # for c++11
X
XOPENSSL_CFLAGS= -I${BUILDLINK_PREFIX.openssl}/include
XOPENSSL_INC= -I${BUILDLINK_PREFIX.openssl}/include
XOPENSSL_LDFLAGS= -L${BUILDLINK_PREFIX.openssl}/lib -lssl -lcrypto
XOPENSSL_LIBS= -lssl -lcrypto
X
XSUBST_CLASSES+= gyp
XSUBST_STAGE.gyp= pre-configure
XSUBST_MESSAGE.gyp= Fix gyp defaults
XSUBST_FILES.gyp+= base/process.cc
XSUBST_FILES.gyp+= gyp/directories.gypi
XSUBST_FILES.gyp+= handwriting/zinnia_handwriting.cc
XSUBST_FILES.gyp+= unix/ibus/ibus.gyp
XSUBST_FILES.gyp+= unix/ibus/path_util.cc
XSUBST_VARS.gyp+= OPENSSL_CFLAGS OPENSSL_INC OPENSSL_LDFLAGS OPENSSL_LIBS
XSUBST_VARS.gyp+= PREFIX
X
X# To disable flock(1) in link stage.
XALL_ENV+= LINK=${CXX}
X
X.include "../../mk/bsd.prefs.mk"
X
XOPSYSVARS+= OSDEST
XOSDEST.Linux= linux
XOSDEST.NetBSD= bsd
X
XMOZC_BUILD_MODE= Release # or Debug
X
Xdo-configure:
X cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} \
X GYP_DEFINES="use_libprotobuf=1" \
X ${PYTHONBIN} build_mozc.py \
X gyp \
X --gypdir=${LOCALBASE}/bin
X
X.include "../../devel/glib2/buildlink3.mk"
X.include "../../devel/protobuf/buildlink3.mk"
X# gmock is not used yet...
X#.include "../../devel/gmock/buildlink3.mk"
X.include "../../inputmethod/zinnia/buildlink3.mk"
X.include "../../www/curl/buildlink3.mk"
X.include "../../x11/gtk2/buildlink3.mk"
X.include "../../x11/qt5-qtbase/buildlink3.mk"
X
X.include "../../lang/python/tool.mk"
X.include "../../mk/bsd.pkg.mk"
END-of-mozc-server/Makefile.common
echo x - mozc-server/PLIST
sed 's/^X//' >mozc-server/PLIST << 'END-of-mozc-server/PLIST'
X@comment $NetBSD: PLIST,v 1.2 2013/04/29 09:22:04 ryoon Exp $
Xlibexec/mozc_server
END-of-mozc-server/PLIST
echo x - mozc-server/distinfo
sed 's/^X//' >mozc-server/distinfo << 'END-of-mozc-server/distinfo'
X$NetBSD: distinfo,v 1.19 2016/05/16 11:51:49 ryoon Exp $
X
XSHA1 (mozc-2.20.2673.102.tar.xz) = 9cedf4d392593e04755fa44afd79cd40bb80b9d1
XRMD160 (mozc-2.20.2673.102.tar.xz) = 723fef550d88c5a4dc33f2ec9c8d7ee694e60d64
XSHA512 (mozc-2.20.2673.102.tar.xz) = 06ce43b0fa6d5a696cddafc97cd84bfa4482204ffb3793a6d3811dd50c4ed859289394ee471987b20fd637768bdfcc2f0289993b88e24c141c93514229dfc402
XSize (mozc-2.20.2673.102.tar.xz) = 44187096 bytes
XSHA1 (uim-mozc-321.3ea28b1.tar.xz) = 22b7c2a5b0a7fef778ee72ebe5873a75e879d26b
XRMD160 (uim-mozc-321.3ea28b1.tar.xz) = 30d160d02a39065e4bc34968fbe6232018b0b202
XSHA512 (uim-mozc-321.3ea28b1.tar.xz) = b28f4d207a52c208694371dbc550ac5022a29c5870b8d856bca8052106d8be88ab8d066bdc6d895ac6fa9f350ce6be16d638603e46058f9528691f97cb86d054
XSize (uim-mozc-321.3ea28b1.tar.xz) = 24400 bytes
XSHA1 (patch-base_base.gyp) = d8d9abc0da196f0573ad645937812710c7c67746
XSHA1 (patch-base_clock.cc) = 0fa3f4b3bcd34283870a317032172745dcf90eaa
XSHA1 (patch-base_cpu__stats.cc) = c55ee389eced767e875553937a80c8ba6c6abd2d
XSHA1 (patch-base_logging.cc) = 5dddcbbf4445e91e6f8ab41999c938e0491c05c4
XSHA1 (patch-base_mutex.cc) = 9563ff1563eef8dc73417454b2ba06322a2cd76d
XSHA1 (patch-base_mutex.h) = cf12a1574d28dd612820578560a76b3b8ab6e27d
XSHA1 (patch-base_password__manager.cc) = 8216bc58d398fae4935e99fe5d11febbee380644
XSHA1 (patch-base_port.h) = 775b8a5afe2336218fc936d009bae9f6b13a4379
XSHA1 (patch-base_process.cc) = 1cba930ffdf14694fa55e473c2e94ee2cf523de4
XSHA1 (patch-base_run__level.cc) = 849a6a6727463305c2fdca4eed0fb4a4cac10567
XSHA1 (patch-base_system__util.cc) = c4d81bb3d4633a11d969520af610c3e10417ab4e
XSHA1 (patch-base_thread.cc) = 2cc63c1d369f842a29e07311364c2a3537f3b428
XSHA1 (patch-build__mozc.py) = 5fd1e328c9a35cc01a507566afeda1179657e685
XSHA1 (patch-build__tools_mozc__version.py) = 7130eac051d0d4f78da887aedd669fc4713dbd62
XSHA1 (patch-build__tools_util.py) = 5ca614adf2453fcc33c18cda74c0d9b2e4f6bc21
XSHA1 (patch-client_client.cc) = f1eb1860c41a97c82a338f74acdcf0ed3477b6da
XSHA1 (patch-config_stats__config__util__test.cc) = 3514f04a921908795c03d0e8685135297dc9e2af
XSHA1 (patch-gui_config__dialog_config__dialog.cc) = de2750a6bf99c4e38983cf5322adae8c46ca45d6
XSHA1 (patch-gui_config__dialog_keybinding__editor.cc) = 529e902c146907d3a91181bad3822bbbec69b6b7
XSHA1 (patch-gui_dictionary__tool_dictionary__tool.cc) = cae617cc8e324b0f93adc1e76632a018530cd2c7
XSHA1 (patch-gui_qt__libraries.gypi) = ceb8d5b15d4cd5b2d907406f02413290bd4ab652
XSHA1 (patch-gui_qt__moc.gypi) = e3d42e61b35012cda10da13aa03cee67786e171c
XSHA1 (patch-gui_qt__rcc.gypi) = d38a849fe8e81672eb441a41936f454d8e45ff5c
XSHA1 (patch-gui_qt__uic.gypi) = 7dd69ee109e81f0e70f2866b77555412518b4844
XSHA1 (patch-gui_word__register__dialog_word__register__dialog.cc) = 6e247fcab5d570b733365b57c5a5d72a021dd16f
XSHA1 (patch-gyp_common.gypi) = 13cd5010a6f3ed314a94248144657955f8bbbe72
XSHA1 (patch-gyp_directories.gypi) = 6504d8b43f83be3908b39a5e51598c2aba0dffd9
XSHA1 (patch-handwriting_zinnia.gyp) = b59e546cb9b8b91dcd627885e1853e8ba8dead46
XSHA1 (patch-handwriting_zinnia__handwriting.cc) = dd87817aabcd290c9fb25f3ebe4f36ce670ae44b
XSHA1 (patch-ipc_ipc__path__manager.cc) = 533d37b3802385873450ebeef561425aef7d9c63
XSHA1 (patch-ipc_ipc__path__manager__test.cc) = 1b83b513383f184f5ab5a56cce734b7934998533
XSHA1 (patch-ipc_named__event.cc) = 92283261e7580569587e43156f13567b593c9a32
XSHA1 (patch-ipc_unix__ipc.cc) = 25107c2e84844ecaa3445efb48cc3f2795579dec
XSHA1 (patch-net_net.gyp) = 61353724533f9239f4c58fa37f0a8fb2eb5552c3
XSHA1 (patch-session_session.cc) = 773017ac54e79239f6734a124f457b0b81bb1ced
XSHA1 (patch-session_session__test.cc) = 99165b29555844a40d30cf5554cc5c66773b70ed
XSHA1 (patch-third__party_protobuf_post__process__dist.sh) = 8adc79d5d7eed3cbf406ebcfbd5832b7a050ced6
XSHA1 (patch-unix_ibus_ibus.gyp) = aa2077cf3c379bf9ce33e97abe478540346782ad
XSHA1 (patch-unix_ibus_path__util.cc) = a6aa368d9ce8926e200602fdc370c13e35d5a8cf
END-of-mozc-server/distinfo
echo c - mozc-server/patches
mkdir -p mozc-server/patches > /dev/null 2>&1
echo x - mozc-server/patches/patch-base_base.gyp
sed 's/^X//' >mozc-server/patches/patch-base_base.gyp << 'END-of-mozc-server/patches/patch-base_base.gyp'
X$NetBSD$
X
X* NetBSD support
X
X--- base/base.gyp.orig 2017-11-02 13:32:45.000000000 +0000
X+++ base/base.gyp
X@@ -141,7 +141,7 @@
X },
X },
X }],
X- ['target_platform=="Linux" and server_dir!=""', {
X+ ['(target_platform=="Linux" or target_platform=="NetBSD") and server_dir!=""', {
X 'defines': [
X 'MOZC_SERVER_DIRECTORY="<(server_dir)"',
X ],
END-of-mozc-server/patches/patch-base_base.gyp
echo x - mozc-server/patches/patch-base_clock.cc
sed 's/^X//' >mozc-server/patches/patch-base_clock.cc << 'END-of-mozc-server/patches/patch-base_clock.cc'
X$NetBSD: patch-base_clock.cc,v 1.1 2016/05/16 11:51:49 ryoon Exp $
X
X* NetBSD support
X
X--- base/clock.cc.orig 2016-05-15 08:11:10.000000000 +0000
X+++ base/clock.cc
X@@ -124,7 +124,7 @@ class ClockImpl : public ClockInterface
X mach_timebase_info(&timebase_info);
X return static_cast<uint64>(
X 1.0e9 * timebase_info.denom / timebase_info.numer);
X-#elif defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NACL)
X+#elif defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NACL) || defined(OS_NETBSD)
X return 1000000uLL;
X #else // platforms (OS_WIN, OS_MACOSX, OS_LINUX, ...)
X #error "Not supported platform"
X@@ -141,7 +141,7 @@ class ClockImpl : public ClockInterface
X return static_cast<uint64>(timestamp.QuadPart);
X #elif defined(OS_MACOSX)
X return static_cast<uint64>(mach_absolute_time());
X-#elif defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NACL)
X+#elif defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NACL) || defined(OS_NETBSD)
X uint64 sec;
X uint32 usec;
X GetTimeOfDay(&sec, &usec);
END-of-mozc-server/patches/patch-base_clock.cc
echo x - mozc-server/patches/patch-base_cpu__stats.cc
sed 's/^X//' >mozc-server/patches/patch-base_cpu__stats.cc << 'END-of-mozc-server/patches/patch-base_cpu__stats.cc'
X$NetBSD: patch-base_cpu__stats.cc,v 1.2 2016/05/16 11:51:49 ryoon Exp $
X
X* NetBSD support
X
X--- base/cpu_stats.cc.orig 2016-05-15 08:11:10.000000000 +0000
X+++ base/cpu_stats.cc
X@@ -123,13 +123,13 @@ float CPUStats::GetSystemCPULoad() {
X
X #endif // OS_MACOSX
X
X-#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NACL)
X+#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NACL) || defined(OS_NETBSD)
X // NOT IMPLEMENTED
X // TODO(taku): implement Linux version
X // can take the info from /proc/stats
X const uint64 total_times = 0;
X const uint64 cpu_times = 0;
X-#endif // OS_LINUX || OS_ANDROID || OS_NACL
X+#endif // OS_LINUX || OS_ANDROID || OS_NACL || OS_NETBSD
X
X return UpdateCPULoad(total_times,
X cpu_times,
X@@ -178,11 +178,11 @@ float CPUStats::GetCurrentProcessCPULoad
X TimeValueTToInt64(task_times_info.system_time);
X #endif // OS_MACOSX
X
X-#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NACL)
X+#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NACL) || defined(OS_NETBSD)
X // not implemented
X const uint64 total_times = 0;
X const uint64 cpu_times = 0;
X-#endif // OS_LINUX || OS_ANDROID || OS_NACL
X+#endif // OS_LINUX || OS_ANDROID || OS_NACL || OS_NETBSD
X
X return UpdateCPULoad(total_times,
X cpu_times,
X@@ -210,9 +210,9 @@ size_t CPUStats::GetNumberOfProcessors()
X return static_cast<size_t>(basic_info.avail_cpus);
X #endif // OS_MACOSX
X
X-#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NACL)
X+#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NACL) || defined(OS_NETBSD)
X // Not implemented
X return 1;
X-#endif // OS_LINUX
X+#endif // OS_LINUX || OS_ANDROID || OS_NACL || OS_NETBSD
X }
X } // namespace mozc
END-of-mozc-server/patches/patch-base_cpu__stats.cc
echo x - mozc-server/patches/patch-base_logging.cc
sed 's/^X//' >mozc-server/patches/patch-base_logging.cc << 'END-of-mozc-server/patches/patch-base_logging.cc'
X$NetBSD: patch-base_logging.cc,v 1.4 2016/05/16 11:51:49 ryoon Exp $
X
X* NetBSD support
X
X--- base/logging.cc.orig 2016-05-15 08:11:10.000000000 +0000
X+++ base/logging.cc
X@@ -61,6 +61,10 @@
X #include "base/mutex.h"
X #include "base/singleton.h"
X
X+#if defined(OS_NETBSD)
X+#include <lwp.h>
X+#endif
X+
X DEFINE_bool(colored_log, true, "Enables colored log messages on tty devices");
X DEFINE_bool(logtostderr,
X false,
X@@ -102,7 +106,7 @@ string Logging::GetLogMessageHeader() {
X "%4.4d-%2.2d-%2.2d %2.2d:%2.2d:%2.2d %u "
X #if defined(OS_NACL)
X "%p",
X-#elif defined(OS_LINUX)
X+#elif defined(OS_LINUX) || defined(OS_NETBSD)
X "%lu",
X #elif defined(OS_MACOSX) && defined(__LP64__)
X "%llu",
X@@ -129,6 +133,9 @@ string Logging::GetLogMessageHeader() {
X ::getpid(),
X // pthread_self() returns __nc_basic_thread_data*.
X static_cast<void*>(pthread_self())
X+#elif defined(OS_NETBSD)
X+ ::getpid(),
X+ (unsigned long)_lwp_self()
X #else // = OS_LINUX
X ::getpid(),
X // It returns unsigned long.
END-of-mozc-server/patches/patch-base_logging.cc
echo x - mozc-server/patches/patch-base_mutex.cc
sed 's/^X//' >mozc-server/patches/patch-base_mutex.cc << 'END-of-mozc-server/patches/patch-base_mutex.cc'
X$NetBSD: patch-base_mutex.cc,v 1.4 2016/05/16 11:51:49 ryoon Exp $
X
X* NetBSD support
X
X--- base/mutex.cc.orig 2017-11-02 13:32:45.000000000 +0000
X+++ base/mutex.cc
X@@ -53,7 +53,7 @@ namespace mozc {
X
X // Wrapper for Windows InterlockedCompareExchange
X namespace {
X-#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NACL)
X+#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NACL) || defined(OS_NETBSD)
X // Linux doesn't provide InterlockedCompareExchange-like function.
X inline int InterlockedCompareExchange(volatile int *target,
X int new_value,
X@@ -72,7 +72,7 @@ inline int InterlockedCompareExchange(vo
X pthread_mutex_unlock(&lock);
X return result;
X }
X-#endif // OS_LINUX || OS_ANDROID || OS_NACL
X+#endif // OS_LINUX || OS_ANDROID || OS_NACL || OS_NETBSD
X
X // Use OSAtomicCompareAndSwapInt on Mac OSX
X // https://developer.apple.com/library/prerelease/mac/documentation/Darwin/Reference/ManPages/man3/OSAtomicCompareAndSwapInt.3.html
X@@ -84,7 +84,7 @@ inline int InterlockedCompareExchange(vo
X return OSAtomicCompareAndSwapInt(old_value, new_value, target)
X ? old_value : *target;
X }
X-#endif // OX_MACOSX
X+#endif // OS_MACOSX
X
X } // namespace
X
X@@ -182,7 +182,7 @@ Mutex::Mutex() {
X // PTHREAD_MUTEX_RECURSIVE_NP but Mac OS X 10.5 does not
X pthread_mutexattr_t attr;
X pthread_mutexattr_init(&attr);
X-#if defined(OS_MACOSX)
X+#if defined(OS_MACOSX) || defined(OS_NETBSD)
X pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
X #elif defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NACL)
X pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE_NP);
END-of-mozc-server/patches/patch-base_mutex.cc
echo x - mozc-server/patches/patch-base_mutex.h
sed 's/^X//' >mozc-server/patches/patch-base_mutex.h << 'END-of-mozc-server/patches/patch-base_mutex.h'
X$NetBSD: patch-base_mutex.h,v 1.2 2016/05/16 11:51:49 ryoon Exp $
X
X* First chunk, NetBSD ILP32 ports seem to require larger mutex array size.
X* I am not sure.
X
X--- base/mutex.h.orig 2016-05-15 08:11:10.000000000 +0000
X+++ base/mutex.h
X@@ -50,8 +50,8 @@ namespace mozc {
X // To remove dependencies against plafrom specific headers such as
X // <Windows.h> or <pthread.h>, we use an array of pointers as an opaque buffer
X // where platform specific mutex structure will be placed.
X-#if defined(OS_MACOSX)
X-// Mac requires relatively large buffer for pthread mutex object.
X+#if defined(OS_MACOSX) || defined(OS_NETBSD)
X+// Mac and NetBSD requires relatively large buffer for pthread mutex object.
X #define MOZC_MUTEX_PTR_ARRAYSIZE 11
X #define MOZC_RW_MUTEX_PTR_ARRAYSIZE 32
X #else
END-of-mozc-server/patches/patch-base_mutex.h
echo x - mozc-server/patches/patch-base_password__manager.cc
sed 's/^X//' >mozc-server/patches/patch-base_password__manager.cc << 'END-of-mozc-server/patches/patch-base_password__manager.cc'
X$NetBSD: patch-base_password__manager.cc,v 1.3 2016/05/16 11:51:49 ryoon Exp $
X
X* NetBSD support
X
X--- base/password_manager.cc.orig 2016-05-15 08:11:10.000000000 +0000
X+++ base/password_manager.cc
X@@ -264,9 +264,9 @@ bool WinMacPasswordManager::RemovePasswo
X // We use plain text file for password storage on Linux. If you port this module
X // to other Linux distro, you might want to implement a new password manager
X // which adopts some secure mechanism such like gnome-keyring.
X-#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NACL)
X+#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NACL) || defined(OS_NETBSD)
X typedef PlainPasswordManager DefaultPasswordManager;
X-#endif // OS_LINUX || OS_ANDROID || OS_NACL
X+#endif // OS_LINUX || OS_ANDROID || OS_NACL || OS_NETBSD
X
X // Windows or Mac
X #if (defined(OS_WIN) || defined(OS_MACOSX))
END-of-mozc-server/patches/patch-base_password__manager.cc
echo x - mozc-server/patches/patch-base_port.h
sed 's/^X//' >mozc-server/patches/patch-base_port.h << 'END-of-mozc-server/patches/patch-base_port.h'
X$NetBSD: patch-base_port.h,v 1.3 2016/05/16 11:51:49 ryoon Exp $
X
X* NetBSD support
X* kludge to build with gcc45
X
X--- base/port.h.orig 2017-11-02 13:32:45.000000000 +0000
X+++ base/port.h
X@@ -56,6 +56,9 @@
X #endif // !OS_ANDROID && !OS_NACL
X #endif // OS_LINUX
X
X+#ifdef OS_NETBSD
X+#define MOZC_OS_DEFINED
X+#endif // OS_NETBSD
X
X #ifndef MOZC_OS_DEFINED
X #error "OS_XXX (e.g., OS_WIN) must be defined."
X@@ -154,4 +157,9 @@ static const int64 kint64max = (( int6
X #define AS_STRING(x) AS_STRING_INTERNAL(x)
X #define AS_STRING_INTERNAL(x) #x
X
X+// gcc>=46 has nullptr, otherwise use __null instead.
X+#if __cplusplus < 201103L && !defined(__clang__) && defined(__GNUC__) && __GNUC__ * 1000 + __GNUC__MINOR__ < 4006
X+#define nullptr __null
X+#endif
X+
X #endif // MOZC_BASE_PORT_H_
END-of-mozc-server/patches/patch-base_port.h
echo x - mozc-server/patches/patch-base_process.cc
sed 's/^X//' >mozc-server/patches/patch-base_process.cc << 'END-of-mozc-server/patches/patch-base_process.cc'
X$NetBSD: patch-base_process.cc,v 1.4 2016/05/16 11:51:49 ryoon Exp $
X
X* NetBSD support
X
X--- base/process.cc.orig 2017-11-02 13:32:45.000000000 +0000
X+++ base/process.cc
X@@ -44,12 +44,12 @@
X #include "base/mac_process.h"
X #endif // OS_MACOSX
X
X-#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NACL)
X+#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NACL) || defined(OS_NETBSD)
X #include <fcntl.h>
X #include <signal.h>
X #include <spawn.h> // for posix_spawn().
X #include <sys/types.h>
X-#endif // OS_LINUX || OS_ANDROID || OS_NACL
X+#endif // OS_LINUX || OS_ANDROID || OS_NACL || OS_NETBSD
X
X #include <cstdlib>
X #include <memory>
X@@ -96,12 +96,12 @@ bool Process::OpenBrowser(const string &
X return WinUtil::ShellExecuteInSystemDir(L"open", wurl.c_str(), nullptr);
X #endif
X
X-#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NACL)
X- static const char kBrowserCommand[] = "/usr/bin/xdg-open";
X+#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NACL) || defined(OS_NETBSD)
X+ static const char kBrowserCommand[] = "@PREFIX@/bin/xdg-open";
X // xdg-open which uses kfmclient or gnome-open internally works both on KDE
X // and GNOME environments.
X return SpawnProcess(kBrowserCommand, url);
X-#endif // OS_LINUX || OS_ANDROID || OS_NACL
X+#endif // OS_LINUX || OS_ANDROID || OS_NACL || OS_NETBSD
X
X #ifdef OS_MACOSX
X return MacProcess::OpenBrowserForMac(url);
X@@ -180,7 +180,7 @@ bool Process::SpawnProcess(const string
X }
X #endif
X
X-#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NACL)
X+#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NACL) || defined(OS_NETBSD)
X // Do not call posix_spawn() for obviously bad path.
X if (!S_ISREG(statbuf.st_mode)) {
X LOG(ERROR) << "Not a regular file: " << path;
X@@ -203,7 +203,7 @@ bool Process::SpawnProcess(const string
X // (www.gnu.org/software/libc/manual/html_node/Heap-Consistency-Checking.html)
X const int kOverwrite = 0; // Do not overwrite.
X ::setenv("MALLOC_CHECK_", "2", kOverwrite);
X-#endif // OS_LINUX || OS_ANDROID || OS_NACL
X+#endif // OS_LINUX || OS_ANDROID || OS_NACL || OS_NETBSD
X pid_t tmp_pid = 0;
X
X // Spawn new process.
X@@ -374,7 +374,7 @@ bool Process::LaunchErrorMessageDialog(c
X }
X #endif // OS_WIN
X
X-#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NACL)
X+#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NACL) || defined(OS_NETBSD)
X const char kMozcTool[] = "mozc_tool";
X const string arg = "--mode=error_message_dialog --error_type=" + error_type;
X size_t pid = 0;
X@@ -382,7 +382,7 @@ bool Process::LaunchErrorMessageDialog(c
X LOG(ERROR) << "cannot launch " << kMozcTool;
X return false;
X }
X-#endif // OS_LINUX || OS_ANDROID || OS_NACL
X+#endif // OS_LINUX || OS_ANDROID || OS_NACL || OS_NETBSD
X
X return true;
X }
END-of-mozc-server/patches/patch-base_process.cc
echo x - mozc-server/patches/patch-base_run__level.cc
sed 's/^X//' >mozc-server/patches/patch-base_run__level.cc << 'END-of-mozc-server/patches/patch-base_run__level.cc'
X$NetBSD: patch-base_run__level.cc,v 1.4 2016/05/16 11:51:49 ryoon Exp $
X
X* NetBSD support
X
X--- base/run_level.cc.orig 2016-05-15 08:11:10.000000000 +0000
X+++ base/run_level.cc
X@@ -38,10 +38,10 @@
X #include <unistd.h>
X #endif // OS_MACOSX
X
X-#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NACL)
X+#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NACL) || defined(OS_NETBSD)
X #include <unistd.h>
X #include <sys/types.h>
X-#endif // OS_LINUX || OS_ANDROID || OS_NACL
X+#endif // OS_LINUX || OS_ANDROID || OS_NACL || OS_NETBSD
X
X #include "base/const.h"
X #include "base/logging.h"
END-of-mozc-server/patches/patch-base_run__level.cc
echo x - mozc-server/patches/patch-base_system__util.cc
sed 's/^X//' >mozc-server/patches/patch-base_system__util.cc << 'END-of-mozc-server/patches/patch-base_system__util.cc'
X$NetBSD: patch-base_system__util.cc,v 1.4 2016/05/16 11:51:49 ryoon Exp $
X
X* NetBSD support
X
X--- base/system_util.cc.orig 2017-11-02 13:32:45.000000000 +0000
X+++ base/system_util.cc
X@@ -372,7 +372,7 @@ string SystemUtil::GetServerDirectory()
X #elif defined(OS_MACOSX)
X return MacUtil::GetServerDirectory();
X
X-#elif defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NACL)
X+#elif defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NACL) || defined(OS_NETBSD)
X #if defined(MOZC_SERVER_DIRECTORY)
X return MOZC_SERVER_DIRECTORY;
X #else
X@@ -450,7 +450,7 @@ string SystemUtil::GetUserNameAsString()
X return ppw->pw_name;
X
X #else // OS_ANDROID
X- // OS_MACOSX, OS_LINUX or OS_NACL
X+ // OS_MACOSX, OS_LINUX, OS_NACL or OS_NETBSD
X struct passwd pw, *ppw;
X char buf[1024];
X CHECK_EQ(0, getpwuid_r(geteuid(), &pw, buf, sizeof(buf), &ppw));
X@@ -610,7 +610,7 @@ string GetSessionIdString() {
X #endif // OS_WIN
X
X string SystemUtil::GetDesktopNameAsString() {
X-#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NACL)
X+#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NACL) || defined(OS_NETBSD)
X const char *display = getenv("DISPLAY");
X if (display == NULL) {
X return "";
X@@ -812,6 +812,9 @@ string SystemUtil::GetOSVersionString()
X #elif defined(OS_LINUX) || defined(OS_NACL)
X const string ret = "Linux";
X return ret;
X+#elif defined(OS_NETBSD)
X+ const string ret = "NetBSD";
X+ return ret;
X #else // !OS_WIN && !OS_MACOSX && !OS_LINUX
X const string ret = "Unknown";
X return ret;
X@@ -847,7 +850,7 @@ uint64 SystemUtil::GetTotalPhysicalMemor
X return 0;
X }
X return total_memory;
X-#elif defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NACL)
X+#elif defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NACL) || defined(OS_NETBSD)
X #if defined(_SC_PAGESIZE) && defined(_SC_PHYS_PAGES)
X const long page_size = sysconf(_SC_PAGESIZE);
X const long number_of_phyisical_pages = sysconf(_SC_PHYS_PAGES);
X@@ -862,7 +865,7 @@ uint64 SystemUtil::GetTotalPhysicalMemor
X #endif // defined(_SC_PAGESIZE) && defined(_SC_PHYS_PAGES)
X #else // !(defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX))
X #error "unknown platform"
X-#endif // OS_WIN, OS_MACOSX, OS_LINUX
X+#endif // OS_WIN, OS_MACOSX, OS_LINUX, OS_NETBSD
X }
X
X } // namespace mozc
END-of-mozc-server/patches/patch-base_system__util.cc
echo x - mozc-server/patches/patch-base_thread.cc
sed 's/^X//' >mozc-server/patches/patch-base_thread.cc << 'END-of-mozc-server/patches/patch-base_thread.cc'
X$NetBSD$
X
X* tweak for NetBSD pthread_setname_np(3)
X
X--- base/thread.cc.orig 2017-11-02 13:32:45.000000000 +0000
X+++ base/thread.cc
X@@ -145,9 +145,11 @@ void Thread::Start(const string &thread_
X // NaCl doesn't support setname.
X #elif defined(OS_MACOSX)
X pthread_setname_np(thread_name.c_str());
X-#else // !(OS_NACL | OS_MACOSX)
X+#elif defined(OS_NETBSD)
X+ pthread_setname_np(*state_->handle_, "%s", (void *)thread_name.c_str());
X+#else // !(OS_NACL | OS_MACOSX | OS_NETBSD)
X pthread_setname_np(*state_->handle_, thread_name.c_str());
X-#endif // !(OS_NACL | OS_MACOSX)
X+#endif // !(OS_NACL | OS_MACOSX | OS_NETBSD)
X }
X }
X
END-of-mozc-server/patches/patch-base_thread.cc
echo x - mozc-server/patches/patch-build__mozc.py
sed 's/^X//' >mozc-server/patches/patch-build__mozc.py << 'END-of-mozc-server/patches/patch-build__mozc.py'
X$NetBSD: patch-build__mozc.py,v 1.8 2016/05/16 11:51:49 ryoon Exp $
X
X* NetBSD support
X
X--- build_mozc.py.orig 2017-11-02 13:32:45.000000000 +0000
X+++ build_mozc.py
X@@ -58,6 +58,7 @@ from build_tools.util import GetNumberOf
X from build_tools.util import GetRelPath
X from build_tools.util import IsLinux
X from build_tools.util import IsMac
X+from build_tools.util import IsNetBSD
X from build_tools.util import IsWindows
X from build_tools.util import PrintErrorAndExit
X from build_tools.util import RemoveDirectoryRecursively
X@@ -102,6 +103,7 @@ def GetBuildShortBaseName(target_platfor
X 'Windows': 'out_win',
X 'Mac': 'out_mac',
X 'Linux': 'out_linux',
X+ 'NetBSD': 'out_bsd',
X 'Android': 'out_android',
X 'NaCl': 'out_nacl'
X }
X@@ -179,6 +181,12 @@ def GetGypFileNames(options):
X elif options.target_platform == 'Android':
X # Add Android Mozc gyp scripts.
X gyp_file_names.extend(glob.glob('%s/android/*/*.gyp' % SRC_DIR))
X+ elif options.target_platform == 'NetBSD':
X+ gyp_file_names.extend(glob.glob('%s/unix/*/*.gyp' % SRC_DIR))
X+ # Add ibus.gyp if ibus version is >=1.4.1.
X+ if not PkgExists('ibus-1.0 >= 1.4.1'):
X+ logging.info('removing ibus.gyp.')
X+ gyp_file_names.remove('%s/unix/ibus/ibus.gyp' % SRC_DIR)
X gyp_file_names.sort()
X return gyp_file_names
X
X@@ -243,6 +251,8 @@ def AddTargetPlatformOption(parser):
X # If you want Android build, specify "Android".
X if IsLinux():
X default_target = 'Linux'
X+ if IsNetBSD():
X+ default_target = 'NetBSD'
X elif IsWindows():
X default_target = 'Windows'
X elif IsMac():
X@@ -410,6 +420,12 @@ def ExpandMetaTarget(options, meta_targe
X SRC_DIR + '/gui/gui.gyp:mozc_tool']
X if PkgExists('ibus-1.0 >= 1.4.1'):
X targets.append(SRC_DIR + '/unix/ibus/ibus.gyp:ibus_mozc')
X+ elif target_platform == 'NetBSD':
X+ targets = [SRC_DIR + '/server/server.gyp:mozc_server',
X+ SRC_DIR + '/renderer/renderer.gyp:mozc_renderer',
X+ SRC_DIR + '/gui/gui.gyp:mozc_tool']
X+ if PkgExists('ibus-1.0 >= 1.4.1'):
X+ targets.append(SRC_DIR + '/unix/ibus/ibus.gyp:ibus_mozc')
X elif target_platform == 'Mac':
X targets = [SRC_DIR + '/mac/mac.gyp:DiskImage']
X elif target_platform == 'Windows':
X@@ -585,7 +601,8 @@ def GypMain(options, unused_args):
X if options.noqt or target_platform in ['Android', 'NaCl']:
X gyp_options.extend(['-D', 'use_qt=NO'])
X gyp_options.extend(['-D', 'qt_dir='])
X- elif target_platform == 'Linux':
X+ elif (target_platform == 'Linux' or
X+ target_platform == 'NetBSD'):
X gyp_options.extend(['-D', 'use_qt=YES'])
X gyp_options.extend(['-D', 'qt_dir='])
X
X@@ -607,7 +624,8 @@ def GypMain(options, unused_args):
X else:
X gyp_options.extend(['-D', 'use_wix=NO'])
X
X- if target_platform == 'Linux':
X+ if (target_platform == 'Linux' or
X+ target_platform == 'NetBSD'):
X gyp_options.extend(['-D', 'enable_gtk_renderer=1'])
X
X # Android
X@@ -653,7 +671,8 @@ def GypMain(options, unused_args):
X gyp_options.extend(['-D', 'channel_dev=1'])
X
X def SetCommandLineForFeature(option_name, windows=False, mac=False,
X- linux=False, android=False, nacl=False):
X+ linux=False, android=False, nacl=False,
X+ netbsd=False):
X """Updates an option like '--enable_foober' and add a -D argument for gyp.
X
X This function ensures an option like '--enable_foober' exists and it has a
X@@ -675,6 +694,8 @@ def GypMain(options, unused_args):
X option on Android platform.
X nacl: A boolean which replesents the default value of the target
X option on NaCl.
X+ netbsd: A boolean which replesents the default value of the target option
X+ on NetBSD platform.
X
X Raises:
X ValueError: An error occurred when 'option_name' is empty.
X@@ -685,6 +706,7 @@ def GypMain(options, unused_args):
X default_enabled = {'Windows': windows,
X 'Mac': mac,
X 'Linux': linux,
X+ 'NetBSD': netbsd,
X 'Android': android,
X 'NaCl': nacl}.get(target_platform, False)
X enable_option_name = 'enable_%s' % option_name
X@@ -697,6 +719,7 @@ def GypMain(options, unused_args):
X
X SetCommandLineForFeature(option_name='cloud_handwriting',
X linux=is_official_dev,
X+ netbsd=is_official_dev,
X windows=is_official_dev,
X mac=is_official_dev)
X
X@@ -706,7 +729,8 @@ def GypMain(options, unused_args):
X if IsWindows():
X gyp_options.extend(['-G', 'msvs_version=2015'])
X
X- if (target_platform == 'Linux' and
X+ if ((target_platform == 'Linux' or
X+ target_platform == 'NetBSD') and
X '%s/unix/ibus/ibus.gyp' % SRC_DIR in gyp_file_names):
X gyp_options.extend(['-D', 'use_libibus=1'])
X
X@@ -1163,7 +1187,7 @@ def CleanMain(options, unused_args):
X if build_base:
X directory_names.append(build_base)
X
X- if IsLinux():
X+ if IsLinux() or IsNetBSD():
X # Remove auto-generated files.
X file_names.append(os.path.join(SRC_DIR, 'android', 'AndroidManifest.xml'))
X file_names.append(os.path.join(
END-of-mozc-server/patches/patch-build__mozc.py
echo x - mozc-server/patches/patch-build__tools_mozc__version.py
sed 's/^X//' >mozc-server/patches/patch-build__tools_mozc__version.py << 'END-of-mozc-server/patches/patch-build__tools_mozc__version.py'
X$NetBSD: patch-build__tools_mozc__version.py,v 1.2 2014/01/19 01:18:50 ryoon Exp $
X
X* NetBSD support
X
X--- build_tools/mozc_version.py.orig 2014-01-06 07:10:26.000000000 +0000
X+++ build_tools/mozc_version.py
X@@ -64,6 +64,7 @@ TARGET_PLATFORM_TO_DIGIT = {
X 'Linux': '2',
X 'Android': '3',
X 'NaCl': '4',
X+ 'NetBSD': '5',
X }
X
X VERSION_PROPERTIES = [
END-of-mozc-server/patches/patch-build__tools_mozc__version.py
echo x - mozc-server/patches/patch-build__tools_util.py
sed 's/^X//' >mozc-server/patches/patch-build__tools_util.py << 'END-of-mozc-server/patches/patch-build__tools_util.py'
X$NetBSD: patch-build__tools_util.py,v 1.4 2016/05/16 11:51:49 ryoon Exp $
X
X* NetBSD support
X
X--- build_tools/util.py.orig 2016-05-15 08:11:10.000000000 +0000
X+++ build_tools/util.py
X@@ -59,6 +59,11 @@ def IsLinux():
X return os.name == 'posix' and os.uname()[0] == 'Linux'
X
X
X+def IsNetBSD():
X+ """Returns true if the platform is NetBSD."""
X+ return os.name == 'posix' and os.uname()[0] == 'NetBSD'
X+
X+
X def GetNumberOfProcessors():
X """Returns the number of CPU cores available.
X
END-of-mozc-server/patches/patch-build__tools_util.py
echo x - mozc-server/patches/patch-client_client.cc
sed 's/^X//' >mozc-server/patches/patch-client_client.cc << 'END-of-mozc-server/patches/patch-client_client.cc'
X$NetBSD: patch-client_client.cc,v 1.2 2016/05/16 11:51:49 ryoon Exp $
X
X* NetBSD support
X
X--- client/client.cc.orig 2016-05-15 08:11:10.000000000 +0000
X+++ client/client.cc
X@@ -891,7 +891,7 @@ bool Client::LaunchTool(const string &mo
X }
X
X #if defined(OS_WIN) || defined(OS_LINUX) || defined(OS_ANDROID)\
X- || defined(OS_NACL)
X+ || defined(OS_NACL) || defined(OS_NETBSD)
X string arg = "--mode=" + mode;
X if (!extra_arg.empty()) {
X arg += " ";
X@@ -901,7 +901,7 @@ bool Client::LaunchTool(const string &mo
X LOG(ERROR) << "Cannot execute: " << kMozcTool << " " << arg;
X return false;
X }
X-#endif // OS_WIN || OS_LINUX || OS_ANDROID || OS_NACL
X+#endif // OS_WIN || OS_LINUX || OS_ANDROID || OS_NACL || OS_NETBSD
X
X // TODO(taku): move MacProcess inside SpawnMozcProcess.
X // TODO(taku): support extra_arg.
END-of-mozc-server/patches/patch-client_client.cc
echo x - mozc-server/patches/patch-config_stats__config__util__test.cc
sed 's/^X//' >mozc-server/patches/patch-config_stats__config__util__test.cc << 'END-of-mozc-server/patches/patch-config_stats__config__util__test.cc'
X$NetBSD: patch-config_stats__config__util__test.cc,v 1.2 2016/05/16 11:51:49 ryoon Exp $
X
X* NetBSD support
X
X--- config/stats_config_util_test.cc.orig 2016-05-15 08:11:10.000000000 +0000
X+++ config/stats_config_util_test.cc
X@@ -696,11 +696,11 @@ TEST(StatsConfigUtilTestAndroid, Default
X }
X #endif // OS_ANDROID
X
X-#if defined(OS_LINUX) || defined(OS_NACL)
X+#if defined(OS_LINUX) || defined(OS_NACL) || defined(OS_NETBSD)
X TEST(StatsConfigUtilTestLinux, DefaultValueTest) {
X EXPECT_FALSE(StatsConfigUtil::IsEnabled());
X }
X-#endif // OS_LINUX || OS_NACL
X+#endif // OS_LINUX || OS_NACL || OS_NETBSD
X
X #else // !GOOGLE_JAPANESE_INPUT_BUILD
X TEST(StatsConfigUtilTestNonOfficialBuild, DefaultValueTest) {
END-of-mozc-server/patches/patch-config_stats__config__util__test.cc
echo x - mozc-server/patches/patch-gui_config__dialog_config__dialog.cc
sed 's/^X//' >mozc-server/patches/patch-gui_config__dialog_config__dialog.cc << 'END-of-mozc-server/patches/patch-gui_config__dialog_config__dialog.cc'
X$NetBSD: patch-gui_config__dialog_config__dialog.cc,v 1.5 2016/05/16 11:51:49 ryoon Exp $
X
X* NetBSD support
X
X--- gui/config_dialog/config_dialog.cc.orig 2016-05-15 08:11:11.000000000 +0000
X+++ gui/config_dialog/config_dialog.cc
X@@ -100,21 +100,21 @@ ConfigDialog::ConfigDialog()
X setWindowTitle(tr("Mozc Preferences"));
X #endif // OS_MACOSX
X
X-#if defined(OS_LINUX)
X+#if defined(OS_LINUX) || defined(OS_NETBSD)
X miscDefaultIMEWidget->setVisible(false);
X miscAdministrationWidget->setVisible(false);
X miscStartupWidget->setVisible(false);
X-#endif // OS_LINUX
X+#endif // OS_LINUX || OS_NETBSD
X
X #ifdef NO_LOGGING
X // disable logging options
X miscLoggingWidget->setVisible(false);
X
X-#if defined(OS_LINUX)
X+#if defined(OS_LINUX) || defined(OS_NETBSD)
X // The last "misc" tab has no valid configs on Linux
X const int kMiscTabIndex = 6;
X configDialogTabWidget->removeTab(kMiscTabIndex);
X-#endif // OS_LINUX
X+#endif // OS_LINUX || OS_NETBSD
X #endif // NO_LOGGING
X
X #ifndef ENABLE_CLOUD_HANDWRITING
X@@ -324,7 +324,7 @@ ConfigDialog::ConfigDialog()
X dictionaryPreloadingAndUACLabel->setVisible(false);
X #endif // OS_WIN
X
X-#ifdef OS_LINUX
X+#if defined(OS_LINUX) || defined(OS_NETBSD)
X // On Linux, disable all fields for UsageStats
X usageStatsLabel->setEnabled(false);
X usageStatsLabel->setVisible(false);
X@@ -334,7 +334,7 @@ ConfigDialog::ConfigDialog()
X usageStatsMessage->setVisible(false);
X usageStatsCheckBox->setEnabled(false);
X usageStatsCheckBox->setVisible(false);
X-#endif // OS_LINUX
X+#endif // OS_LINUX || OS_NETBSD
X
X Reload();
X
END-of-mozc-server/patches/patch-gui_config__dialog_config__dialog.cc
echo x - mozc-server/patches/patch-gui_config__dialog_keybinding__editor.cc
sed 's/^X//' >mozc-server/patches/patch-gui_config__dialog_keybinding__editor.cc << 'END-of-mozc-server/patches/patch-gui_config__dialog_keybinding__editor.cc'
X$NetBSD: patch-gui_config__dialog_keybinding__editor.cc,v 1.2 2016/05/16 11:51:49 ryoon Exp $
X
X* NetBSD support
X
X--- gui/config_dialog/keybinding_editor.cc.orig 2017-11-02 13:32:47.000000000 +0000
X+++ gui/config_dialog/keybinding_editor.cc
X@@ -37,7 +37,7 @@
X #include <windows.h>
X #include <imm.h>
X #include <ime.h>
X-#elif OS_LINUX
X+#elif defined(OS_LINUX) || defined(OS_NETBSD)
X #define XK_MISCELLANY
X #include <X11/keysymdef.h>
X #endif
X@@ -128,7 +128,7 @@ const WinVirtualKeyEntry kWinVirtualKeyM
X { VK_DBE_DBCSCHAR, "Hankaku/Zenkaku" }, // Zenkaku/hankaku
X // { VK_KANJI, "Kanji" }, // Do not support Kanji
X };
X-#elif OS_LINUX
X+#elif defined(OS_LINUX) || defined(OS_NETBSD)
X struct LinuxVirtualKeyEntry {
X uint16 virtual_key;
X const char *mozc_key_name;
X@@ -397,7 +397,7 @@ KeyBindingFilter::KeyState KeyBindingFil
X return Encode(result);
X }
X }
X-#elif OS_LINUX
X+#elif defined(OS_LINUX) || defined(OS_NETBSD)
X const uint16 virtual_key = key_event.nativeVirtualKey();
X
X // The XKB defines three types of logical key code: "xkb::Hiragana",
X@@ -507,7 +507,7 @@ bool KeyBindingFilter::eventFilter(QObje
X KeyBindingEditor::KeyBindingEditor(QWidget *parent, QWidget *trigger_parent)
X : QDialog(parent), trigger_parent_(trigger_parent) {
X setupUi(this);
X-#if defined(OS_LINUX)
X+#if defined(OS_LINUX) || defined(OS_NETBSD)
X // Workaround for the issue https://github.com/google/mozc/issues/9
X // Seems that even after clicking the button for the keybinding dialog,
X // the edit is not raised. This might be a bug of setFocusProxy.
END-of-mozc-server/patches/patch-gui_config__dialog_keybinding__editor.cc
echo x - mozc-server/patches/patch-gui_dictionary__tool_dictionary__tool.cc
sed 's/^X//' >mozc-server/patches/patch-gui_dictionary__tool_dictionary__tool.cc << 'END-of-mozc-server/patches/patch-gui_dictionary__tool_dictionary__tool.cc'
X$NetBSD: patch-gui_dictionary__tool_dictionary__tool.cc,v 1.5 2014/06/15 13:08:34 ryoon Exp $
X
X* NetBSD support
X
X--- gui/dictionary_tool/dictionary_tool.cc.orig 2014-05-21 10:51:22.000000000 +0000
X+++ gui/dictionary_tool/dictionary_tool.cc
X@@ -347,7 +347,7 @@ DictionaryTool::DictionaryTool(QWidget *
X #endif // !ENABLE_CLOUD_SYNC
X
X // main window
X-#ifndef OS_LINUX
X+#if !defined(OS_LINUX) && !defined(OS_NETBSD)
X // For some reason setCentralWidget crashes the dictionary_tool on Linux
X // TODO(taku): investigate the cause of the crashes
X setCentralWidget(splitter_);
END-of-mozc-server/patches/patch-gui_dictionary__tool_dictionary__tool.cc
echo x - mozc-server/patches/patch-gui_qt__libraries.gypi
sed 's/^X//' >mozc-server/patches/patch-gui_qt__libraries.gypi << 'END-of-mozc-server/patches/patch-gui_qt__libraries.gypi'
X$NetBSD: patch-gui_qt__libraries.gypi,v 1.3 2014/06/15 13:08:34 ryoon Exp $
X
X* NetBSD support
X
X--- gui/qt_libraries.gypi.orig 2017-11-02 13:32:47.000000000 +0000
X+++ gui/qt_libraries.gypi
X@@ -98,7 +98,7 @@
X '$(SDKROOT)/System/Library/Frameworks/Carbon.framework',
X ]
X }],
X- ['target_platform=="Linux"', {
X+ ['target_platform=="Linux" or target_platform=="NetBSD"', {
X 'cflags': ['<!@(pkg-config --cflags Qt5Widgets Qt5Gui Qt5Core)'],
X 'libraries': ['<!@(pkg-config --libs Qt5Widgets Qt5Gui Qt5Core)'],
X }],
END-of-mozc-server/patches/patch-gui_qt__libraries.gypi
echo x - mozc-server/patches/patch-gui_qt__moc.gypi
sed 's/^X//' >mozc-server/patches/patch-gui_qt__moc.gypi << 'END-of-mozc-server/patches/patch-gui_qt__moc.gypi'
X$NetBSD$
X
X* NetBSD support
X
X--- gui/qt_moc.gypi.orig 2017-11-02 13:32:47.000000000 +0000
X+++ gui/qt_moc.gypi
X@@ -33,7 +33,7 @@
X
X 'variables': {
X 'conditions': [
X- ['target_platform=="Linux"', {
X+ ['target_platform=="Linux" or target_platform=="NetBSD"', {
X 'moc_path': '<!(pkg-config --variable=host_bins Qt5Core)/moc',
X }, 'qt_dir', {
X 'moc_path': '<(qt_dir)/bin/moc<(EXECUTABLE_SUFFIX)',
END-of-mozc-server/patches/patch-gui_qt__moc.gypi
echo x - mozc-server/patches/patch-gui_qt__rcc.gypi
sed 's/^X//' >mozc-server/patches/patch-gui_qt__rcc.gypi << 'END-of-mozc-server/patches/patch-gui_qt__rcc.gypi'
X$NetBSD$
X
X* NetBSD support
X
X--- gui/qt_rcc.gypi.orig 2017-11-02 13:32:47.000000000 +0000
X+++ gui/qt_rcc.gypi
X@@ -33,7 +33,7 @@
X
X 'variables': {
X 'conditions': [
X- ['target_platform=="Linux"', {
X+ ['target_platform=="Linux" or target_platform=="NetBSD"', {
X 'rcc_path': '<!(pkg-config --variable=host_bins Qt5Core)/rcc',
X }, 'qt_dir', {
X 'rcc_path': '<(qt_dir)/bin/rcc<(EXECUTABLE_SUFFIX)',
END-of-mozc-server/patches/patch-gui_qt__rcc.gypi
echo x - mozc-server/patches/patch-gui_qt__uic.gypi
sed 's/^X//' >mozc-server/patches/patch-gui_qt__uic.gypi << 'END-of-mozc-server/patches/patch-gui_qt__uic.gypi'
X$NetBSD$
X
X* NetBSD support
X
X--- gui/qt_uic.gypi.orig 2017-11-02 13:32:47.000000000 +0000
X+++ gui/qt_uic.gypi
X@@ -33,7 +33,7 @@
X
X 'variables': {
X 'conditions': [
X- ['target_platform=="Linux"', {
X+ ['target_platform=="Linux" or target_platform=="NetBSD"', {
X 'uic_path': '<!(pkg-config --variable=host_bins Qt5Core)/uic',
X }, 'qt_dir', {
X 'uic_path': '<(qt_dir)/bin/uic<(EXECUTABLE_SUFFIX)',
END-of-mozc-server/patches/patch-gui_qt__uic.gypi
echo x - mozc-server/patches/patch-gui_word__register__dialog_word__register__dialog.cc
sed 's/^X//' >mozc-server/patches/patch-gui_word__register__dialog_word__register__dialog.cc << 'END-of-mozc-server/patches/patch-gui_word__register__dialog_word__register__dialog.cc'
X$NetBSD: patch-gui_word__register__dialog_word__register__dialog.cc,v 1.3 2016/05/16 11:51:49 ryoon Exp $
X
X* NetBSD support
X
X--- gui/word_register_dialog/word_register_dialog.cc.orig 2016-05-15 08:11:11.000000000 +0000
X+++ gui/word_register_dialog/word_register_dialog.cc
X@@ -90,9 +90,9 @@ QString GetEnv(const char *envname) {
X }
X return "";
X #endif // OS_WIN
X-#if defined(OS_MACOSX) || defined(OS_LINUX)
X+#if defined(OS_MACOSX) || defined(OS_LINUX) || defined(OS_NETBSD)
X return ::getenv(envname);
X-#endif // OS_MACOSX or OS_LINUX
X+#endif // OS_MACOSX, OS_LINUX or OS_NETBSD
X // TODO(team): Support other platforms.
X return "";
X }
END-of-mozc-server/patches/patch-gui_word__register__dialog_word__register__dialog.cc
echo x - mozc-server/patches/patch-gyp_common.gypi
sed 's/^X//' >mozc-server/patches/patch-gyp_common.gypi << 'END-of-mozc-server/patches/patch-gyp_common.gypi'
X$NetBSD: patch-gyp_common.gypi,v 1.8 2016/05/16 11:51:49 ryoon Exp $
X
X* NetBSD support
X
X--- gyp/common.gypi.orig 2017-11-02 13:32:47.000000000 +0000
X+++ gyp/common.gypi
X@@ -88,6 +88,12 @@
X '-fstack-protector',
X '--param=ssp-buffer-size=4',
X ],
X+ # netbsd_cflags will be used for NetBSD.
X+ 'netbsd_cflags': [
X+ '<@(gcc_cflags)',
X+ '-fPIC',
X+ '-fno-exceptions',
X+ ],
X # nacl_cflags will be used for NaCl.
X # -fno-omit-frame-pointer flag does not work correctly.
X # http://code.google.com/p/chromium/issues/detail?id=122623
X@@ -133,6 +139,12 @@
X 'compiler_host': 'clang',
X 'compiler_host_version_int': 304, # Clang 3.4 or higher
X }],
X+ ['target_platform=="NetBSD"', {
X+ 'compiler_target': 'gcc',
X+ 'compiler_target_version_int': 409, # GCC 4.9 or higher
X+ 'compiler_host': 'clang',
X+ 'compiler_host_version_int': 304, # Clang 3.4 or higher
X+ }],
X ],
X },
X 'target_defaults': {
X@@ -371,6 +383,24 @@
X }],
X ],
X }],
X+ ['OS=="netbsd"', {
X+ 'defines': [
X+ 'OS_NETBSD',
X+ ],
X+ 'cflags': [
X+ '<@(netbsd_cflags)',
X+ '-fPIC',
X+ '-fno-exceptions',
X+ ],
X+ 'cflags_cc': [
X+ # We use deprecated <hash_map> and <hash_set> instead of upcoming
X+ # <unordered_map> and <unordered_set>.
X+ '-Wno-deprecated',
X+ ],
X+ 'ldflags': [
X+ '-pthread',
X+ ],
X+ }],
X ['OS=="mac"', {
X 'defines': [
X 'OS_MACOSX',
X@@ -442,7 +472,7 @@
X ['READELF.host', '<!(which readelf)'],
X ],
X }],
X- ['target_platform=="Linux"', {
X+ ['target_platform=="Linux" or target_platform=="NetBSD"', {
X 'make_global_settings': [
X ['AR', '<!(which ar)'],
X ['CC', '<!(which clang)'],
END-of-mozc-server/patches/patch-gyp_common.gypi
echo x - mozc-server/patches/patch-gyp_directories.gypi
sed 's/^X//' >mozc-server/patches/patch-gyp_directories.gypi << 'END-of-mozc-server/patches/patch-gyp_directories.gypi'
X$NetBSD$
X
X* use ${PREFIX} paths
X
X--- gyp/directories.gypi.orig 2017-11-02 13:32:47.000000000 +0000
X+++ gyp/directories.gypi
X@@ -42,7 +42,7 @@
X
X # server_dir represents the directory where mozc_server is
X # installed. This option is only for Linux.
X- 'server_dir%': '/usr/lib/mozc',
X+ 'server_dir%': '@PREFIX@/libexec',
X
X # Represents the directory where the source code of protobuf is
X # extracted. This value is ignored when 'use_libprotobuf' is 1.
X@@ -85,7 +85,7 @@
X # Win / Mac / Linux:
X # this file path is directory used by binaries without copying.
X 'zinnia_model_file%':
X- '/usr/share/tegaki/models/zinnia/handwriting-ja.model',
X+ '@PREFIX@/share/tegaki/models/zinnia/handwriting-ja.model',
X }],
X ],
X },
END-of-mozc-server/patches/patch-gyp_directories.gypi
echo x - mozc-server/patches/patch-handwriting_zinnia.gyp
sed 's/^X//' >mozc-server/patches/patch-handwriting_zinnia.gyp << 'END-of-mozc-server/patches/patch-handwriting_zinnia.gyp'
X$NetBSD: patch-handwriting_zinnia.gyp,v 1.2 2016/05/16 11:51:49 ryoon Exp $
X
X* NetBSD support
X
X--- handwriting/zinnia.gyp.orig 2017-11-02 13:32:47.000000000 +0000
X+++ handwriting/zinnia.gyp
X@@ -88,7 +88,7 @@
X 'ZINNIA_STATIC_LIBRARY',
X ],
X }],
X- ['target_platform=="Linux" or target_platform=="Mac"', {
X+ ['target_platform=="Linux" or target_platform=="Mac" or target_platform=="NetBSD"', {
X 'defines': [
X 'HAVE_CONFIG_H=1'
X ],
END-of-mozc-server/patches/patch-handwriting_zinnia.gyp
echo x - mozc-server/patches/patch-handwriting_zinnia__handwriting.cc
sed 's/^X//' >mozc-server/patches/patch-handwriting_zinnia__handwriting.cc << 'END-of-mozc-server/patches/patch-handwriting_zinnia__handwriting.cc'
X$NetBSD: patch-handwriting_zinnia__handwriting.cc,v 1.3 2016/05/16 11:51:49 ryoon Exp $
X
X* Not confirmed yet.
X
X--- handwriting/zinnia_handwriting.cc.orig 2017-11-02 13:32:47.000000000 +0000
X+++ handwriting/zinnia_handwriting.cc
X@@ -59,7 +59,7 @@ string ZinniaHandwriting::GetModelFileNa
X const char kModelFile[] = "handwriting-ja.model";
X return FileUtil::JoinPath(MacUtil::GetResourcesDirectory(), kModelFile);
X #else // OS_LINUX
X- return "/usr/share/tegaki/models/zinnia/handwriting-ja.model";
X+ return "@PREFIX@/tegaki/models/zinnia/handwriting-ja.model";
X #endif
X #endif // else defined(MOZC_BUILD)
X }
END-of-mozc-server/patches/patch-handwriting_zinnia__handwriting.cc
echo x - mozc-server/patches/patch-ipc_ipc__path__manager.cc
sed 's/^X//' >mozc-server/patches/patch-ipc_ipc__path__manager.cc << 'END-of-mozc-server/patches/patch-ipc_ipc__path__manager.cc'
X$NetBSD: patch-ipc_ipc__path__manager.cc,v 1.4 2014/01/19 01:18:50 ryoon Exp $
X
X* NetBSD support
X
X--- ipc/ipc_path_manager.cc.orig 2014-01-06 07:10:26.000000000 +0000
X+++ ipc/ipc_path_manager.cc
X@@ -44,6 +44,11 @@
X #endif // OS_MACOSX
X #endif // OS_WIN
X
X+#if defined(OS_NETBSD)
X+#include <sys/param.h>
X+#include <sys/sysctl.h>
X+#endif
X+
X #include <cstdlib>
X #include <map>
X #ifdef OS_WIN
X@@ -407,6 +412,23 @@ bool IPCPathManager::IsValidServer(uint3
X return true;
X }
X
X+#if defined(OS_NETBSD)
X+ int name[] = { CTL_KERN, KERN_PROC_ARGS, static_cast<int>(pid) };
X+ size_t data_len = 0;
X+ if (sysctl(name, arraysize(name), NULL,
X+ &data_len, NULL, 0) < 0) {
X+ LOG(ERROR) << "sysctl KERN_PROC_ARGS failed";
X+ return false;
X+ }
X+
X+ server_path_.resize(data_len);
X+ if (sysctl(name, arraysize(name), &server_path_[0],
X+ &data_len, NULL, 0) < 0) {
X+ LOG(ERROR) << "sysctl KERN_PROC_ARGS failed";
X+ return false;
X+ }
X+#endif // OS_NETBSD
X+
X #ifdef OS_LINUX
X if ((server_path + " (deleted)") == server_path_) {
X LOG(WARNING) << server_path << " on disk is modified";
END-of-mozc-server/patches/patch-ipc_ipc__path__manager.cc
echo x - mozc-server/patches/patch-ipc_ipc__path__manager__test.cc
sed 's/^X//' >mozc-server/patches/patch-ipc_ipc__path__manager__test.cc << 'END-of-mozc-server/patches/patch-ipc_ipc__path__manager__test.cc'
X$NetBSD: patch-ipc_ipc__path__manager__test.cc,v 1.2 2013/07/20 04:34:53 ryoon Exp $
X
X* NetBSD support
X
X--- ipc/ipc_path_manager_test.cc.orig 2013-07-17 02:37:50.000000000 +0000
X+++ ipc/ipc_path_manager_test.cc
X@@ -103,7 +103,7 @@ TEST_F(IPCPathManagerTest, IPCPathManage
X EXPECT_FALSE(manager->GetServerProductVersion().empty());
X EXPECT_GT(manager->GetServerProcessId(), 0);
X EXPECT_EQ(t.path(), path);
X-#ifdef OS_LINUX
X+#if defined(OS_LINUX) || defined(OS_NETBSD)
X // On Linux, |path| should be abstract (see man unix(7) for details.)
X ASSERT_FALSE(path.empty());
X EXPECT_EQ('\0', path[0]);
END-of-mozc-server/patches/patch-ipc_ipc__path__manager__test.cc
echo x - mozc-server/patches/patch-ipc_named__event.cc
sed 's/^X//' >mozc-server/patches/patch-ipc_named__event.cc << 'END-of-mozc-server/patches/patch-ipc_named__event.cc'
X$NetBSD: patch-ipc_named__event.cc,v 1.1 2013/04/29 09:52:17 ryoon Exp $
X
X* sem_open(..., 0) is not supported for NetBSD at least.
X
X--- ipc/named_event.cc.orig 2012-08-31 05:37:07.000000000 +0000
X+++ ipc/named_event.cc
X@@ -337,7 +337,7 @@ int NamedEventListener::WaitEventOrProce
X NamedEventNotifier::NamedEventNotifier(const char *name)
X : sem_(SEM_FAILED) {
X const string key_filename = NamedEventUtil::GetEventPath(name);
X- sem_ = ::sem_open(key_filename.c_str(), 0);
X+ sem_ = ::sem_open(key_filename.c_str(), O_CREAT);
X if (sem_ == SEM_FAILED) {
X LOG(ERROR) << "sem_open failed: " << ::strerror(errno);
X }
END-of-mozc-server/patches/patch-ipc_named__event.cc
echo x - mozc-server/patches/patch-ipc_unix__ipc.cc
sed 's/^X//' >mozc-server/patches/patch-ipc_unix__ipc.cc << 'END-of-mozc-server/patches/patch-ipc_unix__ipc.cc'
X$NetBSD: patch-ipc_unix__ipc.cc,v 1.4 2016/05/16 11:51:49 ryoon Exp $
X
X* NetBSD support
X
X--- ipc/unix_ipc.cc.orig 2016-05-15 08:11:11.000000000 +0000
X+++ ipc/unix_ipc.cc
X@@ -28,7 +28,7 @@
X // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
X
X // OS_LINUX only. Note that OS_ANDROID/OS_NACL don't reach here.
X-#if defined(OS_LINUX)
X+#if defined(OS_LINUX) || defined(OS_NETBSD)
X
X #include "ipc/ipc.h"
X
X@@ -127,7 +127,7 @@ bool IsPeerValid(int socket, pid_t *pid)
X // sometimes doesn't support the getsockopt(sock, SOL_SOCKET, SO_PEERCRED)
X // system call.
X // TODO(yusukes): Add implementation for ARM Linux.
X-#ifndef __arm__
X+#if !defined(__arm__) && !defined(OS_NETBSD)
X struct ucred peer_cred;
X int peer_cred_len = sizeof(peer_cred);
X if (getsockopt(socket, SOL_SOCKET, SO_PEERCRED,
X@@ -143,7 +143,23 @@ bool IsPeerValid(int socket, pid_t *pid)
X }
X
X *pid = peer_cred.pid;
X-#endif // __arm__
X+#endif // __arm__ || OS_NETBSD
X+
X+#if defined(OS_NETBSD)
X+ struct unpcbid peer_cred;
X+ int peer_cred_len = sizeof(peer_cred);
X+ if (getsockopt(socket, 0, LOCAL_PEEREID,
X+ reinterpret_cast<void *>(&peer_cred),
X+ reinterpret_cast<socklen_t *>(&peer_cred_len)) < 0) {
X+ LOG(ERROR) << "cannot get peer credential. Not a Unix socket?";
X+ return false;
X+ }
X+
X+ if (peer_cred.unp_euid!= ::geteuid()) {
X+ LOG(WARNING) << "uid mismatch." << peer_cred.unp_euid << "!=" << ::geteuid();
X+ return false;
X+ }
X+#endif
X
X return true;
X }
END-of-mozc-server/patches/patch-ipc_unix__ipc.cc
echo x - mozc-server/patches/patch-net_net.gyp
sed 's/^X//' >mozc-server/patches/patch-net_net.gyp << 'END-of-mozc-server/patches/patch-net_net.gyp'
X$NetBSD: patch-net_net.gyp,v 1.1 2013/04/29 09:52:18 ryoon Exp $
X
X* NetBSD support
X
X--- net/net.gyp.orig 2017-11-02 13:32:47.000000000 +0000
X+++ net/net.gyp
X@@ -64,7 +64,7 @@
X },
X },
X }],
X- ['target_platform=="Linux"', {
X+ ['target_platform=="Linux" or target_platform=="NetBSD"', {
X # Enable libcurl
X 'cflags': [
X '<!@(pkg-config --cflags libcurl)',
END-of-mozc-server/patches/patch-net_net.gyp
echo x - mozc-server/patches/patch-session_session.cc
sed 's/^X//' >mozc-server/patches/patch-session_session.cc << 'END-of-mozc-server/patches/patch-session_session.cc'
X$NetBSD: patch-session_session.cc,v 1.4 2016/05/16 11:51:49 ryoon Exp $
X
X* NetBSD support
X
X--- session/session.cc.orig 2016-05-15 08:11:12.000000000 +0000
X+++ session/session.cc
X@@ -232,9 +232,9 @@ void Session::InitContext(ImeContext *co
X
X context->SetConfig(&context->GetConfig());
X
X-#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NACL)
X+#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NACL) || defined(OS_NETBSD)
X context->mutable_converter()->set_use_cascading_window(false);
X-#endif // OS_LINUX || OS_ANDROID || OS_NACL
X+#endif // OS_LINUX || OS_ANDROID || OS_NACL || OS_NETBSD
X }
X
X
X@@ -961,14 +961,14 @@ void Session::UpdatePreferences(commands
X config.selection_shortcut());
X }
X
X-#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NACL)
X+#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NACL) || defined(OS_NETBSD)
X context_->mutable_converter()->set_use_cascading_window(false);
X-#else // OS_LINUX || OS_ANDROID || OS_NACL
X+#else // OS_LINUX || OS_ANDROID || OS_NACL || OS_NETBSD
X if (config.has_use_cascading_window()) {
X context_->mutable_converter()->set_use_cascading_window(
X config.use_cascading_window());
X }
X-#endif // OS_LINUX || OS_ANDROID || OS_NACL
X+#endif // OS_LINUX || OS_ANDROID || OS_NACL || OS_NETBSD
X }
X
X bool Session::IMEOn(commands::Command *command) {
END-of-mozc-server/patches/patch-session_session.cc
echo x - mozc-server/patches/patch-session_session__test.cc
sed 's/^X//' >mozc-server/patches/patch-session_session__test.cc << 'END-of-mozc-server/patches/patch-session_session__test.cc'
X$NetBSD: patch-session_session__test.cc,v 1.2 2016/05/16 11:51:49 ryoon Exp $
X
X* NetBSD support
X
X--- session/session_test.cc.orig 2016-05-15 08:11:12.000000000 +0000
X+++ session/session_test.cc
X@@ -2136,11 +2136,11 @@ TEST_F(SessionTest, UpdatePreferences) {
X const size_t cascading_cand_size =
X command.output().candidates().candidate_size();
X
X-#if defined(OS_LINUX) || defined(OS_ANDROID) || OS_NACL
X+#if defined(OS_LINUX) || defined(OS_ANDROID) || OS_NACL || defined(OS_NETBSD)
X EXPECT_EQ(no_cascading_cand_size, cascading_cand_size);
X-#else // defined(OS_LINUX) || defined(OS_ANDROID) || OS_NACL
X+#else // defined(OS_LINUX) || defined(OS_ANDROID) || OS_NACL || defined(OS_NETBSD)
X EXPECT_GT(no_cascading_cand_size, cascading_cand_size);
X-#endif // defined(OS_LINUX) || defined(OS_ANDROID) || OS_NACL
X+#endif // defined(OS_LINUX) || defined(OS_ANDROID) || OS_NACL || defined(OS_NETBSD)
X
X command.Clear();
X session->ConvertCancel(&command);
X@@ -2330,7 +2330,7 @@ TEST_F(SessionTest, OutputAllCandidateWo
X
X EXPECT_EQ(0, output.all_candidate_words().focused_index());
X EXPECT_EQ(commands::CONVERSION, output.all_candidate_words().category());
X-#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NACL)
X+#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NACL) || defined(OS_NETBSD)
X // Cascading window is not supported on Linux, so the size of
X // candidate words is different from other platform.
X // TODO(komatsu): Modify the client for Linux to explicitly change
X@@ -2340,13 +2340,13 @@ TEST_F(SessionTest, OutputAllCandidateWo
X // "�����" (t13n), "AIUEO" (t13n), "A����" (t13n),
X // "アイウエオ" (t13n) ]
X EXPECT_EQ(9, output.all_candidate_words().candidates_size());
X-#else // OS_LINUX || OS_ANDROID || OS_NACL
X+#else // OS_LINUX || OS_ANDROID || OS_NACL || OS_NETBSD
X // [ "ã??ã??ã??ã??ã??", "ã?¢ã?¤ã?¦ã?¨ã?ª", "ã?¢ã?¤ã?¦ã?¨ã?ª" (t13n), "ã??ã??ã??ã??ã??" (t13n),
X // "aiueo" (t13n), "AIUEO" (t13n), "Aieuo" (t13n),
X // "�����" (t13n), "AIUEO" (t13n), "A����" (t13n),
X // "アイウエオ" (t13n) ]
X EXPECT_EQ(11, output.all_candidate_words().candidates_size());
X-#endif // OS_LINUX || OS_ANDROID || OS_NACL
X+#endif // OS_LINUX || OS_ANDROID || OS_NACL || OS_NETBSD
X }
X
X command.Clear();
X@@ -2358,7 +2358,7 @@ TEST_F(SessionTest, OutputAllCandidateWo
X
X EXPECT_EQ(1, output.all_candidate_words().focused_index());
X EXPECT_EQ(commands::CONVERSION, output.all_candidate_words().category());
X-#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NACL)
X+#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NACL) || defined(OS_NETBSD)
X // Cascading window is not supported on Linux, so the size of
X // candidate words is different from other platform.
X // TODO(komatsu): Modify the client for Linux to explicitly change
X@@ -2368,13 +2368,13 @@ TEST_F(SessionTest, OutputAllCandidateWo
X // "�����" (t13n), "AIUEO" (t13n), "A����" (t13n),
X // "アイウエオ" (t13n) ]
X EXPECT_EQ(9, output.all_candidate_words().candidates_size());
X-#else // OS_LINUX || OS_ANDROID || OS_NACL
X+#else // OS_LINUX || OS_ANDROID || OS_NACL || OS_NETBSD
X // [ "ã??ã??ã??ã??ã??", "ã?¢ã?¤ã?¦ã?¨ã?ª",
X // "aiueo" (t13n), "AIUEO" (t13n), "Aieuo" (t13n),
X // "�����" (t13n), "AIUEO" (t13n), "A����" (t13n),
X // "アイウエオ" (t13n) ]
X EXPECT_EQ(11, output.all_candidate_words().candidates_size());
X-#endif // OS_LINUX || OS_ANDROID || OS_NACL
X+#endif // OS_LINUX || OS_ANDROID || OS_NACL || OS_NETBSD
X }
X }
X
END-of-mozc-server/patches/patch-session_session__test.cc
echo x - mozc-server/patches/patch-third__party_protobuf_post__process__dist.sh
sed 's/^X//' >mozc-server/patches/patch-third__party_protobuf_post__process__dist.sh << 'END-of-mozc-server/patches/patch-third__party_protobuf_post__process__dist.sh'
X$NetBSD: patch-third__party_protobuf_post__process__dist.sh,v 1.3 2016/05/16 11:51:49 ryoon Exp $
X
X* appease pkglint
X
X--- third_party/protobuf/post_process_dist.sh.orig 2017-11-02 13:35:43.000000000 +0000
X+++ third_party/protobuf/post_process_dist.sh
X@@ -15,7 +15,7 @@
X # non-testdata .txt files are converted to Windows-style line endings.
X # 5) Cleans up after itself.
X
X-if [ "$1" == "" ]; then
X+if [ "$1" = "" ]; then
X echo "USAGE: $0 DISTFILE" >&2
X exit 1
X fi
END-of-mozc-server/patches/patch-third__party_protobuf_post__process__dist.sh
echo x - mozc-server/patches/patch-unix_ibus_ibus.gyp
sed 's/^X//' >mozc-server/patches/patch-unix_ibus_ibus.gyp << 'END-of-mozc-server/patches/patch-unix_ibus_ibus.gyp'
X$NetBSD: patch-unix_ibus_ibus.gyp,v 1.1 2014/06/15 13:08:34 ryoon Exp $
X
X* use ${PREFIX} paths
X
X--- unix/ibus/ibus.gyp.orig 2017-11-02 13:32:47.000000000 +0000
X+++ unix/ibus/ibus.gyp
X@@ -31,8 +31,8 @@
X 'variables': {
X 'relative_dir': 'unix/ibus',
X 'gen_out_dir': '<(SHARED_INTERMEDIATE_DIR)/<(relative_dir)',
X- 'ibus_mozc_icon_path%': '/usr/share/ibus-mozc/product_icon.png',
X- 'ibus_mozc_path%': '/usr/lib/ibus-mozc/ibus-engine-mozc',
X+ 'ibus_mozc_icon_path%': '@PREFIX@/share/ibus-mozc/product_icon.png',
X+ 'ibus_mozc_path%': '@PREFIX@/libexec/ibus-engine-mozc',
X # enable_x11_selection_monitor represents if ibus_mozc uses X11 selection
X # monitor or not.
X 'enable_x11_selection_monitor%': 1,
END-of-mozc-server/patches/patch-unix_ibus_ibus.gyp
echo x - mozc-server/patches/patch-unix_ibus_path__util.cc
sed 's/^X//' >mozc-server/patches/patch-unix_ibus_path__util.cc << 'END-of-mozc-server/patches/patch-unix_ibus_path__util.cc'
X$NetBSD$
X
X* use ${PREFIX} path
X
X--- unix/ibus/path_util.cc.orig 2017-11-02 13:32:47.000000000 +0000
X+++ unix/ibus/path_util.cc
X@@ -30,7 +30,7 @@
X #include "unix/ibus/path_util.h"
X
X namespace {
X-const char kInstalledDirectory[] = "/usr/share/ibus-mozc";
X+const char kInstalledDirectory[] = "@PREFIX@/share/ibus-mozc";
X }
X
X namespace mozc {
END-of-mozc-server/patches/patch-unix_ibus_path__util.cc
exit
# This is a shell archive. Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file". Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
# mozc-server
# mozc-server/DESCR
# mozc-server/Makefile
# mozc-server/Makefile.common
# mozc-server/PLIST
# mozc-server/distinfo
# mozc-server/patches
# mozc-server/patches/patch-base_base.gyp
# mozc-server/patches/patch-base_clock.cc
# mozc-server/patches/patch-base_cpu__stats.cc
# mozc-server/patches/patch-base_logging.cc
# mozc-server/patches/patch-base_mutex.cc
# mozc-server/patches/patch-base_mutex.h
# mozc-server/patches/patch-base_password__manager.cc
# mozc-server/patches/patch-base_port.h
# mozc-server/patches/patch-base_process.cc
# mozc-server/patches/patch-base_run__level.cc
# mozc-server/patches/patch-base_system__util.cc
# mozc-server/patches/patch-base_thread.cc
# mozc-server/patches/patch-build__mozc.py
# mozc-server/patches/patch-build__tools_mozc__version.py
# mozc-server/patches/patch-build__tools_util.py
# mozc-server/patches/patch-client_client.cc
# mozc-server/patches/patch-config_stats__config__util__test.cc
# mozc-server/patches/patch-gui_config__dialog_config__dialog.cc
# mozc-server/patches/patch-gui_config__dialog_keybinding__editor.cc
# mozc-server/patches/patch-gui_dictionary__tool_dictionary__tool.cc
# mozc-server/patches/patch-gui_qt__libraries.gypi
# mozc-server/patches/patch-gui_qt__moc.gypi
# mozc-server/patches/patch-gui_qt__rcc.gypi
# mozc-server/patches/patch-gui_qt__uic.gypi
# mozc-server/patches/patch-gui_word__register__dialog_word__register__dialog.cc
# mozc-server/patches/patch-gyp_common.gypi
# mozc-server/patches/patch-gyp_directories.gypi
# mozc-server/patches/patch-handwriting_zinnia.gyp
# mozc-server/patches/patch-handwriting_zinnia__handwriting.cc
# mozc-server/patches/patch-ipc_ipc__path__manager.cc
# mozc-server/patches/patch-ipc_ipc__path__manager__test.cc
# mozc-server/patches/patch-ipc_named__event.cc
# mozc-server/patches/patch-ipc_unix__ipc.cc
# mozc-server/patches/patch-net_net.gyp
# mozc-server/patches/patch-session_session.cc
# mozc-server/patches/patch-session_session__test.cc
# mozc-server/patches/patch-third__party_protobuf_post__process__dist.sh
# mozc-server/patches/patch-unix_ibus_ibus.gyp
# mozc-server/patches/patch-unix_ibus_path__util.cc
#
echo c - mozc-server
mkdir -p mozc-server > /dev/null 2>&1
echo x - mozc-server/DESCR
sed 's/^X//' >mozc-server/DESCR << 'END-of-mozc-server/DESCR'
XMozc is a Japanese Input Method Editor (IME) designed for multi-platform
Xsuch as Chromium OS, Windows, Mac and Linux. This open-source
Xproject originates from Google Japanese Input.
X
XThis package is dictionary server for mozc client, such as ibus-mozc.
END-of-mozc-server/DESCR
echo x - mozc-server/Makefile
sed 's/^X//' >mozc-server/Makefile << 'END-of-mozc-server/Makefile'
X# $NetBSD: Makefile,v 1.33 2017/08/24 20:03:26 adam Exp $
X
XPKGNAME= ${DISTNAME:S/mozc-/mozc-server-/}
X
XINSTALLATION_DIRS+= libexec
X
Xdo-build:
X cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} \
X ${PYTHONBIN} build_mozc.py build \
X -c ${MOZC_BUILD_MODE} \
X server/server.gyp:mozc_server
X
Xdo-install:
X ${INSTALL_PROGRAM} ${WRKSRC}/out_${OSDEST}/${MOZC_BUILD_MODE}/mozc_server \
X ${DESTDIR}${PREFIX}/libexec/mozc_server
X
X.include "../../inputmethod/mozc-server/Makefile.common"
END-of-mozc-server/Makefile
echo x - mozc-server/Makefile.common
sed 's/^X//' >mozc-server/Makefile.common << 'END-of-mozc-server/Makefile.common'
X# $NetBSD: Makefile.common,v 1.25 2016/07/09 13:03:52 wiz Exp $
X# used by inputmethod/ibus-mozc/Makefile
X# used by inputmethod/mozc-elisp/Makefile
X# used by inputmethod/mozc-server/Makefile
X# used by inputmethod/mozc-tool/Makefile
X# used by inputmethod/mozc-renderer/Makefile
X# used by inputmethod/uim-mozc/Makefile
X#
X
XDISTNAME= mozc-2.20.2673.102
XCATEGORIES= inputmethod
XMASTER_SITES= ${MASTER_SITE_LOCAL}
XEXTRACT_SUFX= .tar.xz
X
XMAINTAINER= ryoon%NetBSD.org@localhost
XHOMEPAGE= https://github.com/google/mozc/
XCOMMENT= Japanese inputmethod Mozc engine
XLICENSE= modified-bsd
X
XUIM_MOZC= uim-mozc-321.3ea28b1
XDISTFILES+= ${DISTNAME}${EXTRACT_SUFX} \
X ${UIM_MOZC}.tar.xz
XSITES.${UIM_MOZC}.tar.xz= ${MASTER_SITE_SOURCEFORGE:=pnsft-aur/}
X
XEXTRACT_USING= bsdtar
XWRKSRC= ${WRKDIR}/${DISTNAME}/src
X
XDISTINFO_FILE= ${.CURDIR}/../../inputmethod/mozc-server/distinfo
XPATCHDIR= ${.CURDIR}/../../inputmethod/mozc-server/patches
X
XBUILD_DEPENDS+= ${PYPKGPREFIX}-gyp-[0-9]*:../../devel/gyp
XBUILD_DEPENDS+= ninja-build-[0-9]*:../../devel/ninja-build
X
XUSE_LANGUAGES= c c++
X
XUSE_TOOLS+= gmake pkg-config
XGCC_REQD+= 4.7 # for c++11
X
XOPENSSL_CFLAGS= -I${BUILDLINK_PREFIX.openssl}/include
XOPENSSL_INC= -I${BUILDLINK_PREFIX.openssl}/include
XOPENSSL_LDFLAGS= -L${BUILDLINK_PREFIX.openssl}/lib -lssl -lcrypto
XOPENSSL_LIBS= -lssl -lcrypto
X
XSUBST_CLASSES+= gyp
XSUBST_STAGE.gyp= pre-configure
XSUBST_MESSAGE.gyp= Fix gyp defaults
XSUBST_FILES.gyp+= base/process.cc
XSUBST_FILES.gyp+= gyp/directories.gypi
XSUBST_FILES.gyp+= handwriting/zinnia_handwriting.cc
XSUBST_FILES.gyp+= unix/ibus/ibus.gyp
XSUBST_FILES.gyp+= unix/ibus/path_util.cc
XSUBST_VARS.gyp+= OPENSSL_CFLAGS OPENSSL_INC OPENSSL_LDFLAGS OPENSSL_LIBS
XSUBST_VARS.gyp+= PREFIX
X
X# To disable flock(1) in link stage.
XALL_ENV+= LINK=${CXX}
X
X.include "../../mk/bsd.prefs.mk"
X
XOPSYSVARS+= OSDEST
XOSDEST.Linux= linux
XOSDEST.NetBSD= bsd
X
XMOZC_BUILD_MODE= Release # or Debug
X
Xdo-configure:
X cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} \
X GYP_DEFINES="use_libprotobuf=1" \
X ${PYTHONBIN} build_mozc.py \
X gyp \
X --gypdir=${LOCALBASE}/bin
X
X.include "../../devel/glib2/buildlink3.mk"
X.include "../../devel/protobuf/buildlink3.mk"
X# gmock is not used yet...
X#.include "../../devel/gmock/buildlink3.mk"
X.include "../../inputmethod/zinnia/buildlink3.mk"
X.include "../../www/curl/buildlink3.mk"
X.include "../../x11/gtk2/buildlink3.mk"
X.include "../../x11/qt5-qtbase/buildlink3.mk"
X
X.include "../../lang/python/tool.mk"
X.include "../../mk/bsd.pkg.mk"
END-of-mozc-server/Makefile.common
echo x - mozc-server/PLIST
sed 's/^X//' >mozc-server/PLIST << 'END-of-mozc-server/PLIST'
X@comment $NetBSD: PLIST,v 1.2 2013/04/29 09:22:04 ryoon Exp $
Xlibexec/mozc_server
END-of-mozc-server/PLIST
echo x - mozc-server/distinfo
sed 's/^X//' >mozc-server/distinfo << 'END-of-mozc-server/distinfo'
X$NetBSD: distinfo,v 1.19 2016/05/16 11:51:49 ryoon Exp $
X
XSHA1 (mozc-2.20.2673.102.tar.xz) = 9cedf4d392593e04755fa44afd79cd40bb80b9d1
XRMD160 (mozc-2.20.2673.102.tar.xz) = 723fef550d88c5a4dc33f2ec9c8d7ee694e60d64
XSHA512 (mozc-2.20.2673.102.tar.xz) = 06ce43b0fa6d5a696cddafc97cd84bfa4482204ffb3793a6d3811dd50c4ed859289394ee471987b20fd637768bdfcc2f0289993b88e24c141c93514229dfc402
XSize (mozc-2.20.2673.102.tar.xz) = 44187096 bytes
XSHA1 (uim-mozc-321.3ea28b1.tar.xz) = 22b7c2a5b0a7fef778ee72ebe5873a75e879d26b
XRMD160 (uim-mozc-321.3ea28b1.tar.xz) = 30d160d02a39065e4bc34968fbe6232018b0b202
XSHA512 (uim-mozc-321.3ea28b1.tar.xz) = b28f4d207a52c208694371dbc550ac5022a29c5870b8d856bca8052106d8be88ab8d066bdc6d895ac6fa9f350ce6be16d638603e46058f9528691f97cb86d054
XSize (uim-mozc-321.3ea28b1.tar.xz) = 24400 bytes
XSHA1 (patch-base_base.gyp) = d8d9abc0da196f0573ad645937812710c7c67746
XSHA1 (patch-base_clock.cc) = 0fa3f4b3bcd34283870a317032172745dcf90eaa
XSHA1 (patch-base_cpu__stats.cc) = c55ee389eced767e875553937a80c8ba6c6abd2d
XSHA1 (patch-base_logging.cc) = 5dddcbbf4445e91e6f8ab41999c938e0491c05c4
XSHA1 (patch-base_mutex.cc) = 9563ff1563eef8dc73417454b2ba06322a2cd76d
XSHA1 (patch-base_mutex.h) = cf12a1574d28dd612820578560a76b3b8ab6e27d
XSHA1 (patch-base_password__manager.cc) = 8216bc58d398fae4935e99fe5d11febbee380644
XSHA1 (patch-base_port.h) = 775b8a5afe2336218fc936d009bae9f6b13a4379
XSHA1 (patch-base_process.cc) = 1cba930ffdf14694fa55e473c2e94ee2cf523de4
XSHA1 (patch-base_run__level.cc) = 849a6a6727463305c2fdca4eed0fb4a4cac10567
XSHA1 (patch-base_system__util.cc) = c4d81bb3d4633a11d969520af610c3e10417ab4e
XSHA1 (patch-base_thread.cc) = 2cc63c1d369f842a29e07311364c2a3537f3b428
XSHA1 (patch-build__mozc.py) = 5fd1e328c9a35cc01a507566afeda1179657e685
XSHA1 (patch-build__tools_mozc__version.py) = 7130eac051d0d4f78da887aedd669fc4713dbd62
XSHA1 (patch-build__tools_util.py) = 5ca614adf2453fcc33c18cda74c0d9b2e4f6bc21
XSHA1 (patch-client_client.cc) = f1eb1860c41a97c82a338f74acdcf0ed3477b6da
XSHA1 (patch-config_stats__config__util__test.cc) = 3514f04a921908795c03d0e8685135297dc9e2af
XSHA1 (patch-gui_config__dialog_config__dialog.cc) = de2750a6bf99c4e38983cf5322adae8c46ca45d6
XSHA1 (patch-gui_config__dialog_keybinding__editor.cc) = 529e902c146907d3a91181bad3822bbbec69b6b7
XSHA1 (patch-gui_dictionary__tool_dictionary__tool.cc) = cae617cc8e324b0f93adc1e76632a018530cd2c7
XSHA1 (patch-gui_qt__libraries.gypi) = ceb8d5b15d4cd5b2d907406f02413290bd4ab652
XSHA1 (patch-gui_qt__moc.gypi) = e3d42e61b35012cda10da13aa03cee67786e171c
XSHA1 (patch-gui_qt__rcc.gypi) = d38a849fe8e81672eb441a41936f454d8e45ff5c
XSHA1 (patch-gui_qt__uic.gypi) = 7dd69ee109e81f0e70f2866b77555412518b4844
XSHA1 (patch-gui_word__register__dialog_word__register__dialog.cc) = 6e247fcab5d570b733365b57c5a5d72a021dd16f
XSHA1 (patch-gyp_common.gypi) = 13cd5010a6f3ed314a94248144657955f8bbbe72
XSHA1 (patch-gyp_directories.gypi) = 6504d8b43f83be3908b39a5e51598c2aba0dffd9
XSHA1 (patch-handwriting_zinnia.gyp) = b59e546cb9b8b91dcd627885e1853e8ba8dead46
XSHA1 (patch-handwriting_zinnia__handwriting.cc) = dd87817aabcd290c9fb25f3ebe4f36ce670ae44b
XSHA1 (patch-ipc_ipc__path__manager.cc) = 533d37b3802385873450ebeef561425aef7d9c63
XSHA1 (patch-ipc_ipc__path__manager__test.cc) = 1b83b513383f184f5ab5a56cce734b7934998533
XSHA1 (patch-ipc_named__event.cc) = 92283261e7580569587e43156f13567b593c9a32
XSHA1 (patch-ipc_unix__ipc.cc) = 25107c2e84844ecaa3445efb48cc3f2795579dec
XSHA1 (patch-net_net.gyp) = 61353724533f9239f4c58fa37f0a8fb2eb5552c3
XSHA1 (patch-session_session.cc) = 773017ac54e79239f6734a124f457b0b81bb1ced
XSHA1 (patch-session_session__test.cc) = 99165b29555844a40d30cf5554cc5c66773b70ed
XSHA1 (patch-third__party_protobuf_post__process__dist.sh) = 8adc79d5d7eed3cbf406ebcfbd5832b7a050ced6
XSHA1 (patch-unix_ibus_ibus.gyp) = aa2077cf3c379bf9ce33e97abe478540346782ad
XSHA1 (patch-unix_ibus_path__util.cc) = a6aa368d9ce8926e200602fdc370c13e35d5a8cf
END-of-mozc-server/distinfo
echo c - mozc-server/patches
mkdir -p mozc-server/patches > /dev/null 2>&1
echo x - mozc-server/patches/patch-base_base.gyp
sed 's/^X//' >mozc-server/patches/patch-base_base.gyp << 'END-of-mozc-server/patches/patch-base_base.gyp'
X$NetBSD$
X
X* NetBSD support
X
X--- base/base.gyp.orig 2017-11-02 13:32:45.000000000 +0000
X+++ base/base.gyp
X@@ -141,7 +141,7 @@
X },
X },
X }],
X- ['target_platform=="Linux" and server_dir!=""', {
X+ ['(target_platform=="Linux" or target_platform=="NetBSD") and server_dir!=""', {
X 'defines': [
X 'MOZC_SERVER_DIRECTORY="<(server_dir)"',
X ],
END-of-mozc-server/patches/patch-base_base.gyp
echo x - mozc-server/patches/patch-base_clock.cc
sed 's/^X//' >mozc-server/patches/patch-base_clock.cc << 'END-of-mozc-server/patches/patch-base_clock.cc'
X$NetBSD: patch-base_clock.cc,v 1.1 2016/05/16 11:51:49 ryoon Exp $
X
X* NetBSD support
X
X--- base/clock.cc.orig 2016-05-15 08:11:10.000000000 +0000
X+++ base/clock.cc
X@@ -124,7 +124,7 @@ class ClockImpl : public ClockInterface
X mach_timebase_info(&timebase_info);
X return static_cast<uint64>(
X 1.0e9 * timebase_info.denom / timebase_info.numer);
X-#elif defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NACL)
X+#elif defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NACL) || defined(OS_NETBSD)
X return 1000000uLL;
X #else // platforms (OS_WIN, OS_MACOSX, OS_LINUX, ...)
X #error "Not supported platform"
X@@ -141,7 +141,7 @@ class ClockImpl : public ClockInterface
X return static_cast<uint64>(timestamp.QuadPart);
X #elif defined(OS_MACOSX)
X return static_cast<uint64>(mach_absolute_time());
X-#elif defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NACL)
X+#elif defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NACL) || defined(OS_NETBSD)
X uint64 sec;
X uint32 usec;
X GetTimeOfDay(&sec, &usec);
END-of-mozc-server/patches/patch-base_clock.cc
echo x - mozc-server/patches/patch-base_cpu__stats.cc
sed 's/^X//' >mozc-server/patches/patch-base_cpu__stats.cc << 'END-of-mozc-server/patches/patch-base_cpu__stats.cc'
X$NetBSD: patch-base_cpu__stats.cc,v 1.2 2016/05/16 11:51:49 ryoon Exp $
X
X* NetBSD support
X
X--- base/cpu_stats.cc.orig 2016-05-15 08:11:10.000000000 +0000
X+++ base/cpu_stats.cc
X@@ -123,13 +123,13 @@ float CPUStats::GetSystemCPULoad() {
X
X #endif // OS_MACOSX
X
X-#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NACL)
X+#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NACL) || defined(OS_NETBSD)
X // NOT IMPLEMENTED
X // TODO(taku): implement Linux version
X // can take the info from /proc/stats
X const uint64 total_times = 0;
X const uint64 cpu_times = 0;
X-#endif // OS_LINUX || OS_ANDROID || OS_NACL
X+#endif // OS_LINUX || OS_ANDROID || OS_NACL || OS_NETBSD
X
X return UpdateCPULoad(total_times,
X cpu_times,
X@@ -178,11 +178,11 @@ float CPUStats::GetCurrentProcessCPULoad
X TimeValueTToInt64(task_times_info.system_time);
X #endif // OS_MACOSX
X
X-#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NACL)
X+#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NACL) || defined(OS_NETBSD)
X // not implemented
X const uint64 total_times = 0;
X const uint64 cpu_times = 0;
X-#endif // OS_LINUX || OS_ANDROID || OS_NACL
X+#endif // OS_LINUX || OS_ANDROID || OS_NACL || OS_NETBSD
X
X return UpdateCPULoad(total_times,
X cpu_times,
X@@ -210,9 +210,9 @@ size_t CPUStats::GetNumberOfProcessors()
X return static_cast<size_t>(basic_info.avail_cpus);
X #endif // OS_MACOSX
X
X-#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NACL)
X+#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NACL) || defined(OS_NETBSD)
X // Not implemented
X return 1;
X-#endif // OS_LINUX
X+#endif // OS_LINUX || OS_ANDROID || OS_NACL || OS_NETBSD
X }
X } // namespace mozc
END-of-mozc-server/patches/patch-base_cpu__stats.cc
echo x - mozc-server/patches/patch-base_logging.cc
sed 's/^X//' >mozc-server/patches/patch-base_logging.cc << 'END-of-mozc-server/patches/patch-base_logging.cc'
X$NetBSD: patch-base_logging.cc,v 1.4 2016/05/16 11:51:49 ryoon Exp $
X
X* NetBSD support
X
X--- base/logging.cc.orig 2016-05-15 08:11:10.000000000 +0000
X+++ base/logging.cc
X@@ -61,6 +61,10 @@
X #include "base/mutex.h"
X #include "base/singleton.h"
X
X+#if defined(OS_NETBSD)
X+#include <lwp.h>
X+#endif
X+
X DEFINE_bool(colored_log, true, "Enables colored log messages on tty devices");
X DEFINE_bool(logtostderr,
X false,
X@@ -102,7 +106,7 @@ string Logging::GetLogMessageHeader() {
X "%4.4d-%2.2d-%2.2d %2.2d:%2.2d:%2.2d %u "
X #if defined(OS_NACL)
X "%p",
X-#elif defined(OS_LINUX)
X+#elif defined(OS_LINUX) || defined(OS_NETBSD)
X "%lu",
X #elif defined(OS_MACOSX) && defined(__LP64__)
X "%llu",
X@@ -129,6 +133,9 @@ string Logging::GetLogMessageHeader() {
X ::getpid(),
X // pthread_self() returns __nc_basic_thread_data*.
X static_cast<void*>(pthread_self())
X+#elif defined(OS_NETBSD)
X+ ::getpid(),
X+ (unsigned long)_lwp_self()
X #else // = OS_LINUX
X ::getpid(),
X // It returns unsigned long.
END-of-mozc-server/patches/patch-base_logging.cc
echo x - mozc-server/patches/patch-base_mutex.cc
sed 's/^X//' >mozc-server/patches/patch-base_mutex.cc << 'END-of-mozc-server/patches/patch-base_mutex.cc'
X$NetBSD: patch-base_mutex.cc,v 1.4 2016/05/16 11:51:49 ryoon Exp $
X
X* NetBSD support
X
X--- base/mutex.cc.orig 2017-11-02 13:32:45.000000000 +0000
X+++ base/mutex.cc
X@@ -53,7 +53,7 @@ namespace mozc {
X
X // Wrapper for Windows InterlockedCompareExchange
X namespace {
X-#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NACL)
X+#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NACL) || defined(OS_NETBSD)
X // Linux doesn't provide InterlockedCompareExchange-like function.
X inline int InterlockedCompareExchange(volatile int *target,
X int new_value,
X@@ -72,7 +72,7 @@ inline int InterlockedCompareExchange(vo
X pthread_mutex_unlock(&lock);
X return result;
X }
X-#endif // OS_LINUX || OS_ANDROID || OS_NACL
X+#endif // OS_LINUX || OS_ANDROID || OS_NACL || OS_NETBSD
X
X // Use OSAtomicCompareAndSwapInt on Mac OSX
X // https://developer.apple.com/library/prerelease/mac/documentation/Darwin/Reference/ManPages/man3/OSAtomicCompareAndSwapInt.3.html
X@@ -84,7 +84,7 @@ inline int InterlockedCompareExchange(vo
X return OSAtomicCompareAndSwapInt(old_value, new_value, target)
X ? old_value : *target;
X }
X-#endif // OX_MACOSX
X+#endif // OS_MACOSX
X
X } // namespace
X
X@@ -182,7 +182,7 @@ Mutex::Mutex() {
X // PTHREAD_MUTEX_RECURSIVE_NP but Mac OS X 10.5 does not
X pthread_mutexattr_t attr;
X pthread_mutexattr_init(&attr);
X-#if defined(OS_MACOSX)
X+#if defined(OS_MACOSX) || defined(OS_NETBSD)
X pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
X #elif defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NACL)
X pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE_NP);
END-of-mozc-server/patches/patch-base_mutex.cc
echo x - mozc-server/patches/patch-base_mutex.h
sed 's/^X//' >mozc-server/patches/patch-base_mutex.h << 'END-of-mozc-server/patches/patch-base_mutex.h'
X$NetBSD: patch-base_mutex.h,v 1.2 2016/05/16 11:51:49 ryoon Exp $
X
X* First chunk, NetBSD ILP32 ports seem to require larger mutex array size.
X* I am not sure.
X
X--- base/mutex.h.orig 2016-05-15 08:11:10.000000000 +0000
X+++ base/mutex.h
X@@ -50,8 +50,8 @@ namespace mozc {
X // To remove dependencies against plafrom specific headers such as
X // <Windows.h> or <pthread.h>, we use an array of pointers as an opaque buffer
X // where platform specific mutex structure will be placed.
X-#if defined(OS_MACOSX)
X-// Mac requires relatively large buffer for pthread mutex object.
X+#if defined(OS_MACOSX) || defined(OS_NETBSD)
X+// Mac and NetBSD requires relatively large buffer for pthread mutex object.
X #define MOZC_MUTEX_PTR_ARRAYSIZE 11
X #define MOZC_RW_MUTEX_PTR_ARRAYSIZE 32
X #else
END-of-mozc-server/patches/patch-base_mutex.h
echo x - mozc-server/patches/patch-base_password__manager.cc
sed 's/^X//' >mozc-server/patches/patch-base_password__manager.cc << 'END-of-mozc-server/patches/patch-base_password__manager.cc'
X$NetBSD: patch-base_password__manager.cc,v 1.3 2016/05/16 11:51:49 ryoon Exp $
X
X* NetBSD support
X
X--- base/password_manager.cc.orig 2016-05-15 08:11:10.000000000 +0000
X+++ base/password_manager.cc
X@@ -264,9 +264,9 @@ bool WinMacPasswordManager::RemovePasswo
X // We use plain text file for password storage on Linux. If you port this module
X // to other Linux distro, you might want to implement a new password manager
X // which adopts some secure mechanism such like gnome-keyring.
X-#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NACL)
X+#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NACL) || defined(OS_NETBSD)
X typedef PlainPasswordManager DefaultPasswordManager;
X-#endif // OS_LINUX || OS_ANDROID || OS_NACL
X+#endif // OS_LINUX || OS_ANDROID || OS_NACL || OS_NETBSD
X
X // Windows or Mac
X #if (defined(OS_WIN) || defined(OS_MACOSX))
END-of-mozc-server/patches/patch-base_password__manager.cc
echo x - mozc-server/patches/patch-base_port.h
sed 's/^X//' >mozc-server/patches/patch-base_port.h << 'END-of-mozc-server/patches/patch-base_port.h'
X$NetBSD: patch-base_port.h,v 1.3 2016/05/16 11:51:49 ryoon Exp $
X
X* NetBSD support
X* kludge to build with gcc45
X
X--- base/port.h.orig 2017-11-02 13:32:45.000000000 +0000
X+++ base/port.h
X@@ -56,6 +56,9 @@
X #endif // !OS_ANDROID && !OS_NACL
X #endif // OS_LINUX
X
X+#ifdef OS_NETBSD
X+#define MOZC_OS_DEFINED
X+#endif // OS_NETBSD
X
X #ifndef MOZC_OS_DEFINED
X #error "OS_XXX (e.g., OS_WIN) must be defined."
X@@ -154,4 +157,9 @@ static const int64 kint64max = (( int6
X #define AS_STRING(x) AS_STRING_INTERNAL(x)
X #define AS_STRING_INTERNAL(x) #x
X
X+// gcc>=46 has nullptr, otherwise use __null instead.
X+#if __cplusplus < 201103L && !defined(__clang__) && defined(__GNUC__) && __GNUC__ * 1000 + __GNUC__MINOR__ < 4006
X+#define nullptr __null
X+#endif
X+
X #endif // MOZC_BASE_PORT_H_
END-of-mozc-server/patches/patch-base_port.h
echo x - mozc-server/patches/patch-base_process.cc
sed 's/^X//' >mozc-server/patches/patch-base_process.cc << 'END-of-mozc-server/patches/patch-base_process.cc'
X$NetBSD: patch-base_process.cc,v 1.4 2016/05/16 11:51:49 ryoon Exp $
X
X* NetBSD support
X
X--- base/process.cc.orig 2017-11-02 13:32:45.000000000 +0000
X+++ base/process.cc
X@@ -44,12 +44,12 @@
X #include "base/mac_process.h"
X #endif // OS_MACOSX
X
X-#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NACL)
X+#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NACL) || defined(OS_NETBSD)
X #include <fcntl.h>
X #include <signal.h>
X #include <spawn.h> // for posix_spawn().
X #include <sys/types.h>
X-#endif // OS_LINUX || OS_ANDROID || OS_NACL
X+#endif // OS_LINUX || OS_ANDROID || OS_NACL || OS_NETBSD
X
X #include <cstdlib>
X #include <memory>
X@@ -96,12 +96,12 @@ bool Process::OpenBrowser(const string &
X return WinUtil::ShellExecuteInSystemDir(L"open", wurl.c_str(), nullptr);
X #endif
X
X-#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NACL)
X- static const char kBrowserCommand[] = "/usr/bin/xdg-open";
X+#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NACL) || defined(OS_NETBSD)
X+ static const char kBrowserCommand[] = "@PREFIX@/bin/xdg-open";
X // xdg-open which uses kfmclient or gnome-open internally works both on KDE
X // and GNOME environments.
X return SpawnProcess(kBrowserCommand, url);
X-#endif // OS_LINUX || OS_ANDROID || OS_NACL
X+#endif // OS_LINUX || OS_ANDROID || OS_NACL || OS_NETBSD
X
X #ifdef OS_MACOSX
X return MacProcess::OpenBrowserForMac(url);
X@@ -180,7 +180,7 @@ bool Process::SpawnProcess(const string
X }
X #endif
X
X-#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NACL)
X+#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NACL) || defined(OS_NETBSD)
X // Do not call posix_spawn() for obviously bad path.
X if (!S_ISREG(statbuf.st_mode)) {
X LOG(ERROR) << "Not a regular file: " << path;
X@@ -203,7 +203,7 @@ bool Process::SpawnProcess(const string
X // (www.gnu.org/software/libc/manual/html_node/Heap-Consistency-Checking.html)
X const int kOverwrite = 0; // Do not overwrite.
X ::setenv("MALLOC_CHECK_", "2", kOverwrite);
X-#endif // OS_LINUX || OS_ANDROID || OS_NACL
X+#endif // OS_LINUX || OS_ANDROID || OS_NACL || OS_NETBSD
X pid_t tmp_pid = 0;
X
X // Spawn new process.
X@@ -374,7 +374,7 @@ bool Process::LaunchErrorMessageDialog(c
X }
X #endif // OS_WIN
X
X-#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NACL)
X+#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NACL) || defined(OS_NETBSD)
X const char kMozcTool[] = "mozc_tool";
X const string arg = "--mode=error_message_dialog --error_type=" + error_type;
X size_t pid = 0;
X@@ -382,7 +382,7 @@ bool Process::LaunchErrorMessageDialog(c
X LOG(ERROR) << "cannot launch " << kMozcTool;
X return false;
X }
X-#endif // OS_LINUX || OS_ANDROID || OS_NACL
X+#endif // OS_LINUX || OS_ANDROID || OS_NACL || OS_NETBSD
X
X return true;
X }
END-of-mozc-server/patches/patch-base_process.cc
echo x - mozc-server/patches/patch-base_run__level.cc
sed 's/^X//' >mozc-server/patches/patch-base_run__level.cc << 'END-of-mozc-server/patches/patch-base_run__level.cc'
X$NetBSD: patch-base_run__level.cc,v 1.4 2016/05/16 11:51:49 ryoon Exp $
X
X* NetBSD support
X
X--- base/run_level.cc.orig 2016-05-15 08:11:10.000000000 +0000
X+++ base/run_level.cc
X@@ -38,10 +38,10 @@
X #include <unistd.h>
X #endif // OS_MACOSX
X
X-#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NACL)
X+#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NACL) || defined(OS_NETBSD)
X #include <unistd.h>
X #include <sys/types.h>
X-#endif // OS_LINUX || OS_ANDROID || OS_NACL
X+#endif // OS_LINUX || OS_ANDROID || OS_NACL || OS_NETBSD
X
X #include "base/const.h"
X #include "base/logging.h"
END-of-mozc-server/patches/patch-base_run__level.cc
echo x - mozc-server/patches/patch-base_system__util.cc
sed 's/^X//' >mozc-server/patches/patch-base_system__util.cc << 'END-of-mozc-server/patches/patch-base_system__util.cc'
X$NetBSD: patch-base_system__util.cc,v 1.4 2016/05/16 11:51:49 ryoon Exp $
X
X* NetBSD support
X
X--- base/system_util.cc.orig 2017-11-02 13:32:45.000000000 +0000
X+++ base/system_util.cc
X@@ -372,7 +372,7 @@ string SystemUtil::GetServerDirectory()
X #elif defined(OS_MACOSX)
X return MacUtil::GetServerDirectory();
X
X-#elif defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NACL)
X+#elif defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NACL) || defined(OS_NETBSD)
X #if defined(MOZC_SERVER_DIRECTORY)
X return MOZC_SERVER_DIRECTORY;
X #else
X@@ -450,7 +450,7 @@ string SystemUtil::GetUserNameAsString()
X return ppw->pw_name;
X
X #else // OS_ANDROID
X- // OS_MACOSX, OS_LINUX or OS_NACL
X+ // OS_MACOSX, OS_LINUX, OS_NACL or OS_NETBSD
X struct passwd pw, *ppw;
X char buf[1024];
X CHECK_EQ(0, getpwuid_r(geteuid(), &pw, buf, sizeof(buf), &ppw));
X@@ -610,7 +610,7 @@ string GetSessionIdString() {
X #endif // OS_WIN
X
X string SystemUtil::GetDesktopNameAsString() {
X-#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NACL)
X+#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NACL) || defined(OS_NETBSD)
X const char *display = getenv("DISPLAY");
X if (display == NULL) {
X return "";
X@@ -812,6 +812,9 @@ string SystemUtil::GetOSVersionString()
X #elif defined(OS_LINUX) || defined(OS_NACL)
X const string ret = "Linux";
X return ret;
X+#elif defined(OS_NETBSD)
X+ const string ret = "NetBSD";
X+ return ret;
X #else // !OS_WIN && !OS_MACOSX && !OS_LINUX
X const string ret = "Unknown";
X return ret;
X@@ -847,7 +850,7 @@ uint64 SystemUtil::GetTotalPhysicalMemor
X return 0;
X }
X return total_memory;
X-#elif defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NACL)
X+#elif defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NACL) || defined(OS_NETBSD)
X #if defined(_SC_PAGESIZE) && defined(_SC_PHYS_PAGES)
X const long page_size = sysconf(_SC_PAGESIZE);
X const long number_of_phyisical_pages = sysconf(_SC_PHYS_PAGES);
X@@ -862,7 +865,7 @@ uint64 SystemUtil::GetTotalPhysicalMemor
X #endif // defined(_SC_PAGESIZE) && defined(_SC_PHYS_PAGES)
X #else // !(defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX))
X #error "unknown platform"
X-#endif // OS_WIN, OS_MACOSX, OS_LINUX
X+#endif // OS_WIN, OS_MACOSX, OS_LINUX, OS_NETBSD
X }
X
X } // namespace mozc
END-of-mozc-server/patches/patch-base_system__util.cc
echo x - mozc-server/patches/patch-base_thread.cc
sed 's/^X//' >mozc-server/patches/patch-base_thread.cc << 'END-of-mozc-server/patches/patch-base_thread.cc'
X$NetBSD$
X
X* tweak for NetBSD pthread_setname_np(3)
X
X--- base/thread.cc.orig 2017-11-02 13:32:45.000000000 +0000
X+++ base/thread.cc
X@@ -145,9 +145,11 @@ void Thread::Start(const string &thread_
X // NaCl doesn't support setname.
X #elif defined(OS_MACOSX)
X pthread_setname_np(thread_name.c_str());
X-#else // !(OS_NACL | OS_MACOSX)
X+#elif defined(OS_NETBSD)
X+ pthread_setname_np(*state_->handle_, "%s", (void *)thread_name.c_str());
X+#else // !(OS_NACL | OS_MACOSX | OS_NETBSD)
X pthread_setname_np(*state_->handle_, thread_name.c_str());
X-#endif // !(OS_NACL | OS_MACOSX)
X+#endif // !(OS_NACL | OS_MACOSX | OS_NETBSD)
X }
X }
X
END-of-mozc-server/patches/patch-base_thread.cc
echo x - mozc-server/patches/patch-build__mozc.py
sed 's/^X//' >mozc-server/patches/patch-build__mozc.py << 'END-of-mozc-server/patches/patch-build__mozc.py'
X$NetBSD: patch-build__mozc.py,v 1.8 2016/05/16 11:51:49 ryoon Exp $
X
X* NetBSD support
X
X--- build_mozc.py.orig 2017-11-02 13:32:45.000000000 +0000
X+++ build_mozc.py
X@@ -58,6 +58,7 @@ from build_tools.util import GetNumberOf
X from build_tools.util import GetRelPath
X from build_tools.util import IsLinux
X from build_tools.util import IsMac
X+from build_tools.util import IsNetBSD
X from build_tools.util import IsWindows
X from build_tools.util import PrintErrorAndExit
X from build_tools.util import RemoveDirectoryRecursively
X@@ -102,6 +103,7 @@ def GetBuildShortBaseName(target_platfor
X 'Windows': 'out_win',
X 'Mac': 'out_mac',
X 'Linux': 'out_linux',
X+ 'NetBSD': 'out_bsd',
X 'Android': 'out_android',
X 'NaCl': 'out_nacl'
X }
X@@ -179,6 +181,12 @@ def GetGypFileNames(options):
X elif options.target_platform == 'Android':
X # Add Android Mozc gyp scripts.
X gyp_file_names.extend(glob.glob('%s/android/*/*.gyp' % SRC_DIR))
X+ elif options.target_platform == 'NetBSD':
X+ gyp_file_names.extend(glob.glob('%s/unix/*/*.gyp' % SRC_DIR))
X+ # Add ibus.gyp if ibus version is >=1.4.1.
X+ if not PkgExists('ibus-1.0 >= 1.4.1'):
X+ logging.info('removing ibus.gyp.')
X+ gyp_file_names.remove('%s/unix/ibus/ibus.gyp' % SRC_DIR)
X gyp_file_names.sort()
X return gyp_file_names
X
X@@ -243,6 +251,8 @@ def AddTargetPlatformOption(parser):
X # If you want Android build, specify "Android".
X if IsLinux():
X default_target = 'Linux'
X+ if IsNetBSD():
X+ default_target = 'NetBSD'
X elif IsWindows():
X default_target = 'Windows'
X elif IsMac():
X@@ -410,6 +420,12 @@ def ExpandMetaTarget(options, meta_targe
X SRC_DIR + '/gui/gui.gyp:mozc_tool']
X if PkgExists('ibus-1.0 >= 1.4.1'):
X targets.append(SRC_DIR + '/unix/ibus/ibus.gyp:ibus_mozc')
X+ elif target_platform == 'NetBSD':
X+ targets = [SRC_DIR + '/server/server.gyp:mozc_server',
X+ SRC_DIR + '/renderer/renderer.gyp:mozc_renderer',
X+ SRC_DIR + '/gui/gui.gyp:mozc_tool']
X+ if PkgExists('ibus-1.0 >= 1.4.1'):
X+ targets.append(SRC_DIR + '/unix/ibus/ibus.gyp:ibus_mozc')
X elif target_platform == 'Mac':
X targets = [SRC_DIR + '/mac/mac.gyp:DiskImage']
X elif target_platform == 'Windows':
X@@ -585,7 +601,8 @@ def GypMain(options, unused_args):
X if options.noqt or target_platform in ['Android', 'NaCl']:
X gyp_options.extend(['-D', 'use_qt=NO'])
X gyp_options.extend(['-D', 'qt_dir='])
X- elif target_platform == 'Linux':
X+ elif (target_platform == 'Linux' or
X+ target_platform == 'NetBSD'):
X gyp_options.extend(['-D', 'use_qt=YES'])
X gyp_options.extend(['-D', 'qt_dir='])
X
X@@ -607,7 +624,8 @@ def GypMain(options, unused_args):
X else:
X gyp_options.extend(['-D', 'use_wix=NO'])
X
X- if target_platform == 'Linux':
X+ if (target_platform == 'Linux' or
X+ target_platform == 'NetBSD'):
X gyp_options.extend(['-D', 'enable_gtk_renderer=1'])
X
X # Android
X@@ -653,7 +671,8 @@ def GypMain(options, unused_args):
X gyp_options.extend(['-D', 'channel_dev=1'])
X
X def SetCommandLineForFeature(option_name, windows=False, mac=False,
X- linux=False, android=False, nacl=False):
X+ linux=False, android=False, nacl=False,
X+ netbsd=False):
X """Updates an option like '--enable_foober' and add a -D argument for gyp.
X
X This function ensures an option like '--enable_foober' exists and it has a
X@@ -675,6 +694,8 @@ def GypMain(options, unused_args):
X option on Android platform.
X nacl: A boolean which replesents the default value of the target
X option on NaCl.
X+ netbsd: A boolean which replesents the default value of the target option
X+ on NetBSD platform.
X
X Raises:
X ValueError: An error occurred when 'option_name' is empty.
X@@ -685,6 +706,7 @@ def GypMain(options, unused_args):
X default_enabled = {'Windows': windows,
X 'Mac': mac,
X 'Linux': linux,
X+ 'NetBSD': netbsd,
X 'Android': android,
X 'NaCl': nacl}.get(target_platform, False)
X enable_option_name = 'enable_%s' % option_name
X@@ -697,6 +719,7 @@ def GypMain(options, unused_args):
X
X SetCommandLineForFeature(option_name='cloud_handwriting',
X linux=is_official_dev,
X+ netbsd=is_official_dev,
X windows=is_official_dev,
X mac=is_official_dev)
X
X@@ -706,7 +729,8 @@ def GypMain(options, unused_args):
X if IsWindows():
X gyp_options.extend(['-G', 'msvs_version=2015'])
X
X- if (target_platform == 'Linux' and
X+ if ((target_platform == 'Linux' or
X+ target_platform == 'NetBSD') and
X '%s/unix/ibus/ibus.gyp' % SRC_DIR in gyp_file_names):
X gyp_options.extend(['-D', 'use_libibus=1'])
X
X@@ -1163,7 +1187,7 @@ def CleanMain(options, unused_args):
X if build_base:
X directory_names.append(build_base)
X
X- if IsLinux():
X+ if IsLinux() or IsNetBSD():
X # Remove auto-generated files.
X file_names.append(os.path.join(SRC_DIR, 'android', 'AndroidManifest.xml'))
X file_names.append(os.path.join(
END-of-mozc-server/patches/patch-build__mozc.py
echo x - mozc-server/patches/patch-build__tools_mozc__version.py
sed 's/^X//' >mozc-server/patches/patch-build__tools_mozc__version.py << 'END-of-mozc-server/patches/patch-build__tools_mozc__version.py'
X$NetBSD: patch-build__tools_mozc__version.py,v 1.2 2014/01/19 01:18:50 ryoon Exp $
X
X* NetBSD support
X
X--- build_tools/mozc_version.py.orig 2014-01-06 07:10:26.000000000 +0000
X+++ build_tools/mozc_version.py
X@@ -64,6 +64,7 @@ TARGET_PLATFORM_TO_DIGIT = {
X 'Linux': '2',
X 'Android': '3',
X 'NaCl': '4',
X+ 'NetBSD': '5',
X }
X
X VERSION_PROPERTIES = [
END-of-mozc-server/patches/patch-build__tools_mozc__version.py
echo x - mozc-server/patches/patch-build__tools_util.py
sed 's/^X//' >mozc-server/patches/patch-build__tools_util.py << 'END-of-mozc-server/patches/patch-build__tools_util.py'
X$NetBSD: patch-build__tools_util.py,v 1.4 2016/05/16 11:51:49 ryoon Exp $
X
X* NetBSD support
X
X--- build_tools/util.py.orig 2016-05-15 08:11:10.000000000 +0000
X+++ build_tools/util.py
X@@ -59,6 +59,11 @@ def IsLinux():
X return os.name == 'posix' and os.uname()[0] == 'Linux'
X
X
X+def IsNetBSD():
X+ """Returns true if the platform is NetBSD."""
X+ return os.name == 'posix' and os.uname()[0] == 'NetBSD'
X+
X+
X def GetNumberOfProcessors():
X """Returns the number of CPU cores available.
X
END-of-mozc-server/patches/patch-build__tools_util.py
echo x - mozc-server/patches/patch-client_client.cc
sed 's/^X//' >mozc-server/patches/patch-client_client.cc << 'END-of-mozc-server/patches/patch-client_client.cc'
X$NetBSD: patch-client_client.cc,v 1.2 2016/05/16 11:51:49 ryoon Exp $
X
X* NetBSD support
X
X--- client/client.cc.orig 2016-05-15 08:11:10.000000000 +0000
X+++ client/client.cc
X@@ -891,7 +891,7 @@ bool Client::LaunchTool(const string &mo
X }
X
X #if defined(OS_WIN) || defined(OS_LINUX) || defined(OS_ANDROID)\
X- || defined(OS_NACL)
X+ || defined(OS_NACL) || defined(OS_NETBSD)
X string arg = "--mode=" + mode;
X if (!extra_arg.empty()) {
X arg += " ";
X@@ -901,7 +901,7 @@ bool Client::LaunchTool(const string &mo
X LOG(ERROR) << "Cannot execute: " << kMozcTool << " " << arg;
X return false;
X }
X-#endif // OS_WIN || OS_LINUX || OS_ANDROID || OS_NACL
X+#endif // OS_WIN || OS_LINUX || OS_ANDROID || OS_NACL || OS_NETBSD
X
X // TODO(taku): move MacProcess inside SpawnMozcProcess.
X // TODO(taku): support extra_arg.
END-of-mozc-server/patches/patch-client_client.cc
echo x - mozc-server/patches/patch-config_stats__config__util__test.cc
sed 's/^X//' >mozc-server/patches/patch-config_stats__config__util__test.cc << 'END-of-mozc-server/patches/patch-config_stats__config__util__test.cc'
X$NetBSD: patch-config_stats__config__util__test.cc,v 1.2 2016/05/16 11:51:49 ryoon Exp $
X
X* NetBSD support
X
X--- config/stats_config_util_test.cc.orig 2016-05-15 08:11:10.000000000 +0000
X+++ config/stats_config_util_test.cc
X@@ -696,11 +696,11 @@ TEST(StatsConfigUtilTestAndroid, Default
X }
X #endif // OS_ANDROID
X
X-#if defined(OS_LINUX) || defined(OS_NACL)
X+#if defined(OS_LINUX) || defined(OS_NACL) || defined(OS_NETBSD)
X TEST(StatsConfigUtilTestLinux, DefaultValueTest) {
X EXPECT_FALSE(StatsConfigUtil::IsEnabled());
X }
X-#endif // OS_LINUX || OS_NACL
X+#endif // OS_LINUX || OS_NACL || OS_NETBSD
X
X #else // !GOOGLE_JAPANESE_INPUT_BUILD
X TEST(StatsConfigUtilTestNonOfficialBuild, DefaultValueTest) {
END-of-mozc-server/patches/patch-config_stats__config__util__test.cc
echo x - mozc-server/patches/patch-gui_config__dialog_config__dialog.cc
sed 's/^X//' >mozc-server/patches/patch-gui_config__dialog_config__dialog.cc << 'END-of-mozc-server/patches/patch-gui_config__dialog_config__dialog.cc'
X$NetBSD: patch-gui_config__dialog_config__dialog.cc,v 1.5 2016/05/16 11:51:49 ryoon Exp $
X
X* NetBSD support
X
X--- gui/config_dialog/config_dialog.cc.orig 2016-05-15 08:11:11.000000000 +0000
X+++ gui/config_dialog/config_dialog.cc
X@@ -100,21 +100,21 @@ ConfigDialog::ConfigDialog()
X setWindowTitle(tr("Mozc Preferences"));
X #endif // OS_MACOSX
X
X-#if defined(OS_LINUX)
X+#if defined(OS_LINUX) || defined(OS_NETBSD)
X miscDefaultIMEWidget->setVisible(false);
X miscAdministrationWidget->setVisible(false);
X miscStartupWidget->setVisible(false);
X-#endif // OS_LINUX
X+#endif // OS_LINUX || OS_NETBSD
X
X #ifdef NO_LOGGING
X // disable logging options
X miscLoggingWidget->setVisible(false);
X
X-#if defined(OS_LINUX)
X+#if defined(OS_LINUX) || defined(OS_NETBSD)
X // The last "misc" tab has no valid configs on Linux
X const int kMiscTabIndex = 6;
X configDialogTabWidget->removeTab(kMiscTabIndex);
X-#endif // OS_LINUX
X+#endif // OS_LINUX || OS_NETBSD
X #endif // NO_LOGGING
X
X #ifndef ENABLE_CLOUD_HANDWRITING
X@@ -324,7 +324,7 @@ ConfigDialog::ConfigDialog()
X dictionaryPreloadingAndUACLabel->setVisible(false);
X #endif // OS_WIN
X
X-#ifdef OS_LINUX
X+#if defined(OS_LINUX) || defined(OS_NETBSD)
X // On Linux, disable all fields for UsageStats
X usageStatsLabel->setEnabled(false);
X usageStatsLabel->setVisible(false);
X@@ -334,7 +334,7 @@ ConfigDialog::ConfigDialog()
X usageStatsMessage->setVisible(false);
X usageStatsCheckBox->setEnabled(false);
X usageStatsCheckBox->setVisible(false);
X-#endif // OS_LINUX
X+#endif // OS_LINUX || OS_NETBSD
X
X Reload();
X
END-of-mozc-server/patches/patch-gui_config__dialog_config__dialog.cc
echo x - mozc-server/patches/patch-gui_config__dialog_keybinding__editor.cc
sed 's/^X//' >mozc-server/patches/patch-gui_config__dialog_keybinding__editor.cc << 'END-of-mozc-server/patches/patch-gui_config__dialog_keybinding__editor.cc'
X$NetBSD: patch-gui_config__dialog_keybinding__editor.cc,v 1.2 2016/05/16 11:51:49 ryoon Exp $
X
X* NetBSD support
X
X--- gui/config_dialog/keybinding_editor.cc.orig 2017-11-02 13:32:47.000000000 +0000
X+++ gui/config_dialog/keybinding_editor.cc
X@@ -37,7 +37,7 @@
X #include <windows.h>
X #include <imm.h>
X #include <ime.h>
X-#elif OS_LINUX
X+#elif defined(OS_LINUX) || defined(OS_NETBSD)
X #define XK_MISCELLANY
X #include <X11/keysymdef.h>
X #endif
X@@ -128,7 +128,7 @@ const WinVirtualKeyEntry kWinVirtualKeyM
X { VK_DBE_DBCSCHAR, "Hankaku/Zenkaku" }, // Zenkaku/hankaku
X // { VK_KANJI, "Kanji" }, // Do not support Kanji
X };
X-#elif OS_LINUX
X+#elif defined(OS_LINUX) || defined(OS_NETBSD)
X struct LinuxVirtualKeyEntry {
X uint16 virtual_key;
X const char *mozc_key_name;
X@@ -397,7 +397,7 @@ KeyBindingFilter::KeyState KeyBindingFil
X return Encode(result);
X }
X }
X-#elif OS_LINUX
X+#elif defined(OS_LINUX) || defined(OS_NETBSD)
X const uint16 virtual_key = key_event.nativeVirtualKey();
X
X // The XKB defines three types of logical key code: "xkb::Hiragana",
X@@ -507,7 +507,7 @@ bool KeyBindingFilter::eventFilter(QObje
X KeyBindingEditor::KeyBindingEditor(QWidget *parent, QWidget *trigger_parent)
X : QDialog(parent), trigger_parent_(trigger_parent) {
X setupUi(this);
X-#if defined(OS_LINUX)
X+#if defined(OS_LINUX) || defined(OS_NETBSD)
X // Workaround for the issue https://github.com/google/mozc/issues/9
X // Seems that even after clicking the button for the keybinding dialog,
X // the edit is not raised. This might be a bug of setFocusProxy.
END-of-mozc-server/patches/patch-gui_config__dialog_keybinding__editor.cc
echo x - mozc-server/patches/patch-gui_dictionary__tool_dictionary__tool.cc
sed 's/^X//' >mozc-server/patches/patch-gui_dictionary__tool_dictionary__tool.cc << 'END-of-mozc-server/patches/patch-gui_dictionary__tool_dictionary__tool.cc'
X$NetBSD: patch-gui_dictionary__tool_dictionary__tool.cc,v 1.5 2014/06/15 13:08:34 ryoon Exp $
X
X* NetBSD support
X
X--- gui/dictionary_tool/dictionary_tool.cc.orig 2014-05-21 10:51:22.000000000 +0000
X+++ gui/dictionary_tool/dictionary_tool.cc
X@@ -347,7 +347,7 @@ DictionaryTool::DictionaryTool(QWidget *
X #endif // !ENABLE_CLOUD_SYNC
X
X // main window
X-#ifndef OS_LINUX
X+#if !defined(OS_LINUX) && !defined(OS_NETBSD)
X // For some reason setCentralWidget crashes the dictionary_tool on Linux
X // TODO(taku): investigate the cause of the crashes
X setCentralWidget(splitter_);
END-of-mozc-server/patches/patch-gui_dictionary__tool_dictionary__tool.cc
echo x - mozc-server/patches/patch-gui_qt__libraries.gypi
sed 's/^X//' >mozc-server/patches/patch-gui_qt__libraries.gypi << 'END-of-mozc-server/patches/patch-gui_qt__libraries.gypi'
X$NetBSD: patch-gui_qt__libraries.gypi,v 1.3 2014/06/15 13:08:34 ryoon Exp $
X
X* NetBSD support
X
X--- gui/qt_libraries.gypi.orig 2017-11-02 13:32:47.000000000 +0000
X+++ gui/qt_libraries.gypi
X@@ -98,7 +98,7 @@
X '$(SDKROOT)/System/Library/Frameworks/Carbon.framework',
X ]
X }],
X- ['target_platform=="Linux"', {
X+ ['target_platform=="Linux" or target_platform=="NetBSD"', {
X 'cflags': ['<!@(pkg-config --cflags Qt5Widgets Qt5Gui Qt5Core)'],
X 'libraries': ['<!@(pkg-config --libs Qt5Widgets Qt5Gui Qt5Core)'],
X }],
END-of-mozc-server/patches/patch-gui_qt__libraries.gypi
echo x - mozc-server/patches/patch-gui_qt__moc.gypi
sed 's/^X//' >mozc-server/patches/patch-gui_qt__moc.gypi << 'END-of-mozc-server/patches/patch-gui_qt__moc.gypi'
X$NetBSD$
X
X* NetBSD support
X
X--- gui/qt_moc.gypi.orig 2017-11-02 13:32:47.000000000 +0000
X+++ gui/qt_moc.gypi
X@@ -33,7 +33,7 @@
X
X 'variables': {
X 'conditions': [
X- ['target_platform=="Linux"', {
X+ ['target_platform=="Linux" or target_platform=="NetBSD"', {
X 'moc_path': '<!(pkg-config --variable=host_bins Qt5Core)/moc',
X }, 'qt_dir', {
X 'moc_path': '<(qt_dir)/bin/moc<(EXECUTABLE_SUFFIX)',
END-of-mozc-server/patches/patch-gui_qt__moc.gypi
echo x - mozc-server/patches/patch-gui_qt__rcc.gypi
sed 's/^X//' >mozc-server/patches/patch-gui_qt__rcc.gypi << 'END-of-mozc-server/patches/patch-gui_qt__rcc.gypi'
X$NetBSD$
X
X* NetBSD support
X
X--- gui/qt_rcc.gypi.orig 2017-11-02 13:32:47.000000000 +0000
X+++ gui/qt_rcc.gypi
X@@ -33,7 +33,7 @@
X
X 'variables': {
X 'conditions': [
X- ['target_platform=="Linux"', {
X+ ['target_platform=="Linux" or target_platform=="NetBSD"', {
X 'rcc_path': '<!(pkg-config --variable=host_bins Qt5Core)/rcc',
X }, 'qt_dir', {
X 'rcc_path': '<(qt_dir)/bin/rcc<(EXECUTABLE_SUFFIX)',
END-of-mozc-server/patches/patch-gui_qt__rcc.gypi
echo x - mozc-server/patches/patch-gui_qt__uic.gypi
sed 's/^X//' >mozc-server/patches/patch-gui_qt__uic.gypi << 'END-of-mozc-server/patches/patch-gui_qt__uic.gypi'
X$NetBSD$
X
X* NetBSD support
X
X--- gui/qt_uic.gypi.orig 2017-11-02 13:32:47.000000000 +0000
X+++ gui/qt_uic.gypi
X@@ -33,7 +33,7 @@
X
X 'variables': {
X 'conditions': [
X- ['target_platform=="Linux"', {
X+ ['target_platform=="Linux" or target_platform=="NetBSD"', {
X 'uic_path': '<!(pkg-config --variable=host_bins Qt5Core)/uic',
X }, 'qt_dir', {
X 'uic_path': '<(qt_dir)/bin/uic<(EXECUTABLE_SUFFIX)',
END-of-mozc-server/patches/patch-gui_qt__uic.gypi
echo x - mozc-server/patches/patch-gui_word__register__dialog_word__register__dialog.cc
sed 's/^X//' >mozc-server/patches/patch-gui_word__register__dialog_word__register__dialog.cc << 'END-of-mozc-server/patches/patch-gui_word__register__dialog_word__register__dialog.cc'
X$NetBSD: patch-gui_word__register__dialog_word__register__dialog.cc,v 1.3 2016/05/16 11:51:49 ryoon Exp $
X
X* NetBSD support
X
X--- gui/word_register_dialog/word_register_dialog.cc.orig 2016-05-15 08:11:11.000000000 +0000
X+++ gui/word_register_dialog/word_register_dialog.cc
X@@ -90,9 +90,9 @@ QString GetEnv(const char *envname) {
X }
X return "";
X #endif // OS_WIN
X-#if defined(OS_MACOSX) || defined(OS_LINUX)
X+#if defined(OS_MACOSX) || defined(OS_LINUX) || defined(OS_NETBSD)
X return ::getenv(envname);
X-#endif // OS_MACOSX or OS_LINUX
X+#endif // OS_MACOSX, OS_LINUX or OS_NETBSD
X // TODO(team): Support other platforms.
X return "";
X }
END-of-mozc-server/patches/patch-gui_word__register__dialog_word__register__dialog.cc
echo x - mozc-server/patches/patch-gyp_common.gypi
sed 's/^X//' >mozc-server/patches/patch-gyp_common.gypi << 'END-of-mozc-server/patches/patch-gyp_common.gypi'
X$NetBSD: patch-gyp_common.gypi,v 1.8 2016/05/16 11:51:49 ryoon Exp $
X
X* NetBSD support
X
X--- gyp/common.gypi.orig 2017-11-02 13:32:47.000000000 +0000
X+++ gyp/common.gypi
X@@ -88,6 +88,12 @@
X '-fstack-protector',
X '--param=ssp-buffer-size=4',
X ],
X+ # netbsd_cflags will be used for NetBSD.
X+ 'netbsd_cflags': [
X+ '<@(gcc_cflags)',
X+ '-fPIC',
X+ '-fno-exceptions',
X+ ],
X # nacl_cflags will be used for NaCl.
X # -fno-omit-frame-pointer flag does not work correctly.
X # http://code.google.com/p/chromium/issues/detail?id=122623
X@@ -133,6 +139,12 @@
X 'compiler_host': 'clang',
X 'compiler_host_version_int': 304, # Clang 3.4 or higher
X }],
X+ ['target_platform=="NetBSD"', {
X+ 'compiler_target': 'gcc',
X+ 'compiler_target_version_int': 409, # GCC 4.9 or higher
X+ 'compiler_host': 'clang',
X+ 'compiler_host_version_int': 304, # Clang 3.4 or higher
X+ }],
X ],
X },
X 'target_defaults': {
X@@ -371,6 +383,24 @@
X }],
X ],
X }],
X+ ['OS=="netbsd"', {
X+ 'defines': [
X+ 'OS_NETBSD',
X+ ],
X+ 'cflags': [
X+ '<@(netbsd_cflags)',
X+ '-fPIC',
X+ '-fno-exceptions',
X+ ],
X+ 'cflags_cc': [
X+ # We use deprecated <hash_map> and <hash_set> instead of upcoming
X+ # <unordered_map> and <unordered_set>.
X+ '-Wno-deprecated',
X+ ],
X+ 'ldflags': [
X+ '-pthread',
X+ ],
X+ }],
X ['OS=="mac"', {
X 'defines': [
X 'OS_MACOSX',
X@@ -442,7 +472,7 @@
X ['READELF.host', '<!(which readelf)'],
X ],
X }],
X- ['target_platform=="Linux"', {
X+ ['target_platform=="Linux" or target_platform=="NetBSD"', {
X 'make_global_settings': [
X ['AR', '<!(which ar)'],
X ['CC', '<!(which clang)'],
END-of-mozc-server/patches/patch-gyp_common.gypi
echo x - mozc-server/patches/patch-gyp_directories.gypi
sed 's/^X//' >mozc-server/patches/patch-gyp_directories.gypi << 'END-of-mozc-server/patches/patch-gyp_directories.gypi'
X$NetBSD$
X
X* use ${PREFIX} paths
X
X--- gyp/directories.gypi.orig 2017-11-02 13:32:47.000000000 +0000
X+++ gyp/directories.gypi
X@@ -42,7 +42,7 @@
X
X # server_dir represents the directory where mozc_server is
X # installed. This option is only for Linux.
X- 'server_dir%': '/usr/lib/mozc',
X+ 'server_dir%': '@PREFIX@/libexec',
X
X # Represents the directory where the source code of protobuf is
X # extracted. This value is ignored when 'use_libprotobuf' is 1.
X@@ -85,7 +85,7 @@
X # Win / Mac / Linux:
X # this file path is directory used by binaries without copying.
X 'zinnia_model_file%':
X- '/usr/share/tegaki/models/zinnia/handwriting-ja.model',
X+ '@PREFIX@/share/tegaki/models/zinnia/handwriting-ja.model',
X }],
X ],
X },
END-of-mozc-server/patches/patch-gyp_directories.gypi
echo x - mozc-server/patches/patch-handwriting_zinnia.gyp
sed 's/^X//' >mozc-server/patches/patch-handwriting_zinnia.gyp << 'END-of-mozc-server/patches/patch-handwriting_zinnia.gyp'
X$NetBSD: patch-handwriting_zinnia.gyp,v 1.2 2016/05/16 11:51:49 ryoon Exp $
X
X* NetBSD support
X
X--- handwriting/zinnia.gyp.orig 2017-11-02 13:32:47.000000000 +0000
X+++ handwriting/zinnia.gyp
X@@ -88,7 +88,7 @@
X 'ZINNIA_STATIC_LIBRARY',
X ],
X }],
X- ['target_platform=="Linux" or target_platform=="Mac"', {
X+ ['target_platform=="Linux" or target_platform=="Mac" or target_platform=="NetBSD"', {
X 'defines': [
X 'HAVE_CONFIG_H=1'
X ],
END-of-mozc-server/patches/patch-handwriting_zinnia.gyp
echo x - mozc-server/patches/patch-handwriting_zinnia__handwriting.cc
sed 's/^X//' >mozc-server/patches/patch-handwriting_zinnia__handwriting.cc << 'END-of-mozc-server/patches/patch-handwriting_zinnia__handwriting.cc'
X$NetBSD: patch-handwriting_zinnia__handwriting.cc,v 1.3 2016/05/16 11:51:49 ryoon Exp $
X
X* Not confirmed yet.
X
X--- handwriting/zinnia_handwriting.cc.orig 2017-11-02 13:32:47.000000000 +0000
X+++ handwriting/zinnia_handwriting.cc
X@@ -59,7 +59,7 @@ string ZinniaHandwriting::GetModelFileNa
X const char kModelFile[] = "handwriting-ja.model";
X return FileUtil::JoinPath(MacUtil::GetResourcesDirectory(), kModelFile);
X #else // OS_LINUX
X- return "/usr/share/tegaki/models/zinnia/handwriting-ja.model";
X+ return "@PREFIX@/tegaki/models/zinnia/handwriting-ja.model";
X #endif
X #endif // else defined(MOZC_BUILD)
X }
END-of-mozc-server/patches/patch-handwriting_zinnia__handwriting.cc
echo x - mozc-server/patches/patch-ipc_ipc__path__manager.cc
sed 's/^X//' >mozc-server/patches/patch-ipc_ipc__path__manager.cc << 'END-of-mozc-server/patches/patch-ipc_ipc__path__manager.cc'
X$NetBSD: patch-ipc_ipc__path__manager.cc,v 1.4 2014/01/19 01:18:50 ryoon Exp $
X
X* NetBSD support
X
X--- ipc/ipc_path_manager.cc.orig 2014-01-06 07:10:26.000000000 +0000
X+++ ipc/ipc_path_manager.cc
X@@ -44,6 +44,11 @@
X #endif // OS_MACOSX
X #endif // OS_WIN
X
X+#if defined(OS_NETBSD)
X+#include <sys/param.h>
X+#include <sys/sysctl.h>
X+#endif
X+
X #include <cstdlib>
X #include <map>
X #ifdef OS_WIN
X@@ -407,6 +412,23 @@ bool IPCPathManager::IsValidServer(uint3
X return true;
X }
X
X+#if defined(OS_NETBSD)
X+ int name[] = { CTL_KERN, KERN_PROC_ARGS, static_cast<int>(pid) };
X+ size_t data_len = 0;
X+ if (sysctl(name, arraysize(name), NULL,
X+ &data_len, NULL, 0) < 0) {
X+ LOG(ERROR) << "sysctl KERN_PROC_ARGS failed";
X+ return false;
X+ }
X+
X+ server_path_.resize(data_len);
X+ if (sysctl(name, arraysize(name), &server_path_[0],
X+ &data_len, NULL, 0) < 0) {
X+ LOG(ERROR) << "sysctl KERN_PROC_ARGS failed";
X+ return false;
X+ }
X+#endif // OS_NETBSD
X+
X #ifdef OS_LINUX
X if ((server_path + " (deleted)") == server_path_) {
X LOG(WARNING) << server_path << " on disk is modified";
END-of-mozc-server/patches/patch-ipc_ipc__path__manager.cc
echo x - mozc-server/patches/patch-ipc_ipc__path__manager__test.cc
sed 's/^X//' >mozc-server/patches/patch-ipc_ipc__path__manager__test.cc << 'END-of-mozc-server/patches/patch-ipc_ipc__path__manager__test.cc'
X$NetBSD: patch-ipc_ipc__path__manager__test.cc,v 1.2 2013/07/20 04:34:53 ryoon Exp $
X
X* NetBSD support
X
X--- ipc/ipc_path_manager_test.cc.orig 2013-07-17 02:37:50.000000000 +0000
X+++ ipc/ipc_path_manager_test.cc
X@@ -103,7 +103,7 @@ TEST_F(IPCPathManagerTest, IPCPathManage
X EXPECT_FALSE(manager->GetServerProductVersion().empty());
X EXPECT_GT(manager->GetServerProcessId(), 0);
X EXPECT_EQ(t.path(), path);
X-#ifdef OS_LINUX
X+#if defined(OS_LINUX) || defined(OS_NETBSD)
X // On Linux, |path| should be abstract (see man unix(7) for details.)
X ASSERT_FALSE(path.empty());
X EXPECT_EQ('\0', path[0]);
END-of-mozc-server/patches/patch-ipc_ipc__path__manager__test.cc
echo x - mozc-server/patches/patch-ipc_named__event.cc
sed 's/^X//' >mozc-server/patches/patch-ipc_named__event.cc << 'END-of-mozc-server/patches/patch-ipc_named__event.cc'
X$NetBSD: patch-ipc_named__event.cc,v 1.1 2013/04/29 09:52:17 ryoon Exp $
X
X* sem_open(..., 0) is not supported for NetBSD at least.
X
X--- ipc/named_event.cc.orig 2012-08-31 05:37:07.000000000 +0000
X+++ ipc/named_event.cc
X@@ -337,7 +337,7 @@ int NamedEventListener::WaitEventOrProce
X NamedEventNotifier::NamedEventNotifier(const char *name)
X : sem_(SEM_FAILED) {
X const string key_filename = NamedEventUtil::GetEventPath(name);
X- sem_ = ::sem_open(key_filename.c_str(), 0);
X+ sem_ = ::sem_open(key_filename.c_str(), O_CREAT);
X if (sem_ == SEM_FAILED) {
X LOG(ERROR) << "sem_open failed: " << ::strerror(errno);
X }
END-of-mozc-server/patches/patch-ipc_named__event.cc
echo x - mozc-server/patches/patch-ipc_unix__ipc.cc
sed 's/^X//' >mozc-server/patches/patch-ipc_unix__ipc.cc << 'END-of-mozc-server/patches/patch-ipc_unix__ipc.cc'
X$NetBSD: patch-ipc_unix__ipc.cc,v 1.4 2016/05/16 11:51:49 ryoon Exp $
X
X* NetBSD support
X
X--- ipc/unix_ipc.cc.orig 2016-05-15 08:11:11.000000000 +0000
X+++ ipc/unix_ipc.cc
X@@ -28,7 +28,7 @@
X // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
X
X // OS_LINUX only. Note that OS_ANDROID/OS_NACL don't reach here.
X-#if defined(OS_LINUX)
X+#if defined(OS_LINUX) || defined(OS_NETBSD)
X
X #include "ipc/ipc.h"
X
X@@ -127,7 +127,7 @@ bool IsPeerValid(int socket, pid_t *pid)
X // sometimes doesn't support the getsockopt(sock, SOL_SOCKET, SO_PEERCRED)
X // system call.
X // TODO(yusukes): Add implementation for ARM Linux.
X-#ifndef __arm__
X+#if !defined(__arm__) && !defined(OS_NETBSD)
X struct ucred peer_cred;
X int peer_cred_len = sizeof(peer_cred);
X if (getsockopt(socket, SOL_SOCKET, SO_PEERCRED,
X@@ -143,7 +143,23 @@ bool IsPeerValid(int socket, pid_t *pid)
X }
X
X *pid = peer_cred.pid;
X-#endif // __arm__
X+#endif // __arm__ || OS_NETBSD
X+
X+#if defined(OS_NETBSD)
X+ struct unpcbid peer_cred;
X+ int peer_cred_len = sizeof(peer_cred);
X+ if (getsockopt(socket, 0, LOCAL_PEEREID,
X+ reinterpret_cast<void *>(&peer_cred),
X+ reinterpret_cast<socklen_t *>(&peer_cred_len)) < 0) {
X+ LOG(ERROR) << "cannot get peer credential. Not a Unix socket?";
X+ return false;
X+ }
X+
X+ if (peer_cred.unp_euid!= ::geteuid()) {
X+ LOG(WARNING) << "uid mismatch." << peer_cred.unp_euid << "!=" << ::geteuid();
X+ return false;
X+ }
X+#endif
X
X return true;
X }
END-of-mozc-server/patches/patch-ipc_unix__ipc.cc
echo x - mozc-server/patches/patch-net_net.gyp
sed 's/^X//' >mozc-server/patches/patch-net_net.gyp << 'END-of-mozc-server/patches/patch-net_net.gyp'
X$NetBSD: patch-net_net.gyp,v 1.1 2013/04/29 09:52:18 ryoon Exp $
X
X* NetBSD support
X
X--- net/net.gyp.orig 2017-11-02 13:32:47.000000000 +0000
X+++ net/net.gyp
X@@ -64,7 +64,7 @@
X },
X },
X }],
X- ['target_platform=="Linux"', {
X+ ['target_platform=="Linux" or target_platform=="NetBSD"', {
X # Enable libcurl
X 'cflags': [
X '<!@(pkg-config --cflags libcurl)',
END-of-mozc-server/patches/patch-net_net.gyp
echo x - mozc-server/patches/patch-session_session.cc
sed 's/^X//' >mozc-server/patches/patch-session_session.cc << 'END-of-mozc-server/patches/patch-session_session.cc'
X$NetBSD: patch-session_session.cc,v 1.4 2016/05/16 11:51:49 ryoon Exp $
X
X* NetBSD support
X
X--- session/session.cc.orig 2016-05-15 08:11:12.000000000 +0000
X+++ session/session.cc
X@@ -232,9 +232,9 @@ void Session::InitContext(ImeContext *co
X
X context->SetConfig(&context->GetConfig());
X
X-#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NACL)
X+#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NACL) || defined(OS_NETBSD)
X context->mutable_converter()->set_use_cascading_window(false);
X-#endif // OS_LINUX || OS_ANDROID || OS_NACL
X+#endif // OS_LINUX || OS_ANDROID || OS_NACL || OS_NETBSD
X }
X
X
X@@ -961,14 +961,14 @@ void Session::UpdatePreferences(commands
X config.selection_shortcut());
X }
X
X-#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NACL)
X+#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NACL) || defined(OS_NETBSD)
X context_->mutable_converter()->set_use_cascading_window(false);
X-#else // OS_LINUX || OS_ANDROID || OS_NACL
X+#else // OS_LINUX || OS_ANDROID || OS_NACL || OS_NETBSD
X if (config.has_use_cascading_window()) {
X context_->mutable_converter()->set_use_cascading_window(
X config.use_cascading_window());
X }
X-#endif // OS_LINUX || OS_ANDROID || OS_NACL
X+#endif // OS_LINUX || OS_ANDROID || OS_NACL || OS_NETBSD
X }
X
X bool Session::IMEOn(commands::Command *command) {
END-of-mozc-server/patches/patch-session_session.cc
echo x - mozc-server/patches/patch-session_session__test.cc
sed 's/^X//' >mozc-server/patches/patch-session_session__test.cc << 'END-of-mozc-server/patches/patch-session_session__test.cc'
X$NetBSD: patch-session_session__test.cc,v 1.2 2016/05/16 11:51:49 ryoon Exp $
X
X* NetBSD support
X
X--- session/session_test.cc.orig 2016-05-15 08:11:12.000000000 +0000
X+++ session/session_test.cc
X@@ -2136,11 +2136,11 @@ TEST_F(SessionTest, UpdatePreferences) {
X const size_t cascading_cand_size =
X command.output().candidates().candidate_size();
X
X-#if defined(OS_LINUX) || defined(OS_ANDROID) || OS_NACL
X+#if defined(OS_LINUX) || defined(OS_ANDROID) || OS_NACL || defined(OS_NETBSD)
X EXPECT_EQ(no_cascading_cand_size, cascading_cand_size);
X-#else // defined(OS_LINUX) || defined(OS_ANDROID) || OS_NACL
X+#else // defined(OS_LINUX) || defined(OS_ANDROID) || OS_NACL || defined(OS_NETBSD)
X EXPECT_GT(no_cascading_cand_size, cascading_cand_size);
X-#endif // defined(OS_LINUX) || defined(OS_ANDROID) || OS_NACL
X+#endif // defined(OS_LINUX) || defined(OS_ANDROID) || OS_NACL || defined(OS_NETBSD)
X
X command.Clear();
X session->ConvertCancel(&command);
X@@ -2330,7 +2330,7 @@ TEST_F(SessionTest, OutputAllCandidateWo
X
X EXPECT_EQ(0, output.all_candidate_words().focused_index());
X EXPECT_EQ(commands::CONVERSION, output.all_candidate_words().category());
X-#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NACL)
X+#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NACL) || defined(OS_NETBSD)
X // Cascading window is not supported on Linux, so the size of
X // candidate words is different from other platform.
X // TODO(komatsu): Modify the client for Linux to explicitly change
X@@ -2340,13 +2340,13 @@ TEST_F(SessionTest, OutputAllCandidateWo
X // "�����" (t13n), "AIUEO" (t13n), "A����" (t13n),
X // "アイウエオ" (t13n) ]
X EXPECT_EQ(9, output.all_candidate_words().candidates_size());
X-#else // OS_LINUX || OS_ANDROID || OS_NACL
X+#else // OS_LINUX || OS_ANDROID || OS_NACL || OS_NETBSD
X // [ "ã??ã??ã??ã??ã??", "ã?¢ã?¤ã?¦ã?¨ã?ª", "ã?¢ã?¤ã?¦ã?¨ã?ª" (t13n), "ã??ã??ã??ã??ã??" (t13n),
X // "aiueo" (t13n), "AIUEO" (t13n), "Aieuo" (t13n),
X // "�����" (t13n), "AIUEO" (t13n), "A����" (t13n),
X // "アイウエオ" (t13n) ]
X EXPECT_EQ(11, output.all_candidate_words().candidates_size());
X-#endif // OS_LINUX || OS_ANDROID || OS_NACL
X+#endif // OS_LINUX || OS_ANDROID || OS_NACL || OS_NETBSD
X }
X
X command.Clear();
X@@ -2358,7 +2358,7 @@ TEST_F(SessionTest, OutputAllCandidateWo
X
X EXPECT_EQ(1, output.all_candidate_words().focused_index());
X EXPECT_EQ(commands::CONVERSION, output.all_candidate_words().category());
X-#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NACL)
X+#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_NACL) || defined(OS_NETBSD)
X // Cascading window is not supported on Linux, so the size of
X // candidate words is different from other platform.
X // TODO(komatsu): Modify the client for Linux to explicitly change
X@@ -2368,13 +2368,13 @@ TEST_F(SessionTest, OutputAllCandidateWo
X // "�����" (t13n), "AIUEO" (t13n), "A����" (t13n),
X // "アイウエオ" (t13n) ]
X EXPECT_EQ(9, output.all_candidate_words().candidates_size());
X-#else // OS_LINUX || OS_ANDROID || OS_NACL
X+#else // OS_LINUX || OS_ANDROID || OS_NACL || OS_NETBSD
X // [ "ã??ã??ã??ã??ã??", "ã?¢ã?¤ã?¦ã?¨ã?ª",
X // "aiueo" (t13n), "AIUEO" (t13n), "Aieuo" (t13n),
X // "�����" (t13n), "AIUEO" (t13n), "A����" (t13n),
X // "アイウエオ" (t13n) ]
X EXPECT_EQ(11, output.all_candidate_words().candidates_size());
X-#endif // OS_LINUX || OS_ANDROID || OS_NACL
X+#endif // OS_LINUX || OS_ANDROID || OS_NACL || OS_NETBSD
X }
X }
X
END-of-mozc-server/patches/patch-session_session__test.cc
echo x - mozc-server/patches/patch-third__party_protobuf_post__process__dist.sh
sed 's/^X//' >mozc-server/patches/patch-third__party_protobuf_post__process__dist.sh << 'END-of-mozc-server/patches/patch-third__party_protobuf_post__process__dist.sh'
X$NetBSD: patch-third__party_protobuf_post__process__dist.sh,v 1.3 2016/05/16 11:51:49 ryoon Exp $
X
X* appease pkglint
X
X--- third_party/protobuf/post_process_dist.sh.orig 2017-11-02 13:35:43.000000000 +0000
X+++ third_party/protobuf/post_process_dist.sh
X@@ -15,7 +15,7 @@
X # non-testdata .txt files are converted to Windows-style line endings.
X # 5) Cleans up after itself.
X
X-if [ "$1" == "" ]; then
X+if [ "$1" = "" ]; then
X echo "USAGE: $0 DISTFILE" >&2
X exit 1
X fi
END-of-mozc-server/patches/patch-third__party_protobuf_post__process__dist.sh
echo x - mozc-server/patches/patch-unix_ibus_ibus.gyp
sed 's/^X//' >mozc-server/patches/patch-unix_ibus_ibus.gyp << 'END-of-mozc-server/patches/patch-unix_ibus_ibus.gyp'
X$NetBSD: patch-unix_ibus_ibus.gyp,v 1.1 2014/06/15 13:08:34 ryoon Exp $
X
X* use ${PREFIX} paths
X
X--- unix/ibus/ibus.gyp.orig 2017-11-02 13:32:47.000000000 +0000
X+++ unix/ibus/ibus.gyp
X@@ -31,8 +31,8 @@
X 'variables': {
X 'relative_dir': 'unix/ibus',
X 'gen_out_dir': '<(SHARED_INTERMEDIATE_DIR)/<(relative_dir)',
X- 'ibus_mozc_icon_path%': '/usr/share/ibus-mozc/product_icon.png',
X- 'ibus_mozc_path%': '/usr/lib/ibus-mozc/ibus-engine-mozc',
X+ 'ibus_mozc_icon_path%': '@PREFIX@/share/ibus-mozc/product_icon.png',
X+ 'ibus_mozc_path%': '@PREFIX@/libexec/ibus-engine-mozc',
X # enable_x11_selection_monitor represents if ibus_mozc uses X11 selection
X # monitor or not.
X 'enable_x11_selection_monitor%': 1,
END-of-mozc-server/patches/patch-unix_ibus_ibus.gyp
echo x - mozc-server/patches/patch-unix_ibus_path__util.cc
sed 's/^X//' >mozc-server/patches/patch-unix_ibus_path__util.cc << 'END-of-mozc-server/patches/patch-unix_ibus_path__util.cc'
X$NetBSD$
X
X* use ${PREFIX} path
X
X--- unix/ibus/path_util.cc.orig 2017-11-02 13:32:47.000000000 +0000
X+++ unix/ibus/path_util.cc
X@@ -30,7 +30,7 @@
X #include "unix/ibus/path_util.h"
X
X namespace {
X-const char kInstalledDirectory[] = "/usr/share/ibus-mozc";
X+const char kInstalledDirectory[] = "@PREFIX@/share/ibus-mozc";
X }
X
X namespace mozc {
END-of-mozc-server/patches/patch-unix_ibus_path__util.cc
exit
--- cut here ---
Home |
Main Index |
Thread Index |
Old Index