1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-26 00:55:14 +00:00

Add cmigemo, C implementation of Migemo Japanese incremental search tool.

This commit is contained in:
MANTANI Nobutaka 2011-08-22 17:17:43 +00:00
parent 1d133eef8d
commit 2a6ac0409c
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=280200
11 changed files with 243 additions and 0 deletions

View File

@ -35,6 +35,7 @@
SUBDIR += celrw
SUBDIR += chasen
SUBDIR += chasen-base
SUBDIR += cmigemo
SUBDIR += csrd
SUBDIR += ctags
SUBDIR += dbskkd-cdb

51
japanese/cmigemo/Makefile Normal file
View File

@ -0,0 +1,51 @@
# New ports collection makefile for: cmigemo
# Date created: 22 August 2011
# Whom: MANTANI Nobutaka <nobutaka@FreeBSD.org>
#
# $FreeBSD$
#
PORTNAME= cmigemo
PORTVERSION= 20110227
CATEGORIES= japanese
MASTER_SITES?= ${MASTER_SITE_GOOGLE_CODE}
DISTNAME= ${PORTNAME}-default-src-${PORTVERSION}
DIST_SUBDIR= cmigemo
MAINTAINER= nobutaka@FreeBSD.org
COMMENT= C implementation of Migemo Japanese incremental search tool
.if !defined(MASTERDIR)
LICENSE= MIT
LICENSE_FILE= ${WRKSRC}/doc/LICENSE_MIT.txt
RUN_DEPENDS= ${DATADIR}/cp932/migemo-dict:${PORTSDIR}/japanese/cmigemo-dict
USE_LDCONFIG= yes
ALL_TARGET= gcc-rel gcc-dat
INSTALL_TARGET= gcc-install
DOCSDIR= ${PREFIX}/share/doc/ja/${PORTNAME}
PORTDOCS= README_j.txt
.endif
USE_ZIP= yes
USE_GMAKE= yes
USE_ICONV= yes
HAS_CONFIGURE= yes
CONFIGURE_ARGS= --prefix=${PREFIX}
WRKSRC= ${WRKDIR}/${PORTNAME}-default-src
.if !defined(MASTERDIR) && !defined(NOPORTDOCS)
INSTALL_TARGET+=gcc-install-doc
.endif
.if !target(post-extract)
post-extract:
${CHMOD} a+x ${WRKSRC}/configure
.endif
.include <bsd.port.mk>

View File

@ -0,0 +1,4 @@
SHA256 (cmigemo/cmigemo-default-src-20110227.zip) = 4aa759b2e055ef3c3fbeb9e92f7f0aacc1fd1f8602fdd2f122719793ee14414c
SIZE (cmigemo/cmigemo-default-src-20110227.zip) = 116574
SHA256 (cmigemo/SKK-JISYO.L-20110813.bz2) = 560da93401f0a58417d61e2ff41a43a24f0886877797bbea879ba9db3e70e3d9
SIZE (cmigemo/SKK-JISYO.L-20110813.bz2) = 1694235

View File

@ -0,0 +1,18 @@
--- Makefile.orig 2011-02-27 19:45:40.000000000 +0900
+++ Makefile 2011-08-21 14:21:53.000000000 +0900
@@ -52,8 +52,14 @@
$(MAKE) -f compile/Make_gcc.mak
gcc-dict:
$(MAKE) -f compile/Make_gcc.mak dictionary
-gcc-install: gcc-all
+gcc-dat:
+ $(MAKE) -f compile/Make_gcc.mak dat
+gcc-install: gcc-rel gcc-dat
$(MAKE) -f compile/Make_gcc.mak install
+gcc-install-dict: gcc-dict
+ $(MAKE) -f compile/Make_gcc.mak install-dict
+gcc-install-doc:
+ $(MAKE) -f compile/Make_gcc.mak install-doc
gcc-uninstall:
$(MAKE) -f compile/Make_gcc.mak uninstall
gcc-clean:

View File

@ -0,0 +1,11 @@
--- compile/Make_gcc.mak.orig 2011-08-17 00:54:29.000000000 +0900
+++ compile/Make_gcc.mak 2011-08-17 00:56:14.000000000 +0900
@@ -44,4 +44,7 @@
$(RM) $(libdir)/$(libmigemo)
dictionary:
- cd dict && $(MAKE) gcc
+ cd dict && $(MAKE) gcc-dict
+
+dat:
+ cd dict && $(MAKE) gcc-dat

View File

