73 lines
2.7 KiB
Ruby
73 lines
2.7 KiB
Ruby
class Mame < Formula
|
|
desc "Multiple Arcade Machine Emulator"
|
|
homepage "https://mamedev.org/"
|
|
url "https://github.com/mamedev/mame/archive/mame0214.tar.gz"
|
|
version "0.214"
|
|
sha256 "8ae24e3b1de33df33957c5f642bd98828842305bcb31da130b759ba7e88b36d2"
|
|
head "https://github.com/mamedev/mame.git"
|
|
|
|
bottle do
|
|
cellar :any
|
|
sha256 "68aebd2ec9c2c13fa991dd9b726a26fab5a18d1d1c3899348609dae795a5f106" => :catalina
|
|
sha256 "79445c944fa9a59841b445293d180c47651e69992967c06ef9962ba0212fbc2f" => :mojave
|
|
sha256 "0e79a21dad47af1991279e22e58957c1f318f3b1b25563fe6d5f897bc71057fa" => :high_sierra
|
|
end
|
|
|
|
depends_on "asio" => :build
|
|
depends_on "glm" => :build
|
|
depends_on "pkg-config" => :build
|
|
depends_on "pugixml" => :build
|
|
depends_on "rapidjson" => :build
|
|
depends_on "sphinx-doc" => :build
|
|
depends_on "flac"
|
|
depends_on "jpeg"
|
|
depends_on "lua"
|
|
# Need C++ compiler and standard library support C++14.
|
|
# Build failure on Sierra, see:
|
|
# https://github.com/Homebrew/homebrew-core/pull/39388
|
|
depends_on :macos => :high_sierra
|
|
depends_on "portaudio"
|
|
depends_on "portmidi"
|
|
depends_on "sdl2"
|
|
depends_on "sqlite"
|
|
depends_on "utf8proc"
|
|
|
|
def install
|
|
inreplace "scripts/src/osd/sdl.lua", "--static", ""
|
|
|
|
# Mame's build system genie can't find headers and libraries with version suffix.
|
|
ENV.append "CPPFLAGS", "-I#{Formula["lua"].opt_include}/lua"
|
|
ENV.append "CPPFLAGS", "-I#{Formula["pugixml"].opt_include}/pugixml-1.9"
|
|
ENV.append "LDFLAGS", "-L#{Formula["pugixml"].opt_lib}/pugixml-1.9"
|
|
|
|
system "make", "USE_LIBSDL=1",
|
|
"USE_SYSTEM_LIB_EXPAT=1",
|
|
"USE_SYSTEM_LIB_ZLIB=1",
|
|
"USE_SYSTEM_LIB_ASIO=1",
|
|
"USE_SYSTEM_LIB_FLAC=1",
|
|
"USE_SYSTEM_LIB_GLM=1",
|
|
"USE_SYSTEM_LIB_JPEG=1",
|
|
"USE_SYSTEM_LIB_LUA=1",
|
|
"USE_SYSTEM_LIB_PORTMIDI=1",
|
|
"USE_SYSTEM_LIB_PORTAUDIO=1",
|
|
"USE_SYSTEM_LIB_PUGIXML=1",
|
|
"USE_SYSTEM_LIB_RAPIDJSON=1",
|
|
"USE_SYSTEM_LIB_SQLITE3=1",
|
|
"USE_SYSTEM_LIB_UTF8PROC=1"
|
|
bin.install "mame64" => "mame"
|
|
cd "docs" do
|
|
# We don't convert SVG files into PDF files, don't load the related extensions.
|
|
inreplace "source/conf.py", "'sphinxcontrib.rsvgconverter'", ""
|
|
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
|