aboutsummaryrefslogtreecommitdiffstats
path: root/japanese/mozc-server
diff options
context:
space:
mode:
authorhrs <hrs@FreeBSD.org>2015-07-10 05:12:03 +0800
committerhrs <hrs@FreeBSD.org>2015-07-10 05:12:03 +0800
commitafcb58572a1772c00557546339d45d8cc6342a71 (patch)
treeb65c527bf04ee2ce5ab0dbbd703880a3260b9cf0 /japanese/mozc-server
parent95dcc0573bb869b8a1f913672d65a99470b32b2e (diff)
downloadfreebsd-ports-gnome-afcb58572a1772c00557546339d45d8cc6342a71.tar.gz
freebsd-ports-gnome-afcb58572a1772c00557546339d45d8cc6342a71.tar.zst
freebsd-ports-gnome-afcb58572a1772c00557546339d45d8cc6342a71.zip
- Add japanese/uim-mozc, uim plugin for mozc input method[*].
- Fix XML file for ibus engine. - Fix stop_server() in mozc startup script. PR: 199258 [*] Based on work by: Koichiro IWAO [*]
Diffstat (limited to 'japanese/mozc-server')
-rw-r--r--japanese/mozc-server/Makefile59
-rw-r--r--japanese/mozc-server/distinfo2
-rw-r--r--japanese/mozc-server/files/mozc.in7
-rw-r--r--japanese/mozc-server/files/patch-unix_ibus_gen_mozc_xml.py32
4 files changed, 90 insertions, 10 deletions
diff --git a/japanese/mozc-server/Makefile b/japanese/mozc-server/Makefile
index 799cfd6403b5..e65ab67c62a6 100644
--- a/japanese/mozc-server/Makefile
+++ b/japanese/mozc-server/Makefile
@@ -3,7 +3,7 @@
PORTNAME= mozc
PORTVERSION= 2.16.2051.102
-PORTREVISION= 2
+PORTREVISION= 3
CATEGORIES= japanese
MASTER_SITES= LOCAL/hrs
DISTFILES= ${DISTNAME}${EXTRACT_SUFX}
@@ -27,7 +27,7 @@ USES= compiler:c++11-lang pkgconfig iconv:wchar_t gmake \
BUILD_MOZC_LIST?= mozc_server
-.if ${BUILD_MOZC_LIST:Mmozc_server} == "mozc_server"
+.if ${BUILD_MOZC_LIST:Mmozc_server} == "mozc_server"
PKGNAMEPREFIX= ja-
PKGNAMESUFFIX= -server
@@ -124,7 +124,7 @@ post-configure: ${WRKSRC}/mozcmake
.endif
# mozc_server
-.if ${BUILD_MOZC_LIST:Mmozc_server} == "mozc_server" || defined(makesum)
+.if ${BUILD_MOZC_LIST:Mmozc_server} == "mozc_server" || make(makesum)
GYP_OPTIONS+= --noqt
GYP_DEFINES+= use_libibus=0 \
enable_gtk_renderer=0
@@ -251,6 +251,58 @@ do-install-ibus_mozc:
${STAGEDIR}${DATADIR}/icons/product_icon.png
.endif
+# uim_mozc
+.if ${BUILD_MOZC_LIST:Muim_mozc} == "uim_mozc" || make(makesum)
+#USE_GITHUB= yes # XXX
+GH_ACCOUNT= e-kato
+GH_PROJECT= macuim
+GH_TAGNAME= v0.6.16.2
+DISTFILES+= ${GH_ACCOUNT}-${GH_PROJECT}-${GH_TAGNAME}_GH0${EXTRACT_SUFX}:gh
+EXTRACT_ONLY+= ${GH_ACCOUNT}-${GH_PROJECT}-${GH_TAGNAME}_GH0${EXTRACT_SUFX}
+MASTER_SITES+= https://codeload.github.com/${GH_ACCOUNT}/${GH_PROJECT}/tar.gz/${GH_TAGNAME}?dummy=/:gh
+WRKSRC_MU= ${WRKDIR}/${GH_PROJECT}-${GH_TAGNAME:C/^v//}
+
+LIB_DEPENDS+= libuim.so:${PORTSDIR}/textproc/uim
+RUN_DEPENDS+= mozc_server:${PORTSDIR}/japanese/mozc-server \
+ mozc_tool:${PORTSDIR}/japanese/mozc-tool
+GYP_OPTIONS+= --noqt
+GYP_DEFINES+= use_libibus=0 \
+ enable_gtk_renderer=0
+
+PLIST_FILES+= lib/uim/plugin/libuim-mozc.so \
+ %%DATADIR%%/mozc.scm \
+ %%DATADIR%%/mozc-custom.scm \
+ %%DATADIR%%/mozc-key-custom.scm \
+ %%DATADIR%%/pixmaps/mozc.png \
+ "@exec ${LOCALBASE}/bin/uim-module-manager --register mozc" \
+ "@unexec ${LOCALBASE}/bin/uim-module-manager --unregister mozc"
+
+post-extract-uim_mozc:
+ ${LN} -s ${WRKSRC_MU}/Mozc/uim ${WRKSRC}/unix
+ ${REINPLACE_CMD} -e "s,/usr/lib/mozc,${LOCALBASE}/libexec," \
+ ${WRKSRC_MU}/Mozc/scm/mozc-custom.scm
+
+post-extract: post-extract-uim_mozc
+
+do-build-uim_mozc:
+ ${BUILD_MOZC_CMD_BUILD} \
+ unix/uim/uim.gyp:uim-mozc
+
+do-install-uim_mozc:
+ ${MKDIR} ${STAGEDIR}${PREFIX}/lib/uim/plugin
+ ${INSTALL_PROGRAM} \
+ ${WRKSRC}/out_linux/${BUILD_MODE}/libuim-mozc.so \
+ ${STAGEDIR}${PREFIX}/lib/uim/plugin
+ ${MKDIR} ${STAGEDIR}${DATADIR}
+ cd ${WRKSRC_MU}/Mozc/scm && \
+ ${INSTALL_DATA} mozc.scm mozc-custom.scm mozc-key-custom.scm \
+ ${STAGEDIR}${DATADIR}
+ ${MKDIR} ${STAGEDIR}${DATADIR}/pixmaps
+ ${INSTALL_DATA} \
+ ${WRKSRC}/data/images/product_icon_32bpp-128.png \
+ ${STAGEDIR}${DATADIR}/pixmaps/mozc.png
+.endif
+
# fcitx_mozc
.if ${BUILD_MOZC_LIST:Mfcitx_mozc} == "fcitx_mozc" || make(makesum)
PATCH_SITES= http://download.fcitx-im.org/fcitx-mozc/
@@ -261,7 +313,6 @@ PATCH_DIST_STRIP=-p2
EXTRA_PATCHES= ${PATCHDIR}/extra-patch-unix-fcitx-eim.cc \
${PATCHDIR}/extra-patch-unix-fcitx-mozc_response_parser.cc \
${PATCHDIR}/extra-patch-unix-fcitx-surrounding_text_util.cc
-
GYP_OPTIONS+= --noqt
GYP_DEFINES+= use_libibus=0 \
enable_gtk_renderer=0
diff --git a/japanese/mozc-server/distinfo b/japanese/mozc-server/distinfo
index b4127b3e2a52..a343b80fbf76 100644
--- a/japanese/mozc-server/distinfo
+++ b/japanese/mozc-server/distinfo
@@ -6,3 +6,5 @@ SHA256 (jigyosyo-20130628.lzh) = d7b796d8643457d883de4a33cb3edf7455f11d778ea74d0
SIZE (jigyosyo-20130628.lzh) = 823590
SHA256 (fcitx-mozc-2.16.2037.102.2.patch) = ff175f3e0301c33f750780765ea264887827d00bc7a59fc8b55ae514ba449a1e
SIZE (fcitx-mozc-2.16.2037.102.2.patch) = 140421
+SHA256 (e-kato-macuim-v0.6.16.2_GH0.tar.bz2) = 25fca78d1d76cc5c6a49f3b2f6981791ad8275abb2726334d8d40bd49498194d
+SIZE (e-kato-macuim-v0.6.16.2_GH0.tar.bz2) = 324551
diff --git a/japanese/mozc-server/files/mozc.in b/japanese/mozc-server/files/mozc.in
index 91a8ef2d279c..43023758e46e 100644
--- a/japanese/mozc-server/files/mozc.in
+++ b/japanese/mozc-server/files/mozc.in
@@ -37,10 +37,11 @@ stop_server()
{
if [ -r "${MOZCDIR}/mozc_server.pid" ]; then
pkill -F "${MOZCDIR}/mozc_server.pid"
+ else
+ for p in $(pgrep -U $(id -u) mozc_server); do
+ kill $p
+ done
fi
- for p in $(pgrep -U $(id -u) mozc_server); do
- kill $p
- done
}
case $1 in
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 2aac1215ce43..de022f56d745 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,6 +1,32 @@
---- 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 @@
+--- unix/ibus/gen_mozc_xml.py.orig 2015-02-15 04:18:31.000000000 +0900
++++ unix/ibus/gen_mozc_xml.py 2015-02-22 02:00:23.000000000 +0900
+@@ -67,7 +67,7 @@
+ # Information to generate <engines> part of mozc.xml for IBus 1.5 or later.
+ IBUS_1_5_ENGINE_COMMON_PROPS = {
+ 'description': '%(product_name)s (Japanese Input Method)',
+- 'language': 'ja',
++ 'language': 'jpn',
+ 'icon': '%(ibus_mozc_icon_path)s',
+ 'rank': '80',
+ 'symbol': '&#x3042;',
+@@ -91,7 +91,7 @@
+ # unix/ibus/mozc_engine.cc.
+ 'name': ['mozc-jp'],
+ 'longname': ['%(product_name)s'],
+- 'layout': ['default'],
++ 'layout': ['jp'],
+ },
+ }
+
+@@ -129,6 +129,7 @@
+ engines: A dictionary from a property name to a list of property values of
+ engines. For example, {'name': ['mozc-jp', 'mozc', 'mozc-dv']}.
+ """
++ print '<?xml version="1.0" encoding="utf-8"?>'
+ print '<component>'
+ for key in component:
+ OutputXmlElement(param_dict, key, component[key])
+@@ -203,13 +204,19 @@
parser.add_option('--server_dir', dest='server_dir', default='',
help='The absolute directory path to be installed the '
'server executable.')