68 lines
2.5 KiB
Ruby
68 lines
2.5 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.3.4.1",
|
|
revision: "5087e77032e1342006021f680eb9cad2dc6dabef"
|
|
license "GPL-3.0-only"
|
|
head "https://github.com/OpenRCT2/OpenRCT2.git", branch: "develop"
|
|
|
|
bottle do
|
|
sha256 cellar: :any, arm64_big_sur: "5a75b78d7d74c9eaadff1867bededb84553bf087d1487b54f0fa1899d405b15d"
|
|
sha256 cellar: :any, big_sur: "3027a49a14f166ba899a076e5b62648f49a312fb62da37e21c81959463da91c5"
|
|
sha256 cellar: :any, catalina: "6991d066861d381439123af05c53baa20bf70d5e36cea9475d6aa50564e1830e"
|
|
sha256 cellar: :any, mojave: "d6ee68373bc7d6d0af9a61f92b2f11ec68584fdf39a8960c53345ac3115559e7"
|
|
end
|
|
|
|
depends_on "cmake" => :build
|
|
depends_on "pkg-config" => :build
|
|
depends_on "duktape"
|
|
depends_on "freetype" # for sdl2_ttf
|
|
depends_on "icu4c"
|
|
depends_on "libpng"
|
|
depends_on "libzip"
|
|
depends_on macos: :mojave # `error: call to unavailable member function 'value': introduced in macOS 10.14`
|
|
depends_on "nlohmann-json"
|
|
depends_on "openssl@1.1"
|
|
depends_on "sdl2"
|
|
depends_on "sdl2_ttf"
|
|
depends_on "speexdsp"
|
|
|
|
resource "title-sequences" do
|
|
url "https://github.com/OpenRCT2/title-sequences/releases/download/v0.1.2c/title-sequences.zip"
|
|
sha256 "5284333fa501270835b5f0cf420cb52155742335f5658d7889ea35d136b52517"
|
|
end
|
|
|
|
resource "objects" do
|
|
url "https://github.com/OpenRCT2/objects/archive/v1.2.1.tar.gz"
|
|
sha256 "07816ab18779ab5988d737e1c21c25f0d95404c82919758dfdc44fdd3edf8ab5"
|
|
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,
|
|
"-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
|