11class Libogg < Formula
22 desc "Ogg Bitstream Library"
33 homepage "https://www.xiph.org/ogg/"
4- url "https://ftp.osuosl.org/pub/xiph/releases/ogg/libogg-1.3.5 .tar.gz"
5- mirror "https://github.com/xiph/ogg/releases/download/v1.3.5 /libogg-1.3.5 .tar.gz"
6- sha256 "0eb4b4b9420a0f51db142ba3f9c64b333f826532dc0f48c6410ae51f4799b664 "
4+ url "https://ftp.osuosl.org/pub/xiph/releases/ogg/libogg-1.3.6 .tar.gz"
5+ mirror "https://github.com/xiph/ogg/releases/download/v1.3.6 /libogg-1.3.6 .tar.gz"
6+ sha256 "83e6704730683d004d20e21b8f7f55dcb3383cdf84c0daedf30bde175f774638 "
77 license "BSD-3-Clause"
88 head "https://gitlab.xiph.org/xiph/ogg.git" , branch : "master"
99
@@ -15,37 +15,33 @@ class Libogg < Formula
1515 no_autobump! because : :requires_manual_review
1616
1717 bottle do
18- rebuild 2
19- sha256 cellar : :any , arm64_sequoia : "13592df33977148bd6ca571b333892b42b1d988289a47f4efd3979fd48964b3e"
20- sha256 cellar : :any , arm64_sonoma : "f5da0b4874b723ca02947cd2312df9cdd37bc7b6e000e9e6cdd9bbbb290dc0e9"
21- sha256 cellar : :any , arm64_ventura : "d241e81018d3b64ec0d491d5d43f5409496747d57fb8d0eff75c534bd84dd19a"
22- sha256 cellar : :any , arm64_monterey : "aa2b793e007a3eb86a8b225b91561ecf1dc941071596d23f810ca41e83904d5d"
23- sha256 cellar : :any , arm64_big_sur : "e528165137cd229e4ac1147bd9c5f6de5aafb815c25d00682a923baaa621bc1d"
24- sha256 cellar : :any , sonoma : "d8591422a6ab90f2d890e14cde9c608baac46166abcce2a27978a63573b0d243"
25- sha256 cellar : :any , ventura : "517e16f78d047709c010bd3f31e6497c93c562db71f9b2022395f0a2fcb4c62d"
26- sha256 cellar : :any , monterey : "6e8d8540b1cd602e3ed6f6713fcb82c423a69ca1620f447f4c67b03fe04589c2"
27- sha256 cellar : :any , big_sur : "7871f4d805f54347ab3ac20a7dbd31d78a122bf0cd2da441a45a2b1cf732551c"
28- sha256 cellar : :any_skip_relocation , arm64_linux : "55cda1cf81fe5e216a440b1f3ab4effdfbb0732270727f1ebf5a2566c982765f"
29- sha256 cellar : :any_skip_relocation , x86_64_linux : "be528587bb8d4c822dfbee4bb30705c9511908d86ae5f5859eb9c59eb7459ef3"
18+ sha256 cellar : :any , arm64_sequoia : "2423ff6b931f0393cd314052a7328a61fdd6f1d8519b65c4dff5ab560f82c52d"
19+ sha256 cellar : :any , arm64_sonoma : "b6ec0e6b292eab3768d90933a2e663aa8a43951f601dab9bd418b1a6564f4925"
20+ sha256 cellar : :any , arm64_ventura : "82439bd6c8699a8d97e99ba675199a4f7f85473a2a5e7242dfa471329eeb85e9"
21+ sha256 cellar : :any , sonoma : "7a0ea60e18a7c1da00972c28055638f1ddd1335f3be74821cb9df40dab680f7b"
22+ sha256 cellar : :any , ventura : "bff42905e8a218e8d1699740568c7bc42bf4316f21c6fce7e6a3c90ab0e816ea"
23+ sha256 cellar : :any_skip_relocation , arm64_linux : "7262ddbb97a7421a59bc2cc3bc1574bbb6a440ec6d825a0b5794c79eb89adc8b"
24+ sha256 cellar : :any_skip_relocation , x86_64_linux : "e4fb064699caad0097ce135c7212022d1dc230424fb3b63c379731ab44ea8e42"
3025 end
3126
3227 depends_on "cmake" => :build
3328
34- resource ( "oggfile" ) do
35- url "https://upload.wikimedia.org/wikipedia/commons/c/c8/Example.ogg"
36- sha256 "f57b56d8aae4c847cf01224fb45293610d801cfdac43d932b5eeab1cd318182a"
37- end
38-
3929 def install
4030 system "cmake" , "-S" , "." , "-B" , "build" , "-DBUILD_SHARED_LIBS=TRUE" , *std_cmake_args
4131 system "cmake" , "--build" , "build"
4232 system "cmake" , "--install" , "build"
33+
4334 system "cmake" , "-S" , "." , "-B" , "build-static" , "-DBUILD_SHARED_LIBS=FALSE" , *std_cmake_args
4435 system "cmake" , "--build" , "build-static"
4536 lib . install "build-static/libogg.a"
4637 end
4738
4839 test do
40+ resource "oggfile" do
41+ url "https://upload.wikimedia.org/wikipedia/commons/c/c8/Example.ogg"
42+ sha256 "f57b56d8aae4c847cf01224fb45293610d801cfdac43d932b5eeab1cd318182a"
43+ end
44+
4945 ( testpath /"test.c" ) . write <<~C
5046 #include <ogg/ogg.h>
5147 #include <stdio.h>
@@ -59,9 +55,14 @@ def install
5955 int bytes;
6056
6157 ogg_sync_init (&oy);
62- buffer = ogg_sync_buffer (&oy, 4096);
63- bytes = fread(buffer, 1, 4096, stdin);
64- ogg_sync_wrote (&oy, bytes);
58+
59+ // Read all available input to avoid broken pipe
60+ do {
61+ buffer = ogg_sync_buffer (&oy, 4096);
62+ bytes = fread(buffer, 1, 4096, stdin);
63+ ogg_sync_wrote (&oy, bytes);
64+ } while (bytes == 4096);
65+
6566 if (ogg_sync_pageout (&oy, &og) != 1)
6667 return 1;
6768 ogg_stream_init (&os, ogg_page_serialno (&og));
@@ -76,9 +77,11 @@ def install
7677 testpath . install resource ( "oggfile" )
7778 system ENV . cc , "test.c" , "-I#{ include } " , "-L#{ lib } " , "-logg" ,
7879 "-o" , "test"
80+
7981 # Should work on an OGG file
80- shell_output ( "./test < Example.ogg" )
82+ pipe_output ( "./test" , ( testpath /"Example.ogg" ) . read , 0 )
83+
8184 # Expected to fail on a non-OGG file
82- shell_output ( "./test < #{ test_fixtures ( "test.wav" ) } " , 1 )
85+ pipe_output ( "./test" , test_fixtures ( "test.wav" ) . read , 1 )
8386 end
8487end
0 commit comments