Skip to content

Commit 816c3ea

Browse files
atticus5carlocab
authored andcommitted
sdl3_mixer 3.2.0 (new formula)
Co-authored-by: Carlo Cabrera <github@carlo.cab>
1 parent 9b5b0d3 commit 816c3ea

1 file changed

Lines changed: 52 additions & 0 deletions

File tree

Formula/s/sdl3_mixer.rb

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
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=OFF
30+
-DSDLMIXER_VENDORED=OFF
31+
]
32+
system "cmake", "-S", ".", "-B", "build", *args, *std_cmake_args
33+
system "cmake", "--build", "build"
34+
system "cmake", "--install", "build"
35+
end
36+
37+
test do
38+
(testpath/"test.c").write <<~C
39+
#include <SDL3_mixer/SDL_mixer.h>
40+
#include <stdlib.h>
41+
42+
int main()
43+
{
44+
int result = MIX_Init();
45+
MIX_Quit();
46+
return result != 0 ? EXIT_SUCCESS : EXIT_FAILURE;
47+
}
48+
C
49+
system ENV.cc, "test.c", "-o", "test", "-I#{include}", "-L#{lib}", "-lSDL3_mixer"
50+
system "./test"
51+
end
52+
end

0 commit comments

Comments
 (0)