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 3
livecheck do
url :stable
regex(%r{<div class="version">\s*Latest version is [^<]*?v?(\d+(?:\.\d+)*)\s*</div>}i)
end
bottle do
sha256 "bd894b479827cc07ab590b02175f21ff9d0fcea173f2e67e28a9b89f1057a99e" => :catalina
sha256 "afcec9d9d45e6353763207b5afc7d63794bd3f103dc38ae60a9174bc14d34eab" => :mojave
sha256 "450547ad552cfc246160e375858adafa37565ed80a2be772acca595636980ea5" => :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