86 lines
3.3 KiB
Ruby
86 lines
3.3 KiB
Ruby
class Mame < Formula
|
|
desc "Multiple Arcade Machine Emulator"
|
|
homepage "https://mamedev.org/"
|
|
# NOTE: Please keep these values in sync with rom-tools.rb when updating.
|
|
url "https://github.com/mamedev/mame/archive/mame0229.tar.gz"
|
|
version "0.229"
|
|
sha256 "414921771ada0804a8c7f3540e33338e8495e16a3bca78a5a2b355abafa51e6a"
|
|
license "GPL-2.0-or-later"
|
|
head "https://github.com/mamedev/mame.git"
|
|
|
|
# MAME tags (and filenames) are formatted like `mame0226`, so livecheck will
|
|
# report the version like `0226`. We work around this by matching the link
|
|
# text for the release title, since it contains the properly formatted version
|
|
# (e.g., 0.226).
|
|
livecheck do
|
|
url :stable
|
|
strategy :github_latest
|
|
regex(%r{release-header.*?/releases/tag/mame[._-]?\d+(?:\.\d+)*["' >]>MAME v?(\d+(?:\.\d+)+)}im)
|
|
end
|
|
|
|
bottle do
|
|
sha256 cellar: :any, arm64_big_sur: "5d9c92530c40172e07638877b9c96447cb91bfdbf33045a72d2dbd4fa4f71e6d"
|
|
sha256 cellar: :any, big_sur: "1e8892e6ffbe413fa809a266f490ed675fb0d5998368b725be1f08b7df6d09ef"
|
|
sha256 cellar: :any, catalina: "be17029d7e336580480abfd196d80ea6f99600d9097a6c14472d92c137923379"
|
|
sha256 cellar: :any, mojave: "217f52078eb0005e27d65fd4f2aed651c7252884349679751602feaa53a241da"
|
|
end
|
|
|
|
depends_on "glm" => :build
|
|
depends_on "pkg-config" => :build
|
|
depends_on "python@3.9" => :build
|
|
depends_on "rapidjson" => :build
|
|
depends_on "sphinx-doc" => :build
|
|
depends_on "flac"
|
|
depends_on "jpeg"
|
|
# Need C++ compiler and standard library support C++17.
|
|
depends_on macos: :high_sierra
|
|
depends_on "portaudio"
|
|
depends_on "portmidi"
|
|
depends_on "pugixml"
|
|
depends_on "sdl2"
|
|
depends_on "sqlite"
|
|
depends_on "utf8proc"
|
|
|
|
uses_from_macos "expat"
|
|
uses_from_macos "zlib"
|
|
|
|
def install
|
|
# Cut sdl2-config's invalid option.
|
|
inreplace "scripts/src/osd/sdl.lua", "--static", ""
|
|
|
|
# Use bundled asio and lua instead of latest version.
|
|
# https://github.com/mamedev/mame/issues/5721
|
|
# https://github.com/mamedev/mame/issues/5349
|
|
system "make", "PYTHON_EXECUTABLE=#{Formula["python@3.9"].opt_bin}/python3",
|
|
"USE_LIBSDL=1",
|
|
"USE_SYSTEM_LIB_EXPAT=1",
|
|
"USE_SYSTEM_LIB_ZLIB=1",
|
|
"USE_SYSTEM_LIB_ASIO=",
|
|
"USE_SYSTEM_LIB_LUA=",
|
|
"USE_SYSTEM_LIB_FLAC=1",
|
|
"USE_SYSTEM_LIB_GLM=1",
|
|
"USE_SYSTEM_LIB_JPEG=1",
|
|
"USE_SYSTEM_LIB_PORTAUDIO=1",
|
|
"USE_SYSTEM_LIB_PORTMIDI=1",
|
|
"USE_SYSTEM_LIB_PUGIXML=1",
|
|
"USE_SYSTEM_LIB_RAPIDJSON=1",
|
|
"USE_SYSTEM_LIB_SQLITE3=1",
|
|
"USE_SYSTEM_LIB_UTF8PROC=1"
|
|
bin.install "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 language plugins samples uismall.bdf]
|
|
end
|
|
|
|
test do
|
|
assert shell_output("#{bin}/mame -help").start_with? "MAME v#{version}"
|
|
system "#{bin}/mame", "-validate"
|
|
end
|
|
end
|