@ -0,0 +1,24 @@
--- compile/config.mk.in.orig 2011-02-27 19:45:40.000000000 +0900
+++ compile/config.mk.in 2011-08-17 00:07:28.000000000 +0900
@@ -18,8 +18,8 @@
incdir = $(prefix)/include
# WARNING: Directories $(dictdir) and $(docdir) will be deleted whole the
# directory when unintall.
-dictdir = $(prefix)/share/migemo
-docdir = $(prefix)/doc/migemo
+dictdir = $(prefix)/share/cmigemo
+docdir = $(prefix)/share/doc/ja/cmigemo
##############################################################################
# Commands
@@ -33,8 +33,8 @@
PERL = perl
BUNZIP2 = bzip2 -d
GUNZIP = gzip -d
-FILTER_CP932 = ${PROGRAM_ENCODEFILTER} -s
-FILTER_EUCJP = ${PROGRAM_ENCODEFILTER} -e
+FILTER_CP932 = iconv -t cp932 -f euc-jp
+FILTER_EUCJP = iconv -t euc-jp -f cp932
FILTER_UTF8 = iconv -t utf-8 -f cp932
INSTALL = ${PROGRAM_INSTALL} -c
INSTALL_PROGRAM = $(INSTALL) -m 755

View File

@ -0,0 +1,57 @@
--- compile/unix.mak.orig 2011-02-27 19:45:40.000000000 +0900
+++ compile/unix.mak 2011-08-21 14:23:10.000000000 +0900
@@ -39,36 +39,48 @@
$(MKDIR) $(bindir)
$(MKDIR) $(libdir)
$(MKDIR) $(incdir)
- $(MKDIR) $(docdir)
+
+install-mkdir-dict:
$(MKDIR) $(dictdir)
$(MKDIR) $(dictdir)/cp932
$(MKDIR) $(dictdir)/euc-jp
$(MKDIR) $(dictdir)/utf-8
-install-dict:
+install-mkdir-doc:
+ $(MKDIR) $(docdir)
+
+install-dict: install-mkdir-dict
$(INSTALL_DATA) dict/migemo-dict $(dictdir)/cp932
+ if [ -d dict/euc-jp.d ]; then \
+ $(INSTALL_DATA) dict/euc-jp.d/migemo-dict $(dictdir)/euc-jp; \
+ fi
+ if [ -d dict/utf-8.d ]; then \
+ $(INSTALL_DATA) dict/utf-8.d/migemo-dict $(dictdir)/utf-8; \
+ fi
+
+install-dat: install-mkdir-dict
$(INSTALL_DATA) dict/han2zen.dat $(dictdir)/cp932
$(INSTALL_DATA) dict/hira2kata.dat $(dictdir)/cp932
$(INSTALL_DATA) dict/roma2hira.dat $(dictdir)/cp932
$(INSTALL_DATA) dict/zen2han.dat $(dictdir)/cp932
if [ -d dict/euc-jp.d ]; then \
- $(INSTALL_DATA) dict/euc-jp.d/migemo-dict $(dictdir)/euc-jp; \
$(INSTALL_DATA) dict/euc-jp.d/han2zen.dat $(dictdir)/euc-jp; \
$(INSTALL_DATA) dict/euc-jp.d/hira2kata.dat $(dictdir)/euc-jp; \
$(INSTALL_DATA) dict/euc-jp.d/roma2hira.dat $(dictdir)/euc-jp; \
$(INSTALL_DATA) dict/euc-jp.d/zen2han.dat $(dictdir)/euc-jp; \
fi
if [ -d dict/utf-8.d ]; then \
- $(INSTALL_DATA) dict/utf-8.d/migemo-dict $(dictdir)/utf-8; \
$(INSTALL_DATA) dict/utf-8.d/han2zen.dat $(dictdir)/utf-8; \
$(INSTALL_DATA) dict/utf-8.d/hira2kata.dat $(dictdir)/utf-8; \
$(INSTALL_DATA) dict/utf-8.d/roma2hira.dat $(dictdir)/utf-8; \
$(INSTALL_DATA) dict/utf-8.d/zen2han.dat $(dictdir)/utf-8; \
fi
-install: $(outdir)cmigemo$(EXEEXT) $(libmigemo_DSO) install-mkdir install-dict install-lib
- $(INSTALL_DATA) $(srcdir)migemo.h $(incdir)
+install-doc: install-mkdir-doc
$(INSTALL_DATA) doc/README_j.txt $(docdir)
+
+install: $(outdir)cmigemo$(EXEEXT) $(libmigemo_DSO) install-mkdir install-dat install-lib
+ $(INSTALL_DATA) $(srcdir)migemo.h $(incdir)
$(INSTALL_PROGRAM) $(outdir)cmigemo$(EXEEXT) $(bindir)
##############################################################################

