Skip to content

Instantly share code, notes, and snippets.

@mitio
Last active November 18, 2015 16:44
Show Gist options
  • Save mitio/4fa1c7feda6bcd9a3288 to your computer and use it in GitHub Desktop.
Save mitio/4fa1c7feda6bcd9a3288 to your computer and use it in GitHub Desktop.
Install Adobe Flex 4.6 SDK and the mxmlc Action Script compiler via Homebrew
# Find downloads at: https://helpx.adobe.com/air/kb/archived-air-sdk-version.html
class AdobeFlexSdk < Formula
desc "Adobe Flex SDK & mxmlc compiler"
homepage "https://www.adobe.com/devnet/flex/flex-sdk-download.html"
url "http://download.macromedia.com/pub/flex/sdk/flex_sdk_4.6.zip"
version "4.6.0.23201"
sha256 "622b63f29de44600ff8d4231174a70fcb3085812c0e146a42e91877ca8b46798"
bottle :unneeded
def install
rm_f Dir["bin/*.bat"]
patch_mxmlc
libexec.install Dir["*"]
bin.write_exec_script Dir["#{libexec}/bin/*"]
end
def caveats; <<-EOS.undent
To set FLEX_HOME:
export FLEX_HOME=#{libexec}
Note that mxmlc has been patched to allow it to run on newer OS X versions.
See here for more info: http://stackoverflow.com/a/13302428/75715
EOS
end
test do
build_number = version.split('.').last
main_version = version.split('.')[0..-2].join('.')
actual_version = shell_output("#{bin}/mxmlc -version")
assert actual_version.include?(main_version)
assert actual_version.include?(build_number)
end
private
# See here for details: http://stackoverflow.com/a/13302428/75715
def patch_mxmlc
mxmlc_binary = 'bin/mxmlc'
patched_mxmlc_script = File.read(mxmlc_binary).sub('-d32', '')
File.write(mxmlc_binary, patched_mxmlc_script)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment