ports/167860: [PATCH] Add the support to fcitx-mozc in japanese/mozc-server

Zhihao Yuan lichray at gmail.com
Mon May 14 03:20:02 UTC 2012


>Number:         167860
>Category:       ports
>Synopsis:       [PATCH] Add the support to fcitx-mozc in japanese/mozc-server
>Confidential:   no
>Severity:       non-critical
>Priority:       high
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Mon May 14 03:20:02 UTC 2012
>Closed-Date:
>Last-Modified:
>Originator:     Zhihao Yuan
>Release:        FreeBSD 8.3-STABLE amd64
>Organization:
Northern Illinois University
>Environment:
System: FreeBSD elitebook.hp 8.3-STABLE FreeBSD 8.3-STABLE #1 r235265: Fri May 11 07:06:26 CDT 2012 lichray at elitebook.hp:/usr/obj/usr/src/sys/HOUKAGO amd64


	
>Description:
	
	This patch adds the fcitx-mozc support to mozc-server. Fcitx is featured input method framework.
	https://code.google.com/p/fcitx/

	A new slave port, "japanese/fcitx-mozc" is needed (ports/166711).
	 * It has been a long time since I submit the PR above, so I have to separate the PR into two to notify the japanese/mozc-server maintainer.
>How-To-Repeat:
	
>Fix:

	

--- mozc-server_2.patch begins here ---
diff -ruN --exclude=CVS ../mozc-server.orig/Makefile ./Makefile
--- ../mozc-server.orig/Makefile	2012-05-01 23:16:50.000000000 -0500
+++ ./Makefile	2012-05-04 15:57:23.303055512 -0500
@@ -7,12 +7,16 @@
 
 PORTNAME=	mozc
 PORTVERSION=	1.5.1053.102
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	japanese
 MASTER_SITES=	${MASTER_SITE_GOOGLE_CODE}
 PKGNAMEPREFIX?=	ja-
 PKGNAMESUFFIX?=	-server
 
+PATCH_SITES?=	http://fcitx.googlecode.com/files/
+PATCHFILES?=	fcitx-mozc-${PORTVERSION}-1.patch
+PATCH_DIST_STRIP?=-p2
+
 MAINTAINER=	daichi at FreeBSD.org
 COMMENT?=	Mozc server for IBus, SCIM and others
 
@@ -57,8 +61,7 @@
 BUILD_MODE=	Release
 .endif
 
-LOCALBASE_REPLACE_FILES= \
-		build_mozc.py \
+LOCALBASE_REPLACE_FILES=	\
 		gyp/common.gypi \
 		unix/ibus/gen_mozc_xml.py \
 		unix/ibus/mozc.xml \
@@ -78,7 +81,7 @@
 BUILD_MOZC_CMD=	cd ${BUILD_WRKSRC} && \
 		${SETENV} BUILD_COMMAND="${WRKSRC}/mozcmake" \
 		PYTHONPATH=${WRKSRC}/third_party/gyp/local/lib/python${PYTHON_VER}/site-packages \
-		MOZC_SERVER_DIRECTORY="${PREFIX}/bin" GYP_DEFINES="use_libprotobuf=1" \
+		GYP_DEFINES="use_libprotobuf=1" \
 		${PYTHON_CMD} build_mozc.py
 BUILD_GYP_CMD=	cd ${WRKSRC}/third_party/gyp && ${SETENV} ${MAKE_ENV} ${PYTHON_CMD} ${PYSETUP}
 
@@ -95,7 +98,8 @@
 	${BUILD_GYP_CMD} ${PYDISTUTILS_CONFIGURE_TARGET} ${PYDISTUTILS_CONFIGUREARGS}
 	${BUILD_GYP_CMD} ${PYDISTUTILS_BUILD_TARGET} ${PYDISTUTILS_BUILDARGS}
 	${BUILD_GYP_CMD} ${PYDISTUTILS_INSTALL_TARGET} --prefix=${WRKSRC}/third_party/gyp/local
-	${BUILD_MOZC_CMD} gyp --gypdir=${WRKSRC}/third_party/gyp/local/bin --channel_dev=0
+	${BUILD_MOZC_CMD} gyp --gypdir=${WRKSRC}/third_party/gyp/local/bin \
+		--server_dir="${PREFIX}/bin" --channel_dev=0
 	${BUILD_MOZC_CMD} build_tools -c ${BUILD_MODE}
 
 # mozc_server
@@ -227,6 +231,66 @@
 		${DATADIR}/icons/scim-mozc.png
 .endif
 
+# fcitx_mozc
+.if ${BUILD_MOZC_LIST:Mfcitx_mozc} == "fcitx_mozc"
+LIB_DEPENDS+=	fcitx-config.4:${PORTSDIR}/chinese/fcitx
+RUN_DEPENDS+=	mozc_server:${PORTSDIR}/japanese/mozc-server \
+		mozc_tool:${PORTSDIR}/japanese/mozc-tool \
+		mozc_server_start:${PORTSDIR}/japanese/mozc-additions
+
+PLIST_FILES+=	lib/fcitx/fcitx-mozc.so \
+		share/fcitx/addon/fcitx-mozc.conf \
+		share/fcitx/inputmethod/mozc.conf \
+		${DATADIR_REL}/icon/mozc.png \
+		${DATADIR_REL}/icon/mozc-alpha_full.png \
+		${DATADIR_REL}/icon/mozc-alpha_half.png \
+		${DATADIR_REL}/icon/mozc-direct.png \
+		${DATADIR_REL}/icon/mozc-hiragana.png \
+		${DATADIR_REL}/icon/mozc-katakana_full.png \
+		${DATADIR_REL}/icon/mozc-katakana_half.png \
+		${DATADIR_REL}/icon/mozc-dictionary.png \
+		${DATADIR_REL}/icon/mozc-properties.png \
+		${DATADIR_REL}/icon/mozc-tool.png \
+		share/locale/ja/LC_MESSAGES/fcitx-mozc.mo \
+		share/locale/zh_CN/LC_MESSAGES/fcitx-mozc.mo \
+		share/locale/zh_TW/LC_MESSAGES/fcitx-mozc.mo
+PLIST_DIRS+=	${DATADIR_REL}/icon ${DATADIR_REL}
+
+do-build-fcitx_mozc:
+	${BUILD_MOZC_CMD} build -c ${BUILD_MODE} unix/fcitx/fcitx.gyp:fcitx-mozc
+
+do-install-fcitx_mozc:
+# uncomment the following line for `port test`
+	#${MKDIR} \
+		${PREFIX}/lib/fcitx \
+		${PREFIX}/share/fcitx/addon \
+		${PREFIX}/share/fcitx/inputmethod
+	${INSTALL_LIB} \
+		${WRKSRC}/out_linux/${BUILD_MODE}/fcitx-mozc.so \
+		${PREFIX}/lib/fcitx/fcitx-mozc.so
+	${INSTALL_DATA} \
+		${WRKSRC}/unix/fcitx/fcitx-mozc.conf \
+		${PREFIX}/share/fcitx/addon/fcitx-mozc.conf
+	${INSTALL_DATA} \
+		${WRKSRC}/unix/fcitx/mozc.conf \
+		${PREFIX}/share/fcitx/inputmethod/mozc.conf
+	${MKDIR} ${DATADIR}/icon
+.for F in ui-alpha_full ui-alpha_half ui-dictionary ui-direct \
+	ui-hiragana ui-katakana_full ui-katakana_half ui-properties ui-tool
+	@${INSTALL_DATA} \
+		${WRKSRC}/data/images/unix/${F}.png \
+		${DATADIR}/icon/${F:S/^ui-/mozc-/}.png
+.endfor
+	@${INSTALL_DATA} \
+		${WRKSRC}/data/images/product_icon_32bpp-128.png \
+		${DATADIR}/icon/mozc.png
+.for L in ja zh_CN zh_TW
+	@${INSTALL_DATA} \
+		${WRKSRC}/out_linux/${BUILD_MODE}/obj/gen/unix/fcitx/po/${L}.mo \
+		${PREFIX}/share/locale/${L}/LC_MESSAGES/fcitx-mozc.mo
+.endfor
+.endif
+
 # mozc-el
 .if ${BUILD_MOZC_LIST:Mmozc-el} == "mozc-el"
 CATEGORIES+=	editors elisp
diff -ruN --exclude=CVS ../mozc-server.orig/distinfo ./distinfo
--- ../mozc-server.orig/distinfo	2012-05-01 00:53:34.000000000 -0500
+++ ./distinfo	2012-05-04 15:16:03.106351447 -0500
@@ -1,2 +1,4 @@
 SHA256 (mozc-1.5.1053.102.tar.bz2) = c0b8e2f8db312fb530387c0ac9c67dae8bc723bf02765e54816353b1e8dc11e3
 SIZE (mozc-1.5.1053.102.tar.bz2) = 52230135
+SHA256 (fcitx-mozc-1.5.1053.102-1.patch) = 93ebe5ccf42520212ee81b2eac0b5d8727e211a2fbdef244e44d38576d6c54e6
+SIZE (fcitx-mozc-1.5.1053.102-1.patch) = 96547
diff -ruN --exclude=CVS ../mozc-server.orig/files/patch-unix_fcitx_gen__fcitx__mozc__i18n.sh ./files/patch-unix_fcitx_gen__fcitx__mozc__i18n.sh
--- ../mozc-server.orig/files/patch-unix_fcitx_gen__fcitx__mozc__i18n.sh	1969-12-31 18:00:00.000000000 -0600
+++ ./files/patch-unix_fcitx_gen__fcitx__mozc__i18n.sh	2012-05-04 15:26:37.626878773 -0500
@@ -0,0 +1,11 @@
+--- unix/fcitx/gen_fcitx_mozc_i18n.sh.orig	2012-04-06 15:59:51.874875110 -0500
++++ unix/fcitx/gen_fcitx_mozc_i18n.sh	2012-04-06 16:00:48.621198949 -0500
+@@ -7,5 +7,5 @@ mkdir -p "$1"
+ 
+ for pofile in *.po
+ do
+-  msgfmt "$pofile" -o "$1/${pofile/po/mo}"
+-done
+\ No newline at end of file
++  msgfmt "$pofile" -o "$1/${pofile%po}mo"
++done
--- mozc-server_2.patch ends here ---


>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list