homebrew-core/Formula/freeciv.rb
2019-06-18 08:24:31 +02:00

72 lines
1.9 KiB
Ruby

class Freeciv < Formula
desc "Free and Open Source empire-building strategy game"
homepage "https://freeciv.wikia.com/"
url "https://downloads.sourceforge.net/project/freeciv/Freeciv%202.6/2.6.0/freeciv-2.6.0.tar.bz2"
sha256 "7c20399198d6c7d846fed9a69b02e01134ae5340a3ae0f99d1e38063ade6c999"
revision 2
bottle do
sha256 "e1846824dd58a21076dcd3dcc92538d21ab0571c3e21dc13a39850194a192976" => :mojave
sha256 "3896454c21b30406c48d25877a7deed3aeee943219c976ac62ea9f7825d7903f" => :high_sierra
sha256 "dc55a50e4055b42302630bc6471eda4ac8c5fc6be45bed562824126901918765" => :sierra
end
head do
url "https://github.com/freeciv/freeciv.git"
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "gettext" => :build
depends_on "libtool" => :build
end
depends_on "pkg-config" => :build
depends_on "atk"
depends_on "freetype"
depends_on "gettext"
depends_on "glib"
depends_on "gtk+"
depends_on "icu4c"
depends_on "pango"
depends_on "readline"
depends_on "sdl"
depends_on "sdl_gfx"
depends_on "sdl_image"
depends_on "sdl_mixer"
depends_on "sdl_ttf"
def install
ENV["ac_cv_lib_lzma_lzma_code"] = "no"
args = %W[
--disable-debug
--disable-dependency-tracking
--disable-gtktest
--prefix=#{prefix}
--with-readline=#{Formula["readline"].opt_prefix}
CFLAGS=-I#{Formula["gettext"].include}
LDFLAGS=-L#{Formula["gettext"].lib}
]
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"
assert_predicate testpath/"classic6.mediawiki", :exist?
server = fork do
system bin/"freeciv-server", "-l", testpath/"test.log"
end
sleep 5
Process.kill("TERM", server)
assert_predicate testpath/"test.log", :exist?
end
end