class Openttd < Formula desc "Simulation game based upon Transport Tycoon Deluxe" homepage "https://www.openttd.org/" url "https://binaries.openttd.org/releases/1.7.0/openttd-1.7.0-source.tar.xz" sha256 "df9307f42a45ac57dff23fe5cfb9bdb2a3d676456e7c771de173de060c2a99e0" head "https://git.openttd.org/openttd/trunk.git" bottle do sha256 "953a26f4fb562d4ba5ed8c4745e0523c85ee1bc66b7dd15a0b1fedc9d1593264" => :sierra sha256 "3460b326208fe26a482b350fc970260b3b5f3234acdc58149fed98ae01debafc" => :el_capitan sha256 "222592f2fc59dceea3b95fcb459b053110651e681f3f74d8bec38c489fd6cdbb" => :yosemite end depends_on "lzo" depends_on "xz" depends_on "pkg-config" => :build resource "opengfx" do url "https://bundles.openttdcoop.org/opengfx/releases/0.5.4/opengfx-0.5.4.zip" sha256 "3d136d776906dbe8b5df1434cb9a68d1249511a3c4cfaca55cc24cc0028ae078" end resource "opensfx" do url "https://bundles.openttdcoop.org/opensfx/releases/0.2.3/opensfx-0.2.3.zip" sha256 "3574745ac0c138bae53b56972591db8d778ad9faffd51deae37a48a563e71662" end resource "openmsx" do url "https://bundles.openttdcoop.org/openmsx/releases/0.3.1/openmsx-0.3.1.zip" sha256 "92e293ae89f13ad679f43185e83fb81fb8cad47fe63f4af3d3d9f955130460f5" end def install system "./configure", "--prefix-dir=#{prefix}" system "make", "bundle" (buildpath/"bundle/OpenTTD.app/Contents/Resources/data/opengfx").install resource("opengfx") (buildpath/"bundle/OpenTTD.app/Contents/Resources/data/opensfx").install resource("opensfx") (buildpath/"bundle/OpenTTD.app/Contents/Resources/gm/openmsx").install resource("openmsx") prefix.install "bundle/OpenTTD.app" bin.write_exec_script "#{prefix}/OpenTTD.app/Contents/MacOS/openttd" end def caveats; <<-EOS.undent If you have access to the sound and graphics files from the original Transport Tycoon Deluxe, you can install them by following the instructions in section 4.1 of #{prefix}/readme.txt EOS end test do assert_match /OpenTTD #{version}\n/, shell_output("#{bin}/openttd -h") end end