homebrew-core/Formula/sdl2_mixer.rb

52 lines
1.8 KiB
Ruby

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.2.tar.gz"
sha256 "4e615e27efca4f439df9af6aa2c6de84150d17cbfd12174b54868c12f19c83bb"
head "https://hg.libsdl.org/SDL_mixer", :using => :hg
bottle do
cellar :any
sha256 "967685e44c7848b266e08be764f96f40e95efd5a3b58c6a009389a7e57ce3307" => :high_sierra
sha256 "73c21d12fa99c3ed060349e3e4956d836e26319fde6a0d5d901abb4b6b1cf888" => :sierra
sha256 "b23aaa52501b873ea34221f96d7382aa9f77f87fd233a719ac2fdb0bce9e13e7" => :el_capitan
end
depends_on "pkg-config" => :build
depends_on "libvorbis"
depends_on "sdl2"
depends_on "flac" => :optional
depends_on "fluid-synth" => :optional
depends_on "libmikmod" => :optional
depends_on "libmodplug" => :optional
depends_on "smpeg2" => :optional
def install
inreplace "SDL2_mixer.pc.in", "@prefix@", HOMEBREW_PREFIX
args = %W[
--prefix=#{prefix} --disable-dependency-tracking
--enable-music-ogg --disable-music-ogg-shared
--disable-music-flac-shared
--disable-music-midi-fluidsynth-shared
--disable-music-mod-mikmod-shared
--disable-music-mod-modplug-shared
--disable-music-mp3-smpeg-shared
]
args << "--disable-music-flac" if build.without? "flac"
args << "--disable-music-midi-fluidsynth" if build.without? "fluid-synth"
args << "--enable-music-mod-mikmod" if build.with? "libmikmod"
args << "--disable-music-mod-modplug" if build.without? "libmodplug"
if build.with? "smpeg2"
args << "--with-smpeg-prefix=#{Formula["smpeg2"].opt_prefix}"
else
args << "--disable-music-mp3-smpeg"
end
system "./configure", *args
system "make", "install"
end
end