2017-02-08 10:33:11 +00:00
|
|
|
class ArxLibertatis < Formula
|
|
|
|
desc "Cross-platform, open source port of Arx Fatalis"
|
|
|
|
homepage "https://arx-libertatis.org/"
|
2017-02-12 10:56:23 +00:00
|
|
|
|
|
|
|
stable do
|
|
|
|
url "https://arx-libertatis.org/files/arx-libertatis-1.1.2.tar.xz"
|
|
|
|
sha256 "82adb440a9c86673e74b84abd480cae968e1296d625b6d40c69ca35b35ed4e42"
|
|
|
|
|
|
|
|
# Add a missing include to CMakeLists.txt
|
|
|
|
patch do
|
|
|
|
url "https://github.com/arx/ArxLibertatis/commit/442ba4af978160abd3856a9daec38f5b6e213cb4.patch"
|
|
|
|
sha256 "64a4276b75944da19b91cb812e833339d40826be763eb3d9033d67b698c2ca9f"
|
|
|
|
end
|
|
|
|
end
|
2017-02-08 10:33:11 +00:00
|
|
|
|
2017-02-16 22:28:09 +00:00
|
|
|
bottle do
|
|
|
|
cellar :any
|
|
|
|
sha256 "1395d10871dada5e6687de4f54f9ef868dd6d9ec285689d7c6d0cf42b84f8ef0" => :sierra
|
|
|
|
sha256 "43e112585b39aef6d6c21a173caa1d75ca2313ad07801731a8be5aa8bb85943e" => :el_capitan
|
|
|
|
sha256 "0e23af82f5b1875dd8de3f0796c56609bf521f72bbf94ebfb829489b83bee5dd" => :yosemite
|
|
|
|
end
|
|
|
|
|
2017-02-12 01:00:18 +00:00
|
|
|
head do
|
|
|
|
url "https://github.com/arx/ArxLibertatis.git"
|
|
|
|
|
|
|
|
resource "arx-libertatis-data" do
|
|
|
|
url "https://github.com/arx/ArxLibertatisData.git"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2017-02-08 10:33:11 +00:00
|
|
|
option "without-innoextract", "Build without arx-install-data"
|
|
|
|
|
|
|
|
depends_on "cmake" => :build
|
|
|
|
depends_on "boost" => :build
|
|
|
|
depends_on "glm" => :build
|
|
|
|
depends_on "freetype"
|
|
|
|
depends_on "glew"
|
|
|
|
depends_on "sdl"
|
2017-02-12 10:28:54 +00:00
|
|
|
depends_on "innoextract" => :recommended
|
2017-02-08 10:33:11 +00:00
|
|
|
|
|
|
|
def install
|
2017-02-12 01:00:18 +00:00
|
|
|
args = std_cmake_args
|
|
|
|
|
2017-02-12 01:41:01 +00:00
|
|
|
# The patches for these aren't straightforward to backport because of
|
|
|
|
# other changes; these minimal inreplaces get it building.
|
|
|
|
# HEAD is fine, and the next stable release will contain these changes.
|
|
|
|
if build.stable?
|
2017-02-12 10:31:10 +00:00
|
|
|
# https://github.com/arx/ArxLibertatis/commit/39fb9a0e3a6888a6a5f040e39896e88750c89065
|
2017-02-12 11:14:24 +00:00
|
|
|
inreplace "src/platform/Time.cpp", "clock_t ", "clockid_t "
|
2017-02-12 01:41:01 +00:00
|
|
|
|
|
|
|
# Version parsing is broken in the current stable; fixed upstream.
|
|
|
|
# This hardcodes the current version based on data from VERSION.
|
|
|
|
inreplace "src/core/Version.cpp.in" do |s|
|
|
|
|
s.gsub! "${VERSION_COUNT}", "5"
|
|
|
|
s.gsub! "${VERSION_2}", "10"
|
|
|
|
s.gsub! "${VERSION_0}", "1.1.2"
|
|
|
|
s.gsub! "${GIT_SUFFIX_5}", "+Homebrew-1"
|
|
|
|
s.gsub! "${VERSION_4}", "Rhaa Movis"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2017-02-12 01:00:18 +00:00
|
|
|
# Install prebuilt icons to avoid inkscape and imagemagick deps
|
|
|
|
if build.head?
|
|
|
|
(buildpath/"arx-libertatis-data").install resource("arx-libertatis-data")
|
|
|
|
args << "-DDATA_FILES=#{buildpath}/arx-libertatis-data"
|
|
|
|
end
|
|
|
|
|
2017-02-08 10:33:11 +00:00
|
|
|
mkdir "build" do
|
2017-02-12 01:00:18 +00:00
|
|
|
system "cmake", "..", *args
|
2017-02-08 10:33:11 +00:00
|
|
|
system "make", "install"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def caveats
|
|
|
|
if build.with? "innoextract"; then <<-EOS.undent
|
|
|
|
This package only contains the Arx Libertatis binary, not the game data.
|
|
|
|
To play Arx Fatalis you will need to obtain the game from GOG.com and install
|
|
|
|
the game data with:
|
|
|
|
|
|
|
|
arx-install-data /path/to/setup_arx_fatalis.exe
|
|
|
|
EOS
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
|
|
|
system "#{bin}/arx", "-h"
|
|
|
|
end
|
|
|
|
end
|