-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathsdl2_mixer.rb
67 lines (60 loc) · 1.85 KB
/
sdl2_mixer.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# Original formula:
# https://github.com/Homebrew/homebrew-core/blob/master/Formula/sdl2_mixer.rb
#
# Changes:
# - Added `revision 99` so Homebrew doesn't upgrade the formula
# - Removed `depends_on "libmodplug"`
# - Added `depends_on "flac"`
# - Added `depends_on "libogg"`
# - Added `depends_on "mpg123"`
# - Replaced all `args` with below, adding `--disable-music-xxx-shared` to link statically
# - Removed bottles
class Sdl2Mixer < Formula
desc "Sample multi-channel audio mixer library"
homepage "https://www.libsdl.org/projects/SDL_mixer/"
url "https://www.libsdl.org/projects/SDL_mixer/release/SDL2_mixer-2.0.4.tar.gz"
sha256 "b4cf5a382c061cd75081cf246c2aa2f9df8db04bdda8dcdc6b6cca55bede2419"
license "Zlib"
revision 99
head "https://hg.libsdl.org/SDL_mixer", using: :hg
livecheck do
url :homepage
regex(/SDL2_mixer[._-]v?(\d+(?:\.\d+)*)/i)
end
depends_on "pkg-config" => :build
depends_on "flac"
depends_on "libogg"
depends_on "libvorbis"
depends_on "mpg123"
depends_on "sdl2"
def install
inreplace "SDL2_mixer.pc.in", "@prefix@", HOMEBREW_PREFIX
args = %W[
--prefix=#{prefix}
--disable-dependency-tracking
--disable-music-mod-modplug-shared
--disable-music-mod-mikmod-shared
--disable-music-midi-fluidsynth-shared
--disable-music-ogg-shared
--disable-music-flac-shared
--disable-music-mp3-mpg123-shared
--disable-music-opus-shared
]
system "./configure", *args
system "make", "install"
end
test do
(testpath/"test.c").write <<~EOS
#include <SDL2/SDL_mixer.h>
int main()
{
int success = Mix_Init(0);
Mix_Quit();
return success;
}
EOS
system ENV.cc, "-I#{Formula["sdl2"].opt_include}/SDL2",
"test.c", "-L#{lib}", "-lSDL2_mixer", "-o", "test"
system "./test"
end
end