homebrew-core/Formula/freeling.rb
2016-11-02 08:47:19 -07:00

48 lines
1.6 KiB
Ruby

class Freeling < Formula
desc "Suite of language analyzers"
homepage "http://nlp.lsi.upc.edu/freeling/"
url "https://github.com/TALP-UPC/FreeLing/releases/download/4.0/FreeLing-4.0.tar.gz"
sha256 "c79d21c5af215105ba16eb69ee75b589bf7d41abce86feaa40757513e33c6ecf"
revision 3
bottle do
cellar :any
sha256 "8063b2002337f2391ca09e80432254ef2b2d287961d590403489296607131ccc" => :sierra
sha256 "cda876dfef51471f3eb56107abb5a1e417067f3056dddd45475755b00a424362" => :el_capitan
sha256 "656047f1e71b2bc9abeb9f733211154997c3e0e890d1841533ce7960e66f80c6" => :yosemite
end
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "libtool" => :build
depends_on "boost" => "with-icu4c"
depends_on "icu4c"
conflicts_with "hunspell", :because => "both install 'analyze' binary"
def install
icu4c = Formula["icu4c"]
libtool = Formula["libtool"]
ENV.append "LDFLAGS", "-L#{libtool.lib}"
ENV.append "LDFLAGS", "-L#{icu4c.lib}"
ENV.append "CPPFLAGS", "-I#{libtool.include}"
ENV.append "CPPFLAGS", "-I#{icu4c.include}"
system "autoreconf", "--install"
system "./configure", "--prefix=#{prefix}", "--enable-boost-locale"
system "make", "install"
libexec.install "#{bin}/fl_initialize"
inreplace "#{bin}/analyze",
". $(cd $(dirname $0) && echo $PWD)/fl_initialize",
". #{libexec}/fl_initialize"
end
test do
expected = <<-EOS.undent
Hello hello NN 1
world world NN 1
EOS
assert_equal expected, pipe_output("#{bin}/analyze -f #{pkgshare}/config/en.cfg", "Hello world").chomp
end
end