-
Notifications
You must be signed in to change notification settings - Fork 116
/
Copy pathfreeciv.rb
62 lines (52 loc) · 1.89 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
require "formula"
class Freeciv < Formula
homepage "http://freeciv.wikia.com"
url "https://downloads.sourceforge.net/project/freeciv/Freeciv%202.4/2.4.4/freeciv-2.4.4.tar.bz2"
sha1 "045931a0763df33e1e2114dde2d189a24861ce13"
head "svn://svn.gna.org/svn/freeciv/trunk"
bottle do
root_url "https://homebrew.bintray.com/bottles-games"
sha1 "e6fef82f1c970359033bff3cd9d8f809b2023f85" => :yosemite
sha1 "a495fc6b1197a2e849c08cc0fff194b02ecb267d" => :mavericks
sha1 "a1a7dbcd4b0ee32c72586e14f7fe53fc5ec5797c" => :mountain_lion
end
option "disable-nls" , "Disable NLS support"
option "without-sdl" , "Disable the SDL Freeciv client"
option "with-gtk+" , "Disable the GTK+ Freeciv client"
option "with-gtk+3" , "Enable the GTK+3 Freeciv client"
depends_on "pkg-config" => :build
depends_on "readline"
depends_on :x11
depends_on "gettext" unless build.include? "disable-nls"
depends_on "sdl" => :recommended
depends_on "sdl_image" if build.with? "sdl"
depends_on "sdl_mixer" if build.with? "sdl"
depends_on "gtk+" => :optional
depends_on "gtk+3" => :optional
depends_on "glib" if build.with?("gtk+") || build.with?("gtk+3")
def install
args = %W[
--disable-debug
--disable-dependency-tracking
--prefix=#{prefix}
--with-readline=#{Formula["readline"].opt_prefix}
]
if build.include? "disable-nls"
args << "--disable-nls"
else
gettext = Formula["gettext"]
args << "CFLAGS=-I#{gettext.include}"
args << "LDFLAGS=-L#{gettext.lib}"
end
build_client = []
build_client << "sdl" if build.with? "sdl"
build_client << "gtk" if build.with? "gtk+"
build_client << "gtk+3" if build.with? "gtk+3"
args << "--enable-client=" + build_client.join(",") unless build_client.empty?
system "./configure", *args
system "make", "install"
end
test do
system "#{bin}/freeciv-server", "-v"
end
end