2 desc "Open video compression format"
3 homepage "https://www.theora.org/"
7 url "https://downloads.xiph.org/releases/theora/libtheora-1.1.1.tar.bz2", using: :homebrew_curl
8 mirror "https://ftp.osuosl.org/pub/xiph/releases/theora/libtheora-1.1.1.tar.bz2"
9 sha256 "b6ae1ee2fa3d42ac489287d3ec34c5885730b1296f0801ae577a35193d3affbc"
11 # Fix -flat_namespace being used on Big Sur and later.
13 url "https://raw.githubusercontent.com/Homebrew/formula-patches/03cf8088210822aa2c1ab544ed58ea04c897d9c4/libtool/configure-pre-0.4.2.418-big_sur.diff"
14 sha256 "83af02f2aa2b746bb7225872cab29a253264be49db0ecebb12f841562d9a2923"
19 url "https://ftp.osuosl.org/pub/xiph/releases/theora/?C=M&O=D"
20 regex(/href=.*?libtheora[._-]v?(\d+(?:\.\d+)+)\.t/i)
25 sha256 cellar: :any, arm64_sequoia: "19801e6ceb5c12db4621afff8746a3ef77581226559ec728c6c07a49659b23d3"
26 sha256 cellar: :any, arm64_sonoma: "7f57dbcd0a12b47f7f886f9474d2ffa04df1ff62fc9c6a330c4f828386d94301"
27 sha256 cellar: :any, arm64_ventura: "b4b1fe0a53ce538d88ca098fce885c20cca62175c2d2141ad96454e7163674a6"
28 sha256 cellar: :any, arm64_monterey: "56008e9450fcf3f712f34ec79407b8e738953d5fc50feaf72a6434dd28fc1101"
29 sha256 cellar: :any, arm64_big_sur: "1e5271cb88e3dad8eb5f06460e7f3f2cec0129679c7f7fb4f84db1d09664b827"
30 sha256 cellar: :any, sonoma: "53cce2c2f66137baf358f0a625a5095fa1eab222cda32ecbe8fe202153375cf8"
31 sha256 cellar: :any, ventura: "cab83d4adc91a223bdc43ca9e26f3a15d37ffcda352be74de313ffe2c1160189"
32 sha256 cellar: :any, monterey: "0bdb8acd2fafffff1e172c94aa6f67ce20ea67760d5296ac108ca1ec7e9e4c22"
33 sha256 cellar: :any, big_sur: "7ba57255df2c2f4563767031c6b9ead9a93883217644e9e64b5523e26d7b1088"
34 sha256 cellar: :any, catalina: "1fcbd50039f580bd85554af2d831c28f83613b5d26969f577f7fe87b3c55db67"
35 sha256 cellar: :any, mojave: "6fdb09d75fc6e64b266a185e711c2964e803d8f10c0d40ccb8d572c536c24d3a"
36 sha256 cellar: :any_skip_relocation, x86_64_linux: "4ac10b8e87b29874cd0e6d61de22b1123cbc7757f0eae7e5c195dd8c1ab70ef8"
40 url "https://gitlab.xiph.org/xiph/theora.git", branch: "master"
42 depends_on "autoconf" => :build
43 depends_on "automake" => :build
46 depends_on "libtool" => :build
47 depends_on "pkgconf" => :build
49 depends_on "libvorbis"
52 cp Dir["#{Formula["libtool"].opt_share}/libtool/*/config.{guess,sub}"], buildpath
53 system "./autogen.sh" if build.head?
61 args << "--disable-asm" if build.head?
63 system "./configure", *args, *std_configure_args
64 system "make", "install"
68 (testpath/"test.c").write <<~C
69 #include <theora/theora.h>
74 theora_info_init(&inf);
75 theora_info_clear(&inf);
79 system ENV.cc, "test.c", "-L#{lib}", "-ltheora", "-o", "test"