From nobody@FreeBSD.org  Tue Apr 30 06:42:37 2013
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1])
	by hub.freebsd.org (Postfix) with ESMTP id C0B97B95
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 30 Apr 2013 06:42:37 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [69.147.83.34])
	by mx1.freebsd.org (Postfix) with ESMTP id B2D5B1E84
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 30 Apr 2013 06:42:37 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.5/8.14.5) with ESMTP id r3U6gbq1090729
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 30 Apr 2013 06:42:37 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.5/8.14.5/Submit) id r3U6gbab090728;
	Tue, 30 Apr 2013 06:42:37 GMT
	(envelope-from nobody)
Message-Id: <201304300642.r3U6gbab090728@red.freebsd.org>
Date: Tue, 30 Apr 2013 06:42:37 GMT
From: Tadaaki Nagao <abtk@shitamachi.org>
To: freebsd-gnats-submit@FreeBSD.org
Subject: Fix build failures of japanese/{mozc-server,mozc-tool,ibus-mozc,mozc-el}
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         178250
>Category:       ports
>Synopsis:       Fix build failures of japanese/{mozc-server,mozc-tool,ibus-mozc,mozc-el}
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    hrs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Apr 30 06:50:00 UTC 2013
>Closed-Date:    Wed Jul 03 01:01:22 UTC 2013
>Last-Modified:  Wed Jul 03 01:01:22 UTC 2013
>Originator:     Tadaaki Nagao
>Release:        9.1-STABLE
>Organization:
>Environment:
FreeBSD salt.shitamachi.org 9.1-STABLE FreeBSD 9.1-STABLE #10: Mon Feb 25 19:15:16 JST 2013     root@salt.shitamachi.org:/usr/obj/usr/src/sys/SALT  amd64

>Description:
japanese/mozc-server, japanese/mozc-tool, japanese/ibus-mozc and
japanese/mozc-el don't build after the upgrade to 1.10.1390.102.

In japanese/mozc-server/Makefile, BUILD_DEPENDS on libraries are
specified in a wrong way and USE_QT is misplaced after bsd.port.pre.mk.

On i386, ldflags setting in common.gyp seems to need -fstack-protector,
or the build fails with the following link error:

--------8<--------cut here--------8<--------
  LINK(host) out_linux/Release/gen_oss_segmenter_bitarray_main
