1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-02 06:03:50 +00:00

Add new port japanese/ibus-mozc

- 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.

Submitted by:	daichi
This commit is contained in:
Daichi GOTO 2010-05-23 08:55:44 +00:00
parent 9b62a2acbc
commit 7b29446529
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=254880
12 changed files with 286 additions and 0 deletions

View File

@ -105,6 +105,7 @@
SUBDIR += hex
SUBDIR += hns
SUBDIR += ibus-anthy
SUBDIR += ibus-mozc
SUBDIR += ibus-skk
SUBDIR += ical
SUBDIR += icanna

View File

@ -0,0 +1,65 @@
# New ports collection makefile for: ibus-mozc
# Date created: 22 May 2010
# Whom: Daichi GOTO <daichi@freebsd.org>
#
# $FreeBSD$
#
PORTNAME= ibus-mozc
PORTVERSION= r23
PORTREVISION= 0
CATEGORIES= japanese
MASTER_SITES= http://people.freebsd.org/~daichi/distfiles/
#MASTER_SITES= ${MASTER_SITE_LOCAL}
#MASTER_SITE_SUBDIR= daichi
DISTFILES= ${PORTNAME}-${PORTVERSION}${EXTRACT_SUFX} \
mozc-temp-icons${EXTRACT_SUFX}
MAINTAINER= daichi@freebsd.org
COMMENT= Mozc engine for IBus
BUILD_DEPENDS= svn:${PORTSDIR}/devel/subversion \
gsed:${PORTSDIR}/textproc/gsed
LIB_DEPENDS= ibus.1:${PORTSDIR}/textproc/ibus \
curl.6:${PORTSDIR}/ftp/curl \
protobuf.6:${PORTSDIR}/devel/protobuf \
gtest.0:${PORTSDIR}/devel/googletest
USE_GNOME= pygtk2
USE_GMAKE= yes
USE_PYTHON= yes
PROJECTHOST= ibus
REPLACE_FILES= src/gyp/common.gypi src/unix/ibus/mozc.xml
post-patch:
@for FILE in ${REPLACE_FILES}; do \
${SED} -i .bak -e "s/@@LOCALBASE@@/${LOCALBASE:S/\//\\\//g}/g" \
${WRKSRC}/$${FILE}; \
done;
do-build:
@cd ${WRKSRC}/src; \
${PYTHON_CMD} build_mozc.py gyp; \
${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 unix/unix.gyp:ibus_mozc
do-install:
@${INSTALL} -o 0 -g 0 -m 555 \
${WRKSRC}/src/out/Release/ibus_mozc \
${LOCALBASE}/libexec/ibus-engine-mozc
@${INSTALL} -o 0 -g 0 -m 444 \
${WRKSRC}/src/unix/ibus/mozc.xml \
${LOCALBASE}/share/ibus/component/mozc.xml
@${MKDIR} ${LOCALBASE}/share/ibus-mozc/icons
@${INSTALL} -o 0 -g 0 -m 444 \
${WRKSRC}/../mozc-temp-icons/mozc-temp-icon.png \
${LOCALBASE}/share/ibus-mozc/icons/mozc-temp-icon.png
post-install:
@${CAT} ${PKGMESSAGE}
@${ECHO} To display this message again, type ${PKG_INFO} -D ${PKGNAME}
.include <bsd.port.mk>

View File

@ -0,0 +1,6 @@
MD5 (ibus-mozc-r23.tar.gz) = 4abc7da6bed900d8ed790e02b1916828
SHA256 (ibus-mozc-r23.tar.gz) = 1ab9ffb1e5370ae832f6394e4c2ef475ba7a95f836a4a76d708b8071f48d7e85
SIZE (ibus-mozc-r23.tar.gz) = 46126617
MD5 (mozc-temp-icons.tar.gz) = 90af4d1def5dc01f268d4ccfe46147aa
SHA256 (mozc-temp-icons.tar.gz) = 32301916983c2b265eb61f6755fd74ac8b12d03d720a693d3bf032bdf149aec1
SIZE (mozc-temp-icons.tar.gz) = 658

View File

@ -0,0 +1,11 @@
--- src/base/iconv.cc.org 2010-05-23 14:02:48.371949634 +0900
+++ src/base/iconv.cc 2010-05-23 13:58:38.727786479 +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;
}

View File

@ -0,0 +1,11 @@
--- src/base/mutex.h.org 2010-05-23 14:03:03.131499800 +0900
+++ src/base/mutex.h 2010-05-23 13:58:38.728786327 +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;

View File

