homebrew-core/Formula/freeciv.rb

87 lines
2.2 KiB
Ruby

class Freeciv < Formula
desc "Free and Open Source empire-building strategy game"
homepage "http://freeciv.org"
url "https://downloads.sourceforge.net/project/freeciv/Freeciv%202.6/2.6.2.1/freeciv-2.6.2.1.tar.bz2"
sha256 "bd04ac03c1505582309dd62bcc4710002a3cfb4b2b38c28af33047dd2fb7585e"
license "GPL-2.0-or-later"
livecheck do
url :stable
regex(%r{url=.*?/freeciv[._-]v?(\d+(?:\.\d+)+)\.(?:t|zip)/}i)
end
bottle do
sha256 "52d96a063c396c0b3c7993936c6d2520da049c9a265f32e26e7175d8c3328435" => :big_sur
sha256 "f29bd227e4735a4e6fde10ffa6810460437f8a1fa47f42694f2fa82d6db213fe" => :catalina
sha256 "909bc9989745d0626fdf8d985598d01a7b6ee97b8550bdf701470e991e2e0ab2" => :mojave
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 "cairo"
depends_on "freetype"
depends_on "gdk-pixbuf"
depends_on "gettext"
depends_on "glib"
depends_on "gtk+3"
depends_on "harfbuzz"
depends_on "icu4c"
depends_on "pango"
depends_on "readline"
depends_on "sdl2"
depends_on "sdl2_mixer"
uses_from_macos "bzip2"
uses_from_macos "curl"
uses_from_macos "libiconv"
uses_from_macos "zlib"
def install
ENV["ac_cv_lib_lzma_lzma_code"] = "no"
args = %W[
--disable-debug
--disable-dependency-tracking
--disable-gtktest
--disable-silent-rules
--disable-sdltest
--disable-sdl2test
--disable-sdl2framework
--enable-fcdb=sqlite3
--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?
fork do
system bin/"freeciv-server", "-l", testpath/"test.log"
end
sleep 5
assert_predicate testpath/"test.log", :exist?
end
end