homebrew-core/Formula/openrct2.rb

81 lines
2.9 KiB
Ruby

class Openrct2 < Formula
desc "Open source re-implementation of RollerCoaster Tycoon 2"
homepage "https://openrct2.io/"
url "https://github.com/OpenRCT2/OpenRCT2.git",
tag: "v0.4.1",
revision: "be518f48e34184674cf176102d343e539b20549e"
license "GPL-3.0-only"
head "https://github.com/OpenRCT2/OpenRCT2.git", branch: "develop"
bottle do
sha256 cellar: :any, arm64_monterey: "34b63e6aa7fb8b17e61ed22f00608207ac2ad10d4d377add4a62454ef72979df"
sha256 cellar: :any, arm64_big_sur: "656093b37b8111629e51b979e2241b38bab957793faf4ee4ad3a22826a2f9f49"
sha256 cellar: :any, monterey: "a2e9541db7d546f36a54b849f40c21cf2092fe4ae41d3e247da0b521355499ed"
sha256 cellar: :any, big_sur: "f04d9cba1d66b55eb2dfc602a84fa3f4c522ac44951278d12149b6bec32c8d09"
sha256 cellar: :any, catalina: "937edd5b2c5d684df7efb91067e2c8808dbbe456457778dbb7e80a0a145a235c"
sha256 x86_64_linux: "46a9886feb0ea9b18c3eb74b1fd0cb3640faef52031d66e268e796814d70cd60"
end
depends_on "cmake" => :build
depends_on "nlohmann-json" => :build
depends_on "pkg-config" => :build
depends_on "duktape"
depends_on "flac"
depends_on "freetype"
depends_on "icu4c"
depends_on "libogg"
depends_on "libpng"
depends_on "libvorbis"
depends_on "libzip"
depends_on macos: :mojave # `error: call to unavailable member function 'value': introduced in macOS 10.14`
depends_on "openssl@1.1"
depends_on "sdl2"
depends_on "speexdsp"
on_linux do
depends_on "curl"
depends_on "fontconfig"
depends_on "mesa"
end
fails_with gcc: "5" # C++17
resource "title-sequences" do
url "https://github.com/OpenRCT2/title-sequences/releases/download/v0.4.0/title-sequences.zip"
sha256 "6e7c7b554717072bfc7acb96fd0101dc8e7f0ea0ea316367a05c2e92950c9029"
end
resource "objects" do
url "https://github.com/OpenRCT2/objects/archive/v1.3.2.tar.gz"
sha256 "9c94e479ce676076c739a05edbd9196860d1baecff8753c378043dcea8e0b63b"
end
def install
# Avoid letting CMake download things during the build process.
(buildpath/"data/title").install resource("title-sequences")
(buildpath/"data/object").install resource("objects")
mkdir "build" do
system "cmake", "..", *std_cmake_args,
"-DCMAKE_OSX_DEPLOYMENT_TARGET=#{MacOS.version}",
"-DWITH_TESTS=OFF",
"-DDOWNLOAD_TITLE_SEQUENCES=OFF",
"-DDOWNLOAD_OBJECTS=OFF",
"-DMACOS_USE_DEPENDENCIES=OFF",
"-DDISABLE_DISCORD_RPC=ON"
system "make", "install"
end
# By default macOS build only looks up data in app bundle Resources
libexec.install bin/"openrct2"
(bin/"openrct2").write <<~EOS
#!/bin/bash
exec "#{libexec}/openrct2" "$@" "--openrct2-data-path=#{pkgshare}"
EOS
end
test do
assert_match "OpenRCT2, v#{version}", shell_output("#{bin}/openrct2 -v")
end
end