diff options
author | Hiroki Sato <hrs@FreeBSD.org> | 2015-02-18 19:16:43 +0000 |
---|---|---|
committer | Hiroki Sato <hrs@FreeBSD.org> | 2015-02-18 19:16:43 +0000 |
commit | 496ebd9b56f24ec5fcbb5d0a28e58258e2fa734c (patch) | |
tree | 74e56de6e2b6fb5871d7ae7d4c1cde8e8a9a8077 /japanese | |
parent | 7764305db7e75078142c5b54a93fac801beedeaf (diff) | |
download | ports-496ebd9b56f24ec5fcbb5d0a28e58258e2fa734c.tar.gz ports-496ebd9b56f24ec5fcbb5d0a28e58258e2fa734c.zip |
Notes
Diffstat (limited to 'japanese')
-rw-r--r-- | japanese/mozc-server/Makefile | 17 | ||||
-rw-r--r-- | japanese/mozc-server/files/leim-list.el | 4 | ||||
-rw-r--r-- | japanese/mozc-server/files/mozc.in | 7 | ||||
-rw-r--r-- | japanese/mozc-server/files/mozc_tool.in | 23 | ||||
-rw-r--r-- | japanese/mozc-server/files/patch-base_base.gyp | 19 | ||||
-rw-r--r-- | japanese/mozc-server/files/patch-base_system_util.cc | 26 | ||||
-rw-r--r-- | japanese/mozc-server/files/patch-build_mozc.py | 40 | ||||
-rw-r--r-- | japanese/mozc-server/files/patch-gyp_common.gypi | 23 | ||||
-rw-r--r-- | japanese/mozc-server/files/patch-unix_emacs_mozc.el | 13 | ||||
-rw-r--r-- | japanese/mozc-server/files/patch-unix_ibus_gen_mozc_xml.py | 23 | ||||
-rw-r--r-- | japanese/mozc-server/files/patch-unix_ibus_ibus.gyp | 11 |
11 files changed, 173 insertions, 33 deletions
diff --git a/japanese/mozc-server/Makefile b/japanese/mozc-server/Makefile index 0700f76ed9dc..5a2cc5a5b743 100644 --- a/japanese/mozc-server/Makefile +++ b/japanese/mozc-server/Makefile @@ -3,6 +3,7 @@ PORTNAME= mozc PORTVERSION= 2.16.2051.102 +PORTREVISION= 1 CATEGORIES= japanese MASTER_SITES= LOCAL/hrs DISTFILES= ${DISTNAME}${EXTRACT_SUFX} @@ -116,6 +117,8 @@ post-configure: ${WRKSRC}/mozcmake ${BUILD_MOZC_CMD} gyp \ --gypdir=${WRKSRC}/third_party/gyp \ --server_dir="${PREFIX}/bin" \ + --tool_dir="${PREFIX}/libexec" \ + --renderer_dir="${PREFIX}/libexec" \ --localbase="${LOCALBASE}" \ --ldflags="${LDFLAGS} -fstack-protector -L${LOCALBASE}/lib" \ --cflags="${CFLAGS:Q}" \ @@ -207,7 +210,7 @@ RUN_DEPENDS+= mozc_server:${PORTSDIR}/japanese/mozc-server \ mozc_tool:${PORTSDIR}/japanese/mozc-tool \ ${PYTHON_SITELIBDIR}/gtk-2.0/pynotify/__init__.py:${PORTSDIR}/devel/py-notify -PLIST_FILES+= bin/mozc_renderer \ +PLIST_FILES+= libexec/mozc_renderer \ libexec/ibus-engine-mozc \ %%DATADIR%%/icons/alpha_full.png \ %%DATADIR%%/icons/alpha_half.png \ @@ -230,7 +233,7 @@ do-build-ibus_mozc: do-install-ibus_mozc: ${INSTALL_PROGRAM} \ ${WRKSRC}/out_linux/${BUILD_MODE}/mozc_renderer \ - ${STAGEDIR}${PREFIX}/bin/mozc_renderer + ${STAGEDIR}${PREFIX}/libexec/mozc_renderer ${INSTALL_PROGRAM} \ ${WRKSRC}/out_linux/${BUILD_MODE}/ibus_mozc \ ${STAGEDIR}${PREFIX}/libexec/ibus-engine-mozc @@ -331,11 +334,16 @@ do-install-fcitx_mozc: CATEGORIES+= elisp RUN_DEPENDS+= mozc_server:${PORTSDIR}/japanese/mozc-server -PLIST_FILES+= ${EMACS_VERSION_SITE_LISPDIR}/mozc/mozc.el \ - ${EMACS_VERSION_SITE_LISPDIR}/mozc/mozc.elc \ +PLIST_FILES+= ${EMACS_VERSION_SITE_LISPDIR}/mozc/mozc.elc \ ${EMACS_VERSION_SITE_LISPDIR}/mozc/leim-list.el PLIST_DIRS+= ${EMACS_VERSION_SITE_LISPDIR}/mozc +post-patch-mozc_el: + ${REINPLACE_CMD} "s,%%PREFIX%%,${PREFIX}," \ + ${WRKSRC}/unix/emacs/mozc.el + +post-patch: post-patch-mozc_el + do-build-mozc_el: cd ${WRKSRC}/unix/emacs && \ ${EMACS_CMD} -batch -q -no-site-file -no-init-file \ @@ -344,7 +352,6 @@ do-build-mozc_el: do-install-mozc_el: @${MKDIR} ${STAGEDIR}${PREFIX}/${EMACS_VERSION_SITE_LISPDIR}/mozc ${INSTALL_DATA} \ - ${WRKSRC}/unix/emacs/mozc.el \ ${WRKSRC}/unix/emacs/mozc.elc \ ${FILESDIR}/leim-list.el \ ${STAGEDIR}${PREFIX}/${EMACS_VERSION_SITE_LISPDIR}/mozc/ diff --git a/japanese/mozc-server/files/leim-list.el b/japanese/mozc-server/files/leim-list.el index 7cb0f17861a5..de8980c161c3 100644 --- a/japanese/mozc-server/files/leim-list.el +++ b/japanese/mozc-server/files/leim-list.el @@ -13,8 +13,8 @@ ;; 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) +(autoload 'mozc-mode "mozc" "Activate Mozc." t) +(autoload 'mozc-leim-activate "mozc" "Activate Mozc." t) (defcustom mozc-leim-title "[Mozc]" "Mode line string shown when mozc-mode is enabled. diff --git a/japanese/mozc-server/files/mozc.in b/japanese/mozc-server/files/mozc.in index ccc05c882ea3..91a8ef2d279c 100644 --- a/japanese/mozc-server/files/mozc.in +++ b/japanese/mozc-server/files/mozc.in @@ -19,8 +19,11 @@ cleanup_lock() check_lock() { if [ -r "${MOZCDIR}/.server.lock" ]; then - pid=$(cat "${MOZCDIR}/mozc_server.pid") - printf "mozc_server is running (PID=%s).\n" "$pid" \ + if [ -r "${MOZCDIR}/mozc_server.pid" ]; then + pid=$(cat "${MOZCDIR}/mozc_server.pid") + pid=" (PID=$pid)" + fi + printf "mozc_server is running%s.\n" "$pid" \ > /dev/stderr false fi diff --git a/japanese/mozc-server/files/mozc_tool.in b/japanese/mozc-server/files/mozc_tool.in index 3fb7f8979b71..38f98f26b62e 100644 --- a/japanese/mozc-server/files/mozc_tool.in +++ b/japanese/mozc-server/files/mozc_tool.in @@ -1,20 +1,17 @@ #!/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 +: ${MODE:=${1:-about_dialog}} +case $MODE in +--mode=*) + exec %%PREFIX%%/libexec/mozc_tool $MODE +;; +config_dialog|dictionary_tool|word_register_dialog|about_dialog|character_palette|hand_writing) + exec %%PREFIX%%/libexec/mozc_tool --mode="$MODE" ;; *) - exec %%PREFIX%%/libexec/mozc_tool --mode="$1" + echo "Specify one of the following keywords:" + echo "config_dialog|dictionary_tool|word_register_dialog|about_dialog|character_palette|hand_writing" | tr "|" "\n" + exit 1 ;; esac diff --git a/japanese/mozc-server/files/patch-base_base.gyp b/japanese/mozc-server/files/patch-base_base.gyp new file mode 100644 index 000000000000..2fbd33920e13 --- /dev/null +++ b/japanese/mozc-server/files/patch-base_base.gyp @@ -0,0 +1,19 @@ +--- base/base.gyp.orig 2015-02-17 18:02:46.000000000 +0900 ++++ base/base.gyp 2015-02-17 18:03:44.000000000 +0900 +@@ -154,6 +154,16 @@ + 'MOZC_SERVER_DIRECTORY="<(server_dir)"', + ], + }], ++ ['target_platform=="Linux" and tool_dir!=""', { ++ 'defines': [ ++ 'MOZC_TOOL_DIRECTORY="<(tool_dir)"', ++ ], ++ }], ++ ['target_platform=="Linux" and renderer_dir!=""', { ++ 'defines': [ ++ 'MOZC_RENDERER_DIRECTORY="<(renderer_dir)"', ++ ], ++ }], + ['target_platform=="Linux" and document_dir!=""', { + 'defines': [ + 'MOZC_DOCUMENT_DIRECTORY="<(document_dir)"', diff --git a/japanese/mozc-server/files/patch-base_system_util.cc b/japanese/mozc-server/files/patch-base_system_util.cc new file mode 100644 index 000000000000..9d9e875c11bb --- /dev/null +++ b/japanese/mozc-server/files/patch-base_system_util.cc @@ -0,0 +1,26 @@ +--- base/system_util.cc.orig 2015-02-17 17:59:05.000000000 +0900 ++++ base/system_util.cc 2015-02-17 18:01:50.000000000 +0900 +@@ -407,7 +407,11 @@ + if (server_path.empty()) { + return ""; + } ++#ifdef MOZC_RENDERER_DIRECTORY ++ return FileUtil::JoinPath(MOZC_RENDERER_DIRECTORY "/", kMozcRenderer); ++#else + return FileUtil::JoinPath(server_path, kMozcRenderer); ++#endif + } + + string SystemUtil::GetToolPath() { +@@ -416,7 +420,11 @@ + if (server_path.empty()) { + return ""; + } ++#ifdef MOZC_TOOL_DIRECTORY ++ return FileUtil::JoinPath(MOZC_TOOL_DIRECTORY "/", kMozcTool); ++#else + return FileUtil::JoinPath(server_path, kMozcTool); ++#endif + } + + string SystemUtil::GetDocumentDirectory() { diff --git a/japanese/mozc-server/files/patch-build_mozc.py b/japanese/mozc-server/files/patch-build_mozc.py index 0a9b993664b9..39e3f46871c7 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 2014-08-31 03:36:22.000000000 +0900 -+++ build_mozc.py 2014-09-17 04:37:10.000000000 +0900 -@@ -351,6 +351,11 @@ +--- build_mozc.py.orig 2015-02-15 04:18:52.000000000 +0900 ++++ build_mozc.py 2015-02-19 03:40:47.000000000 +0900 +@@ -357,6 +357,11 @@ parser.add_option('--version_file', dest='version_file', help='use the specified version template file', default='mozc_version_template.txt') @@ -12,7 +12,22 @@ AddTargetPlatformOption(parser) # Mac and Linux -@@ -538,7 +543,7 @@ +@@ -377,6 +382,14 @@ + default='', + help='A path to the directory where the server executable' + 'is installed. This option is used only on Linux.') ++ parser.add_option('--renderer_dir', dest='renderer_dir', ++ default='', ++ help='A path to the directory where the renderer executable' ++ 'is installed. This option is used only on Linux.') ++ parser.add_option('--tool_dir', dest='tool_dir', ++ default='', ++ help='A path to the directory where the tool executable' ++ 'is installed. This option is used only on Linux.') + + # Android + parser.add_option('--android_arch', dest='android_arch', +@@ -548,7 +561,7 @@ parser = optparse.OptionParser(usage='Usage: %prog build [options]') AddCommonOptions(parser) if IsLinux(): @@ -21,7 +36,7 @@ parser.add_option('--jobs', '-j', dest='jobs', default=('%d' % default_build_concurrency), metavar='N', help='run build jobs in parallel') -@@ -701,6 +706,17 @@ +@@ -707,6 +720,17 @@ logging.info('Building GYP command line...') gyp_options = ['--depth=.', '--include=%s/gyp/common.gypi' % SRC_DIR] @@ -39,3 +54,18 @@ mozc_root = os.path.abspath(GetTopLevelSourceDirectoryName()) gyp_options.extend(['-D', 'abs_depth=%s' % mozc_root]) +@@ -936,6 +960,14 @@ + if options.server_dir: + gyp_options.extend([ + '-D', 'server_dir=%s' % os.path.abspath(options.server_dir)]) ++ if options.tool_dir: ++ gyp_options.extend([ ++ '-D', 'tool_dir=%s' % os.path.abspath(options.tool_dir)]) ++ if options.renderer_dir: ++ gyp_options.extend([ ++ '-D', 'renderer_dir=%s' % os.path.abspath(options.renderer_dir)]) ++ ++ + + # TODO(yukawa): Use ninja on OSX. + if generator == 'ninja': diff --git a/japanese/mozc-server/files/patch-gyp_common.gypi b/japanese/mozc-server/files/patch-gyp_common.gypi index 9bfd1d793e18..5369a21a9336 100644 --- a/japanese/mozc-server/files/patch-gyp_common.gypi +++ b/japanese/mozc-server/files/patch-gyp_common.gypi @@ -1,5 +1,5 @@ --- gyp/common.gypi.orig 2015-02-15 04:18:51.000000000 +0900 -+++ gyp/common.gypi 2015-02-15 04:52:49.000000000 +0900 ++++ gyp/common.gypi 2015-02-17 18:08:07.000000000 +0900 @@ -161,9 +161,9 @@ ['target_platform=="Linux"', { # enable_gtk_renderer represents if mozc_renderer is supported on Linux @@ -12,7 +12,22 @@ 'compiler_host_version_int': 305, # Clang 3.5 or higher 'enable_gtk_renderer%': 1, }, { # else -@@ -621,17 +621,20 @@ +@@ -208,6 +208,14 @@ + # installed. This option is only for Linux. + 'server_dir%': '/usr/lib/mozc', + ++ # renderer_dir represents the directory where mozc_renderer is ++ # installed. This option is only for Linux. ++ 'renderer_dir%': '/usr/lib/mozc', ++ ++ # tool_dir represents the directory where mozc_tool is ++ # installed. This option is only for Linux. ++ 'tool_dir%': '/usr/lib/mozc', ++ + # Represents the directory where the source code of protobuf is + # extracted. This value is ignored when 'use_libprotobuf' is 1. + 'protobuf_root': '<(third_party_dir)/protobuf', +@@ -621,17 +629,20 @@ ['compiler_target=="clang"', { 'cflags': [ '-Wtype-limits', @@ -36,7 +51,7 @@ ], }], ], -@@ -641,17 +644,20 @@ +@@ -641,17 +652,20 @@ ['compiler_host=="clang"', { 'cflags': [ '-Wtype-limits', @@ -60,7 +75,7 @@ ], }], ], -@@ -744,16 +750,27 @@ +@@ -744,16 +758,27 @@ ['OS=="linux"', { 'defines': [ 'OS_LINUX', diff --git a/japanese/mozc-server/files/patch-unix_emacs_mozc.el b/japanese/mozc-server/files/patch-unix_emacs_mozc.el index 26fc4b133d5c..22257b1095af 100644 --- a/japanese/mozc-server/files/patch-unix_emacs_mozc.el +++ b/japanese/mozc-server/files/patch-unix_emacs_mozc.el @@ -1,5 +1,14 @@ ---- unix/emacs/mozc.el.orig 2014-08-31 03:35:19.000000000 +0900 -+++ unix/emacs/mozc.el 2014-08-31 03:52:11.000000000 +0900 +--- unix/emacs/mozc.el.orig 2015-02-15 04:18:31.000000000 +0900 ++++ unix/emacs/mozc.el 2015-02-19 04:01:46.000000000 +0900 +@@ -1538,7 +1538,7 @@ + + ;;;; Communication with Mozc server through the helper process + +-(defvar mozc-helper-program-name "mozc_emacs_helper" ++(defvar mozc-helper-program-name "%%PREFIX%%/libexec/mozc_emacs_helper" + "Helper program's name or path to the helper program. + The helper program helps Emacs communicate with Mozc server, + which doesn't understand S-expression.") @@ -1973,12 +1973,12 @@ "Deactivate function `mozc-mode' via LEIM." (mozc-mode nil)) 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 new file mode 100644 index 000000000000..2aac1215ce43 --- /dev/null +++ b/japanese/mozc-server/files/patch-unix_ibus_gen_mozc_xml.py @@ -0,0 +1,23 @@ +--- unix/ibus/gen_mozc_xml.py.orig 2015-02-17 18:05:39.000000000 +0900 ++++ unix/ibus/gen_mozc_xml.py 2015-02-17 18:06:30.000000000 +0900 +@@ -203,13 +203,19 @@ + parser.add_option('--server_dir', dest='server_dir', default='', + help='The absolute directory path to be installed the ' + 'server executable.') ++ parser.add_option('--renderer_dir', dest='renderer_dir', default='', ++ help='The absolute directory path to be installed the ' ++ 'renderer executable.') ++ parser.add_option('--tool_dir', dest='tool_dir', default='', ++ help='The absolute directory path to be installed the ' ++ 'tool executable.') + parser.add_option('--pkg_config_command', dest='pkg_config_command', + default='pkg-config', + help='The path to pkg-config command.') + (options, unused_args) = parser.parse_args() + + setup_arg = [] +- setup_arg.append(os.path.join(options.server_dir, 'mozc_tool')) ++ setup_arg.append(os.path.join(options.tool_dir, 'mozc_tool')) + setup_arg.append('--mode=config_dialog') + if IsIBus15OrGreater(options): + # A tentative workaround against IBus 1.5 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..b4d1ede5dee6 --- /dev/null +++ b/japanese/mozc-server/files/patch-unix_ibus_ibus.gyp @@ -0,0 +1,11 @@ +--- unix/ibus/ibus.gyp.orig 2015-02-17 18:04:40.000000000 +0900 ++++ unix/ibus/ibus.gyp 2015-02-17 18:04:58.000000000 +0900 +@@ -83,6 +83,8 @@ + './gen_mozc_xml.py', + '--branding=Mozc', + '--server_dir=<(server_dir)', ++ '--renderer_dir=<(renderer_dir)', ++ '--tool_dir=<(tool_dir)', + '--pkg_config_command=<(pkg_config_command)', + '--ibus_mozc_path=<(ibus_mozc_path)', + '--ibus_mozc_icon_path=<(ibus_mozc_icon_path)', |