class Fibjs < Formula desc "JavaScript on Fiber" homepage "http://fibjs.org/" url "https://github.com/fibjs/fibjs/releases/download/v0.24.0/fullsrc.zip" sha256 "539ba5b208d8f1a2748e5012c758475f55d859af0a8f9d0d4415f7413d4ed3d1" head "https://github.com/fibjs/fibjs.git" bottle do cellar :any_skip_relocation sha256 "cf654d9fcda65cdb4982335932596bb39b9ad3d42307886d20b9aa2d154e7ef9" => :high_sierra sha256 "76fb4a073908a330803f94007ca6d44bca5006e16d454818b950cd39d3d9e7bc" => :sierra end depends_on :macos => :sierra # fibjs requires >= Xcode 8.3 (or equivalent CLT) depends_on "cmake" => :build def install # the build script breaks when CI is set by Homebrew begin env_ci = ENV.delete "CI" system "./build", "release", "-j#{ENV.make_jobs}" ensure ENV["CI"] = env_ci end bin.install "bin/Darwin_amd64_release/fibjs" end test do path = testpath/"test.js" path.write "console.log('hello');" output = shell_output("#{bin}/fibjs #{path}").strip assert_equal "hello", output end end