2012-01-30 15:56:53 +00:00
|
|
|
require 'formula'
|
|
|
|
|
|
|
|
class Cabocha < Formula
|
|
|
|
homepage 'http://code.google.com/p/cabocha/'
|
2014-03-13 18:15:35 +00:00
|
|
|
url 'https://cabocha.googlecode.com/files/cabocha-0.68.tar.bz2'
|
|
|
|
sha1 '5e22a71eb86d778fdeb1b725c0b27f1fb4af7f4b'
|
2012-01-30 15:56:53 +00:00
|
|
|
|
|
|
|
depends_on 'crf++'
|
2012-11-17 07:12:19 +00:00
|
|
|
depends_on 'mecab'
|
2012-01-30 15:56:53 +00:00
|
|
|
|
2014-04-24 06:52:53 +00:00
|
|
|
# To see which dictionaries are available, run:
|
|
|
|
# ls `mecab-config --libs-only-L`/mecab/dic/
|
|
|
|
depends_on 'mecab-ipadic' => :recommended
|
|
|
|
depends_on 'mecab-jumandic' => :optional
|
|
|
|
depends_on 'mecab-unidic' => :optional
|
|
|
|
|
|
|
|
option 'charset=', 'choose default charset: EUC-JP, CP932, UTF8'
|
2014-04-27 00:09:36 +00:00
|
|
|
option 'posset=', 'choose default posset: IPA, JUMAN, UNIDIC'
|
2013-11-17 22:00:07 +00:00
|
|
|
|
2012-01-30 15:56:53 +00:00
|
|
|
def install
|
|
|
|
ENV["LIBS"] = '-liconv'
|
|
|
|
|
|
|
|
inreplace 'Makefile.in' do |s|
|
|
|
|
s.change_make_var! 'CFLAGS', ENV.cflags
|
|
|
|
s.change_make_var! 'CXXFLAGS', ENV.cflags
|
|
|
|
end
|
|
|
|
|
2014-04-24 06:52:53 +00:00
|
|
|
charset = ARGV.value('charset') || 'UTF8'
|
2014-01-11 08:18:57 +00:00
|
|
|
posset = ARGV.value('posset') || "IPA"
|
2014-04-24 06:52:53 +00:00
|
|
|
args = %W[
|
|
|
|
--disable-dependency-tracking
|
|
|
|
--prefix=#{prefix}
|
|
|
|
--with-charset=#{charset}
|
|
|
|
--with-posset=#{posset}
|
|
|
|
]
|
2014-01-11 08:18:57 +00:00
|
|
|
|
|
|
|
system "./configure", *args
|
2012-01-30 15:56:53 +00:00
|
|
|
system "make install"
|
|
|
|
end
|
|
|
|
end
|