class Mame < Formula desc "Multiple Arcade Machine Emulator" homepage "https://mamedev.org/" url "https://github.com/mamedev/mame/archive/mame0224.tar.gz" version "0.224" sha256 "3518e71ec20fbeac8ebe93f8ec856078b8288e19f0d7cb38959d4bde30cd2810" license "GPL-2.0-or-later" head "https://github.com/mamedev/mame.git" bottle do cellar :any sha256 "02234561654ce4acf965841a0392225186d1edf4200653d3a09ae0f94dcfbe33" => :catalina sha256 "8258fdcf71c960ae6fadf019cbeecc68e2d91977c39c22b884295fa8eeacadac" => :mojave sha256 "ab42ed0bce4a11ef242c0988b80de0e7f51a0168009ec0917e8b64d8b61fb830" => :high_sierra end depends_on "glm" => :build depends_on "pkg-config" => :build depends_on "pugixml" => :build depends_on "python@3.8" => :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 "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. # See: system "make", "PYTHON_EXECUTABLE=#{Formula["python@3.8"].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 "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 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