class Mame < Formula desc "Multiple Arcade Machine Emulator" homepage "http://mamedev.org/" url "https://github.com/mamedev/mame/archive/mame0179.tar.gz" version "0.179" sha256 "d1616ef32b884c3e7913378ebf5282b6f846f895f419eb92a9068770581e081b" head "https://github.com/mamedev/mame.git" bottle do cellar :any sha256 "37c427967d31a90d2b96f77e48c238de613e083cac817632643a8a74efe03ea1" => :sierra sha256 "58432629f3398e36238e4e015dd469c3bd77a8099b9438c90024a1c4219bbafd" => :el_capitan sha256 "3a975c5da951529201a8af6a32d5db2cbf198aeb1d623a4d4151b80fc849cdad" => :yosemite end depends_on :macos => :yosemite depends_on "pkg-config" => :build depends_on "sphinx-doc" => :build depends_on "sdl2" depends_on "jpeg" depends_on "flac" depends_on "portmidi" depends_on "portaudio" # Needs GCC 4.9 or newer fails_with :gcc_4_0 fails_with :gcc ("4.3".."4.8").each do |n| fails_with :gcc => n end def install inreplace "scripts/src/osd/sdl.lua", "--static", "" system "make", "USE_LIBSDL=1", "USE_SYSTEM_LIB_EXPAT=", # brewed version not picked up "USE_SYSTEM_LIB_ZLIB=1", "USE_SYSTEM_LIB_JPEG=1", "USE_SYSTEM_LIB_FLAC=1", "USE_SYSTEM_LIB_LUA=", # lua53 not available yet "USE_SYSTEM_LIB_PORTMIDI=1", "USE_SYSTEM_LIB_PORTAUDIO=1" bin.install "mame64" => "mame" cd "docs" do system "make", "text" doc.install Dir["build/text/*"] system "make", "man" man1.install "build/man/MAME.1" => "mame.1" end pkgshare.install %w[artwork bgfx hash ini keymaps plugins samples uismall.bdf] end test do assert shell_output("#{bin}/mame -help").start_with? "MAME v#{version}" system "#{bin}/mame", "-validate" end end