class Libbluray < Formula desc "Blu-Ray disc playback library for media players like VLC" homepage "https://www.videolan.org/developers/libbluray.html" url "https://download.videolan.org/videolan/libbluray/1.3.4/libbluray-1.3.4.tar.bz2" sha256 "478ffd68a0f5dde8ef6ca989b7f035b5a0a22c599142e5cd3ff7b03bbebe5f2b" license "LGPL-2.1-or-later" livecheck do url "https://download.videolan.org/pub/videolan/libbluray/" regex(%r{href=["']?v?(\d+(?:\.\d+)+)/?["' >]}i) end head do url "https://code.videolan.org/videolan/libbluray.git" depends_on "autoconf" => :build depends_on "automake" => :build depends_on "libtool" => :build end depends_on "pkg-config" => :build depends_on "fontconfig" depends_on "freetype" uses_from_macos "libxml2" def install args = %W[--prefix=#{prefix} --disable-dependency-tracking --disable-silent-rules --disable-bdjava-jar] system "./bootstrap" if build.head? system "./configure", *args system "make" system "make", "install" end test do (testpath/"test.c").write <<~EOS #include int main(void) { BLURAY *bluray = bd_init(); bd_close(bluray); return 0; } EOS system ENV.cc, "test.c", "-I#{include}", "-L#{lib}", "-lbluray", "-o", "test" system "./test" end end