forked from ziz/homebrew-games
-
Notifications
You must be signed in to change notification settings - Fork 0
/
freeciv.rb
87 lines (75 loc) · 2.36 KB
/
freeciv.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
76
77
78
79
80
81
82
83
84
85
86
87
class Freeciv < Formula
desc "A Free and Open Source empire-building strategy game"
homepage "http://freeciv.wikia.com"
url "https://downloads.sourceforge.net/project/freeciv/Freeciv%202.5/2.5.0/freeciv-2.5.0.tar.bz2"
mirror "http://download.gna.org/freeciv/stable/freeciv-2.5.0.tar.bz2"
sha256 "bd9f7523ea79b8d2806d0c1844a9f48506ccd18276330580319913c43051210b"
revision 2
bottle do
sha256 "5a74cd6f37b5658e492039eb83cc1955e0d653864571433320043f75954a75d4" => :yosemite
sha256 "d21792836f4e56e2a23db4e5b7c051530221890969a6217a60b22b4012758cf7" => :mavericks
sha256 "a08453b6a23c4798e8fed7cbad424c581ed8b890509254abd5778ead4d7b58de" => :mountain_lion
end
head do
url "svn://svn.gna.org/svn/freeciv/trunk"
depends_on "automake" => :build
depends_on "autoconf" => :build
depends_on "gettext" => :build
depends_on "libtool" => :build
end
option "without-nls", "Disable NLS support"
option "without-sdl", "Disable the SDL Freeciv client"
depends_on "gettext" if build.with? "nls"
depends_on "icu4c"
depends_on "pkg-config" => :build
depends_on "readline"
depends_on "sdl" => :recommended
if build.with? "sdl"
depends_on "freetype"
depends_on "sdl_image"
depends_on "sdl_gfx"
depends_on "sdl_mixer"
depends_on "sdl_ttf"
end
depends_on "gtk+" => :recommended
depends_on "gtk+3" => :optional
if build.with?("gtk+") || build.with?("gtk+3")
depends_on "atk"
depends_on "glib"
depends_on "pango"
end
depends_on "gdk-pixbuf" if build.with? "gtk+3"
def install
args = %W[
--disable-debug
--disable-dependency-tracking
--disable-gtktest
--prefix=#{prefix}
--with-readline=#{Formula["readline"].opt_prefix}
]
if build.without? "nls"
args << "--disable-nls"
else
gettext = Formula["gettext"]
args << "CFLAGS=-I#{gettext.include}"
args << "LDFLAGS=-L#{gettext.lib}"
end
if build.head?
inreplace "./autogen.sh", "libtoolize", "glibtoolize"
system "./autogen.sh", *args
else
system "./configure", *args
end
system "make", "install"
end
test do
system bin/"freeciv-manual"
File.exist? testpath/"manual6.html"
server = fork do
system bin/"freeciv-server", "-l", testpath/"test.log"
end
sleep 5
Process.kill("TERM", server)
File.exist? testpath/"test.log"
end
end