class RomTools < Formula desc "Tools for Multiple Arcade Machine Emulator" homepage "http://mamedev.org/" url "https://github.com/mamedev/mame/archive/mame0194.tar.gz" version "0.194" sha256 "1faffab72d0d671232a14c73f6e0bec720e086af5c81f8e9c235c314123e761d" head "https://github.com/mamedev/mame.git" bottle do cellar :any sha256 "9f9c904cb3b909e4b307e1e2d43a2f16a0b0dda49e83a3411b9c191c038bd3c0" => :high_sierra sha256 "af5bdc28e19bcc4554fd423ce7b0157748d444ffe45dc454fa9da2bf9616c944" => :sierra sha256 "4aa14e7ada356b64f5a8a2f5a5fe5476aac6a966f2fa36bb1fe94c2df82f83d8" => :el_capitan end depends_on "python" => :build if MacOS.version <= :snow_leopard depends_on "pkg-config" => :build depends_on "sdl2" depends_on "flac" depends_on "portmidi" depends_on "utf8proc" def install inreplace "scripts/src/osd/sdl.lua", "--static", "" system "make", "TOOLS=1", "PTR64=#{MacOS.prefer_64_bit? ? 1 : 0}", # for old Macs "USE_LIBSDL=1", "USE_SYSTEM_LIB_EXPAT=1", "USE_SYSTEM_LIB_ZLIB=1", "USE_SYSTEM_LIB_FLAC=1", "USE_SYSTEM_LIB_PORTMIDI=1", "USE_SYSTEM_LIB_UTF8PROC=1" bin.install %w[ aueffectutil castool chdman floptool imgtool jedutil ldresample ldverify nltool nlwav pngcmp regrep romcmp src2html srcclean unidasm ] bin.install "split" => "rom-split" man1.install Dir["docs/man/*.1"] end # Needs more comprehensive tests test do # system "#{bin}/aueffectutil" # segmentation fault system "#{bin}/castool" assert_match "chdman info", shell_output("#{bin}/chdman help info", 1) system "#{bin}/floptool" system "#{bin}/imgtool", "listformats" system "#{bin}/jedutil", "-viewlist" assert_match "linear equation", shell_output("#{bin}/ldresample 2>&1", 1) assert_match "avifile.avi", shell_output("#{bin}/ldverify 2>&1", 1) system "#{bin}/nltool", "--help" system "#{bin}/nlwav", "--help" assert_match "image1", shell_output("#{bin}/pngcmp 2>&1", 10) assert_match "summary", shell_output("#{bin}/regrep 2>&1", 1) system "#{bin}/romcmp" system "#{bin}/rom-split" assert_match "template", shell_output("#{bin}/src2html 2>&1", 1) system "#{bin}/srcclean" assert_match "architecture", shell_output("#{bin}/unidasm", 1) end end