64 lines
2 KiB
Ruby
64 lines
2 KiB
Ruby
class Haxe < Formula
|
|
desc "Multi-platform programming language"
|
|
homepage "https://haxe.org/"
|
|
url "https://github.com/HaxeFoundation/haxe.git",
|
|
:tag => "4.0.3",
|
|
:revision => "dcfaf4ac01ffd4dbfbcc649f6e2a41ca7bfd1450"
|
|
head "https://github.com/HaxeFoundation/haxe.git", :branch => "development"
|
|
|
|
bottle do
|
|
cellar :any
|
|
sha256 "ddabbf9479d7c3044c8ebaaba12efb14459b48afc3fcd6081c8a0388e4f5ba1d" => :catalina
|
|
sha256 "bb2b28201aebdd74360639a492a70dee82591949a9554818488c1cf8d4519d09" => :mojave
|
|
sha256 "342b165e5295a089106a9dbe6c7674cb6981bae0778e53f4a8256323d587aaf1" => :high_sierra
|
|
end
|
|
|
|
depends_on "cmake" => :build
|
|
depends_on "ocaml" => :build
|
|
depends_on "opam" => :build
|
|
depends_on "pkg-config" => :build
|
|
depends_on "neko"
|
|
depends_on "pcre"
|
|
|
|
def install
|
|
# Build requires targets to be built in specific order
|
|
ENV.deparallelize
|
|
|
|
Dir.mktmpdir("opamroot") do |opamroot|
|
|
ENV["OPAMROOT"] = opamroot
|
|
ENV["OPAMYES"] = "1"
|
|
ENV["ADD_REVISION"] = "1" if build.head?
|
|
system "opam", "init", "--no-setup", "--disable-sandboxing"
|
|
system "opam", "config", "exec", "--",
|
|
"opam", "pin", "add", "haxe", buildpath, "--no-action"
|
|
system "opam", "config", "exec", "--",
|
|
"opam", "install", "haxe", "--deps-only"
|
|
system "opam", "config", "exec", "--",
|
|
"make"
|
|
end
|
|
|
|
# Rebuild haxelib as a valid binary
|
|
cd "extra/haxelib_src" do
|
|
system "cmake", "."
|
|
system "make"
|
|
end
|
|
rm "haxelib"
|
|
cp "extra/haxelib_src/haxelib", "haxelib"
|
|
|
|
bin.mkpath
|
|
system "make", "install", "INSTALL_BIN_DIR=#{bin}",
|
|
"INSTALL_LIB_DIR=#{lib}/haxe", "INSTALL_STD_DIR=#{lib}/haxe/std"
|
|
end
|
|
|
|
def caveats; <<~EOS
|
|
Add the following line to your .bashrc or equivalent:
|
|
export HAXE_STD_PATH="#{HOMEBREW_PREFIX}/lib/haxe/std"
|
|
EOS
|
|
end
|
|
|
|
test do
|
|
ENV["HAXE_STD_PATH"] = "#{HOMEBREW_PREFIX}/lib/haxe/std"
|
|
system "#{bin}/haxe", "-v", "Std"
|
|
system "#{bin}/haxelib", "version"
|
|
end
|
|
end
|