homebrew-core/Formula/widelands.rb

54 lines
1.6 KiB
Ruby

class Widelands < Formula
desc "Free real-time strategy game like Settlers II"
homepage "https://www.widelands.org/"
url "https://launchpad.net/widelands/build21/build21/+download/widelands-build21-source.tar.gz"
version "21"
sha256 "601e0e4c6f91b3fb0ece2cd1b83ecfb02344a1b9194fbb70ef3f70e06994e357"
revision 1
livecheck do
url :stable
regex(%r{<div class="version">\s*Latest version is [^<]*?v?(\d+(?:\.\d+)*)\s*</div>}i)
end
bottle do
sha256 "f41944d59a82424ef8242035d60db6ad270bc101f628b299e7d27a345b9a9c33" => :catalina
sha256 "2ad3c807fe568617432f7f0e542553c23d8ee49db6da9ec5a494bf7ce1f7e04a" => :mojave
sha256 "cdb65ce693e938a996a94a69e0a78f26afb2bc2a6af1bba36800a095cbdcc8ae" => :high_sierra
end
depends_on "cmake" => :build
depends_on "boost"
depends_on "doxygen"
depends_on "gettext"
depends_on "glew"
depends_on "icu4c"
depends_on "libpng"
depends_on "lua"
depends_on "minizip"
depends_on "sdl2_image"
depends_on "sdl2_mixer"
depends_on "sdl2_ttf"
def install
ENV.cxx11
mkdir "build" do
system "cmake", "..",
# Without the following option, Cmake intend to use the library of MONO framework.
"-DPNG_PNG_INCLUDE_DIR:PATH=#{Formula["libpng"].opt_include}",
"-DWL_INSTALL_DATADIR=#{pkgshare}/data",
*std_cmake_args
system "make", "install"
(bin/"widelands").write <<~EOS
#!/bin/sh
exec #{prefix}/widelands "$@"
EOS
end
end
test do
system bin/"widelands", "--version"
end
end