homebrew-core/Formula/mame.rb

57 lines
1.8 KiB
Ruby

class Mame < Formula
desc "Multiple Arcade Machine Emulator"
homepage "http://mamedev.org/"
url "https://github.com/mamedev/mame/archive/mame0183.tar.gz"
version "0.183"
sha256 "c12b3051f2f11331a38f557eac7f3074166e48155133b2f3e7cc323df56ce8b0"
head "https://github.com/mamedev/mame.git"
bottle do
cellar :any
sha256 "84c99711fc9efb6c2c17b5d16a0d8f77042fcac437bd44018782beb9edb07189" => :sierra
sha256 "96becdae51966bd3a4f8ae87e335370eda0d0b8877d2143d0d5da6cb799ecda2" => :el_capitan
sha256 "8a426287eba3b50e06caf01cc5c656c1c0e16390974debfc2a438b04e8cf25ff" => :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=", # Homebrew's lua@5.3 can't build with MAME 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