- fixed a gcc 4.2.1 's namespace bug. Now mozc can build
himself using the system's default gcc. - removed the dependency for external gyp - removed the gsed dependency - removed the gnugrep dependency - refined the mozc relative ports Feature safe: yes Submitted by: hrs
This commit is contained in:
parent
64383248c8
commit
50c0c232c7
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=287265
69 changed files with 219 additions and 1604 deletions
|
@ -7,7 +7,7 @@
|
|||
|
||||
PORTNAME= gyp
|
||||
PORTVERSION= r832
|
||||
PORTREVISION= 1
|
||||
PORTREVISION= 2
|
||||
CATEGORIES= devel python
|
||||
MASTER_SITES= http://people.freebsd.org/~daichi/distfiles/
|
||||
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
|
||||
|
@ -15,20 +15,8 @@ PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
|
|||
MAINTAINER= daichi@FreeBSD.org
|
||||
COMMENT= Generate Your Projects
|
||||
|
||||
RUN_DEPENDS= gsed:${PORTSDIR}/textproc/gsed \
|
||||
${LOCALBASE}/bin/grep:${PORTSDIR}/textproc/gnugrep
|
||||
|
||||
USE_PYTHON= yes
|
||||
USE_PYDISTUTILS= yes
|
||||
PYDISTUTILS_PKGVERSION= 0.1
|
||||
|
||||
REPLACE_FILES= ${WRKSRC}/pylib/gyp/generator/make.py
|
||||
|
||||
post-patch:
|
||||
@for FILE in ${REPLACE_FILES}; \
|
||||
do \
|
||||
${SED} -i .bak -e "s/@@LOCALBASE@@/${LOCALBASE:S/\//\\\//g}/g" \
|
||||
$${FILE}; \
|
||||
done;
|
||||
|
||||
.include <bsd.port.mk>
|
||||
|
|
|
@ -1,21 +1,11 @@
|
|||
--- pylib/gyp/generator/make.py.org 2010-09-03 18:36:39.151835296 +0900
|
||||
+++ pylib/gyp/generator/make.py 2010-09-03 18:55:43.973773838 +0900
|
||||
@@ -177,14 +177,14 @@
|
||||
r"""
|
||||
define fixup_dep
|
||||
# Fixup path as in (1).
|
||||
-sed -e "s|^$(notdir $@)|$@|" $(depfile).raw >> $(depfile)
|
||||
+gsed -e "s|^$(notdir $@)|$@|" $(depfile).raw >> $(depfile)
|
||||
# Add extra rules as in (2).
|
||||
--- pylib/gyp/generator/make.py.orig 2010-06-26 08:55:39.000000000 +0900
|
||||
+++ pylib/gyp/generator/make.py 2011-12-11 22:54:34.000000000 +0900
|
||||
@@ -182,7 +182,7 @@
|
||||
# We remove slashes and replace spaces with new lines;
|
||||
# remove blank lines;
|
||||
# delete the first line and append a colon to the remaining lines.
|
||||
-sed -e 's|\\||' -e 's| |\n|g' $(depfile).raw |\
|
||||
- grep -v '^$$' |\
|
||||
- sed -e 1d -e 's|$$|:|' \
|
||||
+gsed -e 's|\\||' -e 's| |\n|g' $(depfile).raw |\
|
||||
+ @@LOCALBASE@@/bin/grep -E -v '^$$' |\
|
||||
+ gsed -e 1d -e 's|$$|:|' \
|
||||
+env NL=`printf "\n"` sed -e 's|\\||' -e 's| |${NL}|g' $(depfile).raw |\
|
||||
grep -v '^$$' |\
|
||||
sed -e 1d -e 's|$$|:|' \
|
||||
>> $(depfile)
|
||||
rm $(depfile).raw
|
||||
endef
|
||||
|
|
|
@ -5,131 +5,17 @@
|
|||
# $FreeBSD$
|
||||
#
|
||||
|
||||
PORTNAME= ibus-mozc
|
||||
PORTVERSION= 1.3.911.102
|
||||
PORTREVISION= 0
|
||||
CATEGORIES= japanese
|
||||
MASTER_SITES= http://mozc.googlecode.com/files/
|
||||
DISTNAME= mozc-${PORTVERSION}
|
||||
DISTFILES= ${DISTNAME}.tar.bz2
|
||||
|
||||
MAINTAINER= daichi@FreeBSD.org
|
||||
PKGNAMEPREFIX= ja-ibus-
|
||||
COMMENT= Mozc engine for IBus
|
||||
DATADIR= ${PREFIX}/share/ibus-${PORTNAME}
|
||||
|
||||
BUILD_DEPENDS= gsed:${PORTSDIR}/textproc/gsed \
|
||||
${LOCALBASE}/bin/grep:${PORTSDIR}/textproc/gnugrep \
|
||||
gyp:${PORTSDIR}/devel/py-gyp-devel
|
||||
LIB_DEPENDS= curl.6:${PORTSDIR}/ftp/curl \
|
||||
gtest.0:${PORTSDIR}/devel/googletest \
|
||||
ibus.2:${PORTSDIR}/textproc/ibus \
|
||||
protobuf.7:${PORTSDIR}/devel/protobuf \
|
||||
zinnia.0:${PORTSDIR}/japanese/zinnia
|
||||
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 \
|
||||
xdg-open:${PORTSDIR}/devel/xdg-utils
|
||||
MASTERDIR= ${.CURDIR}/../../japanese/mozc-server
|
||||
PKGMESSAGE= ${.CURDIR}/pkg-message
|
||||
|
||||
PROJECTHOST= ibus
|
||||
USE_ICONV= yes
|
||||
USE_GNOME= pygtk2
|
||||
USE_GMAKE= yes
|
||||
USE_PYTHON= yes
|
||||
|
||||
.include <bsd.port.pre.mk>
|
||||
|
||||
.if ${OSVERSION} < 800107
|
||||
BROKEN= Does not compile on FreeBSD 7.X
|
||||
.endif
|
||||
|
||||
.if ${ARCH} == "ia64" || ${ARCH} == "powerpc" || ${ARCH} == "sparc64"
|
||||
BROKEN= Does not compile: segfault
|
||||
.endif
|
||||
|
||||
# workaround for a gcc4.2.1's namespace bug
|
||||
.if (${OSVERSION} < 1000000 && ${OSVERSION} > 9000000) || ${OSVERSION} < 802503
|
||||
BUILD_DEPENDS+= gcc42:${PORTSDIR}/lang/gcc42
|
||||
CC= gcc42
|
||||
CXX= g++42
|
||||
.endif
|
||||
|
||||
.if defined(WITH_DEBUG_CODE)
|
||||
BUILD_MODE= Debug
|
||||
.else
|
||||
BUILD_MODE= Release
|
||||
.endif
|
||||
|
||||
LOCALBASE_REPLACE_FILES= \
|
||||
${WRKSRC}/build_mozc.py \
|
||||
${WRKSRC}/gyp/common.gypi \
|
||||
${WRKSRC}/unix/ibus/gen_mozc_xml.py \
|
||||
${WRKSRC}/unix/ibus/mozc.xml \
|
||||
${WRKSRC}/unix/ibus/path_util.cc \
|
||||
${WRKSRC}/base/util.cc \
|
||||
${WRKSRC}/base/process.cc \
|
||||
${WRKSRC}/handwriting/zinnia_handwriting.cc
|
||||
|
||||
post-patch:
|
||||
@for FILE in ${LOCALBASE_REPLACE_FILES}; \
|
||||
do \
|
||||
${SED} -i .bak -e "s/@@LOCALBASE@@/${LOCALBASE:S/\//\\\//g}/g" \
|
||||
$${FILE}; \
|
||||
done;
|
||||
|
||||
do-build:
|
||||
@cd ${WRKSRC}/; \
|
||||
export BUILD_COMMAND=${GMAKE}; \
|
||||
export CC=${CC}; export CFLAGS="${CFLAGS}"; \
|
||||
export CXX=${CXX}; export CXXFLAGS="${CXXFLAGS}"; \
|
||||
export LDFLAGS="-L${LOCALBASE}/lib"; \
|
||||
${PYTHON_CMD} build_mozc.py gyp --gypdir=${LOCALBASE}/bin; \
|
||||
${PYTHON_CMD} build_mozc.py build_tools \
|
||||
-c ${BUILD_MODE}; \
|
||||
${PYTHON_CMD} build_mozc.py build \
|
||||
-c ${BUILD_MODE} \
|
||||
unix/ibus/ibus.gyp:ibus_mozc
|
||||
|
||||
do-install:
|
||||
@${INSTALL} -o 0 -g 0 -m 555 \
|
||||
${WRKSRC}/out_linux/${BUILD_MODE}/ibus_mozc \
|
||||
${LOCALBASE}/libexec/ibus-engine-mozc
|
||||
@${INSTALL} -o 0 -g 0 -m 444 \
|
||||
${WRKSRC}/unix/ibus/mozc.xml \
|
||||
${LOCALBASE}/share/ibus/component/mozc.xml
|
||||
@${MKDIR} ${LOCALBASE}/share/ibus-mozc/icons
|
||||
@${INSTALL} -o 0 -g 0 -m 444 \
|
||||
${WRKSRC}/data/images/unix/ui-alpha_full.png \
|
||||
${LOCALBASE}/share/ibus-mozc/icons/alpha_full.png
|
||||
@${INSTALL} -o 0 -g 0 -m 444 \
|
||||
${WRKSRC}/data/images/unix/ui-alpha_half.png \
|
||||
${LOCALBASE}/share/ibus-mozc/icons/alpha_half.png
|
||||
@${INSTALL} -o 0 -g 0 -m 444 \
|
||||
${WRKSRC}/data/images/unix/ui-dictionary.png \
|
||||
${LOCALBASE}/share/ibus-mozc/icons/dictionary.png
|
||||
@${INSTALL} -o 0 -g 0 -m 444 \
|
||||
${WRKSRC}/data/images/unix/ui-direct.png \
|
||||
${LOCALBASE}/share/ibus-mozc/icons/direct.png
|
||||
@${INSTALL} -o 0 -g 0 -m 444 \
|
||||
${WRKSRC}/data/images/unix/ui-hiragana.png \
|
||||
${LOCALBASE}/share/ibus-mozc/icons/hiragana.png
|
||||
@${INSTALL} -o 0 -g 0 -m 444 \
|
||||
${WRKSRC}/data/images/unix/ui-katakana_full.png \
|
||||
${LOCALBASE}/share/ibus-mozc/icons/katakana_full.png
|
||||
@${INSTALL} -o 0 -g 0 -m 444 \
|
||||
${WRKSRC}/data/images/unix/ui-katakana_half.png \
|
||||
${LOCALBASE}/share/ibus-mozc/icons/katakana_half.png
|
||||
@${INSTALL} -o 0 -g 0 -m 444 \
|
||||
${WRKSRC}/data/images/unix/ime_product_icon_opensource-32.png \
|
||||
${LOCALBASE}/share/ibus-mozc/icons/product_logo.png
|
||||
@${INSTALL} -o 0 -g 0 -m 444 \
|
||||
${WRKSRC}/data/images/unix/ui-properties.png \
|
||||
${LOCALBASE}/share/ibus-mozc/icons/properties.png
|
||||
@${INSTALL} -o 0 -g 0 -m 444 \
|
||||
${WRKSRC}/data/images/unix/ui-tool.png \
|
||||
${LOCALBASE}/share/ibus-mozc/icons/tool.png
|
||||
BUILD_MOZC_LIST= ibus_mozc
|
||||
|
||||
post-install:
|
||||
@${CAT} ${PKGMESSAGE}
|
||||
@${ECHO} To display this message again, type ${PKG_INFO} -D ${PKGNAME}
|
||||
@${ECHO_CMD} To display this message again, type ${PKG_INFO} -D ${PKGNAME}
|
||||
|
||||
.include <bsd.port.post.mk>
|
||||
.include "${MASTERDIR}/Makefile"
|
||||
|
|
|
@ -1,2 +0,0 @@
|
|||
SHA256 (mozc-1.3.911.102.tar.bz2) = da27945d6732e4fc70c08534cc8d10cd23d6fba5ebc52e6b31cac5d04ba1588a
|
||||
SIZE (mozc-1.3.911.102.tar.bz2) = 39180652
|
|
@ -1,14 +0,0 @@
|
|||
--- base/iconv.cc.orig 2011-12-04 16:22:26.109606820 +0900
|
||||
+++ base/iconv.cc 2011-12-04 16:46:50.884607344 +0900
|
||||
@@ -52,7 +52,11 @@
|
||||
size_t olen_org = olen;
|
||||
iconv(ic, 0, &ilen, 0, &olen); // reset iconv state
|
||||
while (ilen != 0) {
|
||||
+#ifdef __FreeBSD__
|
||||
+ if (iconv(ic, (const char **)(&ibuf), &ilen, &obuf, &olen)
|
||||
+#else
|
||||
if (iconv(ic, reinterpret_cast<char **>(&ibuf), &ilen, &obuf, &olen)
|
||||
+#endif
|
||||
== static_cast<size_t>(-1)) {
|
||||
return;
|
||||
}
|
|
@ -1,21 +0,0 @@
|
|||
--- base/logging.cc.orig 2011-12-04 16:22:26.116610643 +0900
|
||||
+++ base/logging.cc 2011-12-04 19:57:28.052770432 +0900
|
||||
@@ -212,7 +212,7 @@
|
||||
char buf[512];
|
||||
snprintf(buf, sizeof(buf),
|
||||
"%4.4d-%2.2d-%2.2d %2.2d:%2.2d:%2.2d %u "
|
||||
-#ifndef OS_LINUX // = OS_WINDOWS or OS_MACOSX
|
||||
+#if !defined(OS_LINUX) && !defined(__FreeBSD__) // = OS_WINDOWS or OS_MACOSX
|
||||
"%u",
|
||||
#else
|
||||
"%lu",
|
||||
@@ -229,6 +229,9 @@
|
||||
#elif defined(OS_MACOSX)
|
||||
::getpid(),
|
||||
reinterpret_cast<uint32>(pthread_self())
|
||||
+#elif defined(__FreeBSD__)
|
||||
+ ::getpid(),
|
||||
+ (uint64_t)pthread_self()
|
||||
#else // = OS_LINUX
|
||||
::getpid(),
|
||||
pthread_self() // returns unsigned long.
|
|
@ -1,16 +0,0 @@
|
|||
--- base/mutex.h.orig 2011-12-04 16:22:26.106606369 +0900
|
||||
+++ base/mutex.h 2011-12-04 16:46:50.658605855 +0900
|
||||
@@ -82,11 +82,11 @@
|
||||
// PTHREAD_MUTEX_RECURSIVE_NP and PTHREAD_MUTEX_RECURSIVE seem to be
|
||||
// variants. For example, Mac OS X 10.4 had
|
||||
// PTHREAD_MUTEX_RECURSIVE_NP but Mac OS X 10.5 does not
|
||||
-#ifdef OS_MACOSX
|
||||
+#if defined(OS_MACOSX) || defined(__FreeBSD__)
|
||||
#define PTHREAD_MUTEX_RECURSIVE_VALUE PTHREAD_MUTEX_RECURSIVE
|
||||
#endif
|
||||
|
||||
-#ifdef OS_LINUX
|
||||
+#if defined(OS_LINUX) && !defined(__FreeBSD__)
|
||||
#define PTHREAD_MUTEX_RECURSIVE_VALUE PTHREAD_MUTEX_RECURSIVE_NP
|
||||
#endif
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
--- base/process.cc.orig 2011-12-04 16:22:26.103607664 +0900
|
||||
+++ base/process.cc 2011-12-04 16:46:51.045606717 +0900
|
||||
@@ -120,13 +120,18 @@
|
||||
return ShellExecuteInSystemDir(L"open", wurl.c_str(), NULL, SW_SHOW);
|
||||
#endif
|
||||
|
||||
-#ifdef OS_LINUX
|
||||
+#if defined(OS_LINUX) && !defined(__FreeBSD__)
|
||||
static const char kBrowserCommand[] = "/usr/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
|
|
@ -1,17 +0,0 @@
|
|||
--- base/util.cc.orig 2011-12-04 16:22:26.112610903 +0900
|
||||
+++ base/util.cc 2011-12-04 16:46:50.958606064 +0900
|
||||
@@ -2592,9 +2592,13 @@
|
||||
return MacUtil::GetServerDirectory();
|
||||
#endif // OS_MACOSX
|
||||
|
||||
-#ifdef OS_LINUX
|
||||
+#if defined(OS_LINUX) && !defined(__FreeBSD__)
|
||||
return "/usr/lib/mozc";
|
||||
#endif // OS_LINUX
|
||||
+
|
||||
+#ifdef __FreeBSD__
|
||||
+ return "@@LOCALBASE@@/bin";
|
||||
+#endif
|
||||
}
|
||||
|
||||
string Util::GetDocumentDirectory() {
|
|
@ -1,11 +0,0 @@
|
|||
--- build_mozc.py.orig 2011-12-04 16:22:26.517605881 +0900
|
||||
+++ build_mozc.py 2011-12-04 16:46:51.189606024 +0900
|
||||
@@ -70,7 +70,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] == 'Linux' or os.uname()[0] == 'FreeBSD' )
|
||||
|
||||
|
||||
# TODO(yukawa): Move this function to util.py (b/2715400)
|
|
@ -1,11 +0,0 @@
|
|||
--- build_tools/mozc_version.py.orig 2011-12-04 16:22:26.211608471 +0900
|
||||
+++ build_tools/mozc_version.py 2011-12-04 16:35:15.156605950 +0900
|
||||
@@ -56,7 +56,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] == 'Linux' or os.uname()[0] == 'FreeBSD' )
|
||||
|
||||
|
||||
def CalculateRevisionForPlatform(revision, target_platform):
|
|
@ -1,14 +0,0 @@
|
|||
--- gui/about_dialog/about_dialog.cc.orig 2011-12-04 16:22:26.291606976 +0900
|
||||
+++ gui/about_dialog/about_dialog.cc 2011-12-04 16:44:21.340606780 +0900
|
||||
@@ -119,7 +119,11 @@
|
||||
SetLabelText(label_terms);
|
||||
SetLabelText(label_credits);
|
||||
|
||||
+#ifdef __FreeBSD__
|
||||
+ product_image_.reset(new QImage("@@LOCALBASE@@/share/mozc-tool/icons/product_logo.png"));
|
||||
+#else
|
||||
product_image_.reset(new QImage(":/product_logo.png"));
|
||||
+#endif
|
||||
}
|
||||
|
||||
void AboutDialog::paintEvent(QPaintEvent *event) {
|
|
@ -1,15 +0,0 @@
|
|||
--- gyp/common.gypi.orig 2011-12-04 16:22:26.257607334 +0900
|
||||
+++ gyp/common.gypi 2011-12-04 16:46:48.756621873 +0900
|
||||
@@ -512,6 +512,12 @@
|
||||
# <unordered_map> and <unordered_set>.
|
||||
'-Wno-deprecated',
|
||||
],
|
||||
+ 'include_dirs': [
|
||||
+ '@@LOCALBASE@@/include'
|
||||
+ ],
|
||||
+ 'ldflags': [
|
||||
+ '-L@@LOCALBASE@@/lib'
|
||||
+ ],
|
||||
'link_settings': {
|
||||
'libraries': [
|
||||
'<@(linux_libs)',
|
|
@ -1,19 +0,0 @@
|
|||
--- handwriting/zinnia_handwriting.cc.orig 2011-12-04 22:26:40.226138013 +0900
|
||||
+++ handwriting/zinnia_handwriting.cc 2011-12-04 22:27:01.145136587 +0900
|
||||
@@ -49,10 +49,16 @@
|
||||
const char kModelFile[] = "handwriting-light-ja.model";
|
||||
return Util::JoinPath(MacUtil::GetResourcesDirectory(), kModelFile);
|
||||
#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";
|
||||
return kModelFile;
|
||||
+#endif
|
||||
#else
|
||||
const char kModelFile[] = "handwriting-ja.model";
|
||||
return Util::JoinPath(Util::GetServerDirectory(), kModelFile);
|
|
@ -1,11 +0,0 @@
|
|||
--- ipc/ipc_path_manager.cc.orig 2011-12-04 16:22:26.515606954 +0900
|
||||
+++ ipc/ipc_path_manager.cc 2011-12-04 16:46:51.134605388 +0900
|
||||
@@ -274,7 +274,7 @@
|
||||
*ipc_name = kIPCPrefix;
|
||||
#endif // OS_WINDOWS
|
||||
|
||||
-#ifdef OS_LINUX
|
||||
+#if defined(OS_LINUX) && !defined(__FreeBSD__)
|
||||
// On Linux, use abstract namespace which is independent of the file system.
|
||||
(*ipc_name)[0] = '\0';
|
||||
#endif
|
|
@ -1,65 +0,0 @@
|
|||
--- ipc/unix_ipc.cc.orig 2011-12-04 16:22:26.515606954 +0900
|
||||
+++ ipc/unix_ipc.cc 2011-12-04 16:46:51.120605285 +0900
|
||||
@@ -41,7 +41,7 @@
|
||||
#include <sys/time.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/un.h>
|
||||
-#ifdef OS_MACOSX
|
||||
+#if defined(OS_MACOSX) || defined(__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
|
||||
+#if defined(OS_MACOSX) || defined(__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,7 +146,7 @@
|
||||
*pid = 0;
|
||||
#endif
|
||||
|
||||
-#ifdef OS_LINUX
|
||||
+#if defined(OS_LINUX) && !defined(__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.
|
||||
@@ -309,7 +309,7 @@
|
||||
address.sun_family = AF_UNIX;
|
||||
::memcpy(address.sun_path, server_address.data(), server_address_length);
|
||||
address.sun_path[server_address_length] = '\0';
|
||||
-#ifdef OS_MACOSX
|
||||
+#if defined(OS_MACOSX) || defined(__FreeBSD__)
|
||||
address.sun_len = SUN_LEN(&address);
|
||||
const size_t sun_len = sizeof(address);
|
||||
#else
|
||||
@@ -429,21 +429,21 @@
|
||||
SO_REUSEADDR,
|
||||
reinterpret_cast<char *>(&on),
|
||||
sizeof(on));
|
||||
-#ifdef OS_MACOSX
|
||||
+#if defined(OS_MACOSX) || defined(__FreeBSD__)
|
||||
addr.sun_len = SUN_LEN(&addr);
|
||||
const size_t sun_len = sizeof(addr);
|
||||
#else
|
||||
const size_t sun_len = sizeof(addr.sun_family) + server_address_.size();
|
||||
#endif
|
||||
- if (!IsAbstractSocket(server_address_)) {
|
||||
- // Linux does not use files for IPC.
|
||||
- ::chmod(server_address_.c_str(), 0600);
|
||||
- }
|
||||
if (::bind(socket_, reinterpret_cast<sockaddr *>(&addr), sun_len) != 0) {
|
||||
// The UNIX domain socket file (server_address_) already exists?
|
||||
LOG(FATAL) << "bind() failed: " << strerror(errno);
|
||||
return;
|
||||
}
|
||||
+ if (!IsAbstractSocket(server_address_)) {
|
||||
+ // Linux does not use files for IPC.
|
||||
+ ::chmod(server_address_.c_str(), 0600);
|
||||
+ }
|
||||
|
||||
if (::listen(socket_, num_connections) < 0) {
|
||||
LOG(FATAL) << "listen() failed: " << strerror(errno);
|
|
@ -1,49 +0,0 @@
|
|||
--- server/mozc_server.cc.orig 2011-12-04 16:22:26.174607330 +0900
|
||||
+++ server/mozc_server.cc 2011-12-04 16:43:55.914606129 +0900
|
||||
@@ -32,6 +32,9 @@
|
||||
#ifdef OS_WINDOWS
|
||||
#include <windows.h>
|
||||
#endif
|
||||
+#ifdef __FreeBSD__
|
||||
+#include <signal.h>
|
||||
+#endif
|
||||
|
||||
#include "base/base.h"
|
||||
#include "base/process.h"
|
||||
@@ -50,6 +53,23 @@
|
||||
mozc::SessionServer *g_session_server = NULL;
|
||||
}
|
||||
|
||||
+#ifdef __FreeBSD__
|
||||
+static void sig_func(int num)
|
||||
+{
|
||||
+ VLOG(1) << "signal " << num << " recieved.";
|
||||
+ switch (num) {
|
||||
+ case SIGINT:
|
||||
+ case SIGHUP:
|
||||
+ case SIGTERM:
|
||||
+ if (g_session_server)
|
||||
+ g_session_server->Terminate();
|
||||
+ break;
|
||||
+ default:
|
||||
+ break;
|
||||
+ }
|
||||
+}
|
||||
+#endif
|
||||
+
|
||||
namespace mozc {
|
||||
namespace {
|
||||
|
||||
@@ -132,6 +152,12 @@
|
||||
return -1;
|
||||
}
|
||||
|
||||
+#ifdef __FreeBSD__
|
||||
+ ::signal(SIGINT, sig_func);
|
||||
+ ::signal(SIGHUP, sig_func);
|
||||
+ ::signal(SIGTERM, sig_func);
|
||||
+#endif
|
||||
+
|
||||
#if defined(OS_WINDOWS)
|
||||
// On Windows, ShutdownSessionCallback is not called intentionally in order
|
||||
// to avoid crashes oritinates from it. See b/2696087.
|
|
@ -1,35 +0,0 @@
|
|||
--- unix/ibus/gen_mozc_xml.py.orig 2011-12-04 16:22:26.122609031 +0900
|
||||
+++ unix/ibus/gen_mozc_xml.py 2011-12-04 16:35:15.333604982 +0900
|
||||
@@ -39,6 +39,7 @@
|
||||
|
||||
import optparse
|
||||
import sys
|
||||
+import os
|
||||
|
||||
# Information to generate <component> part of mozc.xml. %s will be replaced with
|
||||
# a product name, 'Mozc' or 'Google Japanese Input'.
|
||||
@@ -64,6 +65,24 @@
|
||||
'rank': '80',
|
||||
}
|
||||
|
||||
+if os.uname()[0] == 'FreeBSD':
|
||||
+ IBUS_COMPONENT_PROPS = {
|
||||
+ 'name': 'com.google.IBus.Mozc',
|
||||
+ 'description': '%s Component',
|
||||
+ 'exec': '@@LOCALBASE@@/libexec/ibus-engine-mozc --ibus',
|
||||
+ 'version': '0.0.0.0',
|
||||
+ 'author': 'Google Inc.',
|
||||
+ 'license': 'New BSD',
|
||||
+ 'homepage': 'http://code.google.com/p/mozc/',
|
||||
+ 'textdomain': 'ibus-mozc',
|
||||
+ }
|
||||
+ IBUS_ENGINE_COMMON_PROPS = {
|
||||
+ 'description': '%s (Japanese Input Method)',
|
||||
+ 'language': 'ja',
|
||||
+ 'icon': '@@LOCALBASE@@/share/ibus-mozc/icons/product_logo.png',
|
||||
+ 'rank': '0',
|
||||
+ }
|
||||
+
|
||||
# A dictionary from --platform to engines that are used in the platform. The
|
||||
# information is used to generate <engines> part of mozc.xml.
|
||||
IBUS_ENGINES_PROPS = {
|
|
@ -1,24 +0,0 @@
|
|||
--- unix/ibus/mozc.xml.orig 1970-01-01 09:00:00.000000000 +0900
|
||||
+++ unix/ibus/mozc.xml 2011-12-04 16:04:42.283606379 +0900
|
||||
@@ -0,0 +1,21 @@
|
||||
+<component>
|
||||
+ <name>com.google.IBus.Mozc</name>
|
||||
+ <description>Mozc Component</description>
|
||||
+ <exec>@@LOCALBASE@@/libexec/ibus-engine-mozc --ibus</exec>
|
||||
+ <version>0.0.0.0</version>
|
||||
+ <author>Google Inc.</author>
|
||||
+ <license>New BSD</license>
|
||||
+ <homepage>http://code.google.com/p/mozc/</homepage>
|
||||
+ <textdomain>ibus-mozc</textdomain>
|
||||
+ <engines>
|
||||
+ <engine>
|
||||
+ <rank>0</rank>
|
||||
+ <description>Mozc (Japanese Input Method)</description>
|
||||
+ <language>ja</language>
|
||||
+ <icon>@@LOCALBASE@@/share/ibus-mozc/icons/product_logo.png</icon>
|
||||
+ <layout>jp</layout>
|
||||
+ <name>mozc-jp</name>
|
||||
+ <longname>Mozc</longname>
|
||||
+ </engine>
|
||||
+ </engines>
|
||||
+</component>
|
|
@ -1,25 +0,0 @@
|
|||
--- unix/ibus/path_util.cc.orig 2011-12-04 16:22:26.124607888 +0900
|
||||
+++ unix/ibus/path_util.cc 2011-12-04 16:35:15.354607302 +0900
|
||||
@@ -30,14 +30,22 @@
|
||||
#include "unix/ibus/path_util.h"
|
||||
|
||||
namespace {
|
||||
+#ifdef __FreeBSD__
|
||||
+const char kInstalledDirectory[] = "@@LOCALBASE@@/share/ibus-mozc";
|
||||
+#else
|
||||
const char kInstalledDirectory[] = "/usr/share/ibus-mozc";
|
||||
+#endif
|
||||
}
|
||||
|
||||
namespace mozc {
|
||||
namespace ibus {
|
||||
|
||||
string GetIconPath(const string &icon_file) {
|
||||
+#ifdef __FreeBSD__
|
||||
+ return string("@@LOCALBASE@@/share/ibus-mozc/icons/") + icon_file;
|
||||
+#else
|
||||
return kInstalledDirectory + string("/") + icon_file;
|
||||
+#endif
|
||||
}
|
||||
|
||||
} // namespace ibus
|
|
@ -1,11 +0,0 @@
|
|||
--- unix/scim/scim.gyp.orig 2011-12-04 16:22:26.127609806 +0900
|
||||
+++ unix/scim/scim.gyp 2011-12-04 16:39:02.023609368 +0900
|
||||
@@ -39,7 +39,7 @@
|
||||
'gtk+-2.0',
|
||||
],
|
||||
'scim_defines': [
|
||||
- 'SCIM_ICONDIR="<!@(<(pkg_config_command) --variable=icondir scim)"',
|
||||
+ 'SCIM_ICONDIR="@@LOCALBASE@@/share/scim-mozc/icons/"',
|
||||
]
|
||||
},
|
||||
'targets': [
|
|
@ -1,5 +0,0 @@
|
|||
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/
|
|
@ -1,14 +0,0 @@
|
|||
libexec/ibus-engine-mozc
|
||||
share/ibus/component/mozc.xml
|
||||
share/ibus-mozc/icons/alpha_full.png
|
||||
share/ibus-mozc/icons/alpha_half.png
|
||||
share/ibus-mozc/icons/dictionary.png
|
||||
share/ibus-mozc/icons/direct.png
|
||||
share/ibus-mozc/icons/hiragana.png
|
||||
share/ibus-mozc/icons/katakana_full.png
|
||||
share/ibus-mozc/icons/katakana_half.png
|
||||
share/ibus-mozc/icons/product_logo.png
|
||||
share/ibus-mozc/icons/properties.png
|
||||
share/ibus-mozc/icons/tool.png
|
||||
@dirrm share/ibus-mozc/icons
|
||||
@dirrm share/ibus-mozc
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
PORTNAME= mozc-additions
|
||||
PORTVERSION= 1.3.911.102
|
||||
PORTREVISION= 0
|
||||
PORTREVISION= 1
|
||||
CATEGORIES= japanese
|
||||
MASTER_SITES= http://people.freebsd.org/~daichi/distfiles/
|
||||
|
||||
|
@ -16,13 +16,11 @@ COMMENT= Additional tools and images for Mozc Japanese Input Method
|
|||
|
||||
NO_BUILD= yes
|
||||
LOCALBASE_REPLACE_FILES= \
|
||||
${WRKSRC}/Makefile
|
||||
Makefile
|
||||
|
||||
post-patch:
|
||||
@for FILE in ${LOCALBASE_REPLACE_FILES}; \
|
||||
do \
|
||||
${SED} -i .bak -e "s/@@LOCALBASE@@/${LOCALBASE:S/\//\\\//g}/g" \
|
||||
$${FILE}; \
|
||||
done;
|
||||
cd ${WRKSRC} && \
|
||||
${REINPLACE_CMD} "s/@@LOCALBASE@@/${LOCALBASE:S/\//\\\//g}/g" \
|
||||
${LOCALBASE_REPLACE_FILES}
|
||||
|
||||
.include <bsd.port.mk>
|
||||
|
|
|
@ -5,30 +5,38 @@
|
|||
# $FreeBSD$
|
||||
#
|
||||
|
||||
PORTNAME= mozc-server
|
||||
PORTNAME= mozc
|
||||
PORTVERSION= 1.3.911.102
|
||||
PORTREVISION= 0
|
||||
PORTREVISION= 1
|
||||
CATEGORIES= japanese
|
||||
MASTER_SITES= http://mozc.googlecode.com/files/
|
||||
DISTNAME= mozc-${PORTVERSION}
|
||||
DISTFILES= ${DISTNAME}.tar.bz2
|
||||
MASTER_SITES= ${MASTER_SITE_GOOGLE_CODE}
|
||||
PKGNAMEPREFIX?= ja-
|
||||
PKGNAMESUFFIX?= -server
|
||||
|
||||
MAINTAINER= daichi@FreeBSD.org
|
||||
COMMENT= Mozc server for IBus, SCIM and others
|
||||
COMMENT?= Mozc server for IBus, SCIM and others
|
||||
|
||||
BUILD_DEPENDS= gsed:${PORTSDIR}/textproc/gsed \
|
||||
${LOCALBASE}/bin/grep:${PORTSDIR}/textproc/gnugrep \
|
||||
gyp:${PORTSDIR}/devel/py-gyp-devel
|
||||
LIB_DEPENDS= curl.6:${PORTSDIR}/ftp/curl \
|
||||
gtest.0:${PORTSDIR}/devel/googletest \
|
||||
protobuf.7:${PORTSDIR}/devel/protobuf \
|
||||
zinnia.0:${PORTSDIR}/japanese/zinnia
|
||||
zinnia.0:${PORTSDIR}/japanese/zinnia
|
||||
RUN_DEPENDS= xdg-open:${PORTSDIR}/devel/xdg-utils
|
||||
|
||||
USE_BZIP2= yes
|
||||
USE_GMAKE= yes
|
||||
USE_ICONV= yes
|
||||
USE_PYTHON= yes
|
||||
|
||||
BUILD_MOZC_LIST?= mozc_server
|
||||
|
||||
.if ${BUILD_MOZC_LIST:Mmozc_tool} == "mozc_tool"
|
||||
USE_QT_VER= 4
|
||||
QT_COMPONENTS= gui dbus qmake_build moc_build uic_build rcc_build
|
||||
.endif
|
||||
.if ${BUILD_MOZC_LIST:Mibus_mozc} == "ibus_mozc" || ${BUILD_MOZC_LIST:Mscim_mozc} == "scim_mozc"
|
||||
USE_GNOME= pygtk2
|
||||
.endif
|
||||
|
||||
.include <bsd.port.pre.mk>
|
||||
|
||||
.if ${OSVERSION} < 800107
|
||||
|
@ -39,13 +47,6 @@ BROKEN= Does not compile on FreeBSD 7.X
|
|||
BROKEN= Does not compile: segfault
|
||||
.endif
|
||||
|
||||
# workaround for a gcc4.2.1's namespace bug
|
||||
.if (${OSVERSION} < 1000000 && ${OSVERSION} > 9000000) || ${OSVERSION} < 802503
|
||||
BUILD_DEPENDS+= gcc42:${PORTSDIR}/lang/gcc42
|
||||
CC= gcc42
|
||||
CXX= g++42
|
||||
.endif
|
||||
|
||||
.if defined(WITH_DEBUG_CODE)
|
||||
BUILD_MODE= Debug
|
||||
.else
|
||||
|
@ -53,35 +54,170 @@ BUILD_MODE= Release
|
|||
.endif
|
||||
|
||||
LOCALBASE_REPLACE_FILES= \
|
||||
${WRKSRC}/build_mozc.py \
|
||||
${WRKSRC}/gyp/common.gypi \
|
||||
${WRKSRC}/base/util.cc \
|
||||
${WRKSRC}/base/process.cc \
|
||||
${WRKSRC}/handwriting/zinnia_handwriting.cc
|
||||
build_mozc.py \
|
||||
gyp/common.gypi \
|
||||
unix/ibus/gen_mozc_xml.py \
|
||||
unix/ibus/mozc.xml \
|
||||
unix/ibus/path_util.cc \
|
||||
unix/scim/scim.gyp \
|
||||
unix/scim/scim_mozc.cc \
|
||||
base/util.cc \
|
||||
base/process.cc \
|
||||
gui/about_dialog/about_dialog.cc \
|
||||
handwriting/zinnia_handwriting.cc
|
||||
|
||||
BUILD_CMD= ${SETENV} ${MAKE_ENV} ${GMAKE}
|
||||
BUILD_MOZC_CMD= cd ${BUILD_WRKSRC} && \
|
||||
${SETENV} BUILD_COMMAND="${WRKSRC}/mozcmake" \
|
||||
PYTHONPATH=${WRKSRC}/third_party/gyp/local/lib/python${PYTHON_VER}/site-packages \
|
||||
FLOCK= \
|
||||
${PYTHON_CMD} build_mozc.py
|
||||
BUILD_GYP_CMD= cd ${WRKSRC}/third_party/gyp && ${SETENV} ${MAKE_ENV} ${PYTHON_CMD} ${PYSETUP}
|
||||
|
||||
post-patch:
|
||||
@for FILE in ${LOCALBASE_REPLACE_FILES}; \
|
||||
do \
|
||||
${SED} -i .bak -e "s/@@LOCALBASE@@/${LOCALBASE:S/\//\\\//g}/g" \
|
||||
$${FILE}; \
|
||||
done;
|
||||
cd ${WRKSRC} && \
|
||||
${REINPLACE_CMD} "s/@@LOCALBASE@@/${LOCALBASE:S/\//\\\//g}/g" \
|
||||
${LOCALBASE_REPLACE_FILES}
|
||||
|
||||
do-build:
|
||||
@cd ${WRKSRC}/; \
|
||||
export BUILD_COMMAND=${GMAKE}; \
|
||||
export CC=${CC}; export CFLAGS="${CFLAGS}"; \
|
||||
export CXX=${CXX}; export CXXFLAGS="${CXXFLAGS}"; \
|
||||
export LDFLAGS="-L${LOCALBASE}/lib" ; \
|
||||
${PYTHON_CMD} build_mozc.py gyp --gypdir=${LOCALBASE}/bin; \
|
||||
${PYTHON_CMD} build_mozc.py build_tools \
|
||||
-c ${BUILD_MODE}; \
|
||||
${PYTHON_CMD} build_mozc.py build \
|
||||
-c ${BUILD_MODE}\
|
||||
server/server.gyp:mozc_server
|
||||
pre-build:
|
||||
${PRINTF} "%s\n%s\n" "#!/bin/sh" 'exec ${BUILD_CMD} $$@' > ${WRKSRC}/mozcmake
|
||||
${CHMOD} +x ${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_MOZC_CMD} gyp --gypdir=${WRKSRC}/third_party/gyp/local/bin
|
||||
${BUILD_MOZC_CMD} build_tools -c ${BUILD_MODE}
|
||||
|
||||
do-install:
|
||||
@${INSTALL} -o 0 -g 0 -m 555 \
|
||||
# mozc_server
|
||||
.if ${BUILD_MOZC_LIST:Mmozc_server} == "mozc_server"
|
||||
PLIST_FILES+= bin/mozc_server
|
||||
|
||||
do-build-mozc_server:
|
||||
${BUILD_MOZC_CMD} build -c ${BUILD_MODE} server/server.gyp:mozc_server
|
||||
|
||||
do-install-mozc_server:
|
||||
@${INSTALL_PROGRAM} \
|
||||
${WRKSRC}/out_linux/${BUILD_MODE}/mozc_server \
|
||||
${LOCALBASE}/bin/mozc_server
|
||||
${PREFIX}/bin
|
||||
.endif
|
||||
|
||||
# mozc_tool
|
||||
.if ${BUILD_MOZC_LIST:Mmozc_tool} == "mozc_tool"
|
||||
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}
|
||||
|
||||
do-build-mozc_tool:
|
||||
${BUILD_MOZC_CMD} build -c ${BUILD_MODE} gui/gui.gyp:mozc_tool
|
||||
|
||||
do-install-mozc_tool:
|
||||
@${INSTALL_PROGRAM} \
|
||||
${WRKSRC}/out_linux/${BUILD_MODE}/mozc_tool \
|
||||
${PREFIX}/bin
|
||||
@${MKDIR} ${DATADIR}/icons
|
||||
@${INSTALL_DATA} \
|
||||
${WRKSRC}/data/images/unix/ime_product_icon_opensource-32.png \
|
||||
${DATADIR}/icons/product_logo.png
|
||||
@${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.2:${PORTSDIR}/textproc/ibus
|
||||
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
|
||||
|
||||
PLIST_FILES+= libexec/ibus-engine-mozc \
|
||||
share/ibus/component/mozc.xml \
|
||||
${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
|
||||
PLIST_DIRS+= ${DATADIR_REL}/icons ${DATADIR_REL}
|
||||
|
||||
do-build-ibus_mozc:
|
||||
${BUILD_MOZC_CMD} build -c ${BUILD_MODE} unix/ibus/ibus.gyp:ibus_mozc
|
||||
|
||||
do-install-ibus_mozc:
|
||||
${INSTALL_PROGRAM} \
|
||||
${WRKSRC}/out_linux/${BUILD_MODE}/ibus_mozc \
|
||||
${PREFIX}/libexec/ibus-engine-mozc
|
||||
${INSTALL_DATA} \
|
||||
${WRKSRC}/unix/ibus/mozc.xml \
|
||||
${PREFIX}/share/ibus/component/mozc.xml
|
||||
${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} \
|
||||
${WRKSRC}/data/images/unix/ime_product_icon_opensource-32.png \
|
||||
${DATADIR}/icons/product_logo.png
|
||||
.endif
|
||||
|
||||
# scim_mozc
|
||||
.if ${BUILD_MOZC_LIST:Mscim_mozc} == "scim_mozc"
|
||||
BUILD_DEPENDS+= scim:${PORTSDIR}/textproc/scim
|
||||
RUN_DEPENDS+= scim:${PORTSDIR}/textproc/scim \
|
||||
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
|
||||
|
||||
PLIST_FILES+= lib/scim-1.0/1.4.0/IMEngine/mozc.so \
|
||||
lib/scim-1.0/1.4.0/SetupUI/mozc_setup.so \
|
||||
${DATADIR_REL}/icons/scim-mozc-alpha_full.png \
|
||||
${DATADIR_REL}/icons/scim-mozc-alpha_half.png \
|
||||
${DATADIR_REL}/icons/scim-mozc-dictionary.png \
|
||||
${DATADIR_REL}/icons/scim-mozc-direct.png \
|
||||
${DATADIR_REL}/icons/scim-mozc-hiragana.png \
|
||||
${DATADIR_REL}/icons/scim-mozc-katakana_full.png \
|
||||
${DATADIR_REL}/icons/scim-mozc-katakana_half.png \
|
||||
${DATADIR_REL}/icons/scim-mozc-properties.png \
|
||||
${DATADIR_REL}/icons/scim-mozc-tool.png \
|
||||
${DATADIR_REL}/icons/scim-mozc.png
|
||||
PLIST_DIRS+= ${DATADIR_REL}/icons ${DATADIR_REL}
|
||||
|
||||
do-build-scim_mozc:
|
||||
${BUILD_MOZC_CMD} build -c ${BUILD_MODE} \
|
||||
unix/scim/scim.gyp:scim_mozc \
|
||||
unix/scim/scim.gyp:scim_mozc_setup
|
||||
|
||||
do-install-scim_mozc:
|
||||
${INSTALL_LIB} \
|
||||
${WRKSRC}/out_linux/${BUILD_MODE}/lib.target/libscim_mozc.so \
|
||||
${PREFIX}/lib/scim-1.0/1.4.0/IMEngine/mozc.so
|
||||
${INSTALL_LIB} \
|
||||
${WRKSRC}/out_linux/${BUILD_MODE}/lib.target/libscim_mozc_setup.so \
|
||||
${PREFIX}/lib/scim-1.0/1.4.0/SetupUI/mozc_setup.so
|
||||
@${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-/scim-mozc-/}.png
|
||||
.endfor
|
||||
@${INSTALL_DATA} \
|
||||
${WRKSRC}/data/images/unix/ime_product_icon_opensource-32.png \
|
||||
${DATADIR}/icons/scim-mozc.png
|
||||
.endif
|
||||
|
||||
do-build: ${BUILD_MOZC_LIST:S/^/do-build-/}
|
||||
do-install: ${BUILD_MOZC_LIST:S/^/do-install-/}
|
||||
|
||||
.include <bsd.port.post.mk>
|
||||
|
|
|
@ -1,5 +1,14 @@
|
|||
--- gyp/common.gypi.orig 2011-12-04 16:22:26.257607334 +0900
|
||||
+++ gyp/common.gypi 2011-12-04 16:46:48.756621873 +0900
|
||||
+++ gyp/common.gypi 2011-12-12 22:34:30.005072813 +0900
|
||||
@@ -50,7 +50,7 @@
|
||||
# warning_cflags will be shared with Mac and Linux.
|
||||
'warning_cflags': [
|
||||
'-Wall',
|
||||
- '-Werror',
|
||||
+# '-Werror',
|
||||
'-Wno-char-subscripts',
|
||||
'-Wno-sign-compare',
|
||||
'-Wno-deprecated-declarations',
|
||||
@@ -512,6 +512,12 @@
|
||||
# <unordered_map> and <unordered_set>.
|
||||
'-Wno-deprecated',
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
bin/mozc_server
|
|
@ -5,94 +5,11 @@
|
|||
# $FreeBSD$
|
||||
#
|
||||
|
||||
PORTNAME= mozc-tool
|
||||
PORTVERSION= 1.3.911.102
|
||||
PORTREVISION= 0
|
||||
CATEGORIES= japanese
|
||||
MASTER_SITES= http://mozc.googlecode.com/files/
|
||||
DISTNAME= mozc-${PORTVERSION}
|
||||
DISTFILES= ${DISTNAME}.tar.bz2
|
||||
|
||||
MAINTAINER= daichi@FreeBSD.org
|
||||
PKGNAMESUFFIX= -tool
|
||||
COMMENT= Mozc tool for IBus, SCIM and others
|
||||
DATADIR= ${PREFIX}/share/${PORTNAME}${PKGNAMESUFFIX}
|
||||
|
||||
BUILD_DEPENDS= gsed:${PORTSDIR}/textproc/gsed \
|
||||
${LOCALBASE}/bin/grep:${PORTSDIR}/textproc/gnugrep \
|
||||
gyp:${PORTSDIR}/devel/py-gyp-devel
|
||||
LIB_DEPENDS= curl.6:${PORTSDIR}/ftp/curl \
|
||||
gtest.0:${PORTSDIR}/devel/googletest \
|
||||
protobuf.7:${PORTSDIR}/devel/protobuf \
|
||||
zinnia.0:${PORTSDIR}/japanese/zinnia
|
||||
RUN_DEPENDS= xdg-open:${PORTSDIR}/devel/xdg-utils \
|
||||
${LOCALBASE}/share/tegaki/models/zinnia/handwriting-ja.model:${PORTSDIR}/japanese/tegaki-zinnia-japanese
|
||||
MASTERDIR= ${.CURDIR}/../../japanese/mozc-server
|
||||
BUILD_MOZC_LIST= mozc_tool
|
||||
|
||||
USE_GMAKE= yes
|
||||
USE_ICONV= yes
|
||||
USE_PYTHON= yes
|
||||
USE_QT_VER= 4
|
||||
QT_COMPONENTS= gui dbus qmake_build moc_build uic_build rcc_build
|
||||
|
||||
.include <bsd.port.pre.mk>
|
||||
|
||||
.if ${OSVERSION} < 800107
|
||||
BROKEN= Does not compile on FreeBSD 7.X
|
||||
.endif
|
||||
|
||||
.if ${ARCH} == "ia64" || ${ARCH} == "powerpc" || ${ARCH} == "sparc64"
|
||||
BROKEN= Does not compile: segfault
|
||||
.endif
|
||||
|
||||
# workaround for a gcc4.2.1's namespace bug
|
||||
.if (${OSVERSION} < 1000000 && ${OSVERSION} > 9000000) || ${OSVERSION} < 802503
|
||||
BUILD_DEPENDS+= gcc42:${PORTSDIR}/lang/gcc42
|
||||
CC= gcc42
|
||||
CXX= g++42
|
||||
.endif
|
||||
|
||||
.if defined(WITH_DEBUG_CODE)
|
||||
BUILD_MODE= Debug
|
||||
.else
|
||||
BUILD_MODE= Release
|
||||
.endif
|
||||
|
||||
LOCALBASE_REPLACE_FILES= \
|
||||
${WRKSRC}/build_mozc.py \
|
||||
${WRKSRC}/gyp/common.gypi \
|
||||
${WRKSRC}/base/util.cc \
|
||||
${WRKSRC}/base/process.cc \
|
||||
${WRKSRC}/gui/about_dialog/about_dialog.cc \
|
||||
${WRKSRC}/handwriting/zinnia_handwriting.cc
|
||||
|
||||
post-patch:
|
||||
@for FILE in ${LOCALBASE_REPLACE_FILES}; \
|
||||
do \
|
||||
${SED} -i .bak -e "s/@@LOCALBASE@@/${LOCALBASE:S/\//\\\//g}/g" \
|
||||
$${FILE}; \
|
||||
done;
|
||||
|
||||
do-build:
|
||||
@cd ${WRKSRC}/; \
|
||||
export BUILD_COMMAND=${GMAKE}; \
|
||||
export CC=${CC}; export CFLAGS="${CFLAGS}"; \
|
||||
export CXX=${CXX}; export CXXFLAGS="${CXXFLAGS}"; \
|
||||
export LDFLAGS="-L${LOCALBASE}/lib"; \
|
||||
${PYTHON_CMD} build_mozc.py gyp --gypdir=${LOCALBASE}/bin; \
|
||||
${PYTHON_CMD} build_mozc.py build_tools \
|
||||
-c ${BUILD_MODE}; \
|
||||
${PYTHON_CMD} build_mozc.py build \
|
||||
-c ${BUILD_MODE} \
|
||||
gui/gui.gyp:mozc_tool
|
||||
|
||||
do-install:
|
||||
@${INSTALL} -o 0 -g 0 -m 555 \
|
||||
${WRKSRC}/out_linux/${BUILD_MODE}/mozc_tool \
|
||||
${LOCALBASE}/bin/mozc_tool
|
||||
@${MKDIR} ${LOCALBASE}/share/mozc-tool/icons
|
||||
@${INSTALL} -o 0 -g 0 -m 444 \
|
||||
${WRKSRC}/data/images/unix/ime_product_icon_opensource-32.png \
|
||||
${LOCALBASE}/share/mozc-tool/icons/product_logo.png
|
||||
@${INSTALL} -o 0 -g 0 -m 444 \
|
||||
${WRKSRC}/data/images/unix/ime_product_icon_opensource-32.png \
|
||||
${LOCALBASE}/share/mozc-tool/icons/update_uptodate.png
|
||||
|
||||
.include <bsd.port.post.mk>
|
||||
.include "${MASTERDIR}/Makefile"
|
||||
|
|
|
@ -1,2 +0,0 @@
|
|||
SHA256 (mozc-1.3.911.102.tar.bz2) = da27945d6732e4fc70c08534cc8d10cd23d6fba5ebc52e6b31cac5d04ba1588a
|
||||
SIZE (mozc-1.3.911.102.tar.bz2) = 39180652
|
|
@ -1,14 +0,0 @@
|
|||
--- base/iconv.cc.orig 2011-12-04 16:22:26.109606820 +0900
|
||||
+++ base/iconv.cc 2011-12-04 16:46:50.884607344 +0900
|
||||
@@ -52,7 +52,11 @@
|
||||
size_t olen_org = olen;
|
||||
iconv(ic, 0, &ilen, 0, &olen); // reset iconv state
|
||||
while (ilen != 0) {
|
||||
+#ifdef __FreeBSD__
|
||||
+ if (iconv(ic, (const char **)(&ibuf), &ilen, &obuf, &olen)
|
||||
+#else
|
||||
if (iconv(ic, reinterpret_cast<char **>(&ibuf), &ilen, &obuf, &olen)
|
||||
+#endif
|
||||
== static_cast<size_t>(-1)) {
|
||||
return;
|
||||
}
|
|
@ -1,21 +0,0 @@
|
|||
--- base/logging.cc.orig 2011-12-04 16:22:26.116610643 +0900
|
||||
+++ base/logging.cc 2011-12-04 19:57:28.052770432 +0900
|
||||
@@ -212,7 +212,7 @@
|
||||
char buf[512];
|
||||
snprintf(buf, sizeof(buf),
|
||||
"%4.4d-%2.2d-%2.2d %2.2d:%2.2d:%2.2d %u "
|
||||
-#ifndef OS_LINUX // = OS_WINDOWS or OS_MACOSX
|
||||
+#if !defined(OS_LINUX) && !defined(__FreeBSD__) // = OS_WINDOWS or OS_MACOSX
|
||||
"%u",
|
||||
#else
|
||||
"%lu",
|
||||
@@ -229,6 +229,9 @@
|
||||
#elif defined(OS_MACOSX)
|
||||
::getpid(),
|
||||
reinterpret_cast<uint32>(pthread_self())
|
||||
+#elif defined(__FreeBSD__)
|
||||
+ ::getpid(),
|
||||
+ (uint64_t)pthread_self()
|
||||
#else // = OS_LINUX
|
||||
::getpid(),
|
||||
pthread_self() // returns unsigned long.
|
|
@ -1,16 +0,0 @@
|
|||
--- base/mutex.h.orig 2011-12-04 16:22:26.106606369 +0900
|
||||
+++ base/mutex.h 2011-12-04 16:46:50.658605855 +0900
|
||||
@@ -82,11 +82,11 @@
|
||||
// PTHREAD_MUTEX_RECURSIVE_NP and PTHREAD_MUTEX_RECURSIVE seem to be
|
||||
// variants. For example, Mac OS X 10.4 had
|
||||
// PTHREAD_MUTEX_RECURSIVE_NP but Mac OS X 10.5 does not
|
||||
-#ifdef OS_MACOSX
|
||||
+#if defined(OS_MACOSX) || defined(__FreeBSD__)
|
||||
#define PTHREAD_MUTEX_RECURSIVE_VALUE PTHREAD_MUTEX_RECURSIVE
|
||||
#endif
|
||||
|
||||
-#ifdef OS_LINUX
|
||||
+#if defined(OS_LINUX) && !defined(__FreeBSD__)
|
||||
#define PTHREAD_MUTEX_RECURSIVE_VALUE PTHREAD_MUTEX_RECURSIVE_NP
|
||||
#endif
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
--- base/process.cc.orig 2011-12-04 16:22:26.103607664 +0900
|
||||
+++ base/process.cc 2011-12-04 16:46:51.045606717 +0900
|
||||
@@ -120,13 +120,18 @@
|
||||
return ShellExecuteInSystemDir(L"open", wurl.c_str(), NULL, SW_SHOW);
|
||||
#endif
|
||||
|
||||
-#ifdef OS_LINUX
|
||||
+#if defined(OS_LINUX) && !defined(__FreeBSD__)
|
||||
static const char kBrowserCommand[] = "/usr/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
|
|
@ -1,17 +0,0 @@
|
|||
--- base/util.cc.orig 2011-12-04 16:22:26.112610903 +0900
|
||||
+++ base/util.cc 2011-12-04 16:46:50.958606064 +0900
|
||||
@@ -2592,9 +2592,13 @@
|
||||
return MacUtil::GetServerDirectory();
|
||||
#endif // OS_MACOSX
|
||||
|
||||
-#ifdef OS_LINUX
|
||||
+#if defined(OS_LINUX) && !defined(__FreeBSD__)
|
||||
return "/usr/lib/mozc";
|
||||
#endif // OS_LINUX
|
||||
+
|
||||
+#ifdef __FreeBSD__
|
||||
+ return "@@LOCALBASE@@/bin";
|
||||
+#endif
|
||||
}
|
||||
|
||||
string Util::GetDocumentDirectory() {
|
|
@ -1,11 +0,0 @@
|
|||
--- build_mozc.py.orig 2011-12-04 16:22:26.517605881 +0900
|
||||
+++ build_mozc.py 2011-12-04 16:46:51.189606024 +0900
|
||||
@@ -70,7 +70,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] == 'Linux' or os.uname()[0] == 'FreeBSD' )
|
||||
|
||||
|
||||
# TODO(yukawa): Move this function to util.py (b/2715400)
|
|
@ -1,11 +0,0 @@
|
|||
--- build_tools/mozc_version.py.orig 2011-12-04 16:22:26.211608471 +0900
|
||||
+++ build_tools/mozc_version.py 2011-12-04 16:35:15.156605950 +0900
|
||||
@@ -56,7 +56,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] == 'Linux' or os.uname()[0] == 'FreeBSD' )
|
||||
|
||||
|
||||
def CalculateRevisionForPlatform(revision, target_platform):
|
|
@ -1,14 +0,0 @@
|
|||
--- gui/about_dialog/about_dialog.cc.orig 2011-12-04 16:22:26.291606976 +0900
|
||||
+++ gui/about_dialog/about_dialog.cc 2011-12-04 16:44:21.340606780 +0900
|
||||
@@ -119,7 +119,11 @@
|
||||
SetLabelText(label_terms);
|
||||
SetLabelText(label_credits);
|
||||
|
||||
+#ifdef __FreeBSD__
|
||||
+ product_image_.reset(new QImage("@@LOCALBASE@@/share/mozc-tool/icons/product_logo.png"));
|
||||
+#else
|
||||
product_image_.reset(new QImage(":/product_logo.png"));
|
||||
+#endif
|
||||
}
|
||||
|
||||
void AboutDialog::paintEvent(QPaintEvent *event) {
|
|
@ -1,15 +0,0 @@
|
|||
--- gyp/common.gypi.orig 2011-12-04 16:22:26.257607334 +0900
|
||||
+++ gyp/common.gypi 2011-12-04 16:46:48.756621873 +0900
|
||||
@@ -512,6 +512,12 @@
|
||||
# <unordered_map> and <unordered_set>.
|
||||
'-Wno-deprecated',
|
||||
],
|
||||
+ 'include_dirs': [
|
||||
+ '@@LOCALBASE@@/include'
|
||||
+ ],
|
||||
+ 'ldflags': [
|
||||
+ '-L@@LOCALBASE@@/lib'
|
||||
+ ],
|
||||
'link_settings': {
|
||||
'libraries': [
|
||||
'<@(linux_libs)',
|
|
@ -1,19 +0,0 @@
|
|||
--- handwriting/zinnia_handwriting.cc.orig 2011-12-04 22:26:40.226138013 +0900
|
||||
+++ handwriting/zinnia_handwriting.cc 2011-12-04 22:27:01.145136587 +0900
|
||||
@@ -49,10 +49,16 @@
|
||||
const char kModelFile[] = "handwriting-light-ja.model";
|
||||
return Util::JoinPath(MacUtil::GetResourcesDirectory(), kModelFile);
|
||||
#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";
|
||||
return kModelFile;
|
||||
+#endif
|
||||
#else
|
||||
const char kModelFile[] = "handwriting-ja.model";
|
||||
return Util::JoinPath(Util::GetServerDirectory(), kModelFile);
|
|
@ -1,11 +0,0 @@
|
|||
--- ipc/ipc_path_manager.cc.orig 2011-12-04 16:22:26.515606954 +0900
|
||||
+++ ipc/ipc_path_manager.cc 2011-12-04 16:46:51.134605388 +0900
|
||||
@@ -274,7 +274,7 @@
|
||||
*ipc_name = kIPCPrefix;
|
||||
#endif // OS_WINDOWS
|
||||
|
||||
-#ifdef OS_LINUX
|
||||
+#if defined(OS_LINUX) && !defined(__FreeBSD__)
|
||||
// On Linux, use abstract namespace which is independent of the file system.
|
||||
(*ipc_name)[0] = '\0';
|
||||
#endif
|
|
@ -1,65 +0,0 @@
|
|||
--- ipc/unix_ipc.cc.orig 2011-12-04 16:22:26.515606954 +0900
|
||||
+++ ipc/unix_ipc.cc 2011-12-04 16:46:51.120605285 +0900
|
||||
@@ -41,7 +41,7 @@
|
||||
#include <sys/time.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/un.h>
|
||||
-#ifdef OS_MACOSX
|
||||
+#if defined(OS_MACOSX) || defined(__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
|
||||
+#if defined(OS_MACOSX) || defined(__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,7 +146,7 @@
|
||||
*pid = 0;
|
||||
#endif
|
||||
|
||||
-#ifdef OS_LINUX
|
||||
+#if defined(OS_LINUX) && !defined(__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.
|
||||
@@ -309,7 +309,7 @@
|
||||
address.sun_family = AF_UNIX;
|
||||
::memcpy(address.sun_path, server_address.data(), server_address_length);
|
||||
address.sun_path[server_address_length] = '\0';
|
||||
-#ifdef OS_MACOSX
|
||||
+#if defined(OS_MACOSX) || defined(__FreeBSD__)
|
||||
address.sun_len = SUN_LEN(&address);
|
||||
const size_t sun_len = sizeof(address);
|
||||
#else
|
||||
@@ -429,21 +429,21 @@
|
||||
SO_REUSEADDR,
|
||||
reinterpret_cast<char *>(&on),
|
||||
sizeof(on));
|
||||
-#ifdef OS_MACOSX
|
||||
+#if defined(OS_MACOSX) || defined(__FreeBSD__)
|
||||
addr.sun_len = SUN_LEN(&addr);
|
||||
const size_t sun_len = sizeof(addr);
|
||||
#else
|
||||
const size_t sun_len = sizeof(addr.sun_family) + server_address_.size();
|
||||
#endif
|
||||
- if (!IsAbstractSocket(server_address_)) {
|
||||
- // Linux does not use files for IPC.
|
||||
- ::chmod(server_address_.c_str(), 0600);
|
||||
- }
|
||||
if (::bind(socket_, reinterpret_cast<sockaddr *>(&addr), sun_len) != 0) {
|
||||
// The UNIX domain socket file (server_address_) already exists?
|
||||
LOG(FATAL) << "bind() failed: " << strerror(errno);
|
||||
return;
|
||||
}
|
||||
+ if (!IsAbstractSocket(server_address_)) {
|
||||
+ // Linux does not use files for IPC.
|
||||
+ ::chmod(server_address_.c_str(), 0600);
|
||||
+ }
|
||||
|
||||
if (::listen(socket_, num_connections) < 0) {
|
||||
LOG(FATAL) << "listen() failed: " << strerror(errno);
|
|
@ -1,49 +0,0 @@
|
|||
--- server/mozc_server.cc.orig 2011-12-04 16:22:26.174607330 +0900
|
||||
+++ server/mozc_server.cc 2011-12-04 16:43:55.914606129 +0900
|
||||
@@ -32,6 +32,9 @@
|
||||
#ifdef OS_WINDOWS
|
||||
#include <windows.h>
|
||||
#endif
|
||||
+#ifdef __FreeBSD__
|
||||
+#include <signal.h>
|
||||
+#endif
|
||||
|
||||
#include "base/base.h"
|
||||
#include "base/process.h"
|
||||
@@ -50,6 +53,23 @@
|
||||
mozc::SessionServer *g_session_server = NULL;
|
||||
}
|
||||
|
||||
+#ifdef __FreeBSD__
|
||||
+static void sig_func(int num)
|
||||
+{
|
||||
+ VLOG(1) << "signal " << num << " recieved.";
|
||||
+ switch (num) {
|
||||
+ case SIGINT:
|
||||
+ case SIGHUP:
|
||||
+ case SIGTERM:
|
||||
+ if (g_session_server)
|
||||
+ g_session_server->Terminate();
|
||||
+ break;
|
||||
+ default:
|
||||
+ break;
|
||||
+ }
|
||||
+}
|
||||
+#endif
|
||||
+
|
||||
namespace mozc {
|
||||
namespace {
|
||||
|
||||
@@ -132,6 +152,12 @@
|
||||
return -1;
|
||||
}
|
||||
|
||||
+#ifdef __FreeBSD__
|
||||
+ ::signal(SIGINT, sig_func);
|
||||
+ ::signal(SIGHUP, sig_func);
|
||||
+ ::signal(SIGTERM, sig_func);
|
||||
+#endif
|
||||
+
|
||||
#if defined(OS_WINDOWS)
|
||||
// On Windows, ShutdownSessionCallback is not called intentionally in order
|
||||
// to avoid crashes oritinates from it. See b/2696087.
|
|
@ -1,35 +0,0 @@
|
|||
--- unix/ibus/gen_mozc_xml.py.orig 2011-12-04 16:22:26.122609031 +0900
|
||||
+++ unix/ibus/gen_mozc_xml.py 2011-12-04 16:35:15.333604982 +0900
|
||||
@@ -39,6 +39,7 @@
|
||||
|
||||
import optparse
|
||||
import sys
|
||||
+import os
|
||||
|
||||
# Information to generate <component> part of mozc.xml. %s will be replaced with
|
||||
# a product name, 'Mozc' or 'Google Japanese Input'.
|
||||
@@ -64,6 +65,24 @@
|
||||
'rank': '80',
|
||||
}
|
||||
|
||||
+if os.uname()[0] == 'FreeBSD':
|
||||
+ IBUS_COMPONENT_PROPS = {
|
||||
+ 'name': 'com.google.IBus.Mozc',
|
||||
+ 'description': '%s Component',
|
||||
+ 'exec': '@@LOCALBASE@@/libexec/ibus-engine-mozc --ibus',
|
||||
+ 'version': '0.0.0.0',
|
||||
+ 'author': 'Google Inc.',
|
||||
+ 'license': 'New BSD',
|
||||
+ 'homepage': 'http://code.google.com/p/mozc/',
|
||||
+ 'textdomain': 'ibus-mozc',
|
||||
+ }
|
||||
+ IBUS_ENGINE_COMMON_PROPS = {
|
||||
+ 'description': '%s (Japanese Input Method)',
|
||||
+ 'language': 'ja',
|
||||
+ 'icon': '@@LOCALBASE@@/share/ibus-mozc/icons/product_logo.png',
|
||||
+ 'rank': '0',
|
||||
+ }
|
||||
+
|
||||
# A dictionary from --platform to engines that are used in the platform. The
|
||||
# information is used to generate <engines> part of mozc.xml.
|
||||
IBUS_ENGINES_PROPS = {
|
|
@ -1,24 +0,0 @@
|
|||
--- unix/ibus/mozc.xml.orig 1970-01-01 09:00:00.000000000 +0900
|
||||
+++ unix/ibus/mozc.xml 2011-12-04 16:04:42.283606379 +0900
|
||||
@@ -0,0 +1,21 @@
|
||||
+<component>
|
||||
+ <name>com.google.IBus.Mozc</name>
|
||||
+ <description>Mozc Component</description>
|
||||
+ <exec>@@LOCALBASE@@/libexec/ibus-engine-mozc --ibus</exec>
|
||||
+ <version>0.0.0.0</version>
|
||||
+ <author>Google Inc.</author>
|
||||
+ <license>New BSD</license>
|
||||
+ <homepage>http://code.google.com/p/mozc/</homepage>
|
||||
+ <textdomain>ibus-mozc</textdomain>
|
||||
+ <engines>
|
||||
+ <engine>
|
||||
+ <rank>0</rank>
|
||||
+ <description>Mozc (Japanese Input Method)</description>
|
||||
+ <language>ja</language>
|
||||
+ <icon>@@LOCALBASE@@/share/ibus-mozc/icons/product_logo.png</icon>
|
||||
+ <layout>jp</layout>
|
||||
+ <name>mozc-jp</name>
|
||||
+ <longname>Mozc</longname>
|
||||
+ </engine>
|
||||
+ </engines>
|
||||
+</component>
|
|
@ -1,25 +0,0 @@
|
|||
--- unix/ibus/path_util.cc.orig 2011-12-04 16:22:26.124607888 +0900
|
||||
+++ unix/ibus/path_util.cc 2011-12-04 16:35:15.354607302 +0900
|
||||
@@ -30,14 +30,22 @@
|
||||
#include "unix/ibus/path_util.h"
|
||||
|
||||
namespace {
|
||||
+#ifdef __FreeBSD__
|
||||
+const char kInstalledDirectory[] = "@@LOCALBASE@@/share/ibus-mozc";
|
||||
+#else
|
||||
const char kInstalledDirectory[] = "/usr/share/ibus-mozc";
|
||||
+#endif
|
||||
}
|
||||
|
||||
namespace mozc {
|
||||
namespace ibus {
|
||||
|
||||
string GetIconPath(const string &icon_file) {
|
||||
+#ifdef __FreeBSD__
|
||||
+ return string("@@LOCALBASE@@/share/ibus-mozc/icons/") + icon_file;
|
||||
+#else
|
||||
return kInstalledDirectory + string("/") + icon_file;
|
||||
+#endif
|
||||
}
|
||||
|
||||
} // namespace ibus
|
|
@ -1,11 +0,0 @@
|
|||
--- unix/scim/scim.gyp.orig 2011-12-04 16:22:26.127609806 +0900
|
||||
+++ unix/scim/scim.gyp 2011-12-04 16:39:02.023609368 +0900
|
||||
@@ -39,7 +39,7 @@
|
||||
'gtk+-2.0',
|
||||
],
|
||||
'scim_defines': [
|
||||
- 'SCIM_ICONDIR="<!@(<(pkg_config_command) --variable=icondir scim)"',
|
||||
+ 'SCIM_ICONDIR="@@LOCALBASE@@/share/scim-mozc/icons/"',
|
||||
]
|
||||
},
|
||||
'targets': [
|
|
@ -1,5 +0,0 @@
|
|||
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/
|
|
@ -1,5 +0,0 @@
|
|||
bin/mozc_tool
|
||||
share/mozc-tool/icons/product_logo.png
|
||||
share/mozc-tool/icons/update_uptodate.png
|
||||
@dirrm share/mozc-tool/icons
|
||||
@dirrm share/mozc-tool
|
|
@ -5,131 +5,17 @@
|
|||
# $FreeBSD$
|
||||
#
|
||||
|
||||
PORTNAME= scim-mozc
|
||||
PORTVERSION= 1.3.911.102
|
||||
PORTREVISION= 0
|
||||
CATEGORIES= japanese
|
||||
MASTER_SITES= http://mozc.googlecode.com/files/
|
||||
DISTNAME= mozc-${PORTVERSION}
|
||||
DISTFILES= ${DISTNAME}.tar.bz2
|
||||
|
||||
MAINTAINER= daichi@FreeBSD.org
|
||||
PKGNAMEPREFIX= ja-scim-
|
||||
COMMENT= Mozc engine for SCIM
|
||||
DATADIR= ${PREFIX}/share/scim-${PORTNAME}
|
||||
|
||||
BUILD_DEPENDS= gsed:${PORTSDIR}/textproc/gsed \
|
||||
${LOCALBASE}/bin/grep:${PORTSDIR}/textproc/gnugrep \
|
||||
gyp:${PORTSDIR}/devel/py-gyp-devel \
|
||||
scim:${PORTSDIR}/textproc/scim
|
||||
LIB_DEPENDS= curl.6:${PORTSDIR}/ftp/curl \
|
||||
gtest.0:${PORTSDIR}/devel/googletest \
|
||||
protobuf.7:${PORTSDIR}/devel/protobuf \
|
||||
zinnia.0:${PORTSDIR}/japanese/zinnia
|
||||
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 \
|
||||
scim:${PORTSDIR}/textproc/scim \
|
||||
xdg-open:${PORTSDIR}/devel/xdg-utils
|
||||
MASTERDIR= ${.CURDIR}/../../japanese/mozc-server
|
||||
PKGMESSAGE= ${.CURDIR}/pkg-message
|
||||
|
||||
USE_ICONV= yes
|
||||
USE_GNOME= pygtk2
|
||||
USE_GMAKE= yes
|
||||
USE_PYTHON= yes
|
||||
|
||||
.include <bsd.port.pre.mk>
|
||||
|
||||
.if ${OSVERSION} < 800107
|
||||
BROKEN= Does not compile on FreeBSD 7.X
|
||||
.endif
|
||||
|
||||
.if ${ARCH} == "ia64" || ${ARCH} == "powerpc" || ${ARCH} == "sparc64"
|
||||
BROKEN= Does not compile: segfault
|
||||
.endif
|
||||
|
||||
# workaround for a gcc4.2.1's namespace bug
|
||||
.if (${OSVERSION} < 1000000 && ${OSVERSION} > 9000000) || ${OSVERSION} < 802503
|
||||
BUILD_DEPENDS+= gcc42:${PORTSDIR}/lang/gcc42
|
||||
CC= gcc42
|
||||
CXX= g++42
|
||||
.endif
|
||||
|
||||
.if defined(WITH_DEBUG_CODE)
|
||||
BUILD_MODE= Debug
|
||||
.else
|
||||
BUILD_MODE= Release
|
||||
.endif
|
||||
|
||||
LOCALBASE_REPLACE_FILES= \
|
||||
${WRKSRC}/build_mozc.py \
|
||||
${WRKSRC}/gyp/common.gypi \
|
||||
${WRKSRC}/base/util.cc \
|
||||
${WRKSRC}/base/process.cc \
|
||||
${WRKSRC}/unix/scim/scim.gyp \
|
||||
${WRKSRC}/unix/scim/scim_mozc.cc \
|
||||
${WRKSRC}/handwriting/zinnia_handwriting.cc
|
||||
|
||||
post-patch:
|
||||
@for FILE in ${LOCALBASE_REPLACE_FILES}; \
|
||||
do \
|
||||
${SED} -i .bak -e "s/@@LOCALBASE@@/${LOCALBASE:S/\//\\\//g}/g" \
|
||||
$${FILE}; \
|
||||
done;
|
||||
|
||||
do-build:
|
||||
@cd ${WRKSRC}/; \
|
||||
export BUILD_COMMAND=${GMAKE}; \
|
||||
export CC=${CC}; export CFLAGS="${CFLAGS}"; \
|
||||
export CXX=${CXX}; export CXXFLAGS="${CXXFLAGS}"; \
|
||||
export LDFLAGS="-L${LOCALBASE}/lib"; \
|
||||
${PYTHON_CMD} build_mozc.py gyp --gypdir=${LOCALBASE}/bin; \
|
||||
${PYTHON_CMD} build_mozc.py build_tools \
|
||||
-c ${BUILD_MODE}; \
|
||||
${PYTHON_CMD} build_mozc.py build \
|
||||
-c ${BUILD_MODE} \
|
||||
unix/scim/scim.gyp:scim_mozc \
|
||||
unix/scim/scim.gyp:scim_mozc_setup
|
||||
|
||||
do-install:
|
||||
@${INSTALL} -o 0 -g 0 -m 555 \
|
||||
${WRKSRC}/out_linux/${BUILD_MODE}/lib.target/libscim_mozc.so \
|
||||
${LOCALBASE}/lib/scim-1.0/1.4.0/IMEngine/mozc.so
|
||||
@${INSTALL} -o 0 -g 0 -m 555 \
|
||||
${WRKSRC}/out_linux/${BUILD_MODE}/lib.target/libscim_mozc_setup.so \
|
||||
${LOCALBASE}/lib/scim-1.0/1.4.0/SetupUI/mozc_setup.so
|
||||
@${MKDIR} ${LOCALBASE}/share/scim-mozc/icons
|
||||
@${INSTALL} -o 0 -g 0 -m 444 \
|
||||
${WRKSRC}/data/images/unix/ui-alpha_full.png \
|
||||
${LOCALBASE}/share/scim-mozc/icons/scim-mozc-alpha_full.png
|
||||
@${INSTALL} -o 0 -g 0 -m 444 \
|
||||
${WRKSRC}/data/images/unix/ui-alpha_half.png \
|
||||
${LOCALBASE}/share/scim-mozc/icons/scim-mozc-alpha_half.png
|
||||
@${INSTALL} -o 0 -g 0 -m 444 \
|
||||
${WRKSRC}/data/images/unix/ui-dictionary.png \
|
||||
${LOCALBASE}/share/scim-mozc/icons/scim-mozc-dictionary.png
|
||||
@${INSTALL} -o 0 -g 0 -m 444 \
|
||||
${WRKSRC}/data/images/unix/ui-direct.png \
|
||||
${LOCALBASE}/share/scim-mozc/icons/scim-mozc-direct.png
|
||||
@${INSTALL} -o 0 -g 0 -m 444 \
|
||||
${WRKSRC}/data/images/unix/ui-hiragana.png \
|
||||
${LOCALBASE}/share/scim-mozc/icons/scim-mozc-hiragana.png
|
||||
@${INSTALL} -o 0 -g 0 -m 444 \
|
||||
${WRKSRC}/data/images/unix/ui-katakana_full.png \
|
||||
${LOCALBASE}/share/scim-mozc/icons/scim-mozc-katakana_full.png
|
||||
@${INSTALL} -o 0 -g 0 -m 444 \
|
||||
${WRKSRC}/data/images/unix/ui-katakana_half.png \
|
||||
${LOCALBASE}/share/scim-mozc/icons/scim-mozc-katakana_half.png
|
||||
@${INSTALL} -o 0 -g 0 -m 444 \
|
||||
${WRKSRC}/data/images/unix/ui-properties.png \
|
||||
${LOCALBASE}/share/scim-mozc/icons/scim-mozc-properties.png
|
||||
@${INSTALL} -o 0 -g 0 -m 444 \
|
||||
${WRKSRC}/data/images/unix/ui-tool.png \
|
||||
${LOCALBASE}/share/scim-mozc/icons/scim-mozc-tool.png
|
||||
@${INSTALL} -o 0 -g 0 -m 444 \
|
||||
${WRKSRC}/data/images/unix/ime_product_icon_opensource-32.png \
|
||||
${LOCALBASE}/share/scim-mozc/icons/scim-mozc.png
|
||||
BUILD_MOZC_LIST= scim_mozc
|
||||
|
||||
post-install:
|
||||
@${CAT} ${PKGMESSAGE}
|
||||
@${ECHO} To display this message again, type ${PKG_INFO} -D ${PKGNAME}
|
||||
@${ECHO_CMD} To display this message again, type ${PKG_INFO} -D ${PKGNAME}
|
||||
|
||||
.include <bsd.port.post.mk>
|
||||
.include "${MASTERDIR}/Makefile"
|
||||
|
|
|
@ -1,2 +0,0 @@
|
|||
SHA256 (mozc-1.3.911.102.tar.bz2) = da27945d6732e4fc70c08534cc8d10cd23d6fba5ebc52e6b31cac5d04ba1588a
|
||||
SIZE (mozc-1.3.911.102.tar.bz2) = 39180652
|
|
@ -1,14 +0,0 @@
|
|||
--- base/iconv.cc.orig 2011-12-04 16:22:26.109606820 +0900
|
||||
+++ base/iconv.cc 2011-12-04 16:46:50.884607344 +0900
|
||||
@@ -52,7 +52,11 @@
|
||||
size_t olen_org = olen;
|
||||
iconv(ic, 0, &ilen, 0, &olen); // reset iconv state
|
||||
while (ilen != 0) {
|
||||
+#ifdef __FreeBSD__
|
||||
+ if (iconv(ic, (const char **)(&ibuf), &ilen, &obuf, &olen)
|
||||
+#else
|
||||
if (iconv(ic, reinterpret_cast<char **>(&ibuf), &ilen, &obuf, &olen)
|
||||
+#endif
|
||||
== static_cast<size_t>(-1)) {
|
||||
return;
|
||||
}
|
|
@ -1,21 +0,0 @@
|
|||
--- base/logging.cc.orig 2011-12-04 16:22:26.116610643 +0900
|
||||
+++ base/logging.cc 2011-12-04 19:57:28.052770432 +0900
|
||||
@@ -212,7 +212,7 @@
|
||||
char buf[512];
|
||||
snprintf(buf, sizeof(buf),
|
||||
"%4.4d-%2.2d-%2.2d %2.2d:%2.2d:%2.2d %u "
|
||||
-#ifndef OS_LINUX // = OS_WINDOWS or OS_MACOSX
|
||||
+#if !defined(OS_LINUX) && !defined(__FreeBSD__) // = OS_WINDOWS or OS_MACOSX
|
||||
"%u",
|
||||
#else
|
||||
"%lu",
|
||||
@@ -229,6 +229,9 @@
|
||||
#elif defined(OS_MACOSX)
|
||||
::getpid(),
|
||||
reinterpret_cast<uint32>(pthread_self())
|
||||
+#elif defined(__FreeBSD__)
|
||||
+ ::getpid(),
|
||||
+ (uint64_t)pthread_self()
|
||||
#else // = OS_LINUX
|
||||
::getpid(),
|
||||
pthread_self() // returns unsigned long.
|
|
@ -1,16 +0,0 @@
|
|||
--- base/mutex.h.orig 2011-12-04 16:22:26.106606369 +0900
|
||||
+++ base/mutex.h 2011-12-04 16:46:50.658605855 +0900
|
||||
@@ -82,11 +82,11 @@
|
||||
// PTHREAD_MUTEX_RECURSIVE_NP and PTHREAD_MUTEX_RECURSIVE seem to be
|
||||
// variants. For example, Mac OS X 10.4 had
|
||||
// PTHREAD_MUTEX_RECURSIVE_NP but Mac OS X 10.5 does not
|
||||
-#ifdef OS_MACOSX
|
||||
+#if defined(OS_MACOSX) || defined(__FreeBSD__)
|
||||
#define PTHREAD_MUTEX_RECURSIVE_VALUE PTHREAD_MUTEX_RECURSIVE
|
||||
#endif
|
||||
|
||||
-#ifdef OS_LINUX
|
||||
+#if defined(OS_LINUX) && !defined(__FreeBSD__)
|
||||
#define PTHREAD_MUTEX_RECURSIVE_VALUE PTHREAD_MUTEX_RECURSIVE_NP
|
||||
#endif
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
--- base/process.cc.orig 2011-12-04 16:22:26.103607664 +0900
|
||||
+++ base/process.cc 2011-12-04 16:46:51.045606717 +0900
|
||||
@@ -120,13 +120,18 @@
|
||||
return ShellExecuteInSystemDir(L"open", wurl.c_str(), NULL, SW_SHOW);
|
||||
#endif
|
||||
|
||||
-#ifdef OS_LINUX
|
||||
+#if defined(OS_LINUX) && !defined(__FreeBSD__)
|
||||
static const char kBrowserCommand[] = "/usr/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
|
|
@ -1,17 +0,0 @@
|
|||
--- base/util.cc.orig 2011-12-04 16:22:26.112610903 +0900
|
||||
+++ base/util.cc 2011-12-04 16:46:50.958606064 +0900
|
||||
@@ -2592,9 +2592,13 @@
|
||||
return MacUtil::GetServerDirectory();
|
||||
#endif // OS_MACOSX
|
||||
|
||||
-#ifdef OS_LINUX
|
||||
+#if defined(OS_LINUX) && !defined(__FreeBSD__)
|
||||
return "/usr/lib/mozc";
|
||||
#endif // OS_LINUX
|
||||
+
|
||||
+#ifdef __FreeBSD__
|
||||
+ return "@@LOCALBASE@@/bin";
|
||||
+#endif
|
||||
}
|
||||
|
||||
string Util::GetDocumentDirectory() {
|
|
@ -1,11 +0,0 @@
|
|||
--- build_mozc.py.orig 2011-12-04 16:22:26.517605881 +0900
|
||||
+++ build_mozc.py 2011-12-04 16:46:51.189606024 +0900
|
||||
@@ -70,7 +70,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] == 'Linux' or os.uname()[0] == 'FreeBSD' )
|
||||
|
||||
|
||||
# TODO(yukawa): Move this function to util.py (b/2715400)
|
|
@ -1,11 +0,0 @@
|
|||
--- build_tools/mozc_version.py.orig 2011-12-04 16:22:26.211608471 +0900
|
||||
+++ build_tools/mozc_version.py 2011-12-04 16:35:15.156605950 +0900
|
||||
@@ -56,7 +56,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] == 'Linux' or os.uname()[0] == 'FreeBSD' )
|
||||
|
||||
|
||||
def CalculateRevisionForPlatform(revision, target_platform):
|
|
@ -1,14 +0,0 @@
|
|||
--- gui/about_dialog/about_dialog.cc.orig 2011-12-04 16:22:26.291606976 +0900
|
||||
+++ gui/about_dialog/about_dialog.cc 2011-12-04 16:44:21.340606780 +0900
|
||||
@@ -119,7 +119,11 @@
|
||||
SetLabelText(label_terms);
|
||||
SetLabelText(label_credits);
|
||||
|
||||
+#ifdef __FreeBSD__
|
||||
+ product_image_.reset(new QImage("@@LOCALBASE@@/share/mozc-tool/icons/product_logo.png"));
|
||||
+#else
|
||||
product_image_.reset(new QImage(":/product_logo.png"));
|
||||
+#endif
|
||||
}
|
||||
|
||||
void AboutDialog::paintEvent(QPaintEvent *event) {
|
|
@ -1,15 +0,0 @@
|
|||
--- gyp/common.gypi.orig 2011-12-04 16:22:26.257607334 +0900
|
||||
+++ gyp/common.gypi 2011-12-04 16:46:48.756621873 +0900
|
||||
@@ -512,6 +512,12 @@
|
||||
# <unordered_map> and <unordered_set>.
|
||||
'-Wno-deprecated',
|
||||
],
|
||||
+ 'include_dirs': [
|
||||
+ '@@LOCALBASE@@/include'
|
||||
+ ],
|
||||
+ 'ldflags': [
|
||||
+ '-L@@LOCALBASE@@/lib'
|
||||
+ ],
|
||||
'link_settings': {
|
||||
'libraries': [
|
||||
'<@(linux_libs)',
|
|
@ -1,19 +0,0 @@
|
|||
--- handwriting/zinnia_handwriting.cc.orig 2011-12-04 22:26:40.226138013 +0900
|
||||
+++ handwriting/zinnia_handwriting.cc 2011-12-04 22:27:01.145136587 +0900
|
||||
@@ -49,10 +49,16 @@
|
||||
const char kModelFile[] = "handwriting-light-ja.model";
|
||||
return Util::JoinPath(MacUtil::GetResourcesDirectory(), kModelFile);
|
||||
#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";
|
||||
return kModelFile;
|
||||
+#endif
|
||||
#else
|
||||
const char kModelFile[] = "handwriting-ja.model";
|
||||
return Util::JoinPath(Util::GetServerDirectory(), kModelFile);
|
|
@ -1,11 +0,0 @@
|
|||
--- ipc/ipc_path_manager.cc.orig 2011-12-04 16:22:26.515606954 +0900
|
||||
+++ ipc/ipc_path_manager.cc 2011-12-04 16:46:51.134605388 +0900
|
||||
@@ -274,7 +274,7 @@
|
||||
*ipc_name = kIPCPrefix;
|
||||
#endif // OS_WINDOWS
|
||||
|
||||
-#ifdef OS_LINUX
|
||||
+#if defined(OS_LINUX) && !defined(__FreeBSD__)
|
||||
// On Linux, use abstract namespace which is independent of the file system.
|
||||
(*ipc_name)[0] = '\0';
|
||||
#endif
|
|
@ -1,65 +0,0 @@
|
|||
--- ipc/unix_ipc.cc.orig 2011-12-04 16:22:26.515606954 +0900
|
||||
+++ ipc/unix_ipc.cc 2011-12-04 16:46:51.120605285 +0900
|
||||
@@ -41,7 +41,7 @@
|
||||
#include <sys/time.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/un.h>
|
||||
-#ifdef OS_MACOSX
|
||||
+#if defined(OS_MACOSX) || defined(__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
|
||||
+#if defined(OS_MACOSX) || defined(__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,7 +146,7 @@
|
||||
*pid = 0;
|
||||
#endif
|
||||
|
||||
-#ifdef OS_LINUX
|
||||
+#if defined(OS_LINUX) && !defined(__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.
|
||||
@@ -309,7 +309,7 @@
|
||||
address.sun_family = AF_UNIX;
|
||||
::memcpy(address.sun_path, server_address.data(), server_address_length);
|
||||
address.sun_path[server_address_length] = '\0';
|
||||
-#ifdef OS_MACOSX
|
||||
+#if defined(OS_MACOSX) || defined(__FreeBSD__)
|
||||
address.sun_len = SUN_LEN(&address);
|
||||
const size_t sun_len = sizeof(address);
|
||||
#else
|
||||
@@ -429,21 +429,21 @@
|
||||
SO_REUSEADDR,
|
||||
reinterpret_cast<char *>(&on),
|
||||
sizeof(on));
|
||||
-#ifdef OS_MACOSX
|
||||
+#if defined(OS_MACOSX) || defined(__FreeBSD__)
|
||||
addr.sun_len = SUN_LEN(&addr);
|
||||
const size_t sun_len = sizeof(addr);
|
||||
#else
|
||||
const size_t sun_len = sizeof(addr.sun_family) + server_address_.size();
|
||||
#endif
|
||||
- if (!IsAbstractSocket(server_address_)) {
|
||||
- // Linux does not use files for IPC.
|
||||
- ::chmod(server_address_.c_str(), 0600);
|
||||
- }
|
||||
if (::bind(socket_, reinterpret_cast<sockaddr *>(&addr), sun_len) != 0) {
|
||||
// The UNIX domain socket file (server_address_) already exists?
|
||||
LOG(FATAL) << "bind() failed: " << strerror(errno);
|
||||
return;
|
||||
}
|
||||
+ if (!IsAbstractSocket(server_address_)) {
|
||||
+ // Linux does not use files for IPC.
|
||||
+ ::chmod(server_address_.c_str(), 0600);
|
||||
+ }
|
||||
|
||||
if (::listen(socket_, num_connections) < 0) {
|
||||
LOG(FATAL) << "listen() failed: " << strerror(errno);
|
|
@ -1,49 +0,0 @@
|
|||
--- server/mozc_server.cc.orig 2011-12-04 16:22:26.174607330 +0900
|
||||
+++ server/mozc_server.cc 2011-12-04 16:43:55.914606129 +0900
|
||||
@@ -32,6 +32,9 @@
|
||||
#ifdef OS_WINDOWS
|
||||
#include <windows.h>
|
||||
#endif
|
||||
+#ifdef __FreeBSD__
|
||||
+#include <signal.h>
|
||||
+#endif
|
||||
|
||||
#include "base/base.h"
|
||||
#include "base/process.h"
|
||||
@@ -50,6 +53,23 @@
|
||||
mozc::SessionServer *g_session_server = NULL;
|
||||
}
|
||||
|
||||
+#ifdef __FreeBSD__
|
||||
+static void sig_func(int num)
|
||||
+{
|
||||
+ VLOG(1) << "signal " << num << " recieved.";
|
||||
+ switch (num) {
|
||||
+ case SIGINT:
|
||||
+ case SIGHUP:
|
||||
+ case SIGTERM:
|
||||
+ if (g_session_server)
|
||||
+ g_session_server->Terminate();
|
||||
+ break;
|
||||
+ default:
|
||||
+ break;
|
||||
+ }
|
||||
+}
|
||||
+#endif
|
||||
+
|
||||
namespace mozc {
|
||||
namespace {
|
||||
|
||||
@@ -132,6 +152,12 @@
|
||||
return -1;
|
||||
}
|
||||
|
||||
+#ifdef __FreeBSD__
|
||||
+ ::signal(SIGINT, sig_func);
|
||||
+ ::signal(SIGHUP, sig_func);
|
||||
+ ::signal(SIGTERM, sig_func);
|
||||
+#endif
|
||||
+
|
||||
#if defined(OS_WINDOWS)
|
||||
// On Windows, ShutdownSessionCallback is not called intentionally in order
|
||||
// to avoid crashes oritinates from it. See b/2696087.
|
|
@ -1,35 +0,0 @@
|
|||
--- unix/ibus/gen_mozc_xml.py.orig 2011-12-04 16:22:26.122609031 +0900
|
||||
+++ unix/ibus/gen_mozc_xml.py 2011-12-04 16:35:15.333604982 +0900
|
||||
@@ -39,6 +39,7 @@
|
||||
|
||||
import optparse
|
||||
import sys
|
||||
+import os
|
||||
|
||||
# Information to generate <component> part of mozc.xml. %s will be replaced with
|
||||
# a product name, 'Mozc' or 'Google Japanese Input'.
|
||||
@@ -64,6 +65,24 @@
|
||||
'rank': '80',
|
||||
}
|
||||
|
||||
+if os.uname()[0] == 'FreeBSD':
|
||||
+ IBUS_COMPONENT_PROPS = {
|
||||
+ 'name': 'com.google.IBus.Mozc',
|
||||
+ 'description': '%s Component',
|
||||
+ 'exec': '@@LOCALBASE@@/libexec/ibus-engine-mozc --ibus',
|
||||
+ 'version': '0.0.0.0',
|
||||
+ 'author': 'Google Inc.',
|
||||
+ 'license': 'New BSD',
|
||||
+ 'homepage': 'http://code.google.com/p/mozc/',
|
||||
+ 'textdomain': 'ibus-mozc',
|
||||
+ }
|
||||
+ IBUS_ENGINE_COMMON_PROPS = {
|
||||
+ 'description': '%s (Japanese Input Method)',
|
||||
+ 'language': 'ja',
|
||||
+ 'icon': '@@LOCALBASE@@/share/ibus-mozc/icons/product_logo.png',
|
||||
+ 'rank': '0',
|
||||
+ }
|
||||
+
|
||||
# A dictionary from --platform to engines that are used in the platform. The
|
||||
# information is used to generate <engines> part of mozc.xml.
|
||||
IBUS_ENGINES_PROPS = {
|
|
@ -1,24 +0,0 @@
|
|||
--- unix/ibus/mozc.xml.orig 1970-01-01 09:00:00.000000000 +0900
|
||||
+++ unix/ibus/mozc.xml 2011-12-04 16:04:42.283606379 +0900
|
||||
@@ -0,0 +1,21 @@
|
||||
+<component>
|
||||
+ <name>com.google.IBus.Mozc</name>
|
||||
+ <description>Mozc Component</description>
|
||||
+ <exec>@@LOCALBASE@@/libexec/ibus-engine-mozc --ibus</exec>
|
||||
+ <version>0.0.0.0</version>
|
||||
+ <author>Google Inc.</author>
|
||||
+ <license>New BSD</license>
|
||||
+ <homepage>http://code.google.com/p/mozc/</homepage>
|
||||
+ <textdomain>ibus-mozc</textdomain>
|
||||
+ <engines>
|
||||
+ <engine>
|
||||
+ <rank>0</rank>
|
||||
+ <description>Mozc (Japanese Input Method)</description>
|
||||
+ <language>ja</language>
|
||||
+ <icon>@@LOCALBASE@@/share/ibus-mozc/icons/product_logo.png</icon>
|
||||
+ <layout>jp</layout>
|
||||
+ <name>mozc-jp</name>
|
||||
+ <longname>Mozc</longname>
|
||||
+ </engine>
|
||||
+ </engines>
|
||||
+</component>
|
|
@ -1,25 +0,0 @@
|
|||
--- unix/ibus/path_util.cc.orig 2011-12-04 16:22:26.124607888 +0900
|
||||
+++ unix/ibus/path_util.cc 2011-12-04 16:35:15.354607302 +0900
|
||||
@@ -30,14 +30,22 @@
|
||||
#include "unix/ibus/path_util.h"
|
||||
|
||||
namespace {
|
||||
+#ifdef __FreeBSD__
|
||||
+const char kInstalledDirectory[] = "@@LOCALBASE@@/share/ibus-mozc";
|
||||
+#else
|
||||
const char kInstalledDirectory[] = "/usr/share/ibus-mozc";
|
||||
+#endif
|
||||
}
|
||||
|
||||
namespace mozc {
|
||||
namespace ibus {
|
||||
|
||||
string GetIconPath(const string &icon_file) {
|
||||
+#ifdef __FreeBSD__
|
||||
+ return string("@@LOCALBASE@@/share/ibus-mozc/icons/") + icon_file;
|
||||
+#else
|
||||
return kInstalledDirectory + string("/") + icon_file;
|
||||
+#endif
|
||||
}
|
||||
|
||||
} // namespace ibus
|
|
@ -1,11 +0,0 @@
|
|||
--- unix/scim/scim.gyp.orig 2011-12-04 16:22:26.127609806 +0900
|
||||
+++ unix/scim/scim.gyp 2011-12-04 16:39:02.023609368 +0900
|
||||
@@ -39,7 +39,7 @@
|
||||
'gtk+-2.0',
|
||||
],
|
||||
'scim_defines': [
|
||||
- 'SCIM_ICONDIR="<!@(<(pkg_config_command) --variable=icondir scim)"',
|
||||
+ 'SCIM_ICONDIR="@@LOCALBASE@@/share/scim-mozc/icons/"',
|
||||
]
|
||||
},
|
||||
'targets': [
|
|
@ -1,5 +0,0 @@
|
|||
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/
|
|
@ -1,14 +0,0 @@
|
|||
lib/scim-1.0/1.4.0/IMEngine/mozc.so
|
||||
lib/scim-1.0/1.4.0/SetupUI/mozc_setup.so
|
||||
share/scim-mozc/icons/scim-mozc-alpha_full.png
|
||||
share/scim-mozc/icons/scim-mozc-alpha_half.png
|
||||
share/scim-mozc/icons/scim-mozc-dictionary.png
|
||||
share/scim-mozc/icons/scim-mozc-direct.png
|
||||
share/scim-mozc/icons/scim-mozc-hiragana.png
|
||||
share/scim-mozc/icons/scim-mozc-katakana_full.png
|
||||
share/scim-mozc/icons/scim-mozc-katakana_half.png
|
||||
share/scim-mozc/icons/scim-mozc-properties.png
|
||||
share/scim-mozc/icons/scim-mozc-tool.png
|
||||
share/scim-mozc/icons/scim-mozc.png
|
||||
@dirrm share/scim-mozc/icons
|
||||
@dirrm share/scim-mozc
|
Loading…
Reference in a new issue