Skip to content

Instantly share code, notes, and snippets.

@lpetre
Last active August 29, 2015 14:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lpetre/eb08cf9b845bcd544022 to your computer and use it in GitHub Desktop.
Save lpetre/eb08cf9b845bcd544022 to your computer and use it in GitHub Desktop.
require 'formula'
class Haxe < Formula
homepage 'http://haxe.org'
head 'https://github.com/proletariatgames/haxe.git', :branch => 'master'
depends_on 'neko' => :recommended
depends_on 'objective-caml' => :build
depends_on 'camlp4' => :build
def install
# Build requires targets to be built in specific order
ENV.deparallelize
system "make"
bin.mkpath
system "make", "install", "INSTALL_BIN_DIR=#{bin}", "INSTALL_LIB_DIR=#{lib}/haxe"
# Replace the absolute symlink by a relative one,
# such that binary package created by homebrew will work in non-/usr/local locations.
rm bin/"haxe"
bin.install_symlink lib/"haxe/haxe"
end
test do
ENV["HAXE_STD_PATH"] = "#{HOMEBREW_PREFIX}/lib/haxe/std"
system "#{bin}/haxe", "-v", "Std"
end
def caveats; <<-EOS.undent
Add the following line to your .bashrc or equivalent:
export HAXE_STD_PATH="#{HOMEBREW_PREFIX}/lib/haxe/std"
EOS
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment