homebrew-core/Formula/stone-soup.rb

81 lines
2.5 KiB
Ruby

class StoneSoup < Formula
desc "Dungeon Crawl Stone Soup: a roguelike game"
homepage "https://crawl.develz.org/"
url "https://github.com/crawl/crawl/archive/0.25.1.tar.gz"
sha256 "41ddf73543940a4d16a7f23c618e2f464dd6d3dd3affc999d2412d8af3f01126"
license "GPL-2.0"
livecheck do
url "https://crawl.develz.org/download.htm"
regex(/Stable.*?>v?(\d+(?:\.\d+)+)</i)
end
bottle do
sha256 "aed9973952598da0eec03689ab04b5133e6170ad2b3009da470191a2fbb0b3b6" => :catalina
sha256 "3ca35a24927cb22726a0f187d794b90637e1b6c09151f507507e79156f6bc33c" => :mojave
sha256 "dc43d1b520ed222b5f00b1a92610422fb2f4dcdf134d5f624cc41b0c23629f6d" => :high_sierra
end
depends_on "pkg-config" => :build
depends_on "python@3.8" => :build
depends_on "lua@5.1"
depends_on "pcre"
depends_on "sqlite"
resource "PyYAML" do
url "https://files.pythonhosted.org/packages/64/c2/b80047c7ac2478f9501676c988a5411ed5572f35d1beff9cae07d321512c/PyYAML-5.3.1.tar.gz"
sha256 "b8eac752c5e14d3eca0e6dd9199cd627518cb5ec06add0de9d32baeee6fe645d"
end
def install
ENV.cxx11
ENV.prepend_path "PATH", Formula["python@3.8"].opt_libexec/"bin"
xy = Language::Python.major_minor_version "python3"
ENV.prepend_create_path "PYTHONPATH", buildpath/"vendor/lib/python#{xy}/site-packages"
resource("PyYAML").stage do
system "python3", *Language::Python.setup_install_args(buildpath/"vendor")
end
cd "crawl-ref/source" do
File.write("util/release_ver", version.to_s)
args = %W[
prefix=#{prefix}
DATADIR=data
NO_PKGCONFIG=
BUILD_ZLIB=
BUILD_SQLITE=
BUILD_FREETYPE=
BUILD_LIBPNG=
BUILD_LUA=
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 += "/" unless MacOS::Xcode.installed?
system "make", "install",
"DEVELOPER_DIR=#{devdir}", "SDKROOT=#{MacOS.sdk_path}",
"SDK_VER=#{MacOS.version}", *args
end
end
test do
output = shell_output("#{bin}/crawl --version")
assert_match "Crawl version #{version}", output
end
end