hfst icon indicating copy to clipboard operation
hfst copied to clipboard

provide a homebrew recipe

Open petri opened this issue 7 years ago • 1 comments

It would be nice if HFST were easily installable on MacOS via homebrew.

petri avatar Dec 09 '18 17:12 petri

Here's a draft homebrew recipe. Some notes:

  • the hfst build process fails to detect glibtoolize so a link to `libtoolize' with that name should be added (would be nice if hfst build process fixed this)

  • bison on MacOS (2.3 at the time of writing this) is too old, not supporting the hfst build process, thus a newer bison must be installed

These should be made part of the recipe as well.

class Hfst < Formula
  desc "Helsinki Finite-State Technology (library and application suite)"
  homepage "https://hfst.github.io"
  url "https://github.com/hfst/hfst/archive/v3.15.0.tar.gz"
  sha256 "1ce90956d7c91d75e7c141e3852504b02728672239746858a141ccfae1712d19"

  depends_on "automake"
  depends_on "autoconf"
  depends_on "libtool"
  depends_on "bison"

  def install

    opoo "In case of libtool problem, add a 'libtoolize' link pointing to 'glibtoolize'"
    opoo "You need a fairly modern version of bison - the MacOS builtin is too old"

    system "./autogen.sh"
    system "./configure", "--disable-debug",
                          "--disable-dependency-tracking",
                          "--disable-silent-rules",
                          "--prefix=#{prefix}"

    system "make", "install" # if this fails, try separate make/make install steps
  end

  test do
    system "#{bin}/hfst-info"
  end
end

petri avatar Dec 09 '18 17:12 petri