homebrew-core/Formula/libass.rb
2016-12-31 08:51:54 +01:00

68 lines
2 KiB
Ruby

class Libass < Formula
desc "Subtitle renderer for the ASS/SSA subtitle format"
homepage "https://github.com/libass/libass"
url "https://github.com/libass/libass/releases/download/0.13.5/libass-0.13.5.tar.gz"
sha256 "e5c6d9ae81c3c75721a3920960959d2512e2ef14666910d76f976589d2f89b3f"
bottle do
cellar :any
sha256 "108532110b90da93e8607d8570956188246ebe280453788017d8f8c9fcd54cf5" => :sierra
sha256 "5788ff60eb585675897eb048fed7ebded3cda36e132eeb03423721ba8f039e82" => :el_capitan
sha256 "dbeeb66443163d53b925e930bb24926ac9c5d00dbf782434bc121de7a137c055" => :yosemite
end
head do
url "https://github.com/libass/libass.git"
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "libtool" => :build
end
option "with-fontconfig", "Disable CoreText backend in favor of the more traditional fontconfig"
depends_on "pkg-config" => :build
depends_on "yasm" => :build
depends_on "freetype"
depends_on "fribidi"
depends_on "harfbuzz" => :recommended
depends_on "fontconfig" => :optional
def install
args = %W[--disable-dependency-tracking --prefix=#{prefix}]
args << "--disable-coretext" if build.with? "fontconfig"
system "autoreconf", "-i" if build.head?
system "./configure", *args
system "make", "install"
end
test do
(testpath/"test.cpp").write <<-EOS.undent
#include "ass/ass.h"
int main() {
ASS_Library *library;
ASS_Renderer *renderer;
library = ass_library_init();
if (library) {
renderer = ass_renderer_init(library);
if (renderer) {
ass_renderer_done(renderer);
ass_library_done(library);
return 0;
}
else {
ass_library_done(library);
return 1;
}
}
else {
return 1;
}
}
EOS
system ENV.cc, "test.cpp", "-I#{include}", "-L#{lib}", "-lass", "-o", "test"
system "./test"
end
end