View File

@ -0,0 +1,42 @@
--- dict/dict.mak.orig 2011-02-27 19:45:40.000000000 +0900
+++ dict/dict.mak 2011-08-17 01:04:58.000000000 +0900
@@ -32,10 +32,10 @@
##############################################################################
# Dictionary in euc-jp
#
-euc-jp: cp932 euc-jp-files
-euc-jp-files: $(EUCJP_DIR) $(EUCJP_DIR)/migemo-dict \
- $(EUCJP_DIR)/zen2han.dat $(EUCJP_DIR)/han2zen.dat \
- $(EUCJP_DIR)/hira2kata.dat $(EUCJP_DIR)/roma2hira.dat
+euc-jp-dict: cp932 $(EUCJP_DIR) $(EUCJP_DIR)/migemo-dict
+euc-jp-dat: $(EUCJP_DIR) $(EUCJP_DIR)/zen2han.dat \
+ $(EUCJP_DIR)/han2zen.dat $(EUCJP_DIR)/hira2kata.dat \
+ $(EUCJP_DIR)/roma2hira.dat
$(EUCJP_DIR):
$(MKDIR) $(EUCJP_DIR)
$(EUCJP_DIR)/migemo-dict: migemo-dict
@@ -52,10 +52,10 @@
##############################################################################
# Dictionary in utf-8
#
-utf-8: cp932 utf-8-files
-utf-8-files: $(UTF8_DIR) $(UTF8_DIR)/migemo-dict \
- $(UTF8_DIR)/zen2han.dat $(UTF8_DIR)/han2zen.dat \
- $(UTF8_DIR)/hira2kata.dat $(UTF8_DIR)/roma2hira.dat
+utf-8-dict: cp932 $(UTF8_DIR) $(UTF8_DIR)/migemo-dict
+utf-8-dat: $(UTF8_DIR) $(UTF8_DIR)/zen2han.dat \
+ $(UTF8_DIR)/han2zen.dat $(UTF8_DIR)/hira2kata.dat \
+ $(UTF8_DIR)/roma2hira.dat
$(UTF8_DIR):
$(MKDIR) $(UTF8_DIR)
$(UTF8_DIR)/migemo-dict: migemo-dict
@@ -87,7 +87,8 @@
##############################################################################
# for GNU/gcc(Linux¼)
#
-gcc: euc-jp
+gcc-dict: euc-jp-dict utf-8-dict
+gcc-dat: euc-jp-dat utf-8-dat
##############################################################################
# for MacOS X

View File

@ -0,0 +1,10 @@
--- src/wordbuf.c.orig 2011-08-13 23:52:52.000000000 +0900
+++ src/wordbuf.c 2011-08-13 23:53:22.000000000 +0900
@@ -9,6 +9,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <limits.h>
#include "wordbuf.h"
#define WORDLEN_DEF 64

View File

@ -0,0 +1,4 @@
C/Migemo is a C language implementation of Migemo Japanese incremental search
tool. You can search a text for Japanese words without having to input kanji.
WWW: http://www.kaoriya.net/software/cmigemo

View File

@ -0,0 +1,21 @@
bin/cmigemo
include/migemo.h
lib/libmigemo.so.1.1.0
lib/libmigemo.so.1
lib/libmigemo.so
%%DATADIR%%/cp932/han2zen.dat
%%DATADIR%%/cp932/hira2kata.dat
%%DATADIR%%/cp932/roma2hira.dat
%%DATADIR%%/cp932/zen2han.dat
%%DATADIR%%/euc-jp/han2zen.dat
%%DATADIR%%/euc-jp/hira2kata.dat
%%DATADIR%%/euc-jp/roma2hira.dat
%%DATADIR%%/euc-jp/zen2han.dat
%%DATADIR%%/utf-8/han2zen.dat
%%DATADIR%%/utf-8/hira2kata.dat
%%DATADIR%%/utf-8/roma2hira.dat
%%DATADIR%%/utf-8/zen2han.dat
@dirrmtry %%DATADIR%%/cp932
@dirrmtry %%DATADIR%%/euc-jp
@dirrmtry %%DATADIR%%/utf-8
@dirrmtry %%DATADIR%%