forked from ziz/homebrew-games
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstone-soup.rb
75 lines (65 loc) · 2.18 KB
/
stone-soup.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
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.16.2.tar.xz"
sha256 "49d5947abb341eb7f0590fa538c475e68ea954064c615d852de968211b68780b"
bottle do
sha256 "c9f57436ba33069f59fcff33ade8152cbcfd5d228f9f9f11c9d2b31d52793375" => :yosemite
sha256 "4d880f7d72d219e3195dcbaddbe0663ed7d35e8d2a384d73a69611aa620519f0" => :mavericks
sha256 "23cd1ec592daffdca36d18809a09da603b0e52da4df802efe928b5037cc20e0a" => :mountain_lion
end
option "with-tiles", "Enable graphic tiles and sound"
depends_on "pkg-config" => :build
depends_on "lua51"
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=
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
# 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