homebrew-core/Formula/freeling.rb

49 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 5
bottle do
cellar :any
sha256 "e552c61461b46e1783d405ab84257a9451c4adaf9004c8a92daafb08e37d5c70" => :sierra
sha256 "9d58650769996c721aafa280bf75479d3f5373d5293b3cfdc1b76d28581e07d1" => :el_capitan
sha256 "8ccd25c9b966956003ee4ab3cd119c4f79431d52737880fda8927027626647eb" => :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