source: trunk/dports/textproc/mecab/Portfile

Last change on this file was 133891, checked in by hum@…, 3 years ago

mecab: add neologd variant; fix to set default_variants

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 3.5 KB
Line 
1# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
2# $Id: Portfile 133891 2015-03-15 00:42:35Z ryandesign@macports.org $
3
4PortSystem          1.0
5
6name                mecab
7version             0.996
8categories          textproc japanese
9maintainers         hum openmaintainer
10
11set encoding        eucjp
12
13subport mecab-sjis {
14    set encoding    sjis
15    conflicts       mecab mecab-utf8
16    livecheck.type  none
17}
18
19subport mecab-utf8 {
20    set encoding    utf8
21    conflicts       mecab mecab-sjis
22    livecheck.type  none
23}
24
25description         yet another part-of-speech and morphological analyzer
26long_description    MeCab is ${description}. \
27                    This port depends on MeCab base analyzer and a Japanese \
28                    dictionary of ${encoding} encoding.
29
30homepage            http://mecab.sourceforge.net/
31platforms           darwin
32license             {GPL LGPL BSD}
33
34distfiles
35
36depends_lib         port:mecab-base
37
38conflicts           mecab-sjis mecab-utf8
39
40use_configure       no
41supported_archs     noarch
42
43build               {}
44
45set dicname         ipadic
46
47variant ipadic conflicts jumandic naistjdic unidic neologd description {Use ipadic} {
48    set dicname         ipadic
49    if {${encoding} == "eucjp"} {
50        depends_lib-append  port:mecab-${dicname}
51    } else {
52        depends_lib-append  port:mecab-${dicname}-${encoding}
53    }
54}
55
56variant jumandic conflicts ipadic naistjdic unidic neologd description {Use jumandic} {
57    set dicname         jumandic
58    if {${encoding} == "eucjp"} {
59        depends_lib-append  port:mecab-${dicname}
60    } else {
61        depends_lib-append  port:mecab-${dicname}-${encoding}
62    }
63}
64
65variant naistjdic conflicts ipadic jumandic unidic neologd description {Use naist-jdic} {
66    set dicname         naist-jdic
67    if {${encoding} == "eucjp"} {
68        depends_lib-append  port:mecab-${dicname}
69    } else {
70        depends_lib-append  port:mecab-${dicname}-${encoding}
71    }
72}
73
74if {${encoding} == "utf8"} {
75    variant unidic conflicts ipadic jumandic naistjdic neologd description {Use unidic} {
76        set dicname         unidic
77        depends_lib-append  port:unidic-mecab
78    }
79
80    variant neologd conflicts ipadic jumandic naistjdic unidic description {Use neologd} {
81        set dicname         neologd
82        depends_lib-append  port:mecab-ipadic-neologd
83    }
84}
85
86if {([variant_isset unidic] || [variant_isset neologd]) && ${encoding} != "utf8"} {
87    ui_error "Please install 'mecab-utf8' to use 'unidic' or 'neologd'." 
88    error "invalid variant"
89}
90
91variant sjis description {Deprecated, install mecab-sjis instead} {
92    ui_msg "Deprecated: please install 'mecab-sjis' instead of 'mecab +sjis'."
93    ui_msg "Note: upgrading mecab will be completed if mecab-sjis is successfully installed, although the process fails due to a conflict."
94    depends_lib         port:mecab-sjis
95}
96
97variant utf8 description {Deprecated, install mecab-utf8 instead} {
98    ui_msg "Deprecated: please install 'mecab-utf8' instead of 'mecab +utf8'."
99    ui_msg "Note: upgrading mecab will be completed if mecab-utf8 is successfully installed, although the process fails due to a conflict."
100    depends_lib         port:mecab-utf8
101}
102
103if {![variant_isset jumandic] && ![variant_isset naistjdic] &&
104    ![variant_isset unidic] && ![variant_isset neologd]} {
105    default_variants    +ipadic
106}
107
108destroot {
109    set dest_dic ${destroot}${prefix}/lib/mecab/dic
110    file mkdir ${dest_dic}
111    ln -s ${dicname}-${encoding} ${dest_dic}/sysdic
112}
113
114livecheck.type      none
Note: See TracBrowser for help on using the repository browser.