Files
homebrew-tap-local/Formula/libvorbis.rb
T

68 lines
2.3 KiB
Ruby

class Libvorbis < Formula
bottle do
root_url "https://homebrew.hyprnet/bottles"
rebuild 1
sha256 cellar: :any, arm64_sequoia: "c28d1e0b461a4cf6f5aee72e664ac6f5f6f3efaab44f15b91924f08474cfafe1"
sha256 cellar: :any, arm64_tahoe: "99c0de7ff87f4648bb17acd0324a15563e975b7492dbd4f11fd656a8eb6b5622"
sha256 cellar: :any_skip_relocation, x86_64_linux: "41daf79ce53910061acbe1f63ca95f53b4149d3ebb2b97c2bb4d31845820f219"
end
desc "Vorbis general audio compression codec"
homepage "https://xiph.org/vorbis/"
url "https://ftp.osuosl.org/pub/xiph/releases/vorbis/libvorbis-1.3.7.tar.xz"
mirror "https://github.com/xiph/vorbis/releases/download/v1.3.7/libvorbis-1.3.7.tar.xz"
sha256 "b33cc4934322bcbf6efcbacf49e3ca01aadbea4114ec9589d1b1e9d20f72954b"
license "BSD-3-Clause"
compatibility_version 1
livecheck do
url "https://ftp.osuosl.org/pub/xiph/releases/vorbis/?C=M&O=D"
regex(%r{href=(?:["']?|.*?/)libvorbis[._-]v?(\d+(?:\.\d+)+)\.t}i)
end
head do
url "https://gitlab.xiph.org/xiph/vorbis.git", branch: "master"
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "libtool" => :build
end
depends_on "pkgconf" => :build
depends_on "libogg"
resource("oggfile") do
url "https://upload.wikimedia.org/wikipedia/commons/c/c8/Example.ogg"
sha256 "f57b56d8aae4c847cf01224fb45293610d801cfdac43d932b5eeab1cd318182a"
end
def install
system "./autogen.sh" if build.head?
inreplace "configure", " -force_cpusubtype_ALL", ""
system "./configure", *std_configure_args
system "make", "install"
end
test do
(testpath/"test.c").write <<~C
#include <stdio.h>
#include <assert.h>
#include "vorbis/vorbisfile.h"
int main (void) {
OggVorbis_File vf;
assert (ov_open_callbacks (stdin, &vf, NULL, 0, OV_CALLBACKS_NOCLOSE) >= 0);
vorbis_info *vi = ov_info (&vf, -1);
printf("Bitstream is %d channel, %ldHz\\n", vi->channels, vi->rate);
printf("Encoded by: %s\\n", ov_comment(&vf,-1)->vendor);
return 0;
}
C
testpath.install resource("oggfile")
system ENV.cc, "test.c", "-I#{include}", "-L#{lib}", "-lvorbisfile",
"-o", "test"
assert_match "2 channel, 44100Hz\nEncoded by: Lavf59.27.100",
shell_output("./test < Example.ogg")
end
end