out_linux/Release/obj.host/converter/libgen_segmenter_bitarray.a(gen_segmenter_b)(.text+0x19b4): In function `mozc::SegmenterBitarrayGenerator::GenerateBitarray(int, int, bool (*)(unsigned short, unsigned short), std::string const&)':
: undefined reference to `__stack_chk_fail_local'
out_linux/Release/obj.host/base/libbase_core.a(logging.o)(.text+0x428): In function `mozc::Logging::GetLogMessageHeader()':
: undefined reference to `__stack_chk_fail_local'
out_linux/Release/obj.host/base/libbase_core.a(system_util.o)(.text+0x603): In function `mozc::SystemUtil::GetUserNameAsString()':
: undefined reference to `__stack_chk_fail_local'
out_linux/Release/obj.host/base/libbase_core.a(system_util.o)(.text+0x1331): In function `mozc::Singleton<mozc::(anonymous namespace)::UserProfileDirectoryImpl>::Init()':
: undefined reference to `__stack_chk_fail_local'
out_linux/Release/obj.host/base/libbase_core.a(util.o)(.text+0x28ac): In function `(anonymous namespace)::StringAppendV(std::string*, char const*, char*)':
: undefined reference to `__stack_chk_fail_local'
out_linux/Release/obj.host/base/libbase_core.a(util.o)(.text+0x3011): more undefined references to `__stack_chk_fail_local' follow
gmake: *** [out_linux/Release/gen_oss_segmenter_bitarray_main] Error 1
gmake: *** Waiting for unfinished jobs....
Traceback (most recent call last):
  File "build_mozc.py", line 1462, in <module>
    main()
  File "build_mozc.py", line 1447, in main
    BuildToolsMain(cmd_opts, cmd_args, original_directory_name)
  File "build_mozc.py", line 982, in BuildToolsMain
    BuildMain(options, [build_tools_target], original_directory_name)
  File "build_mozc.py", line 1075, in BuildMain
    BuildOnLinux(options, targets, original_directory_name)
  File "build_mozc.py", line 1028, in BuildOnLinux
    RunOrDie([make_command] + build_args + target_names)
  File "/usr/ports/japanese/mozc-server/work/mozc-1.10.1390.102/build_tools/util.py", line 97, in RunOrDie
    '==========']))
build_tools.util.RunOrDieError: 
==========
 ERROR: /usr/ports/japanese/mozc-server/work/mozc-1.10.1390.102/mozcmake -j2 MAKE_JOBS=2 BUILDTYPE=Release builddir_name=out_linux build_tools
==========
*** Error code 1

Stop in /usr/ports/japanese/mozc-server.
*** Error code 1

Stop in /usr/ports/japanese/mozc-server.
--------8<--------cut here--------8<--------

>How-To-Repeat:
It's really straightforward but, for example,

cd /usr/ports/japanese/mozc-server
make

and so on.

>Fix:
The following patch is against the port tree as of svn r316662.
Tested on 9.1-RELEASE-p3 (both amd64 and i386) and 8.3-RELEASE-p8 (both
amd64 and i386).


Patch attached with submission follows:

diff -ruN /usr/ports/japanese/mozc-server.orig/Makefile /usr/ports/japanese/mozc-server/Makefile
--- /usr/ports/japanese/mozc-server.orig/Makefile	2013-04-28 18:13:49.550888000 +0900
+++ /usr/ports/japanese/mozc-server/Makefile	2013-04-29 22:38:13.063887261 +0900
@@ -25,12 +25,14 @@
 
 BUILD_MOZC_LIST?=	mozc_server
 
-GYP_OPTIONS=	
+GYP_OPTIONS=
 .if ${BUILD_MOZC_LIST:Mmozc_server} == "mozc_server" || \
     ${BUILD_MOZC_LIST:Mibus_mozc}   == "ibus_mozc"   || \
     ${BUILD_MOZC_LIST:Mfcitx_mozc}  == "fcitx_mozc"  || \
     ${BUILD_MOZC_LIST:Mmozc_el}     == "mozc_el"
 GYP_OPTIONS=	--noqt
+.elif ${BUILD_MOZC_LIST:Mmozc_tool} == "mozc_tool"
+USE_QT4+=	corelib gui
 .endif
 
 .include <bsd.port.pre.mk>
@@ -60,7 +62,7 @@
 .endfor
 LOCALBASE_PTN=	${LOCALBASE:S/\\/\\\\/g:S/"/\"/g:S/\$/\\$/g:S/,/\,/g}
 
-BUILD_MODE=	Release 
+BUILD_MODE=	Release
 BUILD_CMD=	${SETENV} ${MAKE_ENV} ${GMAKE}
 BUILD_MOZC_CMD=	cd ${BUILD_WRKSRC} && \
 		${SETENV} BUILD_COMMAND="${WRKSRC}/mozcmake" \
@@ -74,8 +76,8 @@
 		${LOCALBASE_REPLACE_FILES}
 	cd ${WRKSRC} && \
 		${REINPLACE_CMD} ${SSL_REINPLACE_STR} base/base.gyp
-	${MKDIR} -p ${WRKSRC}/mozc_build_tools/linux
-	${LN} -sf ${LOCALBASE}/bin/protoc ${WRKSRC}/mozc_build_tools/linux/ 
+	${MKDIR} ${WRKSRC}/mozc_build_tools/linux
+	${LN} -sf ${LOCALBASE}/bin/protoc ${WRKSRC}/mozc_build_tools/linux/
 .if ${BUILD_MOZC_LIST:Mfcitx_mozc} == "fcitx_mozc"
 	cd ${WRKSRC} && \
 		${REINPLACE_CMD} 's,/po/mo},%po}mo,g' \
@@ -99,8 +101,9 @@
 
 # mozc_server
 .if ${BUILD_MOZC_LIST:Mmozc_server} == "mozc_server"
-BUILD_DEPENDS+=	glib:${PORTSDIR}/devel/glib20 \
-		gtk:${PORTSDIR}/x11-toolkits/gtk20
+BUILD_DEPENDS+=	${LOCALBASE}/libdata/pkgconfig/glib-2.0.pc:${PORTSDIR}/devel/glib20 \
+		${LOCALBASE}/libdata/pkgconfig/gtk+-x11-2.0.pc:${PORTSDIR}/x11-toolkits/gtk20 \
+		${LOCALBASE}/libdata/pkgconfig/zinnia.pc:${PORTSDIR}/japanese/zinnia
 PLIST_FILES+=	bin/mozc_server
 
 do-build-mozc_server:
@@ -116,8 +119,7 @@
 # mozc_tool
 .if ${BUILD_MOZC_LIST:Mmozc_tool} == "mozc_tool"
 LIB_DEPENDS+=	zinnia.0:${PORTSDIR}/japanese/zinnia
-BUILD_DEPENDS+=	gtk:${PORTSDIR}/x11-toolkits/gtk20
-USE_QT4+=	corelib gui
+BUILD_DEPENDS+=	${LOCALBASE}/libdata/pkgconfig/gtk+-x11-2.0.pc:${PORTSDIR}/x11-toolkits/gtk20
 RUN_DEPENDS+=	${LOCALBASE}/share/tegaki/models/zinnia/handwriting-ja.model:${PORTSDIR}/japanese/tegaki-zinnia-japanese
 
 PLIST_FILES+=	bin/mozc_tool \
@@ -164,7 +166,7 @@
 		${DATADIR_REL}/icons/product_logo.png \
 		${DATADIR_REL}/icons/properties.png \
 		${DATADIR_REL}/icons/tool.png \
-		share/ibus/component/mozc.xml 
+		share/ibus/component/mozc.xml
 PLIST_DIRS+=	${DATADIR_REL}/icons ${DATADIR_REL}
 
 do-build-ibus_mozc:
@@ -202,7 +204,7 @@
 
 LIB_DEPENDS+=	fcitx-config.4:${PORTSDIR}/chinese/fcitx \
 		zinnia.0:${PORTSDIR}/japanese/zinnia
-BUILD_DEPENDS+=	glib:${PORTSDIR}/devel/glib20
+BUILD_DEPENDS+=	${LOCALBASE}/libdata/pkgconfig/glib-2.0.pc:${PORTSDIR}/devel/glib20
 RUN_DEPENDS+=	mozc_server:${PORTSDIR}/japanese/mozc-server \
 		mozc_tool:${PORTSDIR}/japanese/mozc-tool \
 		mozc_server_start:${PORTSDIR}/japanese/mozc-additions
@@ -264,8 +266,8 @@
 .if ${BUILD_MOZC_LIST:Mmozc_el} == "mozc_el"
 LIB_DEPENDS+=	zinnia.0:${PORTSDIR}/japanese/zinnia
 BUILD_DEPENDS+=	emacs:${PORTSDIR}/editors/emacs \
-		glib:${PORTSDIR}/devel/glib20 \
-		gtk:${PORTSDIR}/x11-toolkits/gtk20
+		${LOCALBASE}/libdata/pkgconfig/glib-2.0.pc:${PORTSDIR}/devel/glib20 \
+		${LOCALBASE}/libdata/pkgconfig/gtk+-x11-2.0.pc:${PORTSDIR}/x11-toolkits/gtk20
 RUN_DEPENDS+=	mozc_server:${PORTSDIR}/japanese/mozc-server \
 		mozc_server_start:${PORTSDIR}/japanese/mozc-additions
 
diff -ruN /usr/ports/japanese/mozc-server.orig/files/patch-gyp_common.gypi /usr/ports/japanese/mozc-server/files/patch-gyp_common.gypi
--- /usr/ports/japanese/mozc-server.orig/files/patch-gyp_common.gypi	2013-04-24 06:09:19.525367000 +0900
+++ /usr/ports/japanese/mozc-server/files/patch-gyp_common.gypi	2013-04-29 22:36:45.226889706 +0900
@@ -1,5 +1,5 @@
---- gyp/common.gypi.orig	2013-04-21 03:48:45.395416165 +0900
-+++ gyp/common.gypi	2013-04-21 08:31:10.191270448 +0900
+--- gyp/common.gypi.orig	2013-03-29 13:33:42.000000000 +0900
++++ gyp/common.gypi	2013-04-29 22:28:19.000000000 +0900
 @@ -58,7 +58,7 @@
      # warning_cflags will be shared with Mac and Linux.
      'warning_cflags': [
@@ -9,7 +9,15 @@
        '-Wno-char-subscripts',
        '-Wno-sign-compare',
        '-Wno-deprecated-declarations',
-@@ -194,7 +194,7 @@
+@@ -90,6 +90,7 @@
+     # Libraries for GNU/Linux environment.
+     'linux_ldflags': [
+       '-pthread',
++      '-fstack-protector',
+     ],
+ 
+     # 'conditions' is put inside of 'variables' so that we can use
+@@ -194,7 +195,7 @@
      # - http://code.google.com/p/protobuf/issues/detail?id=128
      # - http://code.google.com/p/protobuf/issues/detail?id=370
      # for the background information.
@@ -18,7 +26,7 @@
  
      # use_libzinnia represents if zinnia library is used or not.
      # This option is only for Linux.
-@@ -735,6 +735,12 @@
+@@ -735,6 +736,12 @@
            # <unordered_map> and <unordered_set>.
            '-Wno-deprecated',
          ],


>Release-Note:
>Audit-Trail:

From: Hiroki Sato <hrs@FreeBSD.org>
To: abtk@shitamachi.org
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: ports/178250: Fix build failures of japanese/{mozc-server,
 mozc-tool, ibus-mozc, mozc-el}
Date: Tue, 30 Apr 2013 16:06:30 +0900 (JST)

 ----Security_Multipart(Tue_Apr_30_16_06_30_2013_566)--
 Content-Type: Text/Plain; charset=us-ascii
 Content-Transfer-Encoding: 7bit
 
 Tadaaki Nagao <abtk@shitamachi.org> wrote
   in <201304300642.r3U6gbab090728@red.freebsd.org>:
 
 ab>  # mozc_server
 ab>  .if ${BUILD_MOZC_LIST:Mmozc_server} == "mozc_server"
 ab> -BUILD_DEPENDS+=	glib:${PORTSDIR}/devel/glib20 \
 ab> -		gtk:${PORTSDIR}/x11-toolkits/gtk20
 ab> +BUILD_DEPENDS+=	${LOCALBASE}/libdata/pkgconfig/glib-2.0.pc:${PORTSDIR}/devel/glib20 \
 ab> +		${LOCALBASE}/libdata/pkgconfig/gtk+-x11-2.0.pc:${PORTSDIR}/x11-toolkits/gtk20 \
 ab> +		${LOCALBASE}/libdata/pkgconfig/zinnia.pc:${PORTSDIR}/japanese/zinnia
 ab>  PLIST_FILES+=	bin/mozc_server
 ab>
 ab>  do-build-mozc_server:
 ab> @@ -116,8 +119,7 @@
 ab>  # mozc_tool
 ab>  .if ${BUILD_MOZC_LIST:Mmozc_tool} == "mozc_tool"
 ab>  LIB_DEPENDS+=	zinnia.0:${PORTSDIR}/japanese/zinnia
 ab> -BUILD_DEPENDS+=	gtk:${PORTSDIR}/x11-toolkits/gtk20
 ab> -USE_QT4+=	corelib gui
 ab> +BUILD_DEPENDS+=	${LOCALBASE}/libdata/pkgconfig/gtk+-x11-2.0.pc:${PORTSDIR}/x11-toolkits/gtk20
 ab>  RUN_DEPENDS+=	${LOCALBASE}/share/tegaki/models/zinnia/handwriting-ja.model:${PORTSDIR}/japanese/tegaki-zinnia-japanese
 ab>
 ab>  PLIST_FILES+=	bin/mozc_tool \
 ab> @@ -164,7 +166,7 @@
 ab>  		${DATADIR_REL}/icons/product_logo.png \
 ab>  		${DATADIR_REL}/icons/properties.png \
 ab>  		${DATADIR_REL}/icons/tool.png \
 ab> -		share/ibus/component/mozc.xml
 ab> +		share/ibus/component/mozc.xml
 ab>  PLIST_DIRS+=	${DATADIR_REL}/icons ${DATADIR_REL}
 ab>
 ab>  do-build-ibus_mozc:
 ab> @@ -202,7 +204,7 @@
 ab>
 ab>  LIB_DEPENDS+=	fcitx-config.4:${PORTSDIR}/chinese/fcitx \
 ab>  		zinnia.0:${PORTSDIR}/japanese/zinnia
 ab> -BUILD_DEPENDS+=	glib:${PORTSDIR}/devel/glib20
 ab> +BUILD_DEPENDS+=	${LOCALBASE}/libdata/pkgconfig/glib-2.0.pc:${PORTSDIR}/devel/glib20
 ab>  RUN_DEPENDS+=	mozc_server:${PORTSDIR}/japanese/mozc-server \
 ab>  		mozc_tool:${PORTSDIR}/japanese/mozc-tool \
 ab>  		mozc_server_start:${PORTSDIR}/japanese/mozc-additions
 ab> @@ -264,8 +266,8 @@
 ab>  .if ${BUILD_MOZC_LIST:Mmozc_el} == "mozc_el"
 ab>  LIB_DEPENDS+=	zinnia.0:${PORTSDIR}/japanese/zinnia
 ab>  BUILD_DEPENDS+=	emacs:${PORTSDIR}/editors/emacs \
 ab> -		glib:${PORTSDIR}/devel/glib20 \
 ab> -		gtk:${PORTSDIR}/x11-toolkits/gtk20
 ab> +		${LOCALBASE}/libdata/pkgconfig/glib-2.0.pc:${PORTSDIR}/devel/glib20 \
 ab> +		${LOCALBASE}/libdata/pkgconfig/gtk+-x11-2.0.pc:${PORTSDIR}/x11-toolkits/gtk20
 
  Dependency on them should be written in USE_*.  And, using
  BUILD_DEPENDS for libraries is not correct.
 
 -- Hiroki
 
 ----Security_Multipart(Tue_Apr_30_16_06_30_2013_566)--
 Content-Type: application/pgp-signature
 Content-Transfer-Encoding: 7bit
 
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.13 (FreeBSD)
 
 iEYEABECAAYFAlF/bXYACgkQTyzT2CeTzy045ACg0w8WJvQ+oczVI0RPn8MtZcSC
 0yoAoLmiRFWuT3uJKPdUo5jQMAg/Ltlk
 =+5v0
 -----END PGP SIGNATURE-----
 
 ----Security_Multipart(Tue_Apr_30_16_06_30_2013_566)----

From: Tadaaki Nagao <abtk@shitamachi.org>
To: hrs@FreeBSD.org
Cc: freebsd-gnats-submit@FreeBSD.org, abtk@shitamachi.org
Subject: Re: ports/178250: Fix build failures of japanese/{mozc-server,
 mozc-tool, ibus-mozc, mozc-el}
Date: Wed, 01 May 2013 01:23:08 +0900 (JST)

 Hi hiroki-san,
 
 In "Re: ports/178250: Fix build failures of japanese/{mozc-server, mozc-tool, ibus-mozc, mozc-el}",
     Hiroki Sato <hrs@FreeBSD.org> wrote:
 >  Dependency on them should be written in USE_*.  And, using
 >  BUILD_DEPENDS for libraries is not correct.
 
 When I wrote the patch I previously sent, my intention was to preserve
 original code as much as possible.  As for why they were so written in
 the first place, please ask the original author... (daichi-san?)
 
 But I agree with you that those BUILD_DEPENDS should be got rid of in
 favor of some other preferable ways.  I will look into this, but it will
 take some time because Mozc's build system looks to me too complicated
 to understand.  In the meanwhile, how about applying my patch as a quick
 fix for the current breakage, and having refinements later as a second
 step.
 
 Thanks,
 Tadaaki Nagao <abtk@shitamachi.org>

From: Hiroki Sato <hrs@FreeBSD.org>
To: abtk@shitamachi.org
Cc: freebsd-gnats-submit@FreeBSD.org, hrs@FreeBSD.org
Subject: Re: ports/178250: Fix build failures of japanese/{mozc-server,
 mozc-tool, ibus-mozc, mozc-el}
Date: Wed, 01 May 2013 03:36:08 +0900 (JST)

 ----Security_Multipart(Wed_May__1_03_36_08_2013_641)--
 Content-Type: Text/Plain; charset=us-ascii
 Content-Transfer-Encoding: 7bit
 
 Tadaaki Nagao <abtk@shitamachi.org> wrote
   in <20130501.012308.420345141091390850.abtk@shitamachi.org>:
 
 ab> When I wrote the patch I previously sent, my intention was to preserve
 ab> original code as much as possible.  As for why they were so written in
 ab> the first place, please ask the original author... (daichi-san?)
 
  I am also not sure why, but they simply shouldn't have been
  committed.  The previous change is fairly broken as you noticed.  We
  do not have to preserve the wrong part.
 
 ab> But I agree with you that those BUILD_DEPENDS should be got rid of in
 ab> favor of some other preferable ways.  I will look into this, but it will
 ab> take some time because Mozc's build system looks to me too complicated
 ab> to understand.  In the meanwhile, how about applying my patch as a quick
 ab> fix for the current breakage, and having refinements later as a second
 ab> step.
 
  I already submitted a similar fix.  Can you review it?
 
   http://people.allbsd.org/~hrs/FreeBSD/mozc_port_20130428-2.diff (patch)
   http://people.allbsd.org/~hrs/FreeBSD/mozc_port_full_20130428-2.tar.gz (tarball of the patched ports)
 
  Although I received a build error report in some environment and
  still investigating it, this should fix wrong parts (including style
  clean-ups) as far as I can see.
 
 -- Hiroki
 
 ----Security_Multipart(Wed_May__1_03_36_08_2013_641)--
 Content-Type: application/pgp-signature
 Content-Transfer-Encoding: 7bit
 
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.13 (FreeBSD)
 
 iEYEABECAAYFAlGADxgACgkQTyzT2CeTzy3ibgCfT1MCo+6nd7reFluTXkPqzu1z
 cFkAoKSdpPQjATaj2eHG4ArNqDJukbXV
 =u58M
 -----END PGP SIGNATURE-----
 
 ----Security_Multipart(Wed_May__1_03_36_08_2013_641)----

From: Tadaaki Nagao <abtk@shitamachi.org>
To: hrs@FreeBSD.org
Cc: freebsd-gnats-submit@FreeBSD.org, abtk@shitamachi.org
Subject: Re: ports/178250: Fix build failures of japanese/{mozc-server,
 mozc-tool, ibus-mozc, mozc-el}
Date: Wed, 01 May 2013 11:21:12 +0900 (JST)

 Hi Hiroki-san,
 
 In "Re: ports/178250: Fix build failures of japanese/{mozc-server, mozc-tool, ibus-mozc, mozc-el}",
     Hiroki Sato <hrs@FreeBSD.org> wrote:
 > ab> But I agree with you that those BUILD_DEPENDS should be got rid of in
 > ab> favor of some other preferable ways.  I will look into this, but it will
 > ab> take some time because Mozc's build system looks to me too complicated
 > ab> to understand.  In the meanwhile, how about applying my patch as a quick
 > ab> fix for the current breakage, and having refinements later as a second
 > ab> step.
 > 
 >  I already submitted a similar fix.  Can you review it?
 > 
 >   http://people.allbsd.org/~hrs/FreeBSD/mozc_port_20130428-2.diff (patch)
 >   http://people.allbsd.org/~hrs/FreeBSD/mozc_port_full_20130428-2.tar.gz (tarball of the patched ports)
 
 Great!
 Your patch looks almost fine to me (about nit-picking, see below) and it
 worked flawlessly for me.  I tested building of mozc-server, mozc-tool,
 ibus-mozc and mozc-el on FreeBSD 9-STABLE amd64 and 9.1-RELEASE-p3 i386.
 
 I noticed two small things in your patch:
 
 - fcitx-mozc and ibus-mozc now have PKGNAMESUFFIX=-server.  Considering
   they didn't have it previously, nor did other fcitx-* and ibus-*
   ports, I guess this isn't what you intended.
 
 - In the newly created patch to build_mozc.py, 'openssl_cflags' in the
   following line should be 'openssl_ldflags'.
 
   +  openssl_ldflags = options.openssl_cflags or ''
 
 >  Although I received a build error report in some environment and
 >  still investigating it, this should fix wrong parts (including style
 >  clean-ups) as far as I can see.
 
 Thanks,
 Tadaaki Nagao <abtk@shitamachi.org>

From: Hiroki Sato <hrs@FreeBSD.org>
To: abtk@shitamachi.org
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: ports/178250: Fix build failures of japanese/{mozc-server,
 mozc-tool, ibus-mozc, mozc-el}
Date: Thu, 02 May 2013 01:22:56 +0900 (JST)

 ----Security_Multipart(Thu_May__2_01_22_56_2013_808)--
 Content-Type: Text/Plain; charset=us-ascii
 Content-Transfer-Encoding: 7bit
 
 Tadaaki Nagao <abtk@shitamachi.org> wrote
   in <20130501.112112.1052925925323308919.abtk@shitamachi.org>:
 
 ab> Your patch looks almost fine to me (about nit-picking, see below) and it
 ab> worked flawlessly for me.  I tested building of mozc-server, mozc-tool,
 ab> ibus-mozc and mozc-el on FreeBSD 9-STABLE amd64 and 9.1-RELEASE-p3 i386.
 ab>
 ab> I noticed two small things in your patch:
 ab>
 ab> - fcitx-mozc and ibus-mozc now have PKGNAMESUFFIX=-server.  Considering
 ab>   they didn't have it previously, nor did other fcitx-* and ibus-*
 ab>   ports, I guess this isn't what you intended.
 ab>
 ab> - In the newly created patch to build_mozc.py, 'openssl_cflags' in the
 ab>   following line should be 'openssl_ldflags'.
 ab>
 ab>   +  openssl_ldflags = options.openssl_cflags or ''
 ab>
 
  Thanks for the feedback!  A revised version is as follows:
 
   http://people.allbsd.org/~hrs/FreeBSD/mozc_port_20130501-1.diff
   http://people.allbsd.org/~hrs/FreeBSD/mozc_port_full_20130501-1.tar.gz
 
  In addition to fixing the spotted issues, toolchain handling has been
  fixed.  I am waiting for a report from one who got a build error on a
  10-CURRENT box.  Any comments are welcome.
 
 -- Hiroki
 
 ----Security_Multipart(Thu_May__2_01_22_56_2013_808)--
 Content-Type: application/pgp-signature
 Content-Transfer-Encoding: 7bit
 
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.13 (FreeBSD)
 
 iEYEABECAAYFAlGBQWAACgkQTyzT2CeTzy1QrgCg2d+2njICAYH7/8tFt9Ij6jPQ
 +OUAni1WNmtw+Ti9T7SBOXTNI8kpmBnl
 =VB/U
 -----END PGP SIGNATURE-----
 
 ----Security_Multipart(Thu_May__2_01_22_56_2013_808)----
Responsible-Changed-From-To: freebsd-ports-bugs->daichi 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Thu May 2 23:15:38 UTC 2013 
Responsible-Changed-Why:  
Over to maintainer of japanese/mozc-server. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=178250 

From: Hiroki Sato <hrs@FreeBSD.org>
To: abtk@shitamachi.org
Cc: freebsd-gnats-submit@FreeBSD.org, hrs@FreeBSD.org
Subject: Re: ports/178250: Fix build failures of japanese/{mozc-server,
 mozc-tool, ibus-mozc, mozc-el}
Date: Fri, 03 May 2013 21:51:35 +0900 (JST)

 ----Security_Multipart(Fri_May__3_21_51_35_2013_995)--
 Content-Type: Text/Plain; charset=us-ascii
 Content-Transfer-Encoding: 7bit
 
 Hiroki Sato <hrs@FreeBSD.org> wrote
   in <20130502.012256.1598456514733307858.hrs@allbsd.org>:
 
 hr> Tadaaki Nagao <abtk@shitamachi.org> wrote
 hr>   in <20130501.112112.1052925925323308919.abtk@shitamachi.org>:
 hr>
 hr> ab> Your patch looks almost fine to me (about nit-picking, see below) and it
 hr> ab> worked flawlessly for me.  I tested building of mozc-server, mozc-tool,
 hr> ab> ibus-mozc and mozc-el on FreeBSD 9-STABLE amd64 and 9.1-RELEASE-p3 i386.
 hr> ab>
 hr> ab> I noticed two small things in your patch:
 hr> ab>
 hr> ab> - fcitx-mozc and ibus-mozc now have PKGNAMESUFFIX=-server.  Considering
 hr> ab>   they didn't have it previously, nor did other fcitx-* and ibus-*
 hr> ab>   ports, I guess this isn't what you intended.
 hr> ab>
 hr> ab> - In the newly created patch to build_mozc.py, 'openssl_cflags' in the
 hr> ab>   following line should be 'openssl_ldflags'.
 hr> ab>
 hr> ab>   +  openssl_ldflags = options.openssl_cflags or ''
 hr> ab>
 hr>
 hr>  Thanks for the feedback!  A revised version is as follows:
 hr>
 hr>   http://people.allbsd.org/~hrs/FreeBSD/mozc_port_20130501-1.diff
 hr>   http://people.allbsd.org/~hrs/FreeBSD/mozc_port_full_20130501-1.tar.gz
 hr>
 hr>  In addition to fixing the spotted issues, toolchain handling has been
 hr>  fixed.  I am waiting for a report from one who got a build error on a
 hr>  10-CURRENT box.  Any comments are welcome.
 
  Just for the record, the latest version of the patch is avaliable at:
 
   http://people.allbsd.org/~hrs/FreeBSD/mozc_port_full_20130503-1.tar.gz
   http://people.allbsd.org/~hrs/FreeBSD/mozc_port_20130503-1.diff
 
  This includes additional fixes for some corner cases.  A brief
  summary is as follows:
 
 ====
  - Fix malformed BUILD_DEPENDS and remove unnecessary dependencies.
    Use USE_* in a consistent manner.
  - Fix inconsistency toolchain usage in build_tools and the others.
    Hardcoded g++ was always used only for the former even if both gcc
    and clang were available.
  - Enable -Werror.
  - Fix SSP issue on i386 platform.
  - Let cpp to replace LOCALBASE instead of patching and sed.
  - Use GYP_DEFINES for build variables instead of patching.
  - Separate configuration and build stages from each other.
  - Add options for localbase and openssl-related configuration to gyp
    instead of patching.
  - Add LICENSE.
  - Fix makesum target.
  - Fix whitespaces to make portlint happy.
  - Disable serialization for linking.  It is not needed.
  - Remove hardcoded mozc.xml.
  - Respect DISABLE_MAKE_JOBS=yes.  Do not calculate the factor using the
    number of CPUs.
  - Remove a confusing message after pkg-message.
 ====
 
 -- Hiroki
 
 ----Security_Multipart(Fri_May__3_21_51_35_2013_995)--
 Content-Type: application/pgp-signature
 Content-Transfer-Encoding: 7bit
 
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.13 (FreeBSD)
 
 iEYEABECAAYFAlGDstgACgkQTyzT2CeTzy1tTQCgkD4eEc9rY2D4dmjFzL0TTrcs
 zpgAoMfSA+VMCMhW3XKhPacAMR9ENSsD
 =0OC9
 -----END PGP SIGNATURE-----
 
 ----Security_Multipart(Fri_May__3_21_51_35_2013_995)----

From: Tadaaki Nagao <abtk@shitamachi.org>
To: hrs@FreeBSD.org
Cc: freebsd-gnats-submit@FreeBSD.org, abtk@shitamachi.org
Subject: Re: ports/178250: Fix build failures of japanese/{mozc-server,
 mozc-tool, ibus-mozc, mozc-el}
Date: Sun, 05 May 2013 11:26:36 +0900 (JST)

 Hi Hiroki-san,
 
 In "Re: ports/178250: Fix build failures of japanese/{mozc-server, mozc-tool, ibus-mozc, mozc-el}",
     Hiroki Sato <hrs@FreeBSD.org> wrote:
 >  Just for the record, the latest version of the patch is avaliable at:
 > 
 >   http://people.allbsd.org/~hrs/FreeBSD/mozc_port_full_20130503-1.tar.gz
 >   http://people.allbsd.org/~hrs/FreeBSD/mozc_port_20130503-1.diff
 
 Just one more thing I'd like to suggest:
 'deactivate-current-input-method-function' was introduced on Emacs 24.3
 by renaming the misspelled 'inactivate-current-input-method-function'.
 To retain our support for older Emacsen, how about the following as
 patch-unix_emacs_mozc.el?
 
 --------8<--------cut here--------8<--------
 --- unix/emacs/mozc.el.orig	2013-03-29 13:33:43.000000000 +0900
 +++ unix/emacs/mozc.el	2013-05-05 11:08:49.421888342 +0900
 @@ -1758,7 +1758,10 @@
  (defun mozc-leim-activate (input-method)
    "Activate mozc-mode via LEIM.
  INPUT-METHOD is not used."
 -  (setq inactivate-current-input-method-function 'mozc-leim-inactivate)
 +  (set (if (boundp 'deactivate-current-input-method-function)
 +	   'deactivate-current-input-method-function
 +	 'inactivate-current-input-method-function)
 +       'mozc-leim-inactivate)
    (mozc-mode t))
  
  (defun mozc-leim-inactivate ()
 --------8<--------cut here--------8<--------
 
 Thanks,
 Tadaaki Nagao <abtk@shitamachi.org>

From: Hiroki Sato <hrs@FreeBSD.org>
To: abtk@shitamachi.org
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: ports/178250: Fix build failures of japanese/{mozc-server,
 mozc-tool, ibus-mozc, mozc-el}
Date: Sun, 05 May 2013 13:38:07 +0900 (JST)

 ----Security_Multipart(Sun_May__5_13_38_07_2013_995)--
 Content-Type: Text/Plain; charset=us-ascii
 Content-Transfer-Encoding: 7bit
 
 Tadaaki Nagao <abtk@shitamachi.org> wrote
   in <20130505.112636.1254348787605646288.abtk@shitamachi.org>:
 
 ab> Hi Hiroki-san,
 ab>
 ab> In "Re: ports/178250: Fix build failures of japanese/{mozc-server, mozc-tool, ibus-mozc, mozc-el}",
 ab>     Hiroki Sato <hrs@FreeBSD.org> wrote:
 ab> >  Just for the record, the latest version of the patch is avaliable at:
 ab> >
 ab> >   http://people.allbsd.org/~hrs/FreeBSD/mozc_port_full_20130503-1.tar.gz
 ab> >   http://people.allbsd.org/~hrs/FreeBSD/mozc_port_20130503-1.diff
 ab>
 ab> Just one more thing I'd like to suggest:
 ab> 'deactivate-current-input-method-function' was introduced on Emacs 24.3
 ab> by renaming the misspelled 'inactivate-current-input-method-function'.
 ab> To retain our support for older Emacsen, how about the following as
 ab> patch-unix_emacs_mozc.el?
 
  Ah, it makes sense.  Thank you for the suggestion.  A new patchset is
  available via the following URLs:
 
   http://people.allbsd.org/~hrs/FreeBSD/mozc_port_full_20130505-1.tar.gz
   http://people.allbsd.org/~hrs/FreeBSD/mozc_port_20130505-1.diff
 
 -- Hiroki
 
 ----Security_Multipart(Sun_May__5_13_38_07_2013_995)--
 Content-Type: application/pgp-signature
 Content-Transfer-Encoding: 7bit
 
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.13 (FreeBSD)
 
 iEYEABECAAYFAlGF4i8ACgkQTyzT2CeTzy0ouQCgw6B/jxk7XsIw6Lm86jXsza77
 bOYAniwfMSGGszPywkelEiD18/tHStjH
 =EeoE
 -----END PGP SIGNATURE-----
 
 ----Security_Multipart(Sun_May__5_13_38_07_2013_995)----

From: Hiroki Sato <hrs@FreeBSD.org>
To: ports@FreeBSD.org
Cc: abtk@shitamachi.org, freebsd-gnats-submit@FreeBSD.org
Subject: Re: ports/178250: Fix build failures of japanese/{mozc-server,
 mozc-tool, ibus-mozc, mozc-el}
Date: Sun, 05 May 2013 16:31:03 +0900 (JST)

 ----Security_Multipart(Sun_May__5_16_31_03_2013_151)--
 Content-Type: Text/Plain; charset=us-ascii
 Content-Transfer-Encoding: 7bit
 
 Hiroki Sato <hrs@FreeBSD.org> wrote
   in <20130505.133807.335570424077607008.hrs@allbsd.org>:
 
 hr> Tadaaki Nagao <abtk@shitamachi.org> wrote
 hr>   in <20130505.112636.1254348787605646288.abtk@shitamachi.org>:
 hr>
 hr> ab> Just one more thing I'd like to suggest:
 hr> ab> 'deactivate-current-input-method-function' was introduced on Emacs 24.3
 hr> ab> by renaming the misspelled 'inactivate-current-input-method-function'.
 hr> ab> To retain our support for older Emacsen, how about the following as
 hr> ab> patch-unix_emacs_mozc.el?
 hr>
 hr>  Ah, it makes sense.  Thank you for the suggestion.  A new patchset is
 hr>  available via the following URLs:
 hr>
 hr>   http://people.allbsd.org/~hrs/FreeBSD/mozc_port_full_20130505-1.tar.gz
 hr>   http://people.allbsd.org/~hrs/FreeBSD/mozc_port_20130505-1.diff
 
  I've added Japanese zipcode dictionary, too:
 
   http://people.allbsd.org/~hrs/FreeBSD/mozc_port_full_20130505-2.tar.gz
   http://people.allbsd.org/~hrs/FreeBSD/mozc_port_20130505-2.diff
 
  This patchset is now in a good shape for average users, though I am
  still working on build issue on big-endian platforms while mozc
  supports only LE in the original distribution.
 
 -- Hiroki
 
 ----Security_Multipart(Sun_May__5_16_31_03_2013_151)--
 Content-Type: application/pgp-signature
 Content-Transfer-Encoding: 7bit
 
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.13 (FreeBSD)
 
 iEYEABECAAYFAlGGCrcACgkQTyzT2CeTzy1i0ACgkFK0aJnNXeTI80FQ4cQNLa9l
 cqwAoNNk+pLKT23dv5HO14cr9hxuGtGN
 =k0rQ
 -----END PGP SIGNATURE-----
 
 ----Security_Multipart(Sun_May__5_16_31_03_2013_151)----

From: Hiroki Sato <hrs@FreeBSD.org>
To: ports@FreeBSD.org
Cc: abtk@shitamachi.org, freebsd-gnats-submit@FreeBSD.org
Subject: Re: ports/178250: Fix build failures of japanese/{mozc-server,
 mozc-tool, ibus-mozc, mozc-el}
Date: Sun, 05 May 2013 17:48:03 +0900 (JST)

 ----Security_Multipart(Sun_May__5_17_48_03_2013_892)--
 Content-Type: Text/Plain; charset=us-ascii
 Content-Transfer-Encoding: 7bit
 
 Hiroki Sato <hrs@freebsd.org> wrote
   in <20130505.163103.757541635420675768.hrs@allbsd.org>:
 
 hr>  I've added Japanese zipcode dictionary, too:
 hr>
 hr>   http://people.allbsd.org/~hrs/FreeBSD/mozc_port_full_20130505-2.tar.gz
 hr>   http://people.allbsd.org/~hrs/FreeBSD/mozc_port_20130505-2.diff
 hr>
 hr>  This patchset is now in a good shape for average users, though I am
 hr>  still working on build issue on big-endian platforms while mozc
 hr>  supports only LE in the original distribution.
 
  Gr, I forgot to add leim-list.el to the patch.
 
   http://people.allbsd.org/~hrs/FreeBSD/mozc_port_full_20130505-3.tar.gz
   http://people.allbsd.org/~hrs/FreeBSD/mozc_port_20130505-3.diff
 
  After installing japanese/mozc-el, mozc is automatically added as an
  Emacs input method.  Note that noisy message may be displayed when
  both editors/tamago and mozc.el are installed.  It will be fixed on
  the Tamago side once mozc ports are updated.
 
 -- Hiroki
 
 ----Security_Multipart(Sun_May__5_17_48_03_2013_892)--
 Content-Type: application/pgp-signature
 Content-Transfer-Encoding: 7bit
 
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.13 (FreeBSD)
 
 iEYEABECAAYFAlGGHMMACgkQTyzT2CeTzy3AsQCgp7rKXWiKF6pWrEPulNBge3Ut
 F+wAoLQqvI11aUZyDAfa93exh0ie0RMq
 =wNUM
 -----END PGP SIGNATURE-----
 
 ----Security_Multipart(Sun_May__5_17_48_03_2013_892)----

From: Hiroki Sato <hrs@FreeBSD.org>
To: ports@FreeBSD.org
Cc: freebsd-gnats-submit@FreeBSD.org, hrs@FreeBSD.org, abtk@shitamachi.org,
        niioka@kk.iij4u.or.jp
Subject: Re: ports/178250: Fix build failures of japanese/{mozc-server,
 mozc-tool, ibus-mozc, mozc-el}
Date: Wed, 08 May 2013 08:48:11 +0900 (JST)

 ----Security_Multipart(Wed_May__8_08_48_11_2013_860)--
 Content-Type: Text/Plain; charset=us-ascii
 Content-Transfer-Encoding: 7bit
 
 Hiroki Sato <hrs@FreeBSD.org> wrote
   in <20130503.215135.1987071730491164980.hrs@allbsd.org>:
 
 hr> hr>  Thanks for the feedback!  A revised version is as follows:
 hr> hr>
 hr> hr>   http://people.allbsd.org/~hrs/FreeBSD/mozc_port_20130501-1.diff
 hr> hr>   http://people.allbsd.org/~hrs/FreeBSD/mozc_port_full_20130501-1.tar.gz
 hr> hr>
 hr> hr>  In addition to fixing the spotted issues, toolchain handling has been
 hr> hr>  fixed.  I am waiting for a report from one who got a build error on a
 hr> hr>  10-CURRENT box.  Any comments are welcome.
 
  Another minor build issue when binutils package is installed has been
  fixed.
 
  http://people.allbsd.org/~hrs/FreeBSD/mozc_port_full_20130508-1.tar.gz
  http://people.allbsd.org/~hrs/FreeBSD/mozc_port_20130508-1.diff
 
  A brief summary of the changes is as follows:
 
  ==== mozc_port_20130508-1.diff ====
  - Add Japan Post zip code dictionary.
  - Add LICENSE.
  - Fix malformed BUILD_DEPENDS and remove unnecessary dependencies.
    Use USE_* in a consistent manner.
  - Fix inconsistency toolchain usage in build_tools and the others.
    Hardcoded g++ was always used only for the former even if both gcc
    and clang were available.
  - Enable -Werror.
  - Fix SSP issue on i386 platform.
  - Let cpp(1) to replace LOCALBASE instead of patching and sed(1).
  - Use GYP_DEFINES for build variables instead of patching.
  - Separate the stages of configuration and build from each other.
  - Add options for localbase and openssl-related configuration to gyp
    instead of patching.
  - Fix makesum target.
  - Fix whitespaces to make portlint happy.
  - Disable serialization for linking.  It is not needed.
  - Remove hardcoded mozc.xml.
  - Respect DISABLE_MAKE_JOBS=yes.  Do not calculate the factor using the
    number of CPUs.
  - Remove a confusing message after pkg-message.
  - Rename a deprecated function (inactivate-current-input-method-function)
    in mozc.el in a compatible fashion with the older emacsen [1].
  - Add leim-list.el for registration of mozc-mode via LEIM API.
    "(require 'mozc)" is no longer needed.
  - Fix a build problem when binutils is installed and ${LOCALBASE}/bin
    comes first in $PATH [2].
 
  Submitted by:   Tadaaki Nagao [1]
  Reported by:    Kenichi Niioka [2]
  ====
 
 -- Hiroki
 
 ----Security_Multipart(Wed_May__8_08_48_11_2013_860)--
 Content-Type: application/pgp-signature
 Content-Transfer-Encoding: 7bit
 
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.13 (FreeBSD)
 
 iEYEABECAAYFAlGJkrsACgkQTyzT2CeTzy3eqgCgyL7hvSjG8wVpPxYBhW3RGac6
 UtYAn2wB4PW6uK9Kp6PcqvVb74CQ623z
 =tBSf
 -----END PGP SIGNATURE-----
 
 ----Security_Multipart(Wed_May__8_08_48_11_2013_860)----
State-Changed-From-To: open->analyzed 
State-Changed-By: hrs 
State-Changed-When: Mon May 13 18:29:41 UTC 2013 
State-Changed-Why:  
A fully-working patch is already provided.  I will commit it if no action is 
taken by May 14, two weeks after the PR submission. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=178250 
State-Changed-From-To: analyzed->patched 
State-Changed-By: hrs 
State-Changed-When: Tue May 14 19:47:13 UTC 2013 
State-Changed-Why:  
Committed the patch. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=178250 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/178250: commit references a PR
Date: Tue, 14 May 2013 19:46:34 +0000 (UTC)

 Author: hrs
 Date: Tue May 14 19:46:20 2013
 New Revision: 318195
 URL: http://svnweb.freebsd.org/changeset/ports/318195
 
 Log:
    - Add Japan Post zip code dictionary.
    - Add LICENSE.
    - Fix malformed BUILD_DEPENDS and remove unnecessary dependencies.
      Use USE_* in a consistent manner.
    - Fix inconsistency toolchain usage in build_tools and the others.
      Hardcoded g++ was always used only for the former even if both gcc
      and clang were available.
    - Enable -Werror.
    - Fix SSP issue on i386 platform.
    - Let cpp(1) to replace LOCALBASE instead of patching and sed(1).
    - Use GYP_DEFINES for build variables instead of patching.
    - Separate the stages of configuration and build from each other.
    - Add options for localbase and openssl-related configuration to gyp
      instead of patching.
    - Fix makesum target.
    - Fix whitespaces to make portlint happy.
    - Disable serialization for linking.  It is not needed.
    - Remove hardcoded mozc.xml.
    - Respect DISABLE_MAKE_JOBS=yes.  Do not calculate the factor using the
      number of CPUs.
    - Remove a confusing message after pkg-message.
    - Rename a deprecated function (inactivate-current-input-method-function)
      in mozc.el in a compatible fashion with the older emacsen [1].
    - Add leim-list.el for registration of mozc-mode via LEIM API.
      "(require 'mozc)" is no longer needed.
    - Fix a build problem when binutils is installed and ${LOCALBASE}/bin
      comes first in $PATH [2].
   
   Submitted by:	Tadaaki Nagao [1]
   Reported by:	Kenichi Niioka [2]
   PR:		ports/178250
   Approved by:	maintainer timeout (2 weeks)
 
 Added:
   head/japanese/mozc-server/files/leim-list.el   (contents, props changed)
   head/japanese/mozc-server/files/patch-base_logging.cc   (contents, props changed)
   head/japanese/mozc-server/files/patch-build_mozc.py   (contents, props changed)
   head/japanese/mozc-server/files/patch-unix_emacs_mozc.el   (contents, props changed)
   head/japanese/mozc-server/files/patch-unix_ibus_ibus.gyp   (contents, props changed)
 Deleted:
   head/japanese/mozc-server/files/patch-unix_ibus_mozc.xml
 Modified:
   head/japanese/fcitx-mozc/Makefile
   head/japanese/ibus-mozc/Makefile
   head/japanese/mozc-el/Makefile
   head/japanese/mozc-el/pkg-message
   head/japanese/mozc-server/Makefile
   head/japanese/mozc-server/distinfo
   head/japanese/mozc-server/files/patch-base_base.gyp
   head/japanese/mozc-server/files/patch-base_iconv.cc
   head/japanese/mozc-server/files/patch-base_mutex.cc
   head/japanese/mozc-server/files/patch-base_process.cc
   head/japanese/mozc-server/files/patch-gui_about_dialog_about_dialog.cc
   head/japanese/mozc-server/files/patch-gyp_common.gypi
   head/japanese/mozc-server/files/patch-handwriting_zinnia_handwriting.cc
   head/japanese/mozc-server/files/patch-ipc_ipc_path_manager.cc
   head/japanese/mozc-server/files/patch-ipc_unix_ipc.cc
   head/japanese/mozc-server/files/patch-server_mozc_server.cc
   head/japanese/mozc-server/files/patch-third_party_gyp_pylib_gyp_generator_make.py
   head/japanese/mozc-server/files/patch-unix_ibus_gen_mozc_xml.py
   head/japanese/mozc-server/files/patch-unix_ibus_path_util.cc
   head/japanese/mozc-tool/Makefile
 
 Modified: head/japanese/fcitx-mozc/Makefile
 ==============================================================================
 --- head/japanese/fcitx-mozc/Makefile	Tue May 14 19:38:52 2013	(r318194)
 +++ head/japanese/fcitx-mozc/Makefile	Tue May 14 19:46:20 2013	(r318195)
 @@ -1,12 +1,8 @@
 -# New ports collection makefile for:	fcitx-mozc
 -# Date created:				22 May 2012
 -# Whom:					Daichi GOTO <daichi@freebsd.org>
 -#
 +# Created by: Daichi GOTO <daichi@freebsd.org>
  # $FreeBSD$
 -#
  
  PKGNAMEPREFIX=	ja-fcitx-
 -PKGNAMESUFFIX=
 +
  COMMENT=	Mozc engine for Fcitx
  DATADIR=	${PREFIX}/share/fcitx/${PORTNAME}
  
 @@ -17,8 +13,4 @@ BROKEN=		fails to build
  
  BUILD_MOZC_LIST=	fcitx_mozc
  
 -post-install:
 -	@${CAT} ${PKGMESSAGE}
 -	@${ECHO_CMD} To display this message again, type ${PKG_INFO} -D ${PKGNAME}
 -
  .include "${MASTERDIR}/Makefile"
 
 Modified: head/japanese/ibus-mozc/Makefile
 ==============================================================================
 --- head/japanese/ibus-mozc/Makefile	Tue May 14 19:38:52 2013	(r318194)
 +++ head/japanese/ibus-mozc/Makefile	Tue May 14 19:46:20 2013	(r318195)
 @@ -1,12 +1,8 @@
 -# New ports collection makefile for:	ibus-mozc
 -# Date created:				22 May 2010
 -# Whom:					Daichi GOTO <daichi@freebsd.org>
 -#
 +# Created by: Daichi GOTO <daichi@freebsd.org>
  # $FreeBSD$
 -#
  
  PKGNAMEPREFIX=	ja-ibus-
 -PKGNAMESUFFIX=
 +
  COMMENT=	Mozc engine for IBus
  DATADIR=	${PREFIX}/share/ibus-${PORTNAME}
  
 @@ -15,8 +11,4 @@ PKGMESSAGE=	${.CURDIR}/pkg-message
  
  BUILD_MOZC_LIST=	ibus_mozc
  
 -post-install:
 -	@${CAT} ${PKGMESSAGE}
 -	@${ECHO_CMD} To display this message again, type ${PKG_INFO} -D ${PKGNAME}
 -
  .include "${MASTERDIR}/Makefile"
 
 Modified: head/japanese/mozc-el/Makefile
 ==============================================================================
 --- head/japanese/mozc-el/Makefile	Tue May 14 19:38:52 2013	(r318194)
 +++ head/japanese/mozc-el/Makefile	Tue May 14 19:46:20 2013	(r318195)
 @@ -1,23 +1,13 @@
 -# New ports collection makefile for:	mozc-el
 -# Date created:				26 June 2010
 -# Whom:					TAKANO, Yuji
 -#
 +# Created by: TAKANO, Yuji
  # $FreeBSD$
 -#
  
  PKGNAMESUFFIX=	-el-${EMACS_PORT_NAME}
 -COMMENT=	Mozc for GNU Emacs
 +
 +COMMENT=	Emacs input method for Mozc
  
  MASTERDIR=	${.CURDIR}/../../japanese/mozc-server
  PKGMESSAGE=	${.CURDIR}/pkg-message
  
  BUILD_MOZC_LIST=mozc_el
  
 -USE_EMACS=	yes
 -CATEGORIES=	editors elisp
 -
 -post-install:
 -	@${CAT} ${PKGMESSAGE}
 -	@${ECHO_CMD} To display this message again, type ${PKG_INFO} -D ${PKGNAME}
 -
  .include "${MASTERDIR}/Makefile"
 
 Modified: head/japanese/mozc-el/pkg-message
 ==============================================================================
 --- head/japanese/mozc-el/pkg-message	Tue May 14 19:38:52 2013	(r318194)
 +++ head/japanese/mozc-el/pkg-message	Tue May 14 19:46:20 2013	(r318195)
 @@ -1,7 +1,7 @@
 +
  To activate mozc, you will need to add the following lines to
  your ~/.emacs:
  
 -(require 'mozc)
  (set-language-environment "Japanese")
  (setq default-input-method "japanese-mozc")
  (global-set-key (kbd "C-o") 'toggle-input-method)
 
 Modified: head/japanese/mozc-server/Makefile
 ==============================================================================
 --- head/japanese/mozc-server/Makefile	Tue May 14 19:38:52 2013	(r318194)
 +++ head/japanese/mozc-server/Makefile	Tue May 14 19:46:20 2013	(r318195)
 @@ -3,16 +3,20 @@
  
  PORTNAME=	mozc
  PORTVERSION=	1.10.1390.102
 -PORTREVISION=	2
 +PORTREVISION=	3
  CATEGORIES=	japanese
  MASTER_SITES=	${MASTER_SITE_GOOGLE_CODE}
 -PKGNAMEPREFIX?=	ja-
 -PKGNAMESUFFIX?=	-server
 +DISTFILES=	${DISTNAME}${EXTRACT_SUFX}
 +EXTRACT_ONLY=	${DISTNAME}${EXTRACT_SUFX}
  
  MAINTAINER=	daichi@FreeBSD.org
 -COMMENT?=	Mozc server for IBus and others
 +COMMENT?=	Mozc Japanese Input Method, Server
  
 -LIB_DEPENDS=	protobuf:${PORTSDIR}/devel/protobuf
 +LICENSE=	BSD
 +LICENSE_FILE=	${WRKSRC}/third_party/gyp/LICENSE
 +
 +LIB_DEPENDS=	protobuf:${PORTSDIR}/devel/protobuf \
 +		zinnia:${PORTSDIR}/japanese/zinnia
  RUN_DEPENDS=	xdg-open:${PORTSDIR}/devel/xdg-utils
  
  USES=		pkgconfig iconv
 @@ -25,12 +29,25 @@ MAKE_JOBS_SAFE=	yes
  
  BUILD_MOZC_LIST?=	mozc_server
  
 -GYP_OPTIONS=	
 -.if ${BUILD_MOZC_LIST:Mmozc_server} == "mozc_server" || \
 -    ${BUILD_MOZC_LIST:Mibus_mozc}   == "ibus_mozc"   || \
 -    ${BUILD_MOZC_LIST:Mfcitx_mozc}  == "fcitx_mozc"  || \
 -    ${BUILD_MOZC_LIST:Mmozc_el}     == "mozc_el"
 -GYP_OPTIONS=	--noqt
 +.if   ${BUILD_MOZC_LIST:Mmozc_server} == "mozc_server"
 +PKGNAMEPREFIX=	ja-
 +PKGNAMESUFFIX=	-server
 +
 +LICENSE=		BSD NAISTL
 +LICENSE_COMB=		multi
 +LICENSE_FILE_BSD=	${WRKSRC}/third_party/gyp/LICENSE
 +LICENSE_DISTFILES_BSD=	${DISTNAME}${EXTRACT_SUFX}
 +LICENSE_NAME_NAISTL=	Nara Institute of Science and Technology License
 +LICENSE_PERMS_NAISTL=	dist-mirror dist-sell pkg-mirror pkg-sell auto-accept
 +LICENSE_FILE_NAISTL=	${WRKSRC}/data/dictionary_oss/README.txt
 +LICENSE_DISTFILES_NAISTL=${DISTNAME}${EXTRACT_SUFX}
 +.elif ${BUILD_MOZC_LIST:Mmozc_tool} == "mozc_tool"
 +USE_GNOME=	glib20 gtk20
 +USE_QT4=	corelib gui
 +.elif ${BUILD_MOZC_LIST:Mibus_mozc} == "ibus_mozc"
 +USE_GNOME=	glib20 gtk20
 +.elif ${BUILD_MOZC_LIST:Mmozc_el} == "mozc_el"
 +USE_EMACS=	yes
  .endif
  
  .include <bsd.port.pre.mk>
 @@ -43,132 +60,154 @@ BROKEN=		Does not compile on FreeBSD 7.X
  BROKEN=		Does not compile: segfault
  .endif
  
 -LOCALBASE_REPLACE_FILES=	\
 -		gyp/common.gypi \
 -		unix/ibus/gen_mozc_xml.py \
 -		unix/ibus/mozc.xml \
 -		unix/ibus/path_util.cc \
 -		base/base.gyp \
 -		base/util.cc \
 -		base/process.cc \
 -		gui/about_dialog/about_dialog.cc \
 -		handwriting/zinnia_handwriting.cc \
 -		third_party/gyp/pylib/gyp/generator/make.py
 -SSL_REINPLACE_STR=
 -.for V in OPENSSL_CFLAGS OPENSSLLIB OPENSSLINC OPENSSL_LDFLAGS
 -SSL_REINPLACE_STR+=	-e "s,%%${V}%%,${${V}:S/\\/\\\\/g:S/"/\"/g:S/\$/\\$/g:S/,/\,/g},"
 -.endfor
 -LOCALBASE_PTN=	${LOCALBASE:S/\\/\\\\/g:S/"/\"/g:S/\$/\\$/g:S/,/\,/g}
 -
 -BUILD_MODE=	Release 
 -BUILD_CMD=	${SETENV} ${MAKE_ENV} ${GMAKE}
 +GYP_DEFINES=	use_libprotobuf=1 \
 +		channel_dev=0 \
 +		enable_unittest=0
 +BUILD_MODE=	Release
 +BUILD_CMD=	${SETENV} ${MAKE_ENV} PATH=/bin:/usr/bin:${PATH} ${GMAKE}
  BUILD_MOZC_CMD=	cd ${BUILD_WRKSRC} && \
  		${SETENV} BUILD_COMMAND="${WRKSRC}/mozcmake" \
  		PYTHONPATH=${WRKSRC}/third_party/gyp/local/lib/python${PYTHON_VER}/site-packages \
 +		${DEBUG} \
 +		GYP_DEFINES="${GYP_DEFINES}" \
 +		CC_host="${CC}" \
 +		CXX_host="${CXX}" \
 +		LD_host="${CXX}" \
 +		AR_host="${AR}" \
  		${PYTHON_CMD} build_mozc.py
 -BUILD_GYP_CMD=	cd ${WRKSRC}/third_party/gyp && ${SETENV} ${MAKE_ENV} ${PYTHON_CMD} ${PYSETUP}
 +BUILD_MOZC_CMD_BUILD=	${BUILD_MOZC_CMD} build -c ${BUILD_MODE} ${_MAKE_JOBS}
 +BUILD_GYP_CMD=	cd ${WRKSRC}/third_party/gyp && \
 +			${SETENV} ${MAKE_ENV} ${PYTHON_CMD} ${PYSETUP}
  
  post-patch:
 -	cd ${WRKSRC} && \
 -		${REINPLACE_CMD} "s,@@LOCALBASE@@,${LOCALBASE_PTN},g" \
 -		${LOCALBASE_REPLACE_FILES}
 -	cd ${WRKSRC} && \
 -		${REINPLACE_CMD} ${SSL_REINPLACE_STR} base/base.gyp
 -	${MKDIR} -p ${WRKSRC}/mozc_build_tools/linux
 -	${LN} -sf ${LOCALBASE}/bin/protoc ${WRKSRC}/mozc_build_tools/linux/ 
 +	${MKDIR} ${WRKSRC}/mozc_build_tools/linux
 +	${LN} -sf ${LOCALBASE}/bin/protoc ${WRKSRC}/mozc_build_tools/linux/
  .if ${BUILD_MOZC_LIST:Mfcitx_mozc} == "fcitx_mozc"
 -	cd ${WRKSRC} && \
 -		${REINPLACE_CMD} 's,/po/mo},%po}mo,g' \
 -		unix/fcitx/gen_fcitx_mozc_i18n.sh
 -	cd ${WRKSRC} && \
 -		${REINPLACE_CMD} "s,/usr,${LOCALBASE_PTN}," \
 -		unix/fcitx/mozc.conf
 +	${REINPLACE_CMD} 's,/po/mo},%po}mo,g' \
 +		${WRKSRC}/unix/fcitx/gen_fcitx_mozc_i18n.sh
 +	${REINPLACE_CMD} "s,/usr,${LOCALBASE:Q}," \
 +		${WRKSRC}/unix/fcitx/mozc.conf
  .endif
  
 -pre-build:
 -	${PRINTF} "%s\n%s\n" "#!/bin/sh" 'exec ${BUILD_CMD} $$@' > ${WRKSRC}/mozcmake
 +${WRKSRC}/mozcmake:
 +	${PRINTF} "%s\n%s\n" "#!/bin/sh" 'exec ${BUILD_CMD} $$@' \
 +		> ${WRKSRC}/mozcmake
  	${CHMOD} +x ${WRKSRC}/mozcmake
 -	${BUILD_GYP_CMD} ${PYDISTUTILS_CONFIGURE_TARGET} ${PYDISTUTILS_CONFIGUREARGS}
 +
 +post-configure: ${WRKSRC}/mozcmake
 +	${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_GYP_CMD} ${PYDISTUTILS_INSTALL_TARGET} \
 +		--prefix=${WRKSRC}/third_party/gyp/local
  	${BUILD_MOZC_CMD} gyp \
 -			--gypdir=${WRKSRC}/third_party/gyp/local/bin \
 -			--server_dir="${PREFIX}/bin" --channel_dev=0 \
 -			${GYP_OPTIONS}
 -	${BUILD_MOZC_CMD} build_tools -c ${BUILD_MODE}
 +		--gypdir=${WRKSRC}/third_party/gyp/local/bin \
 +		--server_dir="${PREFIX}/bin" \
 +		--localbase="${LOCALBASE}" \
 +		--ldflags="${LDFLAGS} -fstack-protector -L${LOCALBASE}/lib" \
 +		--include_dirs="${LOCALBASE}/include" \
 +		--openssl_cflags="${OPENSSL_CFLAGS}" \
 +		--openssl_ldflags="${OPENSSL_LDFLAGS}" \
 +		--openssl_inc="-I${OPENSSLINC}" \
 +		--openssl_lib="-lssl -lcrypto -L${OPENSSLLIB}" \
 +		${GYP_OPTIONS}
 +
 +pre-build:
 +	${BUILD_MOZC_CMD} build_tools -c ${BUILD_MODE} ${_MAKE_JOBS}
  
  # mozc_server
 -.if ${BUILD_MOZC_LIST:Mmozc_server} == "mozc_server"
 -BUILD_DEPENDS+=	glib:${PORTSDIR}/devel/glib20 \
 -		gtk:${PORTSDIR}/x11-toolkits/gtk20
 +.if ${BUILD_MOZC_LIST:Mmozc_server} == "mozc_server" || defined(makesum)
 +GYP_OPTIONS+=	--noqt
 +GYP_DEFINES+=	use_libibus=0 \
 +		enable_gtk_renderer=0
 +
 +MASTER_SITES+=	LOCAL/kuriyama:zipcode
 +DISTFILES+= \
 +	ken_all-20130228.lzh:zipcode \
 +	jigyosyo-20130228.lzh:zipcode
 +
 +EXTRACT_DEPENDS+=	lha:${PORTSDIR}/archivers/lha
 +
  PLIST_FILES+=	bin/mozc_server
  
 +post-extract-mozc_server:
 +	@for F in jigyosyo-20130228.lzh ken_all-20130228.lzh; do \
 +		${LHA_CMD} xfqw=${WRKSRC}/data/dictionary_oss ${DISTDIR}/$$F; \
 +	done
 +	@cd ${WRKSRC}/data/dictionary_oss && \
 +		${PYTHON_CMD} ${WRKSRC}/dictionary/gen_zip_code_seed.py \
 +		--zip_code=ken_all.csv --jigyosyo=jigyosyo.csv \
 +		>> dictionary09.txt
 +
 +post-extract: post-extract-mozc_server
 +
  do-build-mozc_server:
 -	${BUILD_MOZC_CMD} build -c ${BUILD_MODE} -j ${MAKE_JOBS_NUMBER} \
 -		server/server.gyp:mozc_server
 +	${BUILD_MOZC_CMD_BUILD} server/server.gyp:mozc_server
  
  do-install-mozc_server:
 -	@${INSTALL_PROGRAM} \
 +	${INSTALL_PROGRAM} \
  		${WRKSRC}/out_linux/${BUILD_MODE}/mozc_server \
  		${PREFIX}/bin
  .endif
  
  # mozc_tool
  .if ${BUILD_MOZC_LIST:Mmozc_tool} == "mozc_tool"
 -LIB_DEPENDS+=	zinnia.0:${PORTSDIR}/japanese/zinnia
 -BUILD_DEPENDS+=	gtk:${PORTSDIR}/x11-toolkits/gtk20
 -USE_QT4+=	corelib gui
 +GYP_DEFINES+=	use_libibus=0 \
 +		enable_gtk_renderer=1
 +
  RUN_DEPENDS+=	${LOCALBASE}/share/tegaki/models/zinnia/handwriting-ja.model:${PORTSDIR}/japanese/tegaki-zinnia-japanese
  
  PLIST_FILES+=	bin/mozc_tool \
 -		${DATADIR_REL}/icons/product_logo.png \
 -		${DATADIR_REL}/icons/update_uptodate.png
 -PLIST_DIRS+=	${DATADIR_REL}/icons ${DATADIR_REL}
 +		%%DATADIR%%/icons/product_logo.png \
 +		%%DATADIR%%/icons/update_uptodate.png
 +PLIST_DIRS+=	%%DATADIR%%/icons ${DATADIR_REL}
  
  do-build-mozc_tool:
 -	${BUILD_MOZC_CMD} build -c ${BUILD_MODE} -j ${MAKE_JOBS_NUMBER} \
 -		gui/gui.gyp:mozc_tool
 +	${BUILD_MOZC_CMD_BUILD} gui/gui.gyp:mozc_tool
  
  do-install-mozc_tool:
 -	@${INSTALL_PROGRAM} \
 +	${INSTALL_PROGRAM} \
  	       ${WRKSRC}/out_linux/${BUILD_MODE}/mozc_tool \
  	       ${PREFIX}/bin
  	@${MKDIR} ${DATADIR}/icons
 -	@${INSTALL_DATA} \
 +	${INSTALL_DATA} \
  		${WRKSRC}/data/images/unix/ime_product_icon_opensource-32.png \
  		${DATADIR}/icons/product_logo.png
 -	@${INSTALL_DATA} \
 +	${INSTALL_DATA} \
  		${WRKSRC}/data/images/unix/ime_product_icon_opensource-32.png \
  		${DATADIR}/icons/update_uptodate.png
  .endif
  
  # ibus_mozc
  .if ${BUILD_MOZC_LIST:Mibus_mozc} == "ibus_mozc"
 -LIB_DEPENDS+=	ibus-1.0.401:${PORTSDIR}/textproc/ibus \
 -		xcb-xfixes.0:${PORTSDIR}/x11/libxcb \
 -		zinnia.0:${PORTSDIR}/japanese/zinnia
 +GYP_OPTIONS+=	--noqt
 +GYP_DEFINES+=	use_libibus=1 \
 +		enable_gtk_renderer=1
 +
 +LIB_DEPENDS+=	ibus-1.0:${PORTSDIR}/textproc/ibus \
 +		xcb-xfixes:${PORTSDIR}/x11/libxcb
  RUN_DEPENDS+=	mozc_server:${PORTSDIR}/japanese/mozc-server \
  		mozc_tool:${PORTSDIR}/japanese/mozc-tool \
  		mozc_server_start:${PORTSDIR}/japanese/mozc-additions \
 -		${PYTHON_SITELIBDIR}/gtk-2.0/pynotify/_pynotify.so:${PORTSDIR}/devel/py-notify
 +		${PYTHON_SITELIBDIR}/gtk-2.0/pynotify/__init__.py:${PORTSDIR}/devel/py-notify
  
  PLIST_FILES+=	bin/mozc_renderer \
  		libexec/ibus-engine-mozc \
 -		${DATADIR_REL}/icons/alpha_full.png \
 -		${DATADIR_REL}/icons/alpha_half.png \
 -		${DATADIR_REL}/icons/dictionary.png \
 -		${DATADIR_REL}/icons/direct.png \
 -		${DATADIR_REL}/icons/hiragana.png \
 -		${DATADIR_REL}/icons/katakana_full.png \
 -		${DATADIR_REL}/icons/katakana_half.png \
 -		${DATADIR_REL}/icons/product_logo.png \
 -		${DATADIR_REL}/icons/properties.png \
 -		${DATADIR_REL}/icons/tool.png \
 -		share/ibus/component/mozc.xml 
 -PLIST_DIRS+=	${DATADIR_REL}/icons ${DATADIR_REL}
 +		%%DATADIR%%/icons/alpha_full.png \
 +		%%DATADIR%%/icons/alpha_half.png \
 +		%%DATADIR%%/icons/dictionary.png \
 +		%%DATADIR%%/icons/direct.png \
 +		%%DATADIR%%/icons/hiragana.png \
 +		%%DATADIR%%/icons/katakana_full.png \
 +		%%DATADIR%%/icons/katakana_half.png \
 +		%%DATADIR%%/icons/product_icon.png \
 +		%%DATADIR%%/icons/properties.png \
 +		%%DATADIR%%/icons/tool.png \
 +		share/ibus/component/mozc.xml
 +PLIST_DIRS+=	%%DATADIR%%/icons ${DATADIR_REL}
  
  do-build-ibus_mozc:
 -	${BUILD_MOZC_CMD} build -c ${BUILD_MODE} -j ${MAKE_JOBS_NUMBER} \
 +	${BUILD_MOZC_CMD_BUILD} \
  		unix/ibus/ibus.gyp:ibus_mozc \
  		renderer/renderer.gyp:mozc_renderer
  
 @@ -180,29 +219,33 @@ do-install-ibus_mozc:
  		${WRKSRC}/out_linux/${BUILD_MODE}/ibus_mozc \
  		${PREFIX}/libexec/ibus-engine-mozc
  	${INSTALL_DATA} \
 -		${WRKSRC}/unix/ibus/mozc.xml \
 +		${WRKSRC}/out_linux/${BUILD_MODE}/obj/gen/unix/ibus/mozc.xml \
  		${PREFIX}/share/ibus/component/mozc.xml
 -	${MKDIR} ${DATADIR}/icons
 +	@${MKDIR} ${DATADIR}/icons
  .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}/icons/${F:S/^ui-//}.png
  .endfor
 -	@${INSTALL_DATA} \
 +	${INSTALL_DATA} \
  		${WRKSRC}/data/images/unix/ime_product_icon_opensource-32.png \
 -		${DATADIR}/icons/product_logo.png
 +		${DATADIR}/icons/product_icon.png
  .endif
  
  # fcitx_mozc
 -.if ${BUILD_MOZC_LIST:Mfcitx_mozc} == "fcitx_mozc"
 +.if ${BUILD_MOZC_LIST:Mfcitx_mozc} == "fcitx_mozc" || make(makesum)
  PATCH_SITES=	http://fcitx.googlecode.com/files/
 -PATCHFILES=	fcitx-mozc-${PORTVERSION}.2.patch
 +PATCHFILES=	fcitx-${DISTNAME}.2.patch
 +.endif
 +.if ${BUILD_MOZC_LIST:Mfcitx_mozc} == "fcitx_mozc"
  PATCH_DIST_STRIP=-p2
  
 -LIB_DEPENDS+=	fcitx-config.4:${PORTSDIR}/chinese/fcitx \
 -		zinnia.0:${PORTSDIR}/japanese/zinnia
 -BUILD_DEPENDS+=	glib:${PORTSDIR}/devel/glib20
 +GYP_OPTIONS+=	--noqt
 +GYP_DEFINES+=	use_libibus=0 \
 +		enable_gtk_renderer=0
 +
 +LIB_DEPENDS+=	fcitx-core:${PORTSDIR}/chinese/fcitx
  RUN_DEPENDS+=	mozc_server:${PORTSDIR}/japanese/mozc-server \
  		mozc_tool:${PORTSDIR}/japanese/mozc-tool \
  		mozc_server_start:${PORTSDIR}/japanese/mozc-additions
 @@ -210,27 +253,26 @@ RUN_DEPENDS+=	mozc_server:${PORTSDIR}/ja
  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 \
 +		%%DATADIR%%/icon/mozc.png \
 +		%%DATADIR%%/icon/mozc-alpha_full.png \
 +		%%DATADIR%%/icon/mozc-alpha_half.png \
 +		%%DATADIR%%/icon/mozc-direct.png \
 +		%%DATADIR%%/icon/mozc-hiragana.png \
 +		%%DATADIR%%/icon/mozc-katakana_full.png \
 +		%%DATADIR%%/icon/mozc-katakana_half.png \
 +		%%DATADIR%%/icon/mozc-dictionary.png \
 +		%%DATADIR%%/icon/mozc-properties.png \
 +		%%DATADIR%%/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}
 +PLIST_DIRS+=	%%DATADIR%%/icon ${DATADIR_REL}
  
  do-build-fcitx_mozc:
 -		${BUILD_MOZC_CMD} build -c ${BUILD_MODE} -j ${MAKE_JOBS_NUMBER} \
 -			unix/fcitx/fcitx.gyp:fcitx-mozc
 +	${BUILD_MOZC_CMD_BUILD} unix/fcitx/fcitx.gyp:fcitx-mozc
  
  do-install-fcitx_mozc:
 -	${MKDIR} \
 +	@${MKDIR} \
  		${PREFIX}/lib/fcitx \
  		${PREFIX}/share/fcitx/addon \
  		${PREFIX}/share/fcitx/inputmethod
 @@ -243,18 +285,18 @@ do-install-fcitx_mozc:
  	${INSTALL_DATA} \
  		${WRKSRC}/unix/fcitx/mozc.conf \
  		${PREFIX}/share/fcitx/inputmethod/mozc.conf
 -	${MKDIR} ${DATADIR}/icon
 +	@${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} \
 +	${INSTALL_DATA} \
  		${WRKSRC}/data/images/unix/${F}.png \
 -		${DATADIR}/icon/${F:S/^ui-/mozc-/}.png
 +		${DATADIR}/icon/${F:S,^ui-,mozc-,}.png
  .endfor
 -	@${INSTALL_DATA} \
 +	${INSTALL_DATA} \
  		${WRKSRC}/data/images/product_icon_32bpp-128.png \
  		${DATADIR}/icon/mozc.png
  .for L in ja zh_CN zh_TW
 -	@${INSTALL_DATA} \
 +	${INSTALL_DATA} \
  		${WRKSRC}/out_linux/${BUILD_MODE}/obj/gen/unix/fcitx/po/${L}.mo \
  		${PREFIX}/share/locale/${L}/LC_MESSAGES/fcitx-mozc.mo
  .endfor
 @@ -262,37 +304,48 @@ do-install-fcitx_mozc:
  
  # mozc_el
  .if ${BUILD_MOZC_LIST:Mmozc_el} == "mozc_el"
 -LIB_DEPENDS+=	zinnia.0:${PORTSDIR}/japanese/zinnia
 -BUILD_DEPENDS+=	emacs:${PORTSDIR}/editors/emacs \
 -		glib:${PORTSDIR}/devel/glib20 \
 -		gtk:${PORTSDIR}/x11-toolkits/gtk20
 +GYP_OPTIONS+=	--noqt
 +GYP_DEFINES+=	use_libibus=0 \
 +		enable_gtk_renderer=0
 +
 +CATEGORIES+=	elisp
  RUN_DEPENDS+=	mozc_server:${PORTSDIR}/japanese/mozc-server \
  		mozc_server_start:${PORTSDIR}/japanese/mozc-additions
  
  PLIST_FILES+=	bin/mozc_emacs_helper \
 -		${EMACS_VERSION_SITE_LISPDIR}/mozc.el \
 -		${EMACS_VERSION_SITE_LISPDIR}/mozc.elc
 +		${EMACS_VERSION_SITE_LISPDIR}/mozc/mozc.el \
 +		${EMACS_VERSION_SITE_LISPDIR}/mozc/mozc.elc \
 +		${EMACS_VERSION_SITE_LISPDIR}/mozc/leim-list.el
 +PLIST_DIRS+=	${EMACS_VERSION_SITE_LISPDIR}/mozc
  
  do-build-mozc_el:
 -	${BUILD_MOZC_CMD} build -c ${BUILD_MODE} -j ${MAKE_JOBS_NUMBER} \
 -		unix/emacs/emacs.gyp:mozc_emacs_helper
 -	@cd ${WRKSRC}/unix/emacs && \
 +	${BUILD_MOZC_CMD_BUILD} unix/emacs/emacs.gyp:mozc_emacs_helper
 +	cd ${WRKSRC}/unix/emacs && \
  		${EMACS_CMD} -batch -q -no-site-file -no-init-file \
  				-f batch-byte-compile mozc.el
  
  do-install-mozc_el:
 -	@${INSTALL_PROGRAM} \
 +	${INSTALL_PROGRAM} \
  		${WRKSRC}/out_linux/${BUILD_MODE}/mozc_emacs_helper \
  		${PREFIX}/bin/
 -	@${INSTALL_DATA} \
 +	@${MKDIR} ${PREFIX}/${EMACS_VERSION_SITE_LISPDIR}/mozc
 +	${INSTALL_DATA} \
  		${WRKSRC}/unix/emacs/mozc.el \
 -		${PREFIX}/${EMACS_VERSION_SITE_LISPDIR}/
 -	@${INSTALL_DATA} \
 +		${PREFIX}/${EMACS_VERSION_SITE_LISPDIR}/mozc/
 +	${INSTALL_DATA} \
  		${WRKSRC}/unix/emacs/mozc.elc \
 -		${PREFIX}/${EMACS_VERSION_SITE_LISPDIR}/
 +		${PREFIX}/${EMACS_VERSION_SITE_LISPDIR}/mozc/
 +	${INSTALL_DATA} \
 +		${FILESDIR}/leim-list.el \
 +		${PREFIX}/${EMACS_VERSION_SITE_LISPDIR}/mozc/
  .endif
  
  do-build: ${BUILD_MOZC_LIST:S/^/do-build-/}
  do-install: ${BUILD_MOZC_LIST:S/^/do-install-/}
  
 +.if defined(PKGMESSAGE) && exists(${PKGMESSAGE})
 +post-install:
 +	@${CAT} ${PKGMESSAGE}
 +.endif
 +
  .include <bsd.port.post.mk>
 
 Modified: head/japanese/mozc-server/distinfo
 ==============================================================================
 --- head/japanese/mozc-server/distinfo	Tue May 14 19:38:52 2013	(r318194)
 +++ head/japanese/mozc-server/distinfo	Tue May 14 19:46:20 2013	(r318195)
 @@ -1,4 +1,8 @@
  SHA256 (mozc-1.10.1390.102.tar.bz2) = 72a8ed6657daa1c03b1efe50c262a69be2ab66d45747a47df6e54996b6d5ee39
 -SIZE(mozc-1.10.1390.102.tar.bz2) = 57879881
 +SIZE (mozc-1.10.1390.102.tar.bz2) = 57879881
 +SHA256 (ken_all-20130228.lzh) = ea7d8c01634821faa6ed1beacb72959e70a357e4e61ee913caa23e502b164681
 +SIZE (ken_all-20130228.lzh) = 1736171
 +SHA256 (jigyosyo-20130228.lzh) = 04f809b7c61355140b810d6b6b1c68ec575ada8c5ef87d27d56d632d1a0e35dd
 +SIZE (jigyosyo-20130228.lzh) = 832542
  SHA256 (fcitx-mozc-1.10.1390.102.2.patch) = 8702225049052ace5c4fa60998606cc7e08bc86966054f6f61b293277cffdcea
  SIZE (fcitx-mozc-1.10.1390.102.2.patch) = 130658
 
 Added: head/japanese/mozc-server/files/leim-list.el
 ==============================================================================
 --- /dev/null	00:00:00 1970	(empty, because file is newly added)
 +++ head/japanese/mozc-server/files/leim-list.el	Tue May 14 19:46:20 2013	(r318195)
 @@ -0,0 +1,30 @@
 +;; leim-list.el --- Mozc setup for leim API
 +;; $FreeBSD$$
 +;;
 +;; Copyright (c) 2013 Hiroki Sato <hrs@FreeBSD.org>.  All rights reserved.
 +;;
 +;; Redistribution and use in source and binary forms, with or without
 +;; modification, are permitted provided that the following conditions
 +;; are met:
 +;; 1. Redistributions of source code must retain the above copyright
 +;;    notice, this list of conditions and the following disclaimer.
 +;; 2. Redistributions in binary form must reproduce the above copyright
 +;;    notice, this list of conditions and the following disclaimer in the
 +;;   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)
 +
 +(defcustom mozc-leim-title "[Mozc]"
 +  "Mode line string shown when mozc-mode is enabled.
 +This indicator is not shown when you don't use LEIM."
 +  :type '(choice (const :tag "No indicator" nil)
 +                 (string :tag "Show an indicator"))
 +  :group 'mozc)
 +
 +(register-input-method
 +  "japanese-mozc" "Japanese" 'mozc-leim-activate
 +  mozc-leim-title
 +  "Japanese input method with Mozc/Google Japanese Input."
 +  'its-select-hiragana)
 
 Modified: head/japanese/mozc-server/files/patch-base_base.gyp
 ==============================================================================
 --- head/japanese/mozc-server/files/patch-base_base.gyp	Tue May 14 19:38:52 2013	(r318194)
 +++ head/japanese/mozc-server/files/patch-base_base.gyp	Tue May 14 19:46:20 2013	(r318195)
 @@ -1,27 +1,27 @@
 ---- base/base.gyp.orig	2013-04-21 03:48:45.178270244 +0900
 -+++ base/base.gyp	2013-04-21 04:16:38.943269499 +0900
 +--- base/base.gyp.orig	2013-03-29 13:33:43.000000000 +0900
 ++++ base/base.gyp	2013-04-23 23:49:53.000000000 +0900
  @@ -265,20 +265,20 @@
           ['OS=="linux" and target_platform!="Android" and '
            'not (target_platform=="NaCl" and _toolset=="target")', {
             'cflags': [
  -            '<!@(<(pkg_config_command) --cflags-only-other openssl)',
 -+            '%%OPENSSL_CFLAGS%%',
 ++            '<(openssl_cflags)',
             ],
             'defines': [
               'HAVE_OPENSSL=1',
             ],
             'include_dirs': [
  -            '<!@(<(pkg_config_command) --cflags-only-I openssl)',
 -+            '-I%%OPENSSLINC%%/openssl',
 ++            '<(openssl_inc)',
             ],
             'link_settings': {
               'ldflags': [
  -              '<!@(<(pkg_config_command) --libs-only-L openssl)',
 -+              '%%OPENSSL_LDFLAGS%% -L%%OPENSSLLIB%%',
 ++              '<(openssl_ldflags)',
               ],
               'libraries': [
  -              '<!@(<(pkg_config_command) --libs-only-l openssl)',
 -+              '-lssl',
 ++              '<(openssl_lib)',
               ],
             },
           }],
 
 Modified: head/japanese/mozc-server/files/patch-base_iconv.cc
 ==============================================================================
 --- head/japanese/mozc-server/files/patch-base_iconv.cc	Tue May 14 19:38:52 2013	(r318194)
 +++ head/japanese/mozc-server/files/patch-base_iconv.cc	Tue May 14 19:46:20 2013	(r318195)
 @@ -1,10 +1,10 @@
 ---- base/iconv.cc.orig	2013-04-21 03:48:45.174270168 +0900
 -+++ base/iconv.cc	2013-04-21 04:16:39.946269033 +0900
 +--- base/iconv.cc.orig	2013-03-29 13:33:43.000000000 +0900
 ++++ base/iconv.cc	2013-04-27 15:36:30.000000000 +0900
  @@ -53,7 +53,11 @@
     size_t olen_org = olen;
     iconv(ic, 0, &ilen, 0, &olen);  // reset iconv state
     while (ilen != 0) {
 -+#ifdef __FreeBSD__
 ++#ifdef OS_FREEBSD
  +    if (iconv(ic, (const char **)(&ibuf), &ilen, &obuf, &olen)
  +#else
       if (iconv(ic, reinterpret_cast<char **>(&ibuf), &ilen, &obuf, &olen)
 
 Added: head/japanese/mozc-server/files/patch-base_logging.cc
 ==============================================================================
 --- /dev/null	00:00:00 1970	(empty, because file is newly added)
 +++ head/japanese/mozc-server/files/patch-base_logging.cc	Tue May 14 19:46:20 2013	(r318195)
 @@ -0,0 +1,11 @@
 +--- base/logging.cc.orig	2013-04-26 10:49:33.000000000 +0900
 ++++ base/logging.cc	2013-04-26 10:53:18.000000000 +0900
 +@@ -111,7 +111,7 @@
 + #if defined(__native_client__)
 +            "%p",
 + #elif defined(OS_LINUX)
 +-           "%lu",
 ++           "%p",
 + #else  // = OS_WIN or OS_MACOSX
 +            "%u",
 + #endif
 
 Modified: head/japanese/mozc-server/files/patch-base_mutex.cc
 ==============================================================================
 --- head/japanese/mozc-server/files/patch-base_mutex.cc	Tue May 14 19:38:52 2013	(r318194)
 +++ head/japanese/mozc-server/files/patch-base_mutex.cc	Tue May 14 19:46:20 2013	(r318195)
 @@ -1,11 +1,11 @@
 ---- base/mutex.cc.orig	2013-04-21 03:48:45.170269862 +0900
 -+++ base/mutex.cc	2013-04-21 04:16:39.083269637 +0900
 +--- base/mutex.cc.orig	2013-03-29 13:33:43.000000000 +0900
 ++++ base/mutex.cc	2013-04-27 15:37:37.000000000 +0900
  @@ -296,7 +296,7 @@
     // PTHREAD_MUTEX_RECURSIVE_NP but Mac OS X 10.5 does not
     pthread_mutexattr_t attr;
     pthread_mutexattr_init(&attr);
  -#if defined(OS_MACOSX)
 -+#if defined(OS_MACOSX) || defined(__FreeBSD__)
 ++#if defined(OS_MACOSX) || defined(OS_FREEBSD)
     pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
   #elif defined(OS_LINUX)
     pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE_NP);
 
 Modified: head/japanese/mozc-server/files/patch-base_process.cc
 ==============================================================================
 --- head/japanese/mozc-server/files/patch-base_process.cc	Tue May 14 19:38:52 2013	(r318194)
 +++ head/japanese/mozc-server/files/patch-base_process.cc	Tue May 14 19:46:20 2013	(r318195)
 @@ -1,22 +1,11 @@
 ---- base/process.cc.orig	2013-04-21 03:48:45.176269982 +0900
 -+++ base/process.cc	2013-04-21 04:16:40.382269441 +0900
 -@@ -121,13 +121,18 @@
 -   return ShellExecuteInSystemDir(L"open", wurl.c_str(), NULL, SW_SHOW);
 +--- base/process.cc.orig	2013-03-29 13:33:43.000000000 +0900
 ++++ base/process.cc	2013-04-24 00:17:03.000000000 +0900
 +@@ -122,7 +122,7 @@
   #endif
   
 --#ifdef OS_LINUX
 -+#if defined(OS_LINUX) && !defined(__FreeBSD__)
 -   static const char kBrowserCommand[] = "/usr/bin/xdg-open";
 + #ifdef OS_LINUX
 +-  static const char kBrowserCommand[] = "/usr/bin/xdg-open";
 ++  static const char kBrowserCommand[] = LOCALBASE "/bin/xdg-open";
     // xdg-open which uses kfmclient or gnome-open internally works both on KDE
     // and GNOME environments.
     return SpawnProcess(kBrowserCommand, url);
 - #endif  // LINUX
 - 
 -+#ifdef __FreeBSD__
 -+  static const char kBrowserCommand[] = "@@LOCALBASE@@/bin/xdg-open";
 -+  return SpawnProcess(kBrowserCommand, url);
 -+#endif
 -+
 - #ifdef OS_MACOSX
 -   return MacProcess::OpenBrowserForMac(url);
 - #endif  // OS_MACOSX
 
 Added: head/japanese/mozc-server/files/patch-build_mozc.py
 ==============================================================================
 --- /dev/null	00:00:00 1970	(empty, because file is newly added)
 +++ head/japanese/mozc-server/files/patch-build_mozc.py	Tue May 14 19:46:20 2013	(r318195)
 @@ -0,0 +1,49 @@
 +--- build_mozc.py.orig	2013-03-29 13:33:25.000000000 +0900
 ++++ build_mozc.py	2013-05-02 00:54:37.000000000 +0900
 +@@ -332,6 +332,14 @@
 +                     help='use rsync to copy files instead of builtin function')
 +   AddTargetPlatformOption(parser)
 + 
 ++  parser.add_option('--localbase', dest='localbase')
 ++  parser.add_option('--ldflags', dest='ldflags')
 ++  parser.add_option('--include_dirs', dest='include_dirs')
 ++  parser.add_option('--openssl_cflags', dest='openssl_cflags')
 ++  parser.add_option('--openssl_ldflags', dest='openssl_ldflags')
 ++  parser.add_option('--openssl_lib', dest='openssl_lib')
 ++  parser.add_option('--openssl_inc', dest='openssl_inc')
 ++
 +   parser.add_option('--mac_dir', dest='mac_dir',
 +                     help='A path to the root directory of third party '
 +                     'libraries for Mac build which will be passed to gyp '
 +@@ -506,7 +514,7 @@
 +   parser = optparse.OptionParser(usage='Usage: %prog build [options]')
 +   AddCommonOptions(parser)
 +   if IsLinux():
 +-    default_build_concurrency = GetNumberOfProcessors() * 2
 ++    default_build_concurrency = 1;
 +     parser.add_option('--jobs', '-j', dest='jobs',
 +                       default=('%d' % default_build_concurrency),
 +                       metavar='N', help='run build jobs in parallel')
 +@@ -709,7 +717,22 @@
 +         command_line.extend(['-D', 'enable_unittest=0'])
 +         break
 + 
 ++  localbase = options.localbase or '/usr'
 ++  command_line.extend(['-D', 'localbase=%s' % localbase])
 + 
 ++  ldflags = options.ldflags or ''
 ++  command_line.extend(['-D', 'ldflags=%s' % ldflags])
 ++  include_dirs = options.include_dirs or ''
 ++  command_line.extend(['-D', 'include_dirs=%s' % include_dirs])
 ++
 ++  openssl_cflags = options.openssl_cflags or ''
 ++  command_line.extend(['-D', 'openssl_cflags=%s' % openssl_cflags])
 ++  openssl_ldflags = options.openssl_cflags or ''
 ++  command_line.extend(['-D', 'openssl_ldflags=%s' % openssl_ldflags])
 ++  openssl_inc = options.openssl_inc or ''
 ++  command_line.extend(['-D', 'openssl_inc=%s' % openssl_inc])
 ++  openssl_lib = options.openssl_lib or ''
 ++  command_line.extend(['-D', 'openssl_lib=%s' % openssl_lib])
 + 
 +   mac_dir = options.mac_dir or '../mac'
 +   if not os.path.isabs(mac_dir):
 
 Modified: head/japanese/mozc-server/files/patch-gui_about_dialog_about_dialog.cc
 ==============================================================================
 --- head/japanese/mozc-server/files/patch-gui_about_dialog_about_dialog.cc	Tue May 14 19:38:52 2013	(r318194)
 +++ head/japanese/mozc-server/files/patch-gui_about_dialog_about_dialog.cc	Tue May 14 19:46:20 2013	(r318195)
 @@ -1,11 +1,11 @@
 ---- gui/about_dialog/about_dialog.cc.orig	2013-04-21 03:48:45.446269666 +0900
 -+++ gui/about_dialog/about_dialog.cc	2013-04-21 04:15:03.065269472 +0900
 +--- gui/about_dialog/about_dialog.cc.orig	2013-03-29 13:33:58.000000000 +0900
 ++++ gui/about_dialog/about_dialog.cc	2013-04-27 15:16:49.000000000 +0900
  @@ -121,7 +121,11 @@
     SetLabelText(label_terms);
     SetLabelText(label_credits);
   
 -+#ifdef __FreeBSD__
 -+  product_image_.reset(new QImage("@@LOCALBASE@@/share/mozc-tool/icons/product_logo.png"));
 ++#ifdef OS_FREEBSD
 ++  product_image_.reset(new QImage(LOCALBASE "/share/mozc-tool/icons/product_logo.png"));
  +#else
     product_image_.reset(new QImage(":/product_logo.png"));
  +#endif
 
 Modified: head/japanese/mozc-server/files/patch-gyp_common.gypi
 ==============================================================================
 --- head/japanese/mozc-server/files/patch-gyp_common.gypi	Tue May 14 19:38:52 2013	(r318194)
 +++ head/japanese/mozc-server/files/patch-gyp_common.gypi	Tue May 14 19:46:20 2013	(r318195)
 @@ -1,32 +1,25 @@
 ---- gyp/common.gypi.orig	2013-04-21 03:48:45.395416165 +0900
 -+++ gyp/common.gypi	2013-04-21 08:31:10.191270448 +0900
 -@@ -58,7 +58,7 @@
 -     # warning_cflags will be shared with Mac and Linux.
 -     'warning_cflags': [
 -       '-Wall',
 --      '-Werror',
 -+#      '-Werror',
 -       '-Wno-char-subscripts',
 -       '-Wno-sign-compare',
 -       '-Wno-deprecated-declarations',
 -@@ -194,7 +194,7 @@
 -     # - http://code.google.com/p/protobuf/issues/detail?id=128
 -     # - http://code.google.com/p/protobuf/issues/detail?id=370
 -     # for the background information.
 --    'use_libprotobuf%': 0,
 -+    'use_libprotobuf%': 1,
 - 
 -     # use_libzinnia represents if zinnia library is used or not.
 -     # This option is only for Linux.
 -@@ -735,6 +735,12 @@
 +--- gyp/common.gypi.orig	2013-03-29 13:33:42.000000000 +0900
 ++++ gyp/common.gypi	2013-04-28 17:38:16.000000000 +0900
 +@@ -723,7 +723,9 @@
 +       ['OS=="linux"', {
 +         'defines': [
 +           'OS_LINUX',
 ++          'OS_FREEBSD',
 +           'MOZC_SERVER_DIRECTORY="<@(server_dir)"',
 ++          'LOCALBASE="<@(localbase)"',
 +         ],
 +         'cflags': [
 +           '<@(warning_cflags)',
 +@@ -735,6 +737,13 @@
             # <unordered_map> and <unordered_set>.
             '-Wno-deprecated',
           ],
  +        'include_dirs': [
 -+          '@@LOCALBASE@@/include'
 ++          '<@(include_dirs)'
  +        ],
  +        'ldflags': [
 -+          '-L@@LOCALBASE@@/lib'
 ++          '<@(ldflags)',
 ++	  '-fstack-protector',
  +        ],
           'conditions': [
             ['target_platform=="ChromeOS"', {
 
 Modified: head/japanese/mozc-server/files/patch-handwriting_zinnia_handwriting.cc
 ==============================================================================
 --- head/japanese/mozc-server/files/patch-handwriting_zinnia_handwriting.cc	Tue May 14 19:38:52 2013	(r318194)
 +++ head/japanese/mozc-server/files/patch-handwriting_zinnia_handwriting.cc	Tue May 14 19:46:20 2013	(r318195)
 @@ -1,19 +1,11 @@
 ---- handwriting/zinnia_handwriting.cc.orig	2013-04-21 03:48:52.166271231 +0900
 -+++ handwriting/zinnia_handwriting.cc	2013-04-21 04:20:14.073270179 +0900
 -@@ -49,10 +49,16 @@
 -   const char kModelFile[] = "handwriting-light-ja.model";
 -   return FileUtil::JoinPath(MacUtil::GetResourcesDirectory(), kModelFile);
 +--- handwriting/zinnia_handwriting.cc.orig	2013-03-29 13:33:25.000000000 +0900
 ++++ handwriting/zinnia_handwriting.cc	2013-04-27 15:15:30.000000000 +0900
 +@@ -51,7 +51,7 @@
   #elif defined(USE_LIBZINNIA)
 -+#if defined(__FreeBSD__)
 -+  const char kModelFile[] =
 -+      "@@LOCALBASE@@/share/tegaki/models/zinnia/handwriting-ja.model";
 -+  return kModelFile;
 -+#else
     // On Linux, use the model for tegaki-zinnia.
     const char kModelFile[] =
 -       "/usr/share/tegaki/models/zinnia/handwriting-ja.model";
 +-      "/usr/share/tegaki/models/zinnia/handwriting-ja.model";
 ++      LOCALBASE "/share/tegaki/models/zinnia/handwriting-ja.model";
     return kModelFile;
 -+#endif
   #else
     const char kModelFile[] = "handwriting-ja.model";
 -   return FileUtil::JoinPath(SystemUtil::GetServerDirectory(), kModelFile);
 
 Modified: head/japanese/mozc-server/files/patch-ipc_ipc_path_manager.cc
 ==============================================================================
 --- head/japanese/mozc-server/files/patch-ipc_ipc_path_manager.cc	Tue May 14 19:38:52 2013	(r318194)
 +++ head/japanese/mozc-server/files/patch-ipc_ipc_path_manager.cc	Tue May 14 19:46:20 2013	(r318195)
 @@ -1,11 +1,11 @@
 ---- ipc/ipc_path_manager.cc.orig	2013-04-21 03:48:45.259273192 +0900
 -+++ ipc/ipc_path_manager.cc	2013-04-21 04:20:12.800269260 +0900
 +--- ipc/ipc_path_manager.cc.orig	2013-03-29 13:33:26.000000000 +0900
 ++++ ipc/ipc_path_manager.cc	2013-04-27 15:21:52.000000000 +0900
  @@ -276,7 +276,7 @@
     *ipc_name = kIPCPrefix;
   #endif  // OS_WIN
   
  -#ifdef OS_LINUX
 -+#if defined(OS_LINUX) && !defined(__FreeBSD__)
 ++#if defined(OS_LINUX) && !defined(OS_FREEBSD)
     // On Linux, use abstract namespace which is independent of the file system.
     (*ipc_name)[0] = '\0';
   #endif
 
 Modified: head/japanese/mozc-server/files/patch-ipc_unix_ipc.cc
 ==============================================================================
 --- head/japanese/mozc-server/files/patch-ipc_unix_ipc.cc	Tue May 14 19:38:52 2013	(r318194)
 +++ head/japanese/mozc-server/files/patch-ipc_unix_ipc.cc	Tue May 14 19:46:20 2013	(r318195)
 @@ -1,10 +1,10 @@
 ---- ipc/unix_ipc.cc.orig	2013-04-21 03:48:45.257269513 +0900
 -+++ ipc/unix_ipc.cc	2013-04-21 08:33:27.207272333 +0900
 +--- ipc/unix_ipc.cc.orig	2013-03-29 13:33:26.000000000 +0900
 ++++ ipc/unix_ipc.cc	2013-04-27 15:23:08.000000000 +0900
  @@ -41,6 +41,9 @@
   #include <sys/time.h>
   #include <sys/types.h>
   #include <sys/un.h>
 -+#if defined(OS_MACOSX) || defined(__FreeBSD__)
 ++#if defined(OS_MACOSX) || defined(OS_FREEBSD)
  +#include <sys/ucred.h>
  +#endif
   #include <sys/wait.h>
 @@ -14,7 +14,7 @@
   bool IsPeerValid(int socket, pid_t *pid) {
     *pid = 0;
   
 -+#if defined(OS_MACOSX) || defined(__FreeBSD__)
 ++#if defined(OS_MACOSX) || defined(OS_FREEBSD)
  +  // If the OS is MAC, we should validate the peer by using LOCAL_PEERCRED.
  +  struct xucred peer_cred;
  +  socklen_t peer_cred_len = sizeof(struct xucred);
 @@ -36,7 +36,7 @@
  +  *pid = 0;
  +#endif
  +
 -+#if defined(OS_LINUX) && !defined(__FreeBSD__)
 ++#if defined(OS_LINUX) && !defined(OS_FREEBSD)
     // On ARM Linux, we do nothing and just return true since the platform
     // sometimes doesn't support the getsockopt(sock, SOL_SOCKET, SO_PEERCRED)
     // system call.
 @@ -52,7 +52,7 @@
       address.sun_family = AF_UNIX;
       ::memcpy(address.sun_path, server_address.data(), server_address_length);
       address.sun_path[server_address_length] = '\0';
 -+#if defined(OS_MACOSX) || defined(__FreeBSD__)
 ++#if defined(OS_MACOSX) || defined(OS_FREEBSD)
  +    address.sun_len = SUN_LEN(&address);
  +    const size_t sun_len = sizeof(address);
  +#else
 @@ -65,7 +65,7 @@
                  SO_REUSEADDR,
                  reinterpret_cast<char *>(&on),
                  sizeof(on));
 -+#if defined(OS_MACOSX) || defined(__FreeBSD__)
 ++#if defined(OS_MACOSX) || defined(OS_FREEBSD)
  +  addr.sun_len = SUN_LEN(&addr);
  +  const size_t sun_len = sizeof(addr);
  +#else
 
 Modified: head/japanese/mozc-server/files/patch-server_mozc_server.cc
 ==============================================================================
 --- head/japanese/mozc-server/files/patch-server_mozc_server.cc	Tue May 14 19:38:52 2013	(r318194)
 +++ head/japanese/mozc-server/files/patch-server_mozc_server.cc	Tue May 14 19:46:20 2013	(r318195)
 @@ -1,10 +1,10 @@
 ---- server/mozc_server.cc.orig	2013-04-21 03:48:44.841269792 +0900
 -+++ server/mozc_server.cc	2013-04-21 04:14:37.821269328 +0900
 +--- server/mozc_server.cc.orig	2013-03-29 13:33:26.000000000 +0900
 ++++ server/mozc_server.cc	2013-04-27 15:18:29.000000000 +0900
  @@ -32,6 +32,9 @@
   #ifdef OS_WIN
   #include <windows.h>
   #endif
 -+#ifdef __FreeBSD__
 ++#ifdef OS_FREEBSD
  +#include <signal.h>
  +#endif
   
 @@ -14,7 +14,7 @@
   mozc::SessionServer *g_session_server = NULL;
   }
   
 -+#ifdef __FreeBSD__
 ++#ifdef OS_FREEBSD
  +static void sig_func(int num)
  +{
  +  VLOG(1) << "signal " << num << " recieved.";
 @@ -38,7 +38,7 @@
         return -1;
       }
   
 -+#ifdef __FreeBSD__
 ++#ifdef OS_FREEBSD
  +    ::signal(SIGINT, sig_func);
  +    ::signal(SIGHUP, sig_func);
  +    ::signal(SIGTERM, sig_func);
 
 Modified: head/japanese/mozc-server/files/patch-third_party_gyp_pylib_gyp_generator_make.py
 ==============================================================================
 --- head/japanese/mozc-server/files/patch-third_party_gyp_pylib_gyp_generator_make.py	Tue May 14 19:38:52 2013	(r318194)
 +++ head/japanese/mozc-server/files/patch-third_party_gyp_pylib_gyp_generator_make.py	Tue May 14 19:46:20 2013	(r318195)
 @@ -1,5 +1,14 @@
 ---- third_party/gyp/pylib/gyp/generator/make.py.orig	2013-04-21 03:48:44.552270209 +0900
 -+++ third_party/gyp/pylib/gyp/generator/make.py	2013-04-21 04:16:32.828269137 +0900
 +--- third_party/gyp/pylib/gyp/generator/make.py.orig	2013-02-26 11:59:54.000000000 +0900
 ++++ third_party/gyp/pylib/gyp/generator/make.py	2013-05-03 21:08:15.000000000 +0900
 +@@ -259,7 +259,7 @@
 + #   export LINK=g++
 + #
 + # This will allow make to invoke N linker processes as specified in -jN.
 +-LINK ?= %(flock)s $(builddir)/linker.lock $(CXX.target)
 ++LINK ?= $(CXX.target)
 + 
 + CC.target ?= %(CC.target)s
 + CFLAGS.target ?= $(CFLAGS)
  @@ -1956,6 +1956,9 @@
       srcdir_prefix = '$(srcdir)/'
   
 @@ -10,3 +19,13 @@
     header_params = {
         'default_target': default_target,
         'builddir': builddir_name,
 +@@ -2003,7 +2006,8 @@
 +   build_file, _, _ = gyp.common.ParseQualifiedTarget(target_list[0])
 +   make_global_settings_array = data[build_file].get('make_global_settings', [])
 +   wrappers = {}
 +-  wrappers['LINK'] = '%s $(builddir)/linker.lock' % flock_command
 ++  # Disable flock for linking.
 ++  # wrappers['LINK'] = '%s $(builddir)/linker.lock' % flock_command
 +   for key, value in make_global_settings_array:
 +     if key.endswith('_wrapper'):
 +       wrappers[key[:-len('_wrapper')]] = '$(abspath %s)' % value
 
 Added: head/japanese/mozc-server/files/patch-unix_emacs_mozc.el
 ==============================================================================
 --- /dev/null	00:00:00 1970	(empty, because file is newly added)
 +++ head/japanese/mozc-server/files/patch-unix_emacs_mozc.el	Tue May 14 19:46:20 2013	(r318195)
 @@ -0,0 +1,55 @@
 +--- unix/emacs/mozc.el.orig	2013-03-29 13:33:43.000000000 +0900
 
 *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
 _______________________________________________
 svn-ports-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-ports-all
 To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: patched->closed 
State-Changed-By: linimon 
State-Changed-When: Wed Jul 3 00:50:32 UTC 2013 
State-Changed-Why:  
committed by hrs 14 May 2013. 


Responsible-Changed-From-To: daichi->hrs 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Wed Jul 3 00:50:32 UTC 2013 
Responsible-Changed-Why:  

http://www.freebsd.org/cgi/query-pr.cgi?pr=178250 
>Unformatted:
