class StoneSoup < Formula desc "Dungeon Crawl Stone Soup: a roguelike game" homepage "https://crawl.develz.org/" url "https://crawl.develz.org/release/0.22/stone_soup-0.22.0.tar.xz" sha256 "02e36ccc458747e89ab84835f6dd7df554e8e40537397797c5bb61a4d376597d" bottle do rebuild 1 sha256 "42e9d8799c1bc5c7fb8fe1e173cada66ea4cca54eaa94401d3a271c49dcf1fef" => :mojave sha256 "a6c1c2fcefb3f5e7da4afb8bf44f90c655944faedc48ea49c48b02dff6228512" => :high_sierra sha256 "ad88cc136ebe523cb58c818b41041a69587b041b2b8e325f42855478933ffd31" => :sierra end depends_on "pkg-config" => :build depends_on "lua@5.1" depends_on "pcre" needs :cxx11 def install ENV.cxx11 cd "source" do args = %W[ prefix=#{prefix} DATADIR=data NO_PKGCONFIG= BUILD_ZLIB= BUILD_SQLITE=yes BUILD_FREETYPE= BUILD_LIBPNG= BUILD_LUA=y BUILD_SDL2= BUILD_SDL2MIXER= BUILD_SDL2IMAGE= BUILD_PCRE= USE_PCRE=y ] # FSF GCC doesn't support the -rdynamic flag args << "NO_RDYNAMIC=y" unless ENV.compiler == :clang # The makefile has trouble locating the developer tools for # CLT-only systems, so we set these manually. Reported upstream: # https://crawl.develz.org/mantis/view.php?id=7625 # # On 10.9, stone-soup will try to use xcrun and fail due to an empty # DEVELOPER_DIR devdir = MacOS::Xcode.prefix.to_s devdir += "/" if MacOS.version >= :mavericks && !MacOS::Xcode.installed? system "make", "install", "DEVELOPER_DIR=#{devdir}", "SDKROOT=#{MacOS.sdk_path}", # stone-soup tries to use `uname -m` to determine build -arch, # which is frequently wrong on OS X "SDK_VER=#{MacOS.version}", "MARCH=#{MacOS.preferred_arch}", *args end end test do output = shell_output("#{bin}/crawl --version") assert_match "Crawl version #{version}", output end end