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 1 bottle do sha256 "32d6fc9dc78b0d190493ee48ee7c02b14aaff9bea3aef3625047dea14e515d37" => :mojave sha256 "f64cbbe1927f3625b07bb6ebc808ece1cc862063cf79ff944daa931f4f225590" => :high_sierra sha256 "ec8ad3415d098e391fcb677208d96cef04811a5273777cdfff6d53bd70319c72" => :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