aboutsummaryrefslogtreecommitdiff
path: root/japanese/mozc-server/files
diff options
context:
space:
mode:
authorHiroki Sato <hrs@FreeBSD.org>2013-05-14 19:46:20 +0000
committerHiroki Sato <hrs@FreeBSD.org>2013-05-14 19:46:20 +0000
commit8a7acbced9ab85ca1cf0669741656cbcf5004a6d (patch)
treef985850491613a2507e5197dbaec962101e3ffef /japanese/mozc-server/files
parentad3c41ea0b2e6e93c0f050f2b4cb4c756dde2949 (diff)
downloadports-8a7acbced9ab85ca1cf0669741656cbcf5004a6d.tar.gz
ports-8a7acbced9ab85ca1cf0669741656cbcf5004a6d.zip
Notes
Diffstat (limited to 'japanese/mozc-server/files')
-rw-r--r--japanese/mozc-server/files/leim-list.el30
-rw-r--r--japanese/mozc-server/files/patch-base_base.gyp12
-rw-r--r--japanese/mozc-server/files/patch-base_iconv.cc6
-rw-r--r--japanese/mozc-server/files/patch-base_logging.cc11
-rw-r--r--japanese/mozc-server/files/patch-base_mutex.cc6
-rw-r--r--japanese/mozc-server/files/patch-base_process.cc23
-rw-r--r--japanese/mozc-server/files/patch-build_mozc.py49
-rw-r--r--japanese/mozc-server/files/patch-gui_about_dialog_about_dialog.cc8
-rw-r--r--japanese/mozc-server/files/patch-gyp_common.gypi39
-rw-r--r--japanese/mozc-server/files/patch-handwriting_zinnia_handwriting.cc18
-rw-r--r--japanese/mozc-server/files/patch-ipc_ipc_path_manager.cc6
-rw-r--r--japanese/mozc-server/files/patch-ipc_unix_ipc.cc14
-rw-r--r--japanese/mozc-server/files/patch-server_mozc_server.cc10
-rw-r--r--japanese/mozc-server/files/patch-third_party_gyp_pylib_gyp_generator_make.py23
-rw-r--r--japanese/mozc-server/files/patch-unix_emacs_mozc.el55
-rw-r--r--japanese/mozc-server/files/patch-unix_ibus_gen_mozc_xml.py198
-rw-r--r--japanese/mozc-server/files/patch-unix_ibus_ibus.gyp10
-rw-r--r--japanese/mozc-server/files/patch-unix_ibus_mozc.xml24
-rw-r--r--japanese/mozc-server/files/patch-unix_ibus_path_util.cc24
19 files changed, 398 insertions, 168 deletions
diff --git a/japanese/mozc-server/files/leim-list.el b/japanese/mozc-server/files/leim-list.el
new file mode 100644
index 000000000000..bb15f3cfb8f4
--- /dev/null
+++ b/japanese/mozc-server/files/leim-list.el
@@ -0,0 +1,30 @@
+;; leim-list.el --- Mozc setup for leim API
+;; $FreeBSD$$
+;;
+;; Copyright (c) 2013 Hiroki Sato <hrs@FreeBSD.org>. All rights reserved.
+;;
+;; Redistribution and use in source and binary forms, with or without
+;; modification, are permitted provided that the following conditions
+;; are met:
+;; 1. Redistributions of source code must retain the above copyright
+;; notice, this list of conditions and the following disclaimer.
+;; 2. Redistributions in binary form must reproduce the above copyright
+;; notice, this list of conditions and the following disclaimer in the
+;; documentation and/or other materials provided with the distribution.
+;;
+
+(autoload 'mozc-mode "mozc.el" "Activate Mozc." t)
+(autoload 'mozc-leim-activate "mozc.el" "Activate Mozc." t)
+
+(defcustom mozc-leim-title "[Mozc]"
+ "Mode line string shown when mozc-mode is enabled.
+This indicator is not shown when you don't use LEIM."
+ :type '(choice (const :tag "No indicator" nil)
+ (string :tag "Show an indicator"))
+ :group 'mozc)
+
+(register-input-method
+ "japanese-mozc" "Japanese" 'mozc-leim-activate
+ mozc-leim-title
+ "Japanese input method with Mozc/Google Japanese Input."
+ 'its-select-hiragana)
diff --git a/japanese/mozc-server/files/patch-base_base.gyp b/japanese/mozc-server/files/patch-base_base.gyp
index 5b85404f4a72..d3f893ed4fe2 100644
--- a/japanese/mozc-server/files/patch-base_base.gyp
+++ b/japanese/mozc-server/files/patch-base_base.gyp
@@ -1,27 +1,27 @@
---- base/base.gyp.orig 2013-04-21 03:48:45.178270244 +0900
-+++ base/base.gyp 2013-04-21 04:16:38.943269499 +0900
+--- base/base.gyp.orig 2013-03-29 13:33:43.000000000 +0900
++++ base/base.gyp 2013-04-23 23:49:53.000000000 +0900
@@ -265,20 +265,20 @@
['OS=="linux" and target_platform!="Android" and '
'not (target_platform=="NaCl" and _toolset=="target")', {
'cflags': [
- '<!@(<(pkg_config_command) --cflags-only-other openssl)',
-+ '%%OPENSSL_CFLAGS%%',
++ '<(openssl_cflags)',
],
'defines': [
'HAVE_OPENSSL=1',
],
'include_dirs': [
- '<!@(<(pkg_config_command) --cflags-only-I openssl)',
-+ '-I%%OPENSSLINC%%/openssl',
++ '<(openssl_inc)',
],
'link_settings': {
'ldflags': [
- '<!@(<(pkg_config_command) --libs-only-L openssl)',
-+ '%%OPENSSL_LDFLAGS%% -L%%OPENSSLLIB%%',
++ '<(openssl_ldflags)',
],
'libraries': [
- '<!@(<(pkg_config_command) --libs-only-l openssl)',
-+ '-lssl',
++ '<(openssl_lib)',
],
},
}],
diff --git a/japanese/mozc-server/files/patch-base_iconv.cc b/japanese/mozc-server/files/patch-base_iconv.cc
index 4fb4d60f6688..4ac94c3a2f40 100644
--- a/japanese/mozc-server/files/patch-base_iconv.cc
+++ b/japanese/mozc-server/files/patch-base_iconv.cc
@@ -1,10 +1,10 @@
---- base/iconv.cc.orig 2013-04-21 03:48:45.174270168 +0900
-+++ base/iconv.cc 2013-04-21 04:16:39.946269033 +0900
+--- base/iconv.cc.orig 2013-03-29 13:33:43.000000000 +0900
++++ base/iconv.cc 2013-04-27 15:36:30.000000000 +0900
@@ -53,7 +53,11 @@
size_t olen_org = olen;
iconv(ic, 0, &ilen, 0, &olen); // reset iconv state
while (ilen != 0) {
-+#ifdef __FreeBSD__
++#ifdef OS_FREEBSD
+ if (iconv(ic, (const char **)(&ibuf), &ilen, &obuf, &olen)
+#else
if (iconv(ic, reinterpret_cast<char **>(&ibuf), &ilen, &obuf, &olen)
diff --git a/japanese/mozc-server/files/patch-base_logging.cc b/japanese/mozc-server/files/patch-base_logging.cc
new file mode 100644
index 000000000000..e8791332356f
--- /dev/null
+++ b/japanese/mozc-server/files/patch-base_logging.cc
@@ -0,0 +1,11 @@
+--- base/logging.cc.orig 2013-04-26 10:49:33.000000000 +0900
++++ base/logging.cc 2013-04-26 10:53:18.000000000 +0900
+@@ -111,7 +111,7 @@
+ #if defined(__native_client__)
+ "%p",
+ #elif defined(OS_LINUX)
+- "%lu",
++ "%p",
+ #else // = OS_WIN or OS_MACOSX
+ "%u",
+ #endif
diff --git a/japanese/mozc-server/files/patch-base_mutex.cc b/japanese/mozc-server/files/patch-base_mutex.cc
index a11517f467a9..5d36cf708388 100644
--- a/japanese/mozc-server/files/patch-base_mutex.cc
+++ b/japanese/mozc-server/files/patch-base_mutex.cc
@@ -1,11 +1,11 @@
---- base/mutex.cc.orig 2013-04-21 03:48:45.170269862 +0900
-+++ base/mutex.cc 2013-04-21 04:16:39.083269637 +0900
+--- base/mutex.cc.orig 2013-03-29 13:33:43.000000000 +0900
++++ base/mutex.cc 2013-04-27 15:37:37.000000000 +0900
@@ -296,7 +296,7 @@
// PTHREAD_MUTEX_RECURSIVE_NP but Mac OS X 10.5 does not
pthread_mutexattr_t attr;
pthread_mutexattr_init(&attr);
-#if defined(OS_MACOSX)
-+#if defined(OS_MACOSX) || defined(__FreeBSD__)
++#if defined(OS_MACOSX) || defined(OS_FREEBSD)
pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
#elif defined(OS_LINUX)
pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE_NP);
diff --git a/japanese/mozc-server/files/patch-base_process.cc b/japanese/mozc-server/files/patch-base_process.cc
index 5990af6eb29d..48b94ca9c40d 100644
--- a/japanese/mozc-server/files/patch-base_process.cc
+++ b/japanese/mozc-server/files/patch-base_process.cc
@@ -1,22 +1,11 @@
---- base/process.cc.orig 2013-04-21 03:48:45.176269982 +0900
-+++ base/process.cc 2013-04-21 04:16:40.382269441 +0900
-@@ -121,13 +121,18 @@
- return ShellExecuteInSystemDir(L"open", wurl.c_str(), NULL, SW_SHOW);
+--- base/process.cc.orig 2013-03-29 13:33:43.000000000 +0900
++++ base/process.cc 2013-04-24 00:17:03.000000000 +0900
+@@ -122,7 +122,7 @@
#endif
--#ifdef OS_LINUX
-+#if defined(OS_LINUX) && !defined(__FreeBSD__)
- static const char kBrowserCommand[] = "/usr/bin/xdg-open";
+ #ifdef OS_LINUX
+- static const char kBrowserCommand[] = "/usr/bin/xdg-open";
++ static const char kBrowserCommand[] = LOCALBASE "/bin/xdg-open";
// xdg-open which uses kfmclient or gnome-open internally works both on KDE
// and GNOME environments.
return SpawnProcess(kBrowserCommand, url);
- #endif // LINUX
-
-+#ifdef __FreeBSD__
-+ static const char kBrowserCommand[] = "@@LOCALBASE@@/bin/xdg-open";
-+ return SpawnProcess(kBrowserCommand, url);
-+#endif
-+
- #ifdef OS_MACOSX
- return MacProcess::OpenBrowserForMac(url);
- #endif // OS_MACOSX
diff --git a/japanese/mozc-server/files/patch-build_mozc.py b/japanese/mozc-server/files/patch-build_mozc.py
new file mode 100644
index 000000000000..8cbae3d0f42d
--- /dev/null
+++ b/japanese/mozc-server/files/patch-build_mozc.py
@@ -0,0 +1,49 @@
+--- build_mozc.py.orig 2013-03-29 13:33:25.000000000 +0900
++++ build_mozc.py 2013-05-02 00:54:37.000000000 +0900
+@@ -332,6 +332,14 @@
+ help='use rsync to copy files instead of builtin function')
+ AddTargetPlatformOption(parser)
+
++ parser.add_option('--localbase', dest='localbase')
++ parser.add_option('--ldflags', dest='ldflags')
++ parser.add_option('--include_dirs', dest='include_dirs')
++ parser.add_option('--openssl_cflags', dest='openssl_cflags')
++ parser.add_option('--openssl_ldflags', dest='openssl_ldflags')
++ parser.add_option('--openssl_lib', dest='openssl_lib')
++ parser.add_option('--openssl_inc', dest='openssl_inc')
++
+ parser.add_option('--mac_dir', dest='mac_dir',
+ help='A path to the root directory of third party '
+ 'libraries for Mac build which will be passed to gyp '
+@@ -506,7 +514,7 @@
+ parser = optparse.OptionParser(usage='Usage: %prog build [options]')
+ AddCommonOptions(parser)
+ if IsLinux():
+- default_build_concurrency = GetNumberOfProcessors() * 2
++ default_build_concurrency = 1;
+ parser.add_option('--jobs', '-j', dest='jobs',
+ default=('%d' % default_build_concurrency),
+ metavar='N', help='run build jobs in parallel')
+@@ -709,7 +717,22 @@
+ command_line.extend(['-D', 'enable_unittest=0'])
+ break
+
++ localbase = options.localbase or '/usr'
++ command_line.extend(['-D', 'localbase=%s' % localbase])
+
++ ldflags = options.ldflags or ''
++ command_line.extend(['-D', 'ldflags=%s' % ldflags])
++ include_dirs = options.include_dirs or ''
++ command_line.extend(['-D', 'include_dirs=%s' % include_dirs])
++
++ openssl_cflags = options.openssl_cflags or ''
++ command_line.extend(['-D', 'openssl_cflags=%s' % openssl_cflags])
++ openssl_ldflags = options.openssl_cflags or ''
++ command_line.extend(['-D', 'openssl_ldflags=%s' % openssl_ldflags])
++ openssl_inc = options.openssl_inc or ''
++ command_line.extend(['-D', 'openssl_inc=%s' % openssl_inc])
++ openssl_lib = options.openssl_lib or ''
++ command_line.extend(['-D', 'openssl_lib=%s' % openssl_lib])
+
+ mac_dir = options.mac_dir or '../mac'
+ if not os.path.isabs(mac_dir):
diff --git a/japanese/mozc-server/files/patch-gui_about_dialog_about_dialog.cc b/japanese/mozc-server/files/patch-gui_about_dialog_about_dialog.cc
index 18b83b3ec86f..ad375ba47ea0 100644
--- a/japanese/mozc-server/files/patch-gui_about_dialog_about_dialog.cc
+++ b/japanese/mozc-server/files/patch-gui_about_dialog_about_dialog.cc
@@ -1,11 +1,11 @@
---- gui/about_dialog/about_dialog.cc.orig 2013-04-21 03:48:45.446269666 +0900
-+++ gui/about_dialog/about_dialog.cc 2013-04-21 04:15:03.065269472 +0900
+--- gui/about_dialog/about_dialog.cc.orig 2013-03-29 13:33:58.000000000 +0900
++++ gui/about_dialog/about_dialog.cc 2013-04-27 15:16:49.000000000 +0900
@@ -121,7 +121,11 @@
SetLabelText(label_terms);
SetLabelText(label_credits);
-+#ifdef __FreeBSD__
-+ product_image_.reset(new QImage("@@LOCALBASE@@/share/mozc-tool/icons/product_logo.png"));
++#ifdef OS_FREEBSD
++ product_image_.reset(new QImage(LOCALBASE "/share/mozc-tool/icons/product_logo.png"));
+#else
product_image_.reset(new QImage(":/product_logo.png"));
+#endif
diff --git a/japanese/mozc-server/files/patch-gyp_common.gypi b/japanese/mozc-server/files/patch-gyp_common.gypi
index 946877e4b7b1..a0705b4c36f0 100644
--- a/japanese/mozc-server/files/patch-gyp_common.gypi
+++ b/japanese/mozc-server/files/patch-gyp_common.gypi
@@ -1,32 +1,25 @@
---- gyp/common.gypi.orig 2013-04-21 03:48:45.395416165 +0900
-+++ gyp/common.gypi 2013-04-21 08:31:10.191270448 +0900
-@@ -58,7 +58,7 @@
- # warning_cflags will be shared with Mac and Linux.
- 'warning_cflags': [
- '-Wall',
-- '-Werror',
-+# '-Werror',
- '-Wno-char-subscripts',
- '-Wno-sign-compare',
- '-Wno-deprecated-declarations',
-@@ -194,7 +194,7 @@
- # - http://code.google.com/p/protobuf/issues/detail?id=128
- # - http://code.google.com/p/protobuf/issues/detail?id=370
- # for the background information.
-- 'use_libprotobuf%': 0,
-+ 'use_libprotobuf%': 1,
-
- # use_libzinnia represents if zinnia library is used or not.
- # This option is only for Linux.
-@@ -735,6 +735,12 @@
+--- gyp/common.gypi.orig 2013-03-29 13:33:42.000000000 +0900
++++ gyp/common.gypi 2013-04-28 17:38:16.000000000 +0900
+@@ -723,7 +723,9 @@
+ ['OS=="linux"', {
+ 'defines': [
+ 'OS_LINUX',
++ 'OS_FREEBSD',
+ 'MOZC_SERVER_DIRECTORY="<@(server_dir)"',
++ 'LOCALBASE="<@(localbase)"',
+ ],
+ 'cflags': [
+ '<@(warning_cflags)',
+@@ -735,6 +737,13 @@
# <unordered_map> and <unordered_set>.
'-Wno-deprecated',
],
+ 'include_dirs': [
-+ '@@LOCALBASE@@/include'
++ '<@(include_dirs)'
+ ],
+ 'ldflags': [
-+ '-L@@LOCALBASE@@/lib'
++ '<@(ldflags)',
++ '-fstack-protector',
+ ],
'conditions': [
['target_platform=="ChromeOS"', {
diff --git a/japanese/mozc-server/files/patch-handwriting_zinnia_handwriting.cc b/japanese/mozc-server/files/patch-handwriting_zinnia_handwriting.cc
index 6d92dc1837ff..22fb9c119b6b 100644
--- a/japanese/mozc-server/files/patch-handwriting_zinnia_handwriting.cc
+++ b/japanese/mozc-server/files/patch-handwriting_zinnia_handwriting.cc
@@ -1,19 +1,11 @@
---- handwriting/zinnia_handwriting.cc.orig 2013-04-21 03:48:52.166271231 +0900
-+++ handwriting/zinnia_handwriting.cc 2013-04-21 04:20:14.073270179 +0900
-@@ -49,10 +49,16 @@
- const char kModelFile[] = "handwriting-light-ja.model";
- return FileUtil::JoinPath(MacUtil::GetResourcesDirectory(), kModelFile);
+--- handwriting/zinnia_handwriting.cc.orig 2013-03-29 13:33:25.000000000 +0900
++++ handwriting/zinnia_handwriting.cc 2013-04-27 15:15:30.000000000 +0900
+@@ -51,7 +51,7 @@
#elif defined(USE_LIBZINNIA)
-+#if defined(__FreeBSD__)
-+ const char kModelFile[] =
-+ "@@LOCALBASE@@/share/tegaki/models/zinnia/handwriting-ja.model";
-+ return kModelFile;
-+#else
// On Linux, use the model for tegaki-zinnia.
const char kModelFile[] =
- "/usr/share/tegaki/models/zinnia/handwriting-ja.model";
+- "/usr/share/tegaki/models/zinnia/handwriting-ja.model";
++ LOCALBASE "/share/tegaki/models/zinnia/handwriting-ja.model";
return kModelFile;
-+#endif
#else
const char kModelFile[] = "handwriting-ja.model";
- return FileUtil::JoinPath(SystemUtil::GetServerDirectory(), kModelFile);
diff --git a/japanese/mozc-server/files/patch-ipc_ipc_path_manager.cc b/japanese/mozc-server/files/patch-ipc_ipc_path_manager.cc
index 542f221f0eb0..8b029cc2652f 100644
--- a/japanese/mozc-server/files/patch-ipc_ipc_path_manager.cc
+++ b/japanese/mozc-server/files/patch-ipc_ipc_path_manager.cc
@@ -1,11 +1,11 @@
---- ipc/ipc_path_manager.cc.orig 2013-04-21 03:48:45.259273192 +0900
-+++ ipc/ipc_path_manager.cc 2013-04-21 04:20:12.800269260 +0900
+--- ipc/ipc_path_manager.cc.orig 2013-03-29 13:33:26.000000000 +0900
++++ ipc/ipc_path_manager.cc 2013-04-27 15:21:52.000000000 +0900
@@ -276,7 +276,7 @@
*ipc_name = kIPCPrefix;
#endif // OS_WIN
-#ifdef OS_LINUX
-+#if defined(OS_LINUX) && !defined(__FreeBSD__)
++#if defined(OS_LINUX) && !defined(OS_FREEBSD)
// On Linux, use abstract namespace which is independent of the file system.
(*ipc_name)[0] = '\0';
#endif
diff --git a/japanese/mozc-server/files/patch-ipc_unix_ipc.cc b/japanese/mozc-server/files/patch-ipc_unix_ipc.cc
index 81be7b6270c0..76192d6fd642 100644
--- a/japanese/mozc-server/files/patch-ipc_unix_ipc.cc
+++ b/japanese/mozc-server/files/patch-ipc_unix_ipc.cc
@@ -1,10 +1,10 @@
---- ipc/unix_ipc.cc.orig 2013-04-21 03:48:45.257269513 +0900
-+++ ipc/unix_ipc.cc 2013-04-21 08:33:27.207272333 +0900
+--- ipc/unix_ipc.cc.orig 2013-03-29 13:33:26.000000000 +0900
++++ ipc/unix_ipc.cc 2013-04-27 15:23:08.000000000 +0900
@@ -41,6 +41,9 @@
#include <sys/time.h>
#include <sys/types.h>
#include <sys/un.h>
-+#if defined(OS_MACOSX) || defined(__FreeBSD__)
++#if defined(OS_MACOSX) || defined(OS_FREEBSD)
+#include <sys/ucred.h>
+#endif
#include <sys/wait.h>
@@ -14,7 +14,7 @@
bool IsPeerValid(int socket, pid_t *pid) {
*pid = 0;
-+#if defined(OS_MACOSX) || defined(__FreeBSD__)
++#if defined(OS_MACOSX) || defined(OS_FREEBSD)
+ // If the OS is MAC, we should validate the peer by using LOCAL_PEERCRED.
+ struct xucred peer_cred;
+ socklen_t peer_cred_len = sizeof(struct xucred);
@@ -36,7 +36,7 @@
+ *pid = 0;
+#endif
+
-+#if defined(OS_LINUX) && !defined(__FreeBSD__)
++#if defined(OS_LINUX) && !defined(OS_FREEBSD)
// On ARM Linux, we do nothing and just return true since the platform
// sometimes doesn't support the getsockopt(sock, SOL_SOCKET, SO_PEERCRED)
// system call.
@@ -52,7 +52,7 @@
address.sun_family = AF_UNIX;
::memcpy(address.sun_path, server_address.data(), server_address_length);
address.sun_path[server_address_length] = '\0';
-+#if defined(OS_MACOSX) || defined(__FreeBSD__)
++#if defined(OS_MACOSX) || defined(OS_FREEBSD)
+ address.sun_len = SUN_LEN(&address);
+ const size_t sun_len = sizeof(address);
+#else
@@ -65,7 +65,7 @@
SO_REUSEADDR,
reinterpret_cast<char *>(&on),
sizeof(on));
-+#if defined(OS_MACOSX) || defined(__FreeBSD__)
++#if defined(OS_MACOSX) || defined(OS_FREEBSD)
+ addr.sun_len = SUN_LEN(&addr);
+ const size_t sun_len = sizeof(addr);
+#else
diff --git a/japanese/mozc-server/files/patch-server_mozc_server.cc b/japanese/mozc-server/files/patch-server_mozc_server.cc
index 543604f7df33..55a601b1a9ba 100644
--- a/japanese/mozc-server/files/patch-server_mozc_server.cc
+++ b/japanese/mozc-server/files/patch-server_mozc_server.cc
@@ -1,10 +1,10 @@
---- server/mozc_server.cc.orig 2013-04-21 03:48:44.841269792 +0900
-+++ server/mozc_server.cc 2013-04-21 04:14:37.821269328 +0900
+--- server/mozc_server.cc.orig 2013-03-29 13:33:26.000000000 +0900
++++ server/mozc_server.cc 2013-04-27 15:18:29.000000000 +0900
@@ -32,6 +32,9 @@
#ifdef OS_WIN
#include <windows.h>
#endif
-+#ifdef __FreeBSD__
++#ifdef OS_FREEBSD
+#include <signal.h>
+#endif
@@ -14,7 +14,7 @@
mozc::SessionServer *g_session_server = NULL;
}
-+#ifdef __FreeBSD__
++#ifdef OS_FREEBSD
+static void sig_func(int num)
+{
+ VLOG(1) << "signal " << num << " recieved.";
@@ -38,7 +38,7 @@
return -1;
}
-+#ifdef __FreeBSD__
++#ifdef OS_FREEBSD
+ ::signal(SIGINT, sig_func);
+ ::signal(SIGHUP, sig_func);
+ ::signal(SIGTERM, sig_func);
diff --git a/japanese/mozc-server/files/patch-third_party_gyp_pylib_gyp_generator_make.py b/japanese/mozc-server/files/patch-third_party_gyp_pylib_gyp_generator_make.py
index 62427e26104b..1d391db29991 100644
--- a/japanese/mozc-server/files/patch-third_party_gyp_pylib_gyp_generator_make.py
+++ b/japanese/mozc-server/files/patch-third_party_gyp_pylib_gyp_generator_make.py
@@ -1,5 +1,14 @@
---- third_party/gyp/pylib/gyp/generator/make.py.orig 2013-04-21 03:48:44.552270209 +0900
-+++ third_party/gyp/pylib/gyp/generator/make.py 2013-04-21 04:16:32.828269137 +0900
+--- third_party/gyp/pylib/gyp/generator/make.py.orig 2013-02-26 11:59:54.000000000 +0900
++++ third_party/gyp/pylib/gyp/generator/make.py 2013-05-03 21:08:15.000000000 +0900
+@@ -259,7 +259,7 @@
+ # export LINK=g++
+ #
+ # This will allow make to invoke N linker processes as specified in -jN.
+-LINK ?= %(flock)s $(builddir)/linker.lock $(CXX.target)
++LINK ?= $(CXX.target)
+
+ CC.target ?= %(CC.target)s
+ CFLAGS.target ?= $(CFLAGS)
@@ -1956,6 +1956,9 @@
srcdir_prefix = '$(srcdir)/'
@@ -10,3 +19,13 @@
header_params = {
'default_target': default_target,
'builddir': builddir_name,
+@@ -2003,7 +2006,8 @@
+ build_file, _, _ = gyp.common.ParseQualifiedTarget(target_list[0])
+ make_global_settings_array = data[build_file].get('make_global_settings', [])
+ wrappers = {}
+- wrappers['LINK'] = '%s $(builddir)/linker.lock' % flock_command
++ # Disable flock for linking.
++ # wrappers['LINK'] = '%s $(builddir)/linker.lock' % flock_command
+ for key, value in make_global_settings_array:
+ if key.endswith('_wrapper'):
+ wrappers[key[:-len('_wrapper')]] = '$(abspath %s)' % value
diff --git a/japanese/mozc-server/files/patch-unix_emacs_mozc.el b/japanese/mozc-server/files/patch-unix_emacs_mozc.el
new file mode 100644
index 000000000000..33364d71c148
--- /dev/null
+++ b/japanese/mozc-server/files/patch-unix_emacs_mozc.el
@@ -0,0 +1,55 @@
+--- unix/emacs/mozc.el.orig 2013-03-29 13:33:43.000000000 +0900
++++ unix/emacs/mozc.el 2013-05-05 17:27:24.000000000 +0900
+@@ -1755,29 +1755,36 @@
+
+ (require 'mule)
+
+-(defun mozc-leim-activate (input-method)
++(defun mozc-leim-activate (&rest input-method)
+ "Activate mozc-mode via LEIM.
+ INPUT-METHOD is not used."
+- (setq inactivate-current-input-method-function 'mozc-leim-inactivate)
++ (set
++ (if (boundp 'deactivate-current-input-method-function)
++ 'deactivate-current-input-method-function
++ 'inactivate-current-input-method-function)
++ 'mozc-leim-deactivate)
+ (mozc-mode t))
+
+-(defun mozc-leim-inactivate ()
+- "Inactivate mozc-mode via LEIM."
++(defun mozc-leim-deactivate ()
++ "Deactivate mozc-mode via LEIM."
+ (mozc-mode nil))
+
+-(defcustom mozc-leim-title "[Mozc]"
+- "Mode line string shown when mozc-mode is enabled.
+-This indicator is not shown when you don't use LEIM."
+- :type '(choice (const :tag "No indicator" nil)
+- (string :tag "Show an indicator"))
+- :group 'mozc)
++;; Defined in leim-list.el
+
+-(register-input-method
+- "japanese-mozc"
+- "Japanese"
+- 'mozc-leim-activate
+- mozc-leim-title
+- "Japanese input method with Mozc/Google Japanese Input.")
++;; (defcustom mozc-leim-title "[Mozc]"
++;; "Mode line string shown when mozc-mode is enabled.
++;; This indicator is not shown when you don't use LEIM."
++;; :type '(choice (const :tag "No indicator" nil)
++;; (string :tag "Show an indicator"))
++;; :group 'mozc)
++
++;;
++;; (register-input-method
++;; "japanese-mozc"
++;; "Japanese"
++;; 'mozc-leim-activate
++;; mozc-leim-title
++;; "Japanese input method with Mozc/Google Japanese Input.")
+
+
+
diff --git a/japanese/mozc-server/files/patch-unix_ibus_gen_mozc_xml.py b/japanese/mozc-server/files/patch-unix_ibus_gen_mozc_xml.py
index 4919e6da85a2..f747b3c76402 100644
--- a/japanese/mozc-server/files/patch-unix_ibus_gen_mozc_xml.py
+++ b/japanese/mozc-server/files/patch-unix_ibus_gen_mozc_xml.py
@@ -1,43 +1,163 @@
---- unix/ibus/gen_mozc_xml.py.orig 2013-04-21 03:48:44.433270458 +0900
-+++ unix/ibus/gen_mozc_xml.py 2013-04-21 04:12:50.384269164 +0900
-@@ -41,6 +41,7 @@
- import os
- import subprocess
- import sys
-+import os
-
- # Information to generate <component> part of mozc.xml. %s will be replaced with
+--- unix/ibus/gen_mozc_xml.py.orig 2013-03-29 13:33:43.000000000 +0900
++++ unix/ibus/gen_mozc_xml.py 2013-04-28 20:40:28.000000000 +0900
+@@ -46,10 +46,10 @@
# a product name, 'Mozc' or 'Google Japanese Input'.
-@@ -75,6 +76,32 @@
+ IBUS_COMPONENT_PROPS = {
+ 'name': 'com.google.IBus.Mozc',
+- 'description': '%s Component',
++ 'description': '%(product_name)s Component',
+ # TODO(yusukes): Support Linux distributions other than Gentoo/ChromeOS.
+ # For example, Ubuntu uses /usr/lib/ibus-mozc/.
+- 'exec': '/usr/libexec/ibus-engine-mozc --ibus',
++ 'exec': '%(localbase)s/libexec/ibus-engine-mozc --ibus',
+ # TODO(mazda): Generate the version number.
+ 'version': '0.0.0.0',
+ 'author': 'Google Inc.',
+@@ -60,17 +60,17 @@
+
+ # Information to generate <engines> part of mozc.xml.
+ IBUS_ENGINE_COMMON_PROPS = {
+- 'description': '%s (Japanese Input Method)',
++ 'description': '%(product_name)s (Japanese Input Method)',
+ 'language': 'ja',
+- 'icon': '/usr/share/ibus-mozc/product_icon.png',
++ 'icon': '%(localbase)s/share/ibus-mozc/icons/product_icon.png',
+ 'rank': '80',
+ }
+
+ # Information to generate <engines> part of mozc.xml for IBus 1.5 or later.
+ IBUS_1_5_ENGINE_COMMON_PROPS = {
+- 'description': '%s (Japanese Input Method)',
++ 'description': '%(product_name)s (Japanese Input Method)',
+ 'language': 'ja',
+- 'icon': '/usr/share/ibus-mozc/product_icon.png',
++ 'icon': '%(localbase)s/share/ibus-mozc/icons/product_icon.png',
+ 'rank': '80',
'symbol': '&#x3042;',
}
+@@ -83,7 +83,7 @@
+ # DO NOT change the engine name 'mozc-jp'. The names is referenced by
+ # unix/ibus/mozc_engine.cc.
+ 'name': ['mozc-jp'],
+- 'longname': ['%s'],
++ 'longname': ['%(product_name)s'],
+ 'layout': ['jp'],
+ },
+ # On Linux (IBus >= 1.5), we use special label 'default' for the keyboard
+@@ -92,7 +92,7 @@
+ # DO NOT change the engine name 'mozc-jp'. The names is referenced by
+ # unix/ibus/mozc_engine.cc.
+ 'name': ['mozc-jp'],
+- 'longname': ['%s'],
++ 'longname': ['%(product_name)s'],
+ 'layout': ['default'],
+ },
+ # On Chrome/Chromium OS, we provide three engines.
+@@ -100,8 +100,8 @@
+ # DO NOT change the engine name 'mozc-jp'. The names is referenced by
+ # unix/ibus/mozc_engine.cc.
+ 'name': ['mozc-jp', 'mozc', 'mozc-dv'],
+- 'longname': ['%s (Japanese keyboard layout)', '%s (US keyboard layout)',
+- '%s (US Dvorak keyboard layout)'],
++ 'longname': ['%(product_name)s (Japanese keyboard layout)', '%(product_name)s (US keyboard layout)',
++ '%(product_name)s (US Dvorak keyboard layout)'],
+ 'layout': ['jp', 'us', 'us(dvorak)'],
+ },
+ }
+@@ -123,18 +123,11 @@
+ #endif // %s"""
+
+
+-def EmbedProductName(product_name, format_string):
+- if format_string.find('%s') != -1:
+- return format_string % product_name
+- return format_string
+-
+-
+-def OutputXmlElement(product_name, element_name, value):
+- print ' <%s>%s</%s>' % (element_name, EmbedProductName(product_name, value),
+- element_name)
++def OutputXmlElement(element_name, value):
++ print ' <%s>%s</%s>' % (element_name, value, element_name)
+
+
+-def OutputXml(product_name, component, engine_common, engines, setup_arg):
++def OutputXml(product_name, component, engine_common, engines, setup_arg, localbase):
+ """Outputs a XML data for ibus-daemon.
+
+ Args:
+@@ -148,27 +141,25 @@
+ """
+ print '<component>'
+ for key in component:
+- OutputXmlElement(product_name, key, component[key])
++ OutputXmlElement(key, component[key] % locals())
+ print '<engines>'
+ for i in range(len(engines['name'])):
+ print '<engine>'
+ for key in engine_common:
+- OutputXmlElement(product_name, key, engine_common[key])
++ OutputXmlElement(key, engine_common[key] % locals())
+ if setup_arg:
+- OutputXmlElement(product_name, 'setup', ' '.join(setup_arg))
++ OutputXmlElement('setup', ' '.join(setup_arg))
+ for key in engines:
+- OutputXmlElement(product_name, key, engines[key][i])
++ OutputXmlElement(key, engines[key][i] % locals())
+ print '</engine>'
+ print '</engines>'
+ print '</component>'
+
+
+-def OutputCppVariable(product_name, prefix, variable_name, value):
+- print 'const char k%s%s[] = "%s";' % (prefix, variable_name.capitalize(),
+- EmbedProductName(product_name, value))
+-
++def OutputCppVariable(prefix, variable_name, value):
++ print 'const char k%s%s[] = "%s";' % (prefix, variable_name.capitalize(), value)
+
+-def OutputCpp(product_name, component, engine_common, engines):
++def OutputCpp(product_name, component, engine_common, engines, localbase):
+ """Outputs a C++ header file for mozc/unix/ibus/main.cc.
+
+ Args:
+@@ -180,13 +171,13 @@
+ guard_name = 'MOZC_UNIX_IBUS_MAIN_H_'
+ print CPP_HEADER % (guard_name, guard_name)
+ for key in component:
+- OutputCppVariable(product_name, 'Component', key, component[key])
++ OutputCppVariable('Component', key, component[key] % locals())
+ for key in engine_common:
+- OutputCppVariable(product_name, 'Engine', key, engine_common[key])
++ OutputCppVariable('Engine', key, engine_common[key] % locals())
+ for key in engines:
+ print 'const char* kEngine%sArray[] = {' % key.capitalize()
+ for i in range(len(engines[key])):
+- print '"%s",' % EmbedProductName(product_name, engines[key][i])
++ print '"%s",' % engines[key][i] % locals()
+ print '};'
+ print 'const size_t kEngineArrayLen = %s;' % len(engines['name'])
+ print CPP_FOOTER % guard_name
+@@ -222,6 +213,7 @@
+ parser.add_option('--pkg_config_command', dest='pkg_config_command',
+ default='pkg-config',
+ help='The path to pkg-config command.')
++ parser.add_option('--localbase', dest='localbase')
+ (options, unused_args) = parser.parse_args()
+
+ setup_arg = []
+@@ -238,12 +230,12 @@
+ if options.output_cpp:
+ OutputCpp(PRODUCT_NAMES[options.branding], IBUS_COMPONENT_PROPS,
+ common_props,
+- IBUS_ENGINES_PROPS[platform])
++ IBUS_ENGINES_PROPS[platform], options.localbase)
+ else:
+ OutputXml(PRODUCT_NAMES[options.branding], IBUS_COMPONENT_PROPS,
+ common_props,
+ IBUS_ENGINES_PROPS[platform],
+- setup_arg)
++ setup_arg, options.localbase)
+ return 0
-+# Override for FreeBSD
-+if os.uname()[0] == 'FreeBSD':
-+ IBUS_COMPONENT_PROPS = {
-+ 'name': 'com.google.IBus.Mozc',
-+ 'description': '%s Component',
-+ 'exec': '@@LOCALBASE@@/libexec/ibus-engine-mozc --ibus',
-+ 'version': '0.0.0.0',
-+ 'author': 'Google Inc.',
-+ 'license': 'New BSD',
-+ 'homepage': 'http://code.google.com/p/mozc/',
-+ 'textdomain': 'ibus-mozc',
-+ }
-+ IBUS_ENGINE_COMMON_PROPS = {
-+ 'description': '%s (Japanese Input Method)',
-+ 'language': 'ja',
-+ 'icon': '@@LOCALBASE@@/share/ibus-mozc/icons/product_logo.png',
-+ 'rank': '0',
-+ }
-+ IBUS_1_5_ENGINE_COMMON_PROPS = {
-+ 'description': '%s (Japanese Input Method)',
-+ 'language': 'ja',
-+ 'icon': '@@LOCALBASE@@/share/ibus-mozc/icons/product_logo.png',
-+ 'rank': '80',
-+ 'symbol': '&#x3042;',
-+ }
-+
- # A dictionary from --platform to engines that are used in the platform. The
- # information is used to generate <engines> part of mozc.xml.
- IBUS_ENGINES_PROPS = {
+ if __name__ == '__main__':
diff --git a/japanese/mozc-server/files/patch-unix_ibus_ibus.gyp b/japanese/mozc-server/files/patch-unix_ibus_ibus.gyp
new file mode 100644
index 000000000000..bb3682b3ff15
--- /dev/null
+++ b/japanese/mozc-server/files/patch-unix_ibus_ibus.gyp
@@ -0,0 +1,10 @@
+--- unix/ibus/ibus.gyp.orig 2013-04-27 19:26:29.000000000 +0900
++++ unix/ibus/ibus.gyp 2013-04-27 19:27:05.000000000 +0900
+@@ -134,6 +134,7 @@
+ '--platform=Linux',
+ '--branding=Mozc',
+ '--server_dir=<(server_dir)',
++ '--localbase=<(localbase)',
+ '--pkg_config_command=<(pkg_config_command)',
+ ],
+ }],
diff --git a/japanese/mozc-server/files/patch-unix_ibus_mozc.xml b/japanese/mozc-server/files/patch-unix_ibus_mozc.xml
deleted file mode 100644
index d2a8fb6683ec..000000000000
--- a/japanese/mozc-server/files/patch-unix_ibus_mozc.xml
+++ /dev/null
@@ -1,24 +0,0 @@
---- unix/ibus/mozc.xml.orig 1970-01-01 09:00:00.000000000 +0900
-+++ unix/ibus/mozc.xml 2011-12-04 16:04:42.283606000 +0900
-@@ -0,0 +1,21 @@
-+<component>
-+ <name>com.google.IBus.Mozc</name>
-+ <description>Mozc Component</description>
-+ <exec>@@LOCALBASE@@/libexec/ibus-engine-mozc --ibus</exec>
-+ <version>0.0.0.0</version>
-+ <author>Google Inc.</author>
-+ <license>New BSD</license>
-+ <homepage>http://code.google.com/p/mozc/</homepage>
-+ <textdomain>ibus-mozc</textdomain>
-+ <engines>
-+ <engine>
-+ <rank>0</rank>
-+ <description>Mozc (Japanese Input Method)</description>
-+ <language>ja</language>
-+ <icon>@@LOCALBASE@@/share/ibus-mozc/icons/product_logo.png</icon>
-+ <layout>jp</layout>
-+ <name>mozc-jp</name>
-+ <longname>Mozc</longname>
-+ </engine>
-+ </engines>
-+</component>
diff --git a/japanese/mozc-server/files/patch-unix_ibus_path_util.cc b/japanese/mozc-server/files/patch-unix_ibus_path_util.cc
index d488733b794b..28185c1ca03c 100644
--- a/japanese/mozc-server/files/patch-unix_ibus_path_util.cc
+++ b/japanese/mozc-server/files/patch-unix_ibus_path_util.cc
@@ -1,25 +1,11 @@
---- unix/ibus/path_util.cc.orig 2013-04-21 03:48:44.435272531 +0900
-+++ unix/ibus/path_util.cc 2013-04-21 04:12:51.235269303 +0900
-@@ -30,14 +30,22 @@
+--- unix/ibus/path_util.cc.orig 2013-03-29 13:33:43.000000000 +0900
++++ unix/ibus/path_util.cc 2013-04-27 15:42:28.000000000 +0900
+@@ -30,7 +30,7 @@
#include "unix/ibus/path_util.h"
namespace {
-+#ifdef __FreeBSD__
-+const char kInstalledDirectory[] = "@@LOCALBASE@@/share/ibus-mozc";
-+#else
- const char kInstalledDirectory[] = "/usr/share/ibus-mozc";
-+#endif
+-const char kInstalledDirectory[] = "/usr/share/ibus-mozc";
++const char kInstalledDirectory[] = LOCALBASE "/share/ibus-mozc/icons";
}
namespace mozc {
- namespace ibus {
-
- string GetIconPath(const string &icon_file) {
-+#ifdef __FreeBSD__
-+ return string("@@LOCALBASE@@/share/ibus-mozc/icons/") + icon_file;
-+#else
- return kInstalledDirectory + string("/") + icon_file;
-+#endif
- }
-
- } // namespace ibus