aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--japanese/Makefile1
-rw-r--r--japanese/mozc-server/Makefile102
-rw-r--r--japanese/mozc-server/distinfo6
-rw-r--r--japanese/mozc-server/files/patch-src_base_iconv.cc11
-rw-r--r--japanese/mozc-server/files/patch-src_base_mutex.h11
-rw-r--r--japanese/mozc-server/files/patch-src_base_process.cc11
-rw-r--r--japanese/mozc-server/files/patch-src_base_util.cc11
-rw-r--r--japanese/mozc-server/files/patch-src_build_mozc.py20
-rw-r--r--japanese/mozc-server/files/patch-src_gyp_common.gypi15
-rw-r--r--japanese/mozc-server/files/patch-src_ipc_unix_ipc.cc29
-rw-r--r--japanese/mozc-server/pkg-descr5
-rw-r--r--japanese/mozc-server/pkg-plist1
12 files changed, 223 insertions, 0 deletions
diff --git a/japanese/Makefile b/japanese/Makefile
index 2267158cea80..6b6f7eb407d0 100644
--- a/japanese/Makefile
+++ b/japanese/Makefile
@@ -195,6 +195,7 @@
SUBDIR += monafonts
SUBDIR += monafonts-ttf
SUBDIR += mozc-additions
+ SUBDIR += mozc-server
SUBDIR += mozilla-jlp
SUBDIR += mtools
SUBDIR += multiskkserv
diff --git a/japanese/mozc-server/Makefile b/japanese/mozc-server/Makefile
new file mode 100644
index 000000000000..cbeadb117179
--- /dev/null
+++ b/japanese/mozc-server/Makefile
@@ -0,0 +1,102 @@
+# New ports collection makefile for: mozc-server
+# Date created: 26 June 2010
+# Whom: Daichi GOTO <daichi@freebsd.org>
+#
+# $FreeBSD$
+#
+
+PORTNAME= mozc-server
+PORTVERSION= 0.11.383.102
+CATEGORIES= japanese
+MASTER_SITES= http://people.freebsd.org/~daichi/distfiles/
+DISTNAME= mozc-${PORTVERSION}
+DISTFILES= ${DISTNAME}.tar.bz2
+
+MAINTAINER= daichi@freebsd.org
+COMMENT= Mozc server for IBus, SCIM and others
+
+BUILD_DEPENDS= gsed:${PORTSDIR}/textproc/gsed \
+ gyp:${PORTSDIR}/devel/py-gyp-devel
+LIB_DEPENDS= curl.6:${PORTSDIR}/ftp/curl \
+ gtest.0:${PORTSDIR}/devel/googletest \
+ protobuf.6:${PORTSDIR}/devel/protobuf
+RUN_DEPENDS= xdg-open:${PORTSDIR}/devel/xdg-utils
+
+USE_GMAKE= yes
+USE_ICONV= yes
+USE_PYTHON= yes
+
+.include <bsd.port.pre.mk>
+
+.if ${OSVERSION} < 800107
+BROKEN= Does not compile on FreeBSD 7.X
+.endif
+
+.if defined(WITH_DIC_UT)
+WITH_DIC_UT_MEISHI=yes
+WITH_DIC_UT_JINMEI=yes
+.endif
+
+.if defined(WITH_DIC_UT_FULL)
+WITH_DIC_UT_MEISHI=yes
+WITH_DIC_UT_JINMEI=yes
+WITH_DIC_UT_KAOMOJI=yes
+WITH_DIC_UT_EDICTKATAKANAGO=yes
+WITH_DIC_UT_GCANNAKIHONMEISHI=yes
+.endif
+
+.if defined(WITH_DIC_UT_MEISHI) || \
+ defined(WITH_DIC_UT_JINMEI) || \
+ defined(WITH_DIC_UT_KAOMOJI) || \
+ defined(WITH_DIC_UT_EDICTKATAKANAGO) || \
+ defined(WITH_DIC_UT_GCANNAKIHONMEISHI)
+DISTFILES+= mozcdic-ut-20100617.tar.bz2
+WRKUTDICSRC= ${WRKDIR}/mozcdic-ut-20100617
+.endif
+
+REPLACE_FILES= ${WRKSRC}/build_mozc.py \
+ ${WRKSRC}/gyp/common.gypi \
+ ${WRKSRC}/base/util.cc \
+ ${WRKSRC}/base/process.cc
+
+post-patch:
+ @for FILE in ${REPLACE_FILES}; \
+ do \
+ ${SED} -i .bak -e "s/@@LOCALBASE@@/${LOCALBASE:S/\//\\\//g}/g" \
+ $${FILE}; \
+ done;
+.if defined(WITH_DIC_UT_MEISHI)
+ ${CAT} ${WRKUTDICSRC}/mozcdic-ut-meisi-20100612.txt \
+ >> ${WRKSRC}/data/dictionary/dictionary1.txt
+.endif
+.if defined(WITH_DIC_UT_JINMEI)
+ ${CAT} ${WRKUTDICSRC}/mozcdic-ut-jinmei-20100609.txt \
+ >> ${WRKSRC}/data/dictionary/dictionary1.txt
+.endif
+.if defined(WITH_DIC_UT_KAOMOJI)
+ ${CAT} ${WRKUTDICSRC}/kaomoji/mozcdic-ut-kaomoji-20100611.txt \
+ >> ${WRKSRC}/data/dictionary/dictionary1.txt
+.endif
+.if defined(WITH_DIC_UT_EDICTKATAKANAGO)
+ ${CAT} ${WRKUTDICSRC}/edict-katakanago/mozcdic-ut-edict-katakanago-20100609.txt \
+ >> ${WRKSRC}/data/dictionary/dictionary1.txt
+.endif
+.if defined(WITH_DIC_UT_GCANNAKIHONMEISHI)
+ ${CAT} ${WRKUTDICSRC}/mozcdic-ut-gcanna-kihonmeisi-20100612.txt \
+ >> ${WRKSRC}/data/dictionary/dictionary1.txt
+.endif
+
+do-build:
+ @cd ${WRKSRC}/; \
+ ${PYTHON_CMD} build_mozc.py gyp --gypdir=${LOCALBASE}/bin; \
+ ${SED} -i .bak -e "s/sed/gsed/g" Makefile; \
+ ${PYTHON_CMD} build_mozc.py build_tools -c Release; \
+ ${PYTHON_CMD} build_mozc.py build -c Release \
+ server/server.gyp:mozc_server
+
+do-install:
+ @${INSTALL} -o 0 -g 0 -m 555 \
+ ${WRKSRC}/out/Release/mozc_server \
+ ${LOCALBASE}/bin/mozc_server
+
+.include <bsd.port.post.mk>
diff --git a/japanese/mozc-server/distinfo b/japanese/mozc-server/distinfo
new file mode 100644
index 000000000000..8d7eecf7a0cc
--- /dev/null
+++ b/japanese/mozc-server/distinfo
@@ -0,0 +1,6 @@
+MD5 (mozc-0.11.383.102.tar.bz2) = 42e7b57f617b470528dc00be28ccaf28
+SHA256 (mozc-0.11.383.102.tar.bz2) = 69e8a4daf2165d9e2918af1e7a1a26262099ab453578d8c7456301aa8df047a2
+SIZE (mozc-0.11.383.102.tar.bz2) = 34539981
+MD5 (mozcdic-ut-20100617.tar.bz2) = 5433a8a60356846291c7ccf01b96322a
+SHA256 (mozcdic-ut-20100617.tar.bz2) = c9f4c130125cb5bdeee6f7f4790d6c4ca5020b3d98dace6a3baf862d4907c767
+SIZE (mozcdic-ut-20100617.tar.bz2) = 3169864
diff --git a/japanese/mozc-server/files/patch-src_base_iconv.cc b/japanese/mozc-server/files/patch-src_base_iconv.cc
new file mode 100644
index 000000000000..5a928e254b27
--- /dev/null
+++ b/japanese/mozc-server/files/patch-src_base_iconv.cc
@@ -0,0 +1,11 @@
+--- base/iconv.cc.org 2010-06-17 15:59:08.032915669 +0900
++++ base/iconv.cc 2010-06-26 14:52:20.086054034 +0900
+@@ -52,7 +52,7 @@
+ size_t olen_org = olen;
+ iconv(ic, 0, &ilen, 0, &olen); // reset iconv state
+ while (ilen != 0) {
+- if (iconv(ic, reinterpret_cast<char **>(&ibuf), &ilen, &obuf, &olen)
++ if (iconv(ic, (const char **)(&ibuf), &ilen, &obuf, &olen)
+ == static_cast<size_t>(-1)) {
+ return;
+ }
diff --git a/japanese/mozc-server/files/patch-src_base_mutex.h b/japanese/mozc-server/files/patch-src_base_mutex.h
new file mode 100644
index 000000000000..4249feff64fc
--- /dev/null
+++ b/japanese/mozc-server/files/patch-src_base_mutex.h
@@ -0,0 +1,11 @@
+--- base/mutex.h.org 2010-06-17 15:59:08.032915669 +0900
++++ base/mutex.h 2010-06-26 14:42:34.171132724 +0900
+@@ -87,7 +87,7 @@
+ #endif
+
+ #ifdef OS_LINUX
+-#define PTHREAD_MUTEX_RECURSIVE_VALUE PTHREAD_MUTEX_RECURSIVE_NP
++#define PTHREAD_MUTEX_RECURSIVE_VALUE PTHREAD_MUTEX_RECURSIVE
+ #endif
+
+ pthread_mutexattr_t attr;
diff --git a/japanese/mozc-server/files/patch-src_base_process.cc b/japanese/mozc-server/files/patch-src_base_process.cc
new file mode 100644
index 000000000000..9832c2f21642
--- /dev/null
+++ b/japanese/mozc-server/files/patch-src_base_process.cc
@@ -0,0 +1,11 @@
+--- base/process.cc.org 2010-06-17 15:59:08.038677016 +0900
++++ base/process.cc 2010-06-26 15:14:15.207482874 +0900
+@@ -195,7 +195,7 @@
+ #endif
+
+ #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);
diff --git a/japanese/mozc-server/files/patch-src_base_util.cc b/japanese/mozc-server/files/patch-src_base_util.cc
new file mode 100644
index 000000000000..b338a19eb60e
--- /dev/null
+++ b/japanese/mozc-server/files/patch-src_base_util.cc
@@ -0,0 +1,11 @@
+--- base/util.cc.org 2010-06-17 15:59:08.035797879 +0900
++++ base/util.cc 2010-06-26 15:18:24.444371641 +0900
+@@ -1493,7 +1493,7 @@
+ #endif // OS_MACOSX
+
+ #ifdef OS_LINUX
+- return "/usr/lib/mozc";
++ return "@@LOCALBASE@@/bin";
+ #endif // OS_LINUX
+ }
+
diff --git a/japanese/mozc-server/files/patch-src_build_mozc.py b/japanese/mozc-server/files/patch-src_build_mozc.py
new file mode 100644
index 000000000000..ba044b1cad4a
--- /dev/null
+++ b/japanese/mozc-server/files/patch-src_build_mozc.py
@@ -0,0 +1,20 @@
+--- build_mozc.py.org 2010-06-17 15:59:08.104932923 +0900
++++ build_mozc.py 2010-06-26 14:43:42.504687128 +0900
+@@ -68,7 +68,7 @@
+
+ def IsLinux():
+ """Returns true if the platform is Linux."""
+- return os.name == 'posix' and os.uname()[0] == 'Linux'
++ return os.name == 'posix' and os.uname()[0] == 'FreeBSD'
+
+
+ def GetGeneratorName():
+@@ -403,7 +403,7 @@
+ (unused_gyp_file_name, target_name) = ParseTarget(target)
+ target_names.append(target_name)
+
+- make_command = os.getenv('BUILD_COMMAND', 'make')
++ make_command = os.getenv('BUILD_COMMAND', 'gmake')
+ # flags for building in Chrome OS chroot environment
+ envvars = [
+ 'CFLAGS',
diff --git a/japanese/mozc-server/files/patch-src_gyp_common.gypi b/japanese/mozc-server/files/patch-src_gyp_common.gypi
new file mode 100644
index 000000000000..6bd13450d867
--- /dev/null
+++ b/japanese/mozc-server/files/patch-src_gyp_common.gypi
@@ -0,0 +1,15 @@
+--- gyp/common.gypi.org 2010-06-17 15:59:08.053080522 +0900
++++ gyp/common.gypi 2010-06-26 14:48:00.645671527 +0900
+@@ -371,6 +371,12 @@
+ '-lz',
+ '<@(extra_linux_libs)',
+ ],
++ 'include_dirs': [
++ '@@LOCALBASE@@/include'
++ ],
++ 'ldflags': [
++ '-L@@LOCALBASE@@/lib'
++ ],
+ 'conditions': [
+ ['chromeos==1', {
+ 'defines': [
diff --git a/japanese/mozc-server/files/patch-src_ipc_unix_ipc.cc b/japanese/mozc-server/files/patch-src_ipc_unix_ipc.cc
new file mode 100644
index 000000000000..f0e5dfc02654
--- /dev/null
+++ b/japanese/mozc-server/files/patch-src_ipc_unix_ipc.cc
@@ -0,0 +1,29 @@
+--- ipc/unix_ipc.cc.org 2010-06-17 15:59:08.061722403 +0900
++++ ipc/unix_ipc.cc 2010-06-26 14:57:03.788901462 +0900
+@@ -41,7 +41,7 @@
+ #include <sys/time.h>
+ #include <sys/types.h>
+ #include <sys/un.h>
+-#ifdef OS_MACOSX
++#if defined(__FreeBSD__) || defined(OS_MACOSX)
+ #include <sys/ucred.h>
+ #endif
+ #include <sys/wait.h>
+@@ -124,7 +124,7 @@
+ bool IsPeerValid(int socket, pid_t *pid) {
+ *pid = 0;
+
+-#ifdef OS_MACOSX
++#if defined(__FreeBSD__) || defined(OS_MACOSX)
+ // 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);
+@@ -146,7 +146,7 @@
+ *pid = 0;
+ #endif
+
+-#ifdef OS_LINUX
++#if !defined(__FreeBSD__) && defined(OS_LINUX)
+ // On ARM Linux, we do nothing and just return true since the platform (at
+ // least the qemu emulator) doesn't support the getsockopt(sock, SOL_SOCKET,
+ // SO_PEERCRED) system call.
diff --git a/japanese/mozc-server/pkg-descr b/japanese/mozc-server/pkg-descr
new file mode 100644
index 000000000000..a30e9243751e
--- /dev/null
+++ b/japanese/mozc-server/pkg-descr
@@ -0,0 +1,5 @@
+Mozc is a Japanese Input Method Editor (IME) designed for multi-platform
+such as Chromium OS, Windows, Mac and Linux. This open-source project
+originates from Google Japanese Input.
+
+WWW: http://code.google.com/p/mozc/
diff --git a/japanese/mozc-server/pkg-plist b/japanese/mozc-server/pkg-plist
new file mode 100644
index 000000000000..14ad1a4855f7
--- /dev/null
+++ b/japanese/mozc-server/pkg-plist
@@ -0,0 +1 @@
+bin/mozc_server