Bug 166711 - New port: japanese/fcitx-mozc - Mozc Japanese input method for Fcitx plus patch to japanese/mozc-server
New port: japanese/fcitx-mozc - Mozc Japanese input method for Fcitx plus pat...
Status: Closed FIXED
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s)
Latest
Any Any
: Normal Affects Only Me
Assigned To: FreeBSD ports mailing list
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-04-07 00:00 UTC by lichray
Modified: 2012-05-22 06:30 UTC (History)
1 user (show)

See Also:


Attachments
file.shar (1.93 KB, text/plain)
2012-04-07 00:00 UTC, lichray
no flags Details
mozc-server_1-1.patch (6.56 KB, patch)
2012-04-07 07:07 UTC, lichray
no flags Details | Diff
mozc-server_2.patch (5.21 KB, patch)
2012-05-04 22:08 UTC, lichray
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description lichray 2012-04-07 00:00:08 UTC
	
	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.

Fix: 

--- fcitx-mozc.shar ends here -----i1aRNCQkhUM8iuRU7Iq02n4K84jGtlAfdbRBafsrGAx0AFca
Content-Type: text/plain; name="mozc-server_1.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="mozc-server_1.patch"

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
Comment 1 lichray 2012-04-07 07:07:51 UTC
The author submit an updated patch w/ better translations.

Port changes:
1. no need to install the empty confgidesc file (configure through mozc_tool);
2. fix mozc's server_dir (not configurable through environ anymore).
3. correctly detects the number of CPUs.

-- 
Zhihao Yuan, nickname lichray
The best way to predict the future is to invent it.
___________________________________________________
4BSD -- http://4bsd.biz/
Comment 2 scheidell freebsd_committer 2012-05-01 11:35:47 UTC
added maintainer of japanese/mozc-server to GNATS so he can approve 
patch first.
(lichray: best way to do some of these is to submit two pr's, especially 
when there are multiple maintainers involved)

daichi@FreeBSD.org:  if you would like to approve/commit your part, and don't want to do the new port part, you can pass pr 166711 back to me when you are done.




-- 
Michael Scheidell, CTO
 >*| * SECNAP Network Security Corporation
d: +1.561.948.2259
w: http://people.freebsd.org/~scheidell
Comment 3 lichray 2012-05-04 22:08:59 UTC
Synchronized with version 1.5.1053.102; the new port
japanese/fcitx-mozc is not changed.

Some explanations to the patch:

 1. No need to substitute build_mozc.py, which no longer accept
$MOZC_SERVER_DIRECTORY either; use --server_dir= instead.
 2. Like other fcitx addons, fcitx-mozc installs to where fcitx
installed, so it can not pass `port test` without creating the 3 fcitx
dirs by hand.

-- 
Zhihao Yuan, nickname lichray
The best way to predict the future is to invent it.
___________________________________________________
4BSD -- http://4bsd.biz/
Comment 4 dfilter freebsd_committer 2012-05-22 06:19:56 UTC
daichi      2012-05-22 05:19:41 UTC

  FreeBSD ports repository

  Modified files:
    japanese/mozc-server Makefile 
    japanese/mozc-server/files patch-base_base.gyp 
  Added files:
    japanese/mozc-server/files patch-unix_fcitx_eim.cc 
                               patch-unix_fcitx_fcitx-mozc.conf 
                               patch-unix_fcitx_fcitx-mozc.desc 
                               patch-unix_fcitx_fcitx.gyp 
                               patch-unix_fcitx_fcitx_config.h 
                               patch-unix_fcitx_fcitx_key_translator.cc 
                               patch-unix_fcitx_fcitx_key_translator.h 
                               patch-unix_fcitx_fcitx_mozc.cc 
                               patch-unix_fcitx_fcitx_mozc.h 
                               patch-unix_fcitx_gen_fcitx_mozc_i18n.sh 
                               patch-unix_fcitx_mozc.conf 
                               patch-unix_fcitx_mozc_connection.cc 
                               patch-unix_fcitx_mozc_connection.h 
                               patch-unix_fcitx_mozc_response_parser.cc 
                               patch-unix_fcitx_mozc_response_parser.h 
                               patch-unix_fcitx_po_Messages.sh 
                               patch-unix_fcitx_po_fcitx-mozc.pot 
                               patch-unix_fcitx_po_ja.po 
                               patch-unix_fcitx_po_zh_CN.po 
                               patch-unix_fcitx_po_zh_TW.po 
  Log:
  Added fcitx-mozc support
  
  PR:             167860, 166711
  Submitted by:   Zhihao Yuan <lichray@gmail.com>
  
  Revision  Changes    Path
  1.30      +63 -4     ports/japanese/mozc-server/Makefile
  1.2       +2 -2      ports/japanese/mozc-server/files/patch-base_base.gyp
  1.1       +141 -0    ports/japanese/mozc-server/files/patch-unix_fcitx_eim.cc (new)
  1.1       +13 -0     ports/japanese/mozc-server/files/patch-unix_fcitx_fcitx-mozc.conf (new)
  1.1       +10 -0     ports/japanese/mozc-server/files/patch-unix_fcitx_fcitx-mozc.desc (new)
  1.1       +110 -0    ports/japanese/mozc-server/files/patch-unix_fcitx_fcitx.gyp (new)
  1.1       +32 -0     ports/japanese/mozc-server/files/patch-unix_fcitx_fcitx_config.h (new)
  1.1       +584 -0    ports/japanese/mozc-server/files/patch-unix_fcitx_fcitx_key_translator.cc (new)
  1.1       +117 -0    ports/japanese/mozc-server/files/patch-unix_fcitx_fcitx_key_translator.h (new)
  1.1       +525 -0    ports/japanese/mozc-server/files/patch-unix_fcitx_fcitx_mozc.cc (new)
  1.1       +153 -0    ports/japanese/mozc-server/files/patch-unix_fcitx_fcitx_mozc.h (new)
  1.1       +14 -0     ports/japanese/mozc-server/files/patch-unix_fcitx_gen_fcitx_mozc_i18n.sh (new)
  1.1       +10 -0     ports/japanese/mozc-server/files/patch-unix_fcitx_mozc.conf (new)
  1.1       +177 -0    ports/japanese/mozc-server/files/patch-unix_fcitx_mozc_connection.cc (new)
  1.1       +139 -0    ports/japanese/mozc-server/files/patch-unix_fcitx_mozc_connection.h (new)
  1.1       +284 -0    ports/japanese/mozc-server/files/patch-unix_fcitx_mozc_response_parser.cc (new)
  1.1       +96 -0     ports/japanese/mozc-server/files/patch-unix_fcitx_mozc_response_parser.h (new)
  1.1       +36 -0     ports/japanese/mozc-server/files/patch-unix_fcitx_po_Messages.sh (new)
  1.1       +81 -0     ports/japanese/mozc-server/files/patch-unix_fcitx_po_fcitx-mozc.pot (new)
  1.1       +84 -0     ports/japanese/mozc-server/files/patch-unix_fcitx_po_ja.po (new)
  1.1       +82 -0     ports/japanese/mozc-server/files/patch-unix_fcitx_po_zh_CN.po (new)
  1.1       +85 -0     ports/japanese/mozc-server/files/patch-unix_fcitx_po_zh_TW.po (new)
_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
Comment 5 Daichi GOTO freebsd_committer 2012-05-22 06:27:37 UTC
State Changed
From-To: open->closed

Committed. Thanks!