Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 06 Apr 2012 17:53:19 -0500
From:      Zhihao Yuan <lichray@gmail.com>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/166711: New port: fcitx-mozc - Mozc Japanese input method for Fcitx
Message-ID:  <4f7f73e6.aa5f320a.3bf1.5b1b@mx.google.com>
Resent-Message-ID: <201204062300.q36N09nc081701@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         166711
>Category:       ports
>Synopsis:       New port: fcitx-mozc - Mozc Japanese input method for Fcitx
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Fri Apr 06 23:00:08 UTC 2012
>Closed-Date:
>Last-Modified:
>Originator:     Zhihao Yuan
>Release:        FreeBSD 8.3-PRERELEASE amd64
>Organization:
Northern Illinois University
>Environment:
System: FreeBSD elitebook.hp 8.3-PRERELEASE FreeBSD 8.3-PRERELEASE #5 r233751: Sat Mar 31 18:29:04 CDT 2012 lichray@elitebook.hp:/usr/obj/home/lichray/devel/freebsd-8/sys/HOUKAGO amd64


	
>Description:
	
	fcitx-mozc is a Fcitx input method module using the Mozc engine. The project is hosted at https://code.google.com/p/fcitx/ as a patch to the mozc source. So this port requires a mozc-server_1.patch in addtion to the fcitx-mozc.shar, and we need to contact daichi@ before importing the port.

	Btw, there is a ports/166689 which updates fcitx to 4.2.1. If you have the time, please take a look at it. Thanks.
>How-To-Repeat:
	
>Fix:

	

--- mozc-server_1.patch begins here ---
diff -ruN --exclude=CVS ../mozc-server.orig/Makefile ./Makefile
--- ../mozc-server.orig/Makefile	2012-04-01 19:10:35.000000000 -0500
+++ ./Makefile	2012-04-06 16:59:15.301169018 -0500
@@ -7,11 +7,16 @@
 
 PORTNAME=	mozc
 PORTVERSION=	1.4.1033.102
+PORTREVISION?=	1
 CATEGORIES=	japanese
 MASTER_SITES=	${MASTER_SITE_GOOGLE_CODE}
 PKGNAMEPREFIX?=	ja-
 PKGNAMESUFFIX?=	-server
 
+PATCH_SITES?=	http://fcitx.googlecode.com/files/
+PATCHFILES?=	fcitx-mozc-${PORTVERSION}.patch
+PATCH_DIST_STRIP?=-p2
+
 MAINTAINER=	daichi@FreeBSD.org
 COMMENT?=	Mozc server for IBus, SCIM and others
 
@@ -80,6 +85,8 @@
 	cd ${WRKSRC} && \
 		${REINPLACE_CMD} "s,@@LOCALBASE@@,${LOCALBASE},g" \
 		${LOCALBASE_REPLACE_FILES}
+	@${REINPLACE_CMD} "s,/usr/.*mozc/,${DATADIR}/," \
+		${WRKSRC}/unix/fcitx/mozc.conf
 
 pre-build:
 	${PRINTF} "%s\n%s\n" "#!/bin/sh" 'exec ${BUILD_CMD} $$@' > ${WRKSRC}/mozcmake
@@ -219,6 +226,71 @@
 		${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/configdesc/fcitx-mozc.desc \
+		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/configdesc \
+		${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/fcitx-mozc.conf \
+		${PREFIX}/share/fcitx/configdesc/fcitx-mozc.desc
+	${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-04-01 19:10:35.000000000 -0500
+++ ./distinfo	2012-04-06 14:25:48.586775904 -0500
@@ -1,2 +1,4 @@
 SHA256 (mozc-1.4.1033.102.tar.bz2) = dd3bf1d849a6861c4ec9aed2e62bc659975cba26c684e7ca2b91f986d717f42f
 SIZE (mozc-1.4.1033.102.tar.bz2) = 55807309
+SHA256 (fcitx-mozc-1.4.1033.102.patch) = 60db14b0e73dc6f26947293657cf5491816095bf447bf8647b35cafc39c29897
+SIZE (fcitx-mozc-1.4.1033.102.patch) = 95648
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-04-06 16:02:37.453730678 -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_1.patch ends here ---

--- fcitx-mozc.shar begins here ---
# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	fcitx-mozc
#	fcitx-mozc/pkg-message
#	fcitx-mozc/Makefile
#
echo c - fcitx-mozc
mkdir -p fcitx-mozc > /dev/null 2>&1
echo x - fcitx-mozc/pkg-message
sed 's/^X//' >fcitx-mozc/pkg-message << '78003968dd5780fc912457ea892e0b53'
Xfcitx-mozc installation finished. To use fcitx-mozc, please do the following:
X
XIf you are using bash or zsh, please add following lines to your $HOME/.bashrc or
X$HOME/.zshrc:
X
Xexport GTK_IM_MODULE=xim
Xexport QT_IM_MODULE=xim
Xexport XMODIFIERS=@im=fcitx
Xmozc_server_start
Xfcitx
X
XIf you are using tcsh, please add following lines to your $HOME/.cshrc:
X
Xsetenv GTK_IM_MODULE xim
Xsetenv QT_IM_MODULE xim
Xsetenv XMODIFIERS @im=fcitx
Xmozc_server_start
Xfcitx
X
XIf you are using KDE4, you may create a shell script in $HOME/.kde4/env, 
Xand add following lines:
X
X#!/bin/sh
Xexport GTK_IM_MODULE=xim
Xexport QT_IM_MODULE=xim
Xexport XMODIFIERS=@im=fcitx
Xmozc_server_start
Xfcitx
X
XYou can replace the `xim` above with `fcitx` if you built fcitx with
Xthe corresponding IM module.
78003968dd5780fc912457ea892e0b53
echo x - fcitx-mozc/Makefile
sed 's/^X//' >fcitx-mozc/Makefile << '0cfb1a7ca47c67175f9bcfd6161d7b1d'
X# New ports collection makefile for:	fcitx-mozc
X# Date created:				4 Apr 2012
X# Whom:					Zhihao Yuan <lichray@gmail.com>
X#
X# $FreeBSD$
X#
X
XPKGNAMEPREFIX=	ja-fcitx-
XPKGNAMESUFFIX=
X
XCOMMENT=	Mozc engine for Fcitx
X
XDATADIR=	${PREFIX}/share/fcitx/mozc
XMASTERDIR=	${.CURDIR}/../mozc-server
XPKGMESSAGE=	${.CURDIR}/pkg-message
X
XBUILD_MOZC_LIST=	fcitx_mozc
X
Xpost-install:
X	@${CAT} ${PKGMESSAGE}
X	@${ECHO_CMD} To display this message again, type ${PKG_INFO} -D ${PKGNAME}
X
X.include "${MASTERDIR}/Makefile"
0cfb1a7ca47c67175f9bcfd6161d7b1d
exit
--- fcitx-mozc.shar ends here ---


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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4f7f73e6.aa5f320a.3bf1.5b1b>