From e1d7ae01c360d548470200c362d41ee985206c69 Mon Sep 17 00:00:00 2001 From: Garrett Hyde Date: Thu, 24 Apr 2014 00:52:53 -0600 Subject: cabocha: add dependencies on mecab dictionaries. add option for default charset. Closes #28659. Signed-off-by: Adam Vandenberg --- Library/Formula/cabocha.rb | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'Library/Formula') diff --git a/Library/Formula/cabocha.rb b/Library/Formula/cabocha.rb index bf3da4379..2fd579da8 100644 --- a/Library/Formula/cabocha.rb +++ b/Library/Formula/cabocha.rb @@ -8,6 +8,13 @@ class Cabocha < Formula depends_on 'crf++' depends_on 'mecab' + # 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' option 'posset=', 'choose default posset: IPA, JUMAN, UNIDIC' def install @@ -18,11 +25,14 @@ class Cabocha < Formula s.change_make_var! 'CXXFLAGS', ENV.cflags end + charset = ARGV.value('charset') || 'UTF8' posset = ARGV.value('posset') || "IPA" - args = ["--with-charset=utf8", - "--disable-dependency-tracking", - "--prefix=#{prefix}"] - args << "--with-posset=#{posset}" + args = %W[ + --disable-dependency-tracking + --prefix=#{prefix} + --with-charset=#{charset} + --with-posset=#{posset} + ] system "./configure", *args system "make install" -- cgit v1.2.3