homebrew-core/Formula/rom-tools.rb
2018-09-30 15:19:30 +02:00

61 lines
2.3 KiB
Ruby

class RomTools < Formula
desc "Tools for Multiple Arcade Machine Emulator"
homepage "https://mamedev.org/"
url "https://github.com/mamedev/mame/archive/mame0202.tar.gz"
version "0.202"
sha256 "a5cef3e7e606e2a36d25b559a5410c1c3105acd24ddbff03352cacb1f1ca7053"
head "https://github.com/mamedev/mame.git"
bottle do
cellar :any
sha256 "93a95e2c87d2d9605bfa19722ced6f05d8cf11936f0c850b8fc6350fa395e7d2" => :mojave
sha256 "b565029f6ba16c604870c37281727c8f4d37f77647da32fad2183e99ebf065fe" => :high_sierra
sha256 "0407c619bdc8e660c11c6accfe376ef0f56723bb8b591b58b4d511dec2bb815c" => :sierra
end
depends_on "pkg-config" => :build
depends_on "python@2" => :build
depends_on "flac"
depends_on "portmidi"
depends_on "sdl2"
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