-
-
Save danigiri/2025311 to your computer and use it in GitHub Desktop.
Homebrew formula for FreeLing3 (SVN Head)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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