@ -0,0 +1,71 @@
--- src/build_mozc.py.org 2010-05-23 14:03:31.479966714 +0900
+++ src/build_mozc.py 2010-05-23 13:58:56.143361084 +0900
@@ -64,9 +64,9 @@
return os.name == 'posix' and os.uname()[0] == 'Darwin'
-def IsLinux():
- """Returns true if the platform is Linux."""
- return os.name == 'posix' and os.uname()[0] == 'Linux'
+def IsFreeBSD():
+ """Returns true if the platform is FreeBSD."""
+ return os.name == 'posix' and os.uname()[0] == 'FreeBSD'
def GetGeneratorName():
@@ -129,7 +129,7 @@
gyp_file_names.extend(glob.glob('%s/win32/*/*.gyp' % SRC_DIR))
gyp_file_names.extend(glob.glob('third_party/breakpad/*.gyp'))
gyp_file_names.append('third_party/mozc/sandbox/sandbox.gyp')
- elif IsLinux():
+ elif IsFreeBSD():
gyp_file_names.extend(glob.glob('%s/unix/*/*.gyp' % SRC_DIR))
# Add ibus.gyp if ibus is isntalled.
# Ubuntu 8.04 (Hardy) does not contain ibus package.
@@ -192,7 +192,7 @@
elif IsMac():
directory_names.extend(glob.glob(os.path.join(gyp_directory_name,
'*.xcodeproj')))
- elif IsLinux():
+ elif IsFreeBSD():
file_names.extend(glob.glob(os.path.join(gyp_directory_name,
'*.target.mk')))
file_names.append('%s/mozc_version.txt' % SRC_DIR)
@@ -201,7 +201,7 @@
directory_names.append('mozc_build_tools')
if IsMac():
directory_names.append('xcodebuild')
- elif IsLinux():
+ elif IsFreeBSD():
file_names.append('Makefile')
directory_names.append('out')
elif IsWindows():
@@ -374,14 +374,14 @@
return (gyp_file_name, target_name)
-def BuildOnLinux(options, targets):
- """Build the targets on Linux."""
+def BuildOnFreeBSD(options, targets):
+ """Build the targets on FreeBSD."""
target_names = []
for target in targets:
(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',
@@ -530,8 +530,8 @@
if IsMac():
BuildOnMac(options, targets, original_directory_name)
- elif IsLinux():
- BuildOnLinux(options, targets)
+ elif IsFreeBSD():
+ BuildOnFreeBSD(options, targets)
elif IsWindows():
BuildOnWindows(options, targets, original_directory_name)
else:

View File

@ -0,0 +1,11 @@
--- src/gyp/common.gypi.org 2010-05-23 14:03:58.827531279 +0900
+++ src/gyp/common.gypi 2010-05-23 13:58:38.441081884 +0900
@@ -420,6 +420,8 @@
'-lssl',
'-lz',
],
+ 'include_dirs': [ '@@LOCALBASE@@/include' ],
+ 'ldflags': [ '-L@@LOCALBASE@@/lib' ],
'conditions': [
['chromeos==1', {
'defines': [

View File

@ -0,0 +1,36 @@
--- src/ipc/unix_ipc.cc.org 2010-05-23 14:04:22.558128045 +0900
+++ src/ipc/unix_ipc.cc 2010-05-23 13:58:38.472786193 +0900
@@ -41,7 +41,7 @@
#include <sys/time.h>
#include <sys/types.h>
#include <sys/un.h>
-#ifdef OS_MACOSX
+#ifdef __FreeBSD__
#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
+#ifdef __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);
@@ -146,6 +146,7 @@
*pid = 0;
#endif
+/*
#ifdef 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,
@@ -172,6 +171,7 @@
*pid = peer_cred.pid;
#endif // __arm__
#endif
+*/
return true;
}

View File

@ -0,0 +1,29 @@
--- src/unix/ibus/mozc.xml.org 2010-05-23 14:00:13.346604513 +0900
+++ src/unix/ibus/mozc.xml 2010-05-23 13:38:30.173956314 +0900
@@ -2,7 +2,7 @@
<component>
<name>com.google.IBus.Mozc</name>
<description>Mozc Component</description>
- <exec>/usr/libexec/ibus-engine-mozc --ibus</exec>
+ <exec>@@LOCALBASE@@/libexec/ibus-engine-mozc --ibus</exec>
<!-- TODO(mazda): Generate the version number -->
<version>0.0.0.0</version>
<author>Google Inc.</author>
@@ -15,7 +15,7 @@
<language>ja</language>
<license>New BSD</license>
<author>Google Inc.</author>
- <icon>/usr/share/ibus-mozc/product_icon.png</icon>
+ <icon>@@LOCALBASE@@/share/ibus-mozc/icons/mozc-temp-icon.png</icon>
<layout>us</layout>
<longname>Mozc (US keyboard layout)</longname>
<description>Mozc Japanese input method</description>
@@ -26,7 +26,7 @@
<language>ja</language>
<license>New BSD</license>
<author>Google Inc.</author>
- <icon>/usr/share/ibus-mozc/product_icon.png</icon>
+ <icon>@@LOCALBASE@@/share/ibus-mozc/icons/mozc-temp-icon.png</icon>
<layout>jp</layout>
<longname>Mozc (Japanese keyboard layout)</longname>
<description>Mozc Japanese input method</description>

View File

@ -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/

View File

@ -0,0 +1,35 @@
ibus-mozc installation finished. To use ibus-mozc, please do the following:
If you are using bash or zsh, please add following lines to your $HOME/.bashrc or
$HOME/.zshrc:
export XIM=ibus
export GTK_IM_MODULE=ibus
export QT_IM_MODULE=xim
export XMODIFIERS=@im=ibus
export XIM_PROGRAM="ibus-daemon"
export XIM_ARGS="-r --daemonize --xim"
If you are using tcsh, please add following lines to your $HOME/.cshrc:
setenv XIM ibus
setenv GTK_IM_MODULE ibus
setenv QT_IM_MODULE xim
setenv XMODIFIERS @im=ibus
setenv XIM_PROGRAM ibus-daemon
setenv XIM_ARGS "-r --daemonize --xim"
If you are using KDE4, you may create a shell script in $HOME/.kde4/env,
and add following lines:
#!/bin/sh
export XIM=ibus
export GTK_IM_MODULE=ibus
export QT_IM_MODULE=xim
export XMODIFIERS=@im=ibus
export XIM_PROGRAM="ibus-daemon"
export XIM_ARGS="-r --daemonize --xim"
If ibus cannot start or the panel does not appear, please ensure
that you are using up-to-date python.
There's a bug in python 2.5, which may prevent the panel from appearing.

View File

@ -0,0 +1,5 @@
libexec/ibus-engine-mozc
share/ibus/component/mozc.xml
share/ibus-mozc/icons/mozc-temp-icon.png
@dirrm share/ibus-mozc/icons
@dirrm share/ibus-mozc