aboutsummaryrefslogtreecommitdiff
path: root/japanese/mozc-server
diff options
context:
space:
mode:
authorHiroki Sato <hrs@FreeBSD.org>2013-07-20 04:02:49 +0000
committerHiroki Sato <hrs@FreeBSD.org>2013-07-20 04:02:49 +0000
commita985a72822ba3a4c0894ca8dd6f1af3f4998d1be (patch)
tree29db0aeab8f1508b052ef8796bfe1d72a0f01301 /japanese/mozc-server
parent82c26bd4e2de601293ce93753df8e993db1893bd (diff)
Notes
Diffstat (limited to 'japanese/mozc-server')
-rw-r--r--japanese/mozc-server/Makefile43
-rw-r--r--japanese/mozc-server/distinfo6
-rw-r--r--japanese/mozc-server/files/leim-list.el5
-rw-r--r--japanese/mozc-server/files/mozc_tool.in20
-rw-r--r--japanese/mozc-server/files/patch-base_compiler_specific.h13
-rw-r--r--japanese/mozc-server/files/patch-base_logging.cc10
-rw-r--r--japanese/mozc-server/files/patch-build_mozc.py37
-rw-r--r--japanese/mozc-server/files/patch-gyp_common.gypi22
-rw-r--r--japanese/mozc-server/files/patch-handwriting_zinnia_handwriting.cc11
-rw-r--r--japanese/mozc-server/files/patch-unix_emacs_mozc.el52
-rw-r--r--japanese/mozc-server/files/patch-unix_ibus_mozc_engine.cc22
-rw-r--r--japanese/mozc-server/files/patch-unix_ibus_selection_monitor.cc101
12 files changed, 228 insertions, 114 deletions
diff --git a/japanese/mozc-server/Makefile b/japanese/mozc-server/Makefile
index 2a9e3052c8f2..90fb291f16a5 100644
--- a/japanese/mozc-server/Makefile
+++ b/japanese/mozc-server/Makefile
@@ -1,15 +1,14 @@
-# Created by: Daichi GOTO <daichi@freebsd.org>
+# Created by: Daichi GOTO <daichi@FreeBSD.org>
# $FreeBSD$
PORTNAME= mozc
-PORTVERSION= 1.10.1390.102
-PORTREVISION= 5
+PORTVERSION= 1.11.1502.102
CATEGORIES= japanese
MASTER_SITES= ${MASTER_SITE_GOOGLE_CODE}
DISTFILES= ${DISTNAME}${EXTRACT_SUFX}
EXTRACT_ONLY= ${DISTNAME}${EXTRACT_SUFX}
-MAINTAINER= daichi@FreeBSD.org
+MAINTAINER= hrs@FreeBSD.org
COMMENT?= Mozc Japanese Input Method, Server
LICENSE= BSD
@@ -46,6 +45,7 @@ LICENSE_DISTFILES_NAISTL=${DISTNAME}${EXTRACT_SUFX}
USE_GNOME= glib20 gtk20
USE_QT4= corelib gui qmake_build moc_build rcc_build uic_build
.elif ${BUILD_MOZC_LIST:Mibus_mozc} == "ibus_mozc"
+USE_XORG= xcb
USE_GNOME= glib20 gtk20
.elif ${BUILD_MOZC_LIST:Mmozc_el} == "mozc_el"
USE_EMACS= yes
@@ -63,7 +63,8 @@ BROKEN= Does not compile: segfault
GYP_DEFINES= use_libprotobuf=1 \
channel_dev=0 \
- enable_unittest=0
+ enable_unittest=0 \
+ zinnia_model_file="${LOCALBASE}/share/tegaki/models/zinnia/handwriting-ja.model"
BUILD_MODE= Release
BUILD_CMD= ${SETENV} ${MAKE_ENV} PATH=/bin:/usr/bin:${PATH} ${GMAKE}
BUILD_MOZC_CMD= cd ${BUILD_WRKSRC} && \
@@ -129,7 +130,8 @@ DISTFILES+= \
EXTRACT_DEPENDS+= lha:${PORTSDIR}/archivers/lha
-PLIST_FILES+= bin/mozc_server
+PLIST_FILES+= bin/mozc_server \
+ bin/mozc_emacs_helper
post-extract-mozc_server:
@for F in jigyosyo-20130628.lzh ken_all-20130628.lzh; do \
@@ -144,10 +146,12 @@ post-extract: post-extract-mozc_server
do-build-mozc_server:
${BUILD_MOZC_CMD_BUILD} server/server.gyp:mozc_server
+ ${BUILD_MOZC_CMD_BUILD} unix/emacs/emacs.gyp:mozc_emacs_helper
do-install-mozc_server:
${INSTALL_PROGRAM} \
${WRKSRC}/out_linux/${BUILD_MODE}/mozc_server \
+ ${WRKSRC}/out_linux/${BUILD_MODE}/mozc_emacs_helper \
${PREFIX}/bin
.endif
@@ -158,18 +162,21 @@ GYP_DEFINES+= use_libibus=0 \
RUN_DEPENDS+= ${LOCALBASE}/share/tegaki/models/zinnia/handwriting-ja.model:${PORTSDIR}/japanese/tegaki-zinnia-japanese
-PLIST_FILES+= bin/mozc_tool \
+PLIST_FILES+= libexec/mozc_tool \
+ bin/mozc_tool \
%%DATADIR%%/icons/product_logo.png \
%%DATADIR%%/icons/update_uptodate.png
PLIST_DIRS+= %%DATADIR%%/icons ${DATADIR_REL}
+SUB_FILES+= mozc_tool
do-build-mozc_tool:
${BUILD_MOZC_CMD_BUILD} gui/gui.gyp:mozc_tool
do-install-mozc_tool:
${INSTALL_PROGRAM} \
- ${WRKSRC}/out_linux/${BUILD_MODE}/mozc_tool \
- ${PREFIX}/bin
+ ${WRKSRC}/out_linux/${BUILD_MODE}/mozc_tool \
+ ${PREFIX}/libexec
+ ${INSTALL_SCRIPT} ${WRKDIR}/mozc_tool ${PREFIX}/bin
@${MKDIR} ${DATADIR}/icons
${INSTALL_DATA} \
${WRKSRC}/data/images/unix/ime_product_icon_opensource-32.png \
@@ -181,7 +188,6 @@ do-install-mozc_tool:
# ibus_mozc
.if ${BUILD_MOZC_LIST:Mibus_mozc} == "ibus_mozc"
-USE_XORG= xcb
GYP_OPTIONS+= --noqt
GYP_DEFINES+= use_libibus=1 \
enable_gtk_renderer=1
@@ -235,7 +241,7 @@ do-install-ibus_mozc:
.endif
# fcitx_mozc
-.if ${BUILD_MOZC_LIST:Mfcitx_mozc} == "fcitx_mozc" || make(makesum)
+.if ${BUILD_MOZC_LIST:Mfcitx_mozc} == "fcitx_mozc" # || make(makesum)
PATCH_SITES= http://fcitx.googlecode.com/files/
PATCHFILES= fcitx-${DISTNAME}.2.patch
.endif
@@ -305,38 +311,25 @@ do-install-fcitx_mozc:
# mozc_el
.if ${BUILD_MOZC_LIST:Mmozc_el} == "mozc_el"
-GYP_OPTIONS+= --noqt
-GYP_DEFINES+= use_libibus=0 \
- enable_gtk_renderer=0
-
CATEGORIES+= elisp
RUN_DEPENDS+= mozc_server:${PORTSDIR}/japanese/mozc-server \
mozc_server_start:${PORTSDIR}/japanese/mozc-additions
-PLIST_FILES+= bin/mozc_emacs_helper \
- ${EMACS_VERSION_SITE_LISPDIR}/mozc/mozc.el \
+PLIST_FILES+= ${EMACS_VERSION_SITE_LISPDIR}/mozc/mozc.el \
${EMACS_VERSION_SITE_LISPDIR}/mozc/mozc.elc \
${EMACS_VERSION_SITE_LISPDIR}/mozc/leim-list.el
PLIST_DIRS+= ${EMACS_VERSION_SITE_LISPDIR}/mozc
do-build-mozc_el:
- ${BUILD_MOZC_CMD_BUILD} unix/emacs/emacs.gyp:mozc_emacs_helper
cd ${WRKSRC}/unix/emacs && \
${EMACS_CMD} -batch -q -no-site-file -no-init-file \
-f batch-byte-compile mozc.el
do-install-mozc_el:
- ${INSTALL_PROGRAM} \
- ${WRKSRC}/out_linux/${BUILD_MODE}/mozc_emacs_helper \
- ${PREFIX}/bin/
@${MKDIR} ${PREFIX}/${EMACS_VERSION_SITE_LISPDIR}/mozc
${INSTALL_DATA} \
${WRKSRC}/unix/emacs/mozc.el \
- ${PREFIX}/${EMACS_VERSION_SITE_LISPDIR}/mozc/
- ${INSTALL_DATA} \
${WRKSRC}/unix/emacs/mozc.elc \
- ${PREFIX}/${EMACS_VERSION_SITE_LISPDIR}/mozc/
- ${INSTALL_DATA} \
${FILESDIR}/leim-list.el \
${PREFIX}/${EMACS_VERSION_SITE_LISPDIR}/mozc/
.endif
diff --git a/japanese/mozc-server/distinfo b/japanese/mozc-server/distinfo
index 1340d73e4ff5..d7c8daf2ece0 100644
--- a/japanese/mozc-server/distinfo
+++ b/japanese/mozc-server/distinfo
@@ -1,8 +1,6 @@
-SHA256 (mozc-1.10.1390.102.tar.bz2) = 72a8ed6657daa1c03b1efe50c262a69be2ab66d45747a47df6e54996b6d5ee39
-SIZE (mozc-1.10.1390.102.tar.bz2) = 57879881
+SHA256 (mozc-1.11.1502.102.tar.bz2) = c74eb3f1096b0c1144868f6807fdf113412bd4cb23a297974ee22bd7a5f2dfe9
+SIZE (mozc-1.11.1502.102.tar.bz2) = 58777653
SHA256 (ken_all-20130628.lzh) = 78630e7f8b396603cde066c4a6d598c9af94bb97f415a68148dd3144dea18871
SIZE (ken_all-20130628.lzh) = 1735995
SHA256 (jigyosyo-20130628.lzh) = d7b796d8643457d883de4a33cb3edf7455f11d778ea74d07b450ea10f3339cf7
SIZE (jigyosyo-20130628.lzh) = 823590
-SHA256 (fcitx-mozc-1.10.1390.102.2.patch) = 8702225049052ace5c4fa60998606cc7e08bc86966054f6f61b293277cffdcea
-SIZE (fcitx-mozc-1.10.1390.102.2.patch) = 130658
diff --git a/japanese/mozc-server/files/leim-list.el b/japanese/mozc-server/files/leim-list.el
index bb15f3cfb8f4..62365f953453 100644
--- a/japanese/mozc-server/files/leim-list.el
+++ b/japanese/mozc-server/files/leim-list.el
@@ -24,7 +24,6 @@ This indicator is not shown when you don't use LEIM."
:group 'mozc)
(register-input-method
- "japanese-mozc" "Japanese" 'mozc-leim-activate
+ "japanese-mozc" "Japanese" #'mozc-leim-activate
mozc-leim-title
- "Japanese input method with Mozc/Google Japanese Input."
- 'its-select-hiragana)
+ "Japanese input method with Mozc/Google Japanese Input.")
diff --git a/japanese/mozc-server/files/mozc_tool.in b/japanese/mozc-server/files/mozc_tool.in
new file mode 100644
index 000000000000..e420a3b936ae
--- /dev/null
+++ b/japanese/mozc-server/files/mozc_tool.in
@@ -0,0 +1,20 @@
+#!/bin/sh
+# $FreeBSD$
+
+case $# in
+0)
+ echo "Specify one of the following keyword in --mode= option:"
+ cat <<EOT
+ config_dialog
+ dictionary_tool
+ word_register_dialog
+ about_dialog
+ character_palette
+ hand_writing
+EOT
+ exit 1
+;;
+*)
+ exec %%PREFIX%%/libexec/mozc_tool "$@"
+;;
+esac
diff --git a/japanese/mozc-server/files/patch-base_compiler_specific.h b/japanese/mozc-server/files/patch-base_compiler_specific.h
new file mode 100644
index 000000000000..4bbe5cbf178b
--- /dev/null
+++ b/japanese/mozc-server/files/patch-base_compiler_specific.h
@@ -0,0 +1,13 @@
+--- base/compiler_specific.h.orig 2013-07-17 11:38:04.000000000 +0900
++++ base/compiler_specific.h 2013-07-20 00:41:09.000000000 +0900
+@@ -236,4 +236,10 @@
+ #endif // _MSC_VER or !_MSC_VER
+ // === End suppress warning C4355 macro definitions ===
+
++#if 0
++#define static_assert(a,b) { char _dum[(a) ? 1 : 0]; }
++#endif
++#define static_assert(a,b)
++#define unique_ptr auto_ptr
++
+ #endif // MOZC_BASE_COMPILER_SPECIFIC_H
diff --git a/japanese/mozc-server/files/patch-base_logging.cc b/japanese/mozc-server/files/patch-base_logging.cc
index e8791332356f..c6fca634fd65 100644
--- a/japanese/mozc-server/files/patch-base_logging.cc
+++ b/japanese/mozc-server/files/patch-base_logging.cc
@@ -1,11 +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
+--- base/logging.cc.orig 2013-07-17 11:38:04.000000000 +0900
++++ base/logging.cc 2013-07-19 22:24:20.000000000 +0900
@@ -111,7 +111,7 @@
#if defined(__native_client__)
"%p",
#elif defined(OS_LINUX)
- "%lu",
+ "%p",
- #else // = OS_WIN or OS_MACOSX
- "%u",
- #endif
+ #elif defined(OS_MACOSX) && defined(__LP64__)
+ "%llu",
+ #else // OS_WIN or OS_MACOSX(32bit)
diff --git a/japanese/mozc-server/files/patch-build_mozc.py b/japanese/mozc-server/files/patch-build_mozc.py
index 8cbae3d0f42d..55ea82f24091 100644
--- a/japanese/mozc-server/files/patch-build_mozc.py
+++ b/japanese/mozc-server/files/patch-build_mozc.py
@@ -1,6 +1,6 @@
---- 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 @@
+--- build_mozc.py.orig 2013-07-17 11:37:50.000000000 +0900
++++ build_mozc.py 2013-07-19 22:27:55.000000000 +0900
+@@ -332,6 +332,13 @@
help='use rsync to copy files instead of builtin function')
AddTargetPlatformOption(parser)
@@ -11,11 +11,10 @@
+ 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 @@
+
+ # Mac and Linux
+ warn_as_error_default = False
+@@ -518,7 +525,7 @@
parser = optparse.OptionParser(usage='Usage: %prog build [options]')
AddCommonOptions(parser)
if IsLinux():
@@ -24,13 +23,23 @@
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
+@@ -566,9 +573,6 @@
+
+ return parser.parse_args(args, values)
+
+-
+-
+-
+ def AddPythonPathToEnvironmentFilesForWindows(out_dir):
+ """Add PYTHONPATH to environment files for Ninja."""
+ mozc_root = os.path.abspath(GetTopLevelSourceDirectoryName())
+@@ -746,6 +750,22 @@
+ else:
+ command_line.extend(['-D', 'warn_as_error=0'])
+ 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 ''
@@ -45,5 +54,5 @@
+ 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):
+ # mac_dir should be started with '<(DEPTH)', otherwise some
+ # operations in XCode fails. So if the mac_dir option is an
diff --git a/japanese/mozc-server/files/patch-gyp_common.gypi b/japanese/mozc-server/files/patch-gyp_common.gypi
index a0705b4c36f0..9bf6d634c878 100644
--- a/japanese/mozc-server/files/patch-gyp_common.gypi
+++ b/japanese/mozc-server/files/patch-gyp_common.gypi
@@ -1,16 +1,15 @@
---- 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 @@
+--- gyp/common.gypi.orig 2013-07-17 11:38:04.000000000 +0900
++++ gyp/common.gypi 2013-07-19 22:51:13.000000000 +0900
+@@ -749,6 +749,8 @@
['OS=="linux"', {
'defines': [
'OS_LINUX',
+ 'OS_FREEBSD',
- 'MOZC_SERVER_DIRECTORY="<@(server_dir)"',
+ 'LOCALBASE="<@(localbase)"',
],
'cflags': [
'<@(warning_cflags)',
-@@ -735,6 +737,13 @@
+@@ -760,6 +762,13 @@
# <unordered_map> and <unordered_set>.
'-Wno-deprecated',
],
@@ -24,3 +23,16 @@
'conditions': [
['target_platform=="ChromeOS"', {
'defines': [
+@@ -774,12 +783,10 @@
+ '-Wno-covered-switch-default',
+ '-Wno-unnamed-type-template-args',
+ '-Wno-c++11-narrowing',
+- '-std=gnu++0x',
+ ],
+ }],
+ ['clang==0 and target_platform!="Windows"', {
+ 'cflags_cc': [
+- '-std=gnu++0x',
+ ],
+ 'defines': [
+ 'GTEST_LANG_CXX11=0',
diff --git a/japanese/mozc-server/files/patch-handwriting_zinnia_handwriting.cc b/japanese/mozc-server/files/patch-handwriting_zinnia_handwriting.cc
deleted file mode 100644
index 22fb9c119b6b..000000000000
--- a/japanese/mozc-server/files/patch-handwriting_zinnia_handwriting.cc
+++ /dev/null
@@ -1,11 +0,0 @@
---- 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)
- // On Linux, use the model for tegaki-zinnia.
- const char kModelFile[] =
-- "/usr/share/tegaki/models/zinnia/handwriting-ja.model";
-+ LOCALBASE "/share/tegaki/models/zinnia/handwriting-ja.model";
- return kModelFile;
- #else
- const char kModelFile[] = "handwriting-ja.model";
diff --git a/japanese/mozc-server/files/patch-unix_emacs_mozc.el b/japanese/mozc-server/files/patch-unix_emacs_mozc.el
index 33364d71c148..2fd5c22d674f 100644
--- a/japanese/mozc-server/files/patch-unix_emacs_mozc.el
+++ b/japanese/mozc-server/files/patch-unix_emacs_mozc.el
@@ -1,25 +1,7 @@
---- 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."
+--- unix/emacs/mozc.el.orig 2013-07-17 11:37:50.000000000 +0900
++++ unix/emacs/mozc.el 2013-07-19 22:36:17.000000000 +0900
+@@ -1834,19 +1834,20 @@
+ "Deactivate mozc-mode via LEIM."
(mozc-mode nil))
-(defcustom mozc-leim-title "[Mozc]"
@@ -28,27 +10,25 @@
- :type '(choice (const :tag "No indicator" nil)
- (string :tag "Show an indicator"))
- :group 'mozc)
-+;; Defined in leim-list.el
++;; defined in leim-list.el
++;; (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-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-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_mozc_engine.cc b/japanese/mozc-server/files/patch-unix_ibus_mozc_engine.cc
index 3851a2841320..2291dbf19c23 100644
--- a/japanese/mozc-server/files/patch-unix_ibus_mozc_engine.cc
+++ b/japanese/mozc-server/files/patch-unix_ibus_mozc_engine.cc
@@ -1,11 +1,11 @@
---- unix/ibus/mozc_engine.cc.orig 2013-04-21 03:48:44.433270458 +0900
-+++ unix/ibus/mozc_engine.cc 2013-04-21 04:12:50.609270610 +0900
-@@ -758,7 +758,7 @@
- // on size_t, not uint32.
- string selection_text;
- const uint32 selection_start = min(cursor_pos, anchor_pos);
-- const uint32 selection_length = abs(relative_selected_length);
-+ const uint32 selection_length = ::abs(relative_selected_length);
- Util::SubString(surrounding_text,
- selection_start,
- selection_length,
+--- unix/ibus/mozc_engine.cc.orig 2013-07-17 11:37:50.000000000 +0900
++++ unix/ibus/mozc_engine.cc 2013-07-19 22:37:55.000000000 +0900
+@@ -265,7 +265,7 @@
+ }
+
+ const uint32 selection_start = min(cursor_pos, anchor_pos);
+- const uint32 selection_length = abs(info->relative_selected_length);
++ const uint32 selection_length = ::abs(info->relative_selected_length);
+ info->preceding_text = surrounding_text.substr(0, selection_start);
+ Util::SubString(surrounding_text,
+ selection_start,
diff --git a/japanese/mozc-server/files/patch-unix_ibus_selection_monitor.cc b/japanese/mozc-server/files/patch-unix_ibus_selection_monitor.cc
new file mode 100644
index 000000000000..bf15ef7e2b13
--- /dev/null
+++ b/japanese/mozc-server/files/patch-unix_ibus_selection_monitor.cc
@@ -0,0 +1,101 @@
+--- unix/ibus/selection_monitor.cc.orig 2013-07-20 00:29:25.000000000 +0900
++++ unix/ibus/selection_monitor.cc 2013-07-20 00:37:48.000000000 +0900
+@@ -38,6 +38,7 @@
+
+ #include "base/logging.h"
+ #include "base/mutex.h"
++#include "base/scoped_ptr.h"
+ #include "base/thread.h"
+ #include "base/port.h"
+ #include "base/util.h"
+@@ -47,8 +48,6 @@
+
+ namespace {
+
+-using std::unique_ptr;
+-
+ class ScopedXcbGenericError {
+ public:
+ ScopedXcbGenericError()
+@@ -69,27 +68,6 @@
+ xcb_generic_error_t *error_;
+ };
+
+-template <typename T>
+-struct FreeDeleter {
+- void operator()(T *ptr) const {
+- free(ptr);
+- }
+-};
+-
+-// TODO(yukawa): Use template aliases when GCC 4.6 is retired.
+-typedef unique_ptr<xcb_get_property_reply_t,
+- FreeDeleter<xcb_get_property_reply_t>>
+- ScopedXcbGetPropertyReply;
+-typedef unique_ptr<xcb_get_atom_name_reply_t,
+- FreeDeleter<xcb_get_atom_name_reply_t>>
+- ScopedXcbGetAtomNameReply;
+-typedef unique_ptr<xcb_intern_atom_reply_t,
+- FreeDeleter<xcb_intern_atom_reply_t>>
+- ScopedXcbInternAtomReply;
+-typedef unique_ptr<xcb_xfixes_query_version_reply_t,
+- FreeDeleter<xcb_xfixes_query_version_reply_t>>
+- ScopedXcbXFixesQueqyVersionReply;
+-
+ struct XcbAtoms {
+ xcb_atom_t mozc_selection_monitor;
+ xcb_atom_t net_wm_name;
+@@ -231,7 +209,7 @@
+ *atom = XCB_NONE;
+ xcb_intern_atom_cookie_t cookie =
+ ::xcb_intern_atom(connection_, false, name.size(), name.c_str());
+- ScopedXcbInternAtomReply reply(
++ scoped_ptr_malloc<xcb_intern_atom_reply_t> reply(
+ ::xcb_intern_atom_reply(connection_, cookie, 0));
+ if (reply.get() == NULL) {
+ LOG(ERROR) << "xcb_intern_atom_reply returned NULL reply.";
+@@ -267,7 +245,7 @@
+ XCB_XFIXES_MAJOR_VERSION,
+ XCB_XFIXES_MINOR_VERSION);
+ ScopedXcbGenericError xcb_error;
+- ScopedXcbXFixesQueqyVersionReply xfixes_query(
++ scoped_ptr_malloc<xcb_xfixes_query_version_reply_t> xfixes_query(
+ ::xcb_xfixes_query_version_reply(
+ connection_, xfixes_query_cookie, xcb_error.mutable_get()));
+ if (xcb_error.get() != NULL) {
+@@ -298,7 +276,7 @@
+ const xcb_get_atom_name_cookie_t cookie = ::xcb_get_atom_name(
+ connection_, atom);
+ ScopedXcbGenericError xcb_error;
+- ScopedXcbGetAtomNameReply reply(
++ scoped_ptr_malloc<xcb_get_atom_name_reply_t> reply(
+ ::xcb_get_atom_name_reply(
+ connection_, cookie, xcb_error.mutable_get()));
+ if (xcb_error.get() != NULL) {
+@@ -331,7 +309,7 @@
+ property_atom,
+ property_type_atom,
+ 0, 0);
+- ScopedXcbGetPropertyReply reply(
++ scoped_ptr_malloc<xcb_get_property_reply_t> reply(
+ ::xcb_get_property_reply(connection_, cookie, 0));
+ if (reply.get() == NULL) {
+ VLOG(2) << "reply is NULL";
+@@ -378,7 +356,7 @@
+ property_type_atom,
+ byte_offset,
+ max_bytes);
+- ScopedXcbGetPropertyReply reply(
++ scoped_ptr_malloc<xcb_get_property_reply_t> reply(
+ ::xcb_get_property_reply(connection_, cookie, 0));
+ if (reply.get() == NULL) {
+ VLOG(2) << "reply is NULL";
+@@ -408,7 +386,7 @@
+ property_atom,
+ XCB_ATOM_CARDINAL,
+ 0, sizeof(T) * 8);
+- ScopedXcbGetPropertyReply reply(
++ scoped_ptr_malloc<xcb_get_property_reply_t> reply(
+ ::xcb_get_property_reply(connection_, cookie, 0));
+ if (reply.get() == NULL) {
+ VLOG(2) << "reply is NULL";