Skip to content

Instantly share code, notes, and snippets.

@lucaspiller
Last active April 10, 2016 15:09
Show Gist options
  • Save lucaspiller/29fdd47956dd38a1fc0a1d4fd877b052 to your computer and use it in GitHub Desktop.
Save lucaspiller/29fdd47956dd38a1fc0a1d4fd877b052 to your computer and use it in GitHub Desktop.
OpenTTD (Reddit Version) Homebrew formula for OS X
# Install like this:
#
# $ brew install https://gist.githubusercontent.com/lucaspiller/29fdd47956dd38a1fc0a1d4fd877b052/raw/openttd-reddit.rb
#
# To symlink to /Applications/OpenTTD.app run:
#
# $ brew linkapps openttd-reddit
#
# Custom game data files / configuration / saves are stored in ~/Documents/OpenTTD/
#
class OpenttdReddit < Formula
desc "Simulation game based upon Transport Tycoon Deluxe"
homepage "https://www.openttd.org/"
version "reddit-27534"
url "svn://svn.openttd.org/trunk", using: :svn, revision: 27534
depends_on "lzo"
depends_on "xz"
depends_on "pkg-config" => :build
resource "opengfx" do
url "https://bundles.openttdcoop.org/opengfx/releases/0.5.3/opengfx-0.5.3.zip"
sha256 "f744e3bafc27ee03703554128f8dd6d187858af486b0dcfe9570832028073220"
end
resource "opensfx" do
url "https://bundles.openttdcoop.org/opensfx/releases/0.2.3/opensfx-0.2.3.zip"
sha256 "3574745ac0c138bae53b56972591db8d778ad9faffd51deae37a48a563e71662"
end
resource "openmsx" do
url "https://bundles.openttdcoop.org/openmsx/releases/0.3.1/openmsx-0.3.1.zip"
sha256 "92e293ae89f13ad679f43185e83fb81fb8cad47fe63f4af3d3d9f955130460f5"
end
# Ensures a deployment target is not set on 10.9:
# https://bugs.openttd.org/task/6295
patch :p0 do
url "https://trac.macports.org/export/117147/trunk/dports/games/openttd/files/patch-config.lib-remove-deployment-target.diff"
sha256 "95c3d54a109c93dc88a693ab3bcc031ced5d936993f3447b875baa50d4e87dac"
end
# Fixes for 10.11
# https://bugs.openttd.org/task/6380
patch :DATA, :p1
patch :p0 do
url "https://bugs.openttd.org/task/6380/getfile/10390/patch-src__video__cocoa__wnd_quartz.mm-avoid-removed-cmgetsystemprofile.diff"
sha256 "2cf010eb69df588134aceda0eba62cc21e221b6f2dfb7d836869b6edf4bdc093"
end
patch :p0 do
url "https://goo.gl/Ev9eK6"
end
def install
system "./configure", "--prefix-dir=#{prefix}"
system "make", "bundle"
(buildpath/"bundle/OpenTTD.app/Contents/Resources/data/opengfx").install resource("opengfx")
(buildpath/"bundle/OpenTTD.app/Contents/Resources/data/opensfx").install resource("opensfx")
(buildpath/"bundle/OpenTTD.app/Contents/Resources/gm/openmsx").install resource("openmsx")
prefix.install "bundle/OpenTTD.app"
end
def caveats; <<-EOS.undent
OpenTTD.app installed to: #{prefix}
If you have access to the sound and graphics files from the original
Transport Tycoon Deluxe, you can install them by following the
instructions in section 4.1 of #{prefix}/readme.txt
EOS
end
test do
File.executable? prefix/"OpenTTD.app/Contents/MacOS/openttd"
end
end
__END__
diff --git a/src/music/cocoa_m.cpp b/src/music/cocoa_m.cpp
index b0cb879..8818893 100644
--- a/src/music/cocoa_m.cpp
+++ b/src/music/cocoa_m.cpp
@@ -68,7 +68,7 @@ static void DoSetVolume()
* risk compilation errors. The header AudioComponent.h
* was introduced in 10.6 so use it to decide which
* type definition to use. */
-#ifdef __AUDIOCOMPONENT_H__
+#if defined(AUDIO_UNIT_VERSION) && (AUDIO_UNIT_VERSION >= 1060)
AudioComponentDescription desc;
#else
ComponentDescription desc;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment