From ea1636a8079a74724ca5d68545fee5a42e21b2a2 Mon Sep 17 00:00:00 2001 From: Andy Li Date: Thu, 20 Apr 2017 17:00:27 +0800 Subject: [PATCH] haxe: fix head spec (#12156) --- Formula/haxe.rb | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/Formula/haxe.rb b/Formula/haxe.rb index b71b73afd2..d9fc245e76 100644 --- a/Formula/haxe.rb +++ b/Formula/haxe.rb @@ -4,7 +4,6 @@ class Haxe < Formula url "https://github.com/HaxeFoundation/haxe.git", :tag => "3.4.2", :revision => "890f8c70cf23ce6f9fe0fdd0ee514a9699433ca7" - head "https://github.com/HaxeFoundation/haxe.git", :branch => "development" bottle do cellar :any @@ -13,6 +12,11 @@ class Haxe < Formula sha256 "07da6182e4e2482c941a0b7e5d3ec0bda852ab6702c0067153c02e0c3a3a1925" => :yosemite end + head do + url "https://github.com/HaxeFoundation/haxe.git", :branch => "development" + depends_on "opam" => :build + end + depends_on "ocaml" => :build depends_on "camlp4" => :build depends_on "cmake" => :build @@ -22,9 +26,16 @@ class Haxe < Formula def install # Build requires targets to be built in specific order ENV.deparallelize - args = ["OCAMLOPT=ocamlopt.opt"] - args << "ADD_REVISION=1" if build.head? - system "make", *args + + if build.head? + ENV["OPAMROOT"] = buildpath/"opamroot" + ENV["OPAMYES"] = "1" + system "opam", "init", "--no-setup" + system "opam", "install", "ocamlfind" + system "opam", "config", "exec", "--", "make", "ADD_REVISION=1" + else + system "make", "OCAMLOPT=ocamlopt.opt" + end # Rebuild haxelib as a valid binary cd "extra/haxelib_src" do