Skip to content

Commit 4cda0fd

Browse files
atticus5daeho-ro
authored andcommitted
sdl3_mixer 3.2.0 (new formula)
Co-authored-by: Carlo Cabrera <github@carlo.cab> fix linkage issues
1 parent 2f08160 commit 4cda0fd

1 file changed

Lines changed: 54 additions & 0 deletions

File tree

Formula/s/sdl3_mixer.rb

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
class Sdl3Mixer < Formula
2+
desc "Sample multi-channel audio mixer library"
3+
homepage "https://github.com/libsdl-org/SDL_mixer"
4+
url "https://github.com/libsdl-org/SDL_mixer/releases/download/release-3.2.0/SDL3_mixer-3.2.0.tar.gz"
5+
sha256 "1f86fae7226d58f2ad210ca4d9e06488db722230032803423d83bad6d35fc395"
6+
license "Zlib"
7+
head "https://github.com/libsdl-org/SDL_mixer.git", branch: "main"
8+
9+
livecheck do
10+
url :stable
11+
regex(/^(?:release[._-])?v?(3(?:\.\d+)+)$/i)
12+
end
13+
14+
depends_on "cmake" => :build
15+
depends_on "pkgconf" => :build
16+
depends_on "flac"
17+
depends_on "fluid-synth"
18+
depends_on "game-music-emu"
19+
depends_on "libvorbis"
20+
depends_on "libxmp"
21+
depends_on "mpg123"
22+
depends_on "opusfile"
23+
depends_on "sdl3"
24+
depends_on "wavpack"
25+
26+
def install
27+
args = %w[
28+
-DBUILD_SHARED_LIBS=ON
29+
-DSDLMIXER_DEPS_SHARED=ON
30+
-DSDLMIXER_VENDORED=OFF
31+
-DSDLMIXER_EXAMPLES=OFF
32+
-DSDLMIXER_TESTS=OFF
33+
]
34+
system "cmake", "-S", ".", "-B", "build", *args, *std_cmake_args
35+
system "cmake", "--build", "build"
36+
system "cmake", "--install", "build"
37+
end
38+
39+
test do
40+
(testpath/"test.c").write <<~C
41+
#include <SDL3_mixer/SDL_mixer.h>
42+
#include <stdlib.h>
43+
44+
int main()
45+
{
46+
int result = MIX_Init();
47+
MIX_Quit();
48+
return result != 0 ? EXIT_SUCCESS : EXIT_FAILURE;
49+
}
50+
C
51+
system ENV.cc, "test.c", "-o", "test", "-I#{include}", "-L#{lib}", "-lSDL3_mixer"
52+
system "./test"
53+
end
54+
end

0 commit comments

Comments
 (0)