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 |
EUCJP_VARS= ENCODING=euc-jp |
35 |
SHIFTJIS_BUILD_DEPENDS= ja-mecab-ipadic-sjis>0:japanese/mecab-ipadic-sjis |
36 |
SHIFTJIS_VARS= ENCODING=shiftjis |
37 |
UTF8_BUILD_DEPENDS= ja-mecab-ipadic-utf8>0:japanese/mecab-ipadic-utf8 |
38 |
UTF8_VARS= ENCODING=utf-8 |
39 |
|
40 |
do-build: |
41 |
${LOCALBASE}/libexec/mecab/mecab-dict-index \ |
42 |
-d ${LOCALBASE}/${MECABDIR} -u ${WRKSRC}/${MECABDIC} \ |
43 |
-f utf-8 -t ${ENCODING} ${WRKSRC}/mecab-userdic.csv |
44 |
|
45 |
do-install: |
46 |
${MKDIR} ${STAGEDIR}${PREFIX}/${MECABDIR} |
47 |
${INSTALL_DATA} ${WRKSRC}/${MECABDIC} ${STAGEDIR}${PREFIX}/${MECABDIR} |
48 |
.else |
49 |
SKKDIR= share/skk |
50 |
SKKDIC= SKK-JISYO.${PORTNAME} |
51 |
|
52 |
OPTIONS_DEFAULT= EUCCDB |
53 |
OPTIONS_MULTI= DICTIONARY |
54 |
OPTIONS_MULTI_DICTIONARY= EUC EUCCDB UTF8 UTF8CDB |
55 |
EUC_DESC= EUC-JP Charset dictionary |
56 |
EUCCDB_DESC= EUC-JP Charset dictionary (cdb) |
57 |
UTF8_DESC= UTF8 Charset dictionary |
58 |
UTF8CDB_DESC= UTF8 Charset dictionary (cdb) |
59 |
|
60 |
EUC_BUILD_DEPENDS= ${LOCALBASE}/bin/nkf:japanese/nkf |
61 |
EUCCDB_BUILD_DEPENDS= ${LOCALBASE}/bin/nkf:japanese/nkf \ |
62 |
${LOCALBASE}/bin/cdb:databases/tinycdb |
63 |
UTF8CDB_BUILD_DEPENDS= ${LOCALBASE}/bin/cdb:databases/tinycdb |
64 |
|
65 |
EUC_VARS= DICS=${SKKDIC} |
66 |
EUCCDB_VARS= DICS+=${SKKDIC}.cdb CDBS=${SKKDIC} |
67 |
UTF8_VARS= DICS+=${SKKDIC}.utf8 |
68 |
UTF8CDB_VARS= DICS+=${SKKDIC}.utf8.cdb CDBS+=${SKKDIC}.utf8 |
69 |
|
70 |
.include <bsd.port.options.mk> |
71 |
|
72 |
.for dic in ${DICS} |
73 |
PLIST_FILES+= ${SKKDIR}/${dic} |
74 |
.endfor |
75 |
|
76 |
do-build: |
77 |
.if ${PORT_OPTIONS:MEUC*} |
78 |
${LOCALBASE}/bin/nkf -e --overwrite=.utf8 ${WRKSRC}/${SKKDIC} |
79 |
.else |
80 |
${MV} ${WRKSRC}/${SKKDIC} ${WRKSRC}/${SKKDIC}.utf8 |
81 |
.endif |
82 |
.for dic in ${CDBS} |
83 |
${AWK} '/^[^;]/ { \ |
84 |
s = substr($$0, index($$0, " ") + 1); \ |
85 |
print "+" length($$1) "," length(s) ":" $$1 "->" s; \ |
86 |
} \ |
87 |
END { \ |
88 |
print ""; \ |
89 |
}' < ${WRKSRC}/${dic} | \ |
90 |
${LOCALBASE}/bin/cdb -c -t - ${WRKSRC}/${dic}.cdb |
91 |
.endfor |
92 |
|
93 |
do-install: |
94 |
${MKDIR} ${STAGEDIR}${PREFIX}/${SKKDIR} |
95 |
cd ${WRKSRC} && ${INSTALL_DATA} ${DICS} ${STAGEDIR}${PREFIX}/${SKKDIR} |
96 |
.endif |
97 |
|
98 |
.include <bsd.port.mk> |