Skip to content

Instantly share code, notes, and snippets.

@danigiri
Forked from ambs/FreeLing.rb
Created March 12, 2012 23:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danigiri/2025311 to your computer and use it in GitHub Desktop.
Save danigiri/2025311 to your computer and use it in GitHub Desktop.
Homebrew formula for FreeLing3 (SVN Head)
require 'formula'
class Freeling < Formula
homepage 'http://nlp.lsi.upc.edu/freeling/'
head 'http://devel.cpl.upc.edu/freeling/svn/trunk', :using => :svn
depends_on 'icu4c'
# requires boost --with-icu. At the moment I think that is not possible (to force options)
depends_on 'boost'
depends_on 'libtool'
def install
opoo 'Requires boost with icu support, if the installation fails, remove boost and do a \'brew install boost --with-icu\''
icu4c_prefix = Formula.factory('icu4c').prefix
libtool_prefix = Formula.factory('libtool').prefix
ENV.append 'LDFLAGS', "-L#{libtool_prefix}/lib"
ENV.append 'LDFLAGS', "-L#{icu4c_prefix}/lib"
ENV.append 'CPPFLAGS', "-I#{libtool_prefix}/include"
ENV.append 'CPPFLAGS', "-I#{icu4c_prefix}/include"
system "./autogen.sh",
"--prefix=#{prefix}"
# the configure script doesn't have any options to specify libtool binary
# therefore we do a search and replace of the command
inreplace './configure', "LIBTOOL='$(SHELL) $(top_builddir)/libtool'", "LIBTOOL='$(SHELL) #{libtool_prefix}/bin/glibtool'"
system "make install"
end
def test
system "echo 'Hello world' | analyze -f #{share}/freeling/config/en.cfg | grep -c 'world world NN 1'"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment