homebrew-core/Formula/stone-soup.rb
2017-02-08 10:12:32 +00:00

78 lines
2.3 KiB
Ruby

class StoneSoup < Formula
desc "Dungeon Crawl Stone Soup: a roguelike game"
homepage "https://crawl.develz.org/"
url "https://crawl.develz.org/release/stone_soup-0.19.1.tar.xz"
sha256 "89374dc3e4282c7c2bae911ef780043845cc08cf529f4d54b7d81c0ce8355aa0"
bottle do
sha256 "4f7a8c411caf966b1fb7956a1954df35202af3574ffab454813b5648b80cc225" => :sierra
sha256 "e6cc487ace38b88bc782952a1f432b71ed5474a1716123b0a767c19acf07653e" => :el_capitan
sha256 "e3e1bc2ec8bf7d6f34a9013baa07b3b8a52df18dcabcd8f8cbb64abbc599fd10" => :yosemite
end
option "with-tiles", "Enable graphic tiles and sound"
depends_on "pkg-config" => :build
depends_on "lua@5.1"
depends_on "pcre"
if build.with? "tiles"
depends_on "sdl2"
depends_on "sdl2_mixer"
depends_on "sdl2_image"
depends_on "libpng"
depends_on "freetype"
end
needs :cxx11
def install
ENV.cxx11
cd "source" do
args = %W[
prefix=#{prefix}
DATADIR=data
NO_PKGCONFIG=
BUILD_ZLIB=
BUILD_LUA=
BUILD_SQLITE=yes
BUILD_FREETYPE=
BUILD_LIBPNG=
BUILD_SDL2=
BUILD_SDL2MIXER=
BUILD_SDL2IMAGE=
BUILD_PCRE=
USE_PCRE=y
]
if build.with? "tiles"
inreplace "Makefile", "contrib/install/$(ARCH)/lib/libSDL2main.a", ""
args << "TILES=y"
args << "SOUND=y"
end
# 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
assert shell_output("#{bin}/crawl --version").start_with? "Crawl version #{version}"
end
end