Added
Link Here
|
1 |
PORTNAME= jawiki |
2 |
DISTVERSION= g20240521 |
3 |
CATEGORIES= japanese |
4 |
PKGNAMEPREFIX?= ja-skk- |
5 |
|
6 |
MAINTAINER= mew14930xvi@inbox.lv |
7 |
COMMENT?= SKK dictionary from Wikipedia (Japanese edition) |
8 |
WWW= https://github.com/tokuhirom/jawiki-kana-kanji-dict |
9 |
|
10 |
LICENSE= MIT |
11 |
|
12 |
USE_GITHUB= yes |
13 |
GH_ACCOUNT= tokuhirom |
14 |
GH_PROJECT= jawiki-kana-kanji-dict |
15 |
GH_TAGNAME= d62e22e |
16 |
NO_ARCH= yes |
17 |
|
18 |
.if defined(MECAB) |
19 |
BUILD_DEPENDS= ${LOCALBASE}/libexec/mecab/mecab-dict-index:japanese/mecab |
20 |
|
21 |
MECABDIR= lib/mecab/dic/ipadic |
22 |
MECABDIC= ${PORTNAME}.dic |
23 |
|
24 |
PLIST_FILES= ${MECABDIR}/${MECABDIC} |
25 |
|
26 |
OPTIONS_DEFAULT= UTF8 |
27 |
OPTIONS_SINGLE= CHARSET |
28 |
OPTIONS_SINGLE_CHARSET= EUCJP SHIFTJIS UTF8 |
29 |
EUCJP_DESC= Use EUC-JP as dictionary charset. |
30 |
SHIFTJIS_DESC= Use SHIFT-JIS as dictionary charset. |
31 |
UTF8_DESC= Use UTF-8 as dictionary charset. |
32 |
|
33 |
EUCJP_BUILD_DEPENDS= ja-mecab-ipadic-eucjp>0:japanese/mecab-ipadic-eucjp |
34 |
SHIFTJIS_BUILD_DEPENDS= ja-mecab-ipadic-sjis>0:japanese/mecab-ipadic-sjis |
35 |
UTF8_BUILD_DEPENDS= ja-mecab-ipadic-utf8>0:japanese/mecab-ipadic-utf8 |
36 |
|
37 |
EUCJP_VARS= CSET=euc-jp |
38 |
SHIFTJIS_VARS= CSET=shiftjis |
39 |
UTF8_VARS= CSET=utf-8 |
40 |
|
41 |
do-build: |
42 |
${LOCALBASE}/libexec/mecab/mecab-dict-index \ |
43 |
-d ${LOCALBASE}/${MECABDIR} -u ${WRKSRC}/${MECABDIC} \ |
44 |
-f utf-8 -t ${CSET} ${WRKSRC}/mecab-userdic.csv |
45 |
|
46 |
do-install: |
47 |
${MKDIR} ${STAGEDIR}${PREFIX}/${MECABDIR} |
48 |
${INSTALL_DATA} ${WRKSRC}/${MECABDIC} ${STAGEDIR}${PREFIX}/${MECABDIR} |
49 |
.else |
50 |
SKKDIR= share/skk |
51 |
SKKDIC= SKK-JISYO.${PORTNAME} |
52 |
|
53 |
OPTIONS_DEFAULT= EUCCDB |
54 |
OPTIONS_MULTI= DICTIONARY |
55 |
OPTIONS_MULTI_DICTIONARY= EUC EUCCDB UTF8 UTF8CDB |
56 |
EUC_DESC= EUC-JP Charset dictionary |
57 |
EUCCDB_DESC= EUC-JP Charset dictionary (cdb) |
58 |
UTF8_DESC= UTF8 Charset dictionary |
59 |
UTF8CDB_DESC= UTF8 Charset dictionary (cdb) |
60 |
|
61 |
EUC_BUILD_DEPENDS= ${LOCALBASE}/bin/nkf:japanese/nkf |
62 |
EUCCDB_BUILD_DEPENDS= ${LOCALBASE}/bin/nkf:japanese/nkf \ |
63 |
${LOCALBASE}/bin/cdb:databases/tinycdb |
64 |
UTF8CDB_BUILD_DEPENDS= ${LOCALBASE}/bin/cdb:databases/tinycdb |
65 |
|
66 |
EUC_VARS= DICS=${SKKDIC} |
67 |
EUCCDB_VARS= DICS+=${SKKDIC}.cdb |
68 |
UTF8_VARS= DICS+=${SKKDIC}.utf8 |
69 |
UTF8CDB_VARS= DICS+=${SKKDIC}.utf8.cdb |
70 |
|
71 |
PLIST_FILES= ${DICS:S|^|${SKKDIR}/|} |
72 |
|
73 |
.include <bsd.port.options.mk> |
74 |
|
75 |
do-build: |
76 |
${MV} ${WRKSRC}/${SKKDIC} ${WRKSRC}/${SKKDIC}.orig |
77 |
.if ${PORT_OPTIONS:MUTF8*} |
78 |
${ECHO_CMD} ';; -*- mode: fundamental; coding: utf-8 -*-' | \ |
79 |
${CAT} - ${WRKSRC}/${SKKDIC}.orig > ${WRKSRC}/${SKKDIC}.utf8 |
80 |
.endif |
81 |
.if ${PORT_OPTIONS:MEUC*} |
82 |
${ECHO_CMD} ';; -*- mode: fundamental; coding: euc-jp -*-' \ |
83 |
> ${WRKSRC}/${SKKDIC} |
84 |
${LOCALBASE}/bin/nkf --oc=eucJP-ms ${WRKSRC}/${SKKDIC}.orig \ |
85 |
>> ${WRKSRC}/${SKKDIC} |
86 |
.endif |
87 |
.for dic in ${DICS:M*.cdb} |
88 |
${AWK} '/^[^;]/ { \ |
89 |
s = substr($$0, index($$0, " ") + 1); \ |
90 |
print "+" length($$1) "," length(s) ":" $$1 "->" s; \ |
91 |
} \ |
92 |
END { \ |
93 |
print ""; \ |
94 |
}' < ${WRKSRC}/${dic:S|.cdb||} | \ |
95 |
${LOCALBASE}/bin/cdb -c -t - ${WRKSRC}/${dic} |
96 |
.endfor |
97 |
|
98 |
do-install: |
99 |
${MKDIR} ${STAGEDIR}${PREFIX}/${SKKDIR} |
100 |
cd ${WRKSRC} && ${INSTALL_DATA} ${DICS} ${STAGEDIR}${PREFIX}/${SKKDIR} |
101 |
.endif |
102 |
|
103 |
.include <bsd.port.mk> |