2017-01-27 08:54:19 +00:00
|
|
|
class Chakra < Formula
|
|
|
|
desc "The core part of the Chakra JavaScript engine that powers Microsoft Edge"
|
|
|
|
homepage "https://github.com/Microsoft/ChakraCore"
|
2017-02-10 09:00:09 +00:00
|
|
|
url "https://github.com/Microsoft/ChakraCore/archive/v1.4.1.tar.gz"
|
|
|
|
sha256 "80b3cae99475562dd740c470e4398e0649509eeb31c42dccc09dde19330d83e6"
|
2017-01-27 08:54:19 +00:00
|
|
|
|
2017-02-01 18:59:23 +00:00
|
|
|
bottle do
|
|
|
|
cellar :any_skip_relocation
|
2017-02-10 17:30:01 +00:00
|
|
|
sha256 "b6f92ab77539f0b307dcc94153be7689dfe050f07ce54b706f1f3d3e8c6865d2" => :sierra
|
|
|
|
sha256 "50f4f12db16d4b737a1658f73f538935b8725079cba890bf8e942eb1835f6d67" => :el_capitan
|
|
|
|
sha256 "e9b2936b97338308eff93d708b58f0d8b2a9ec42aaa22936878265cc6513ac5b" => :yosemite
|
2017-02-01 18:59:23 +00:00
|
|
|
end
|
|
|
|
|
2017-01-27 08:54:19 +00:00
|
|
|
depends_on "cmake" => :build
|
|
|
|
depends_on "icu4c" => :optional
|
|
|
|
|
|
|
|
def install
|
|
|
|
# Build fails with -Os default
|
|
|
|
# Upstream issue from 26 Jan 2016 https://github.com/Microsoft/ChakraCore/issues/2417
|
|
|
|
# Fixed in master https://github.com/obastemur/ChakraCore/commit/cda81f4
|
|
|
|
ENV.O3
|
|
|
|
|
|
|
|
args = ["--static"]
|
|
|
|
if build.with? "icu4c"
|
|
|
|
args << "--icu=#{Formula["icu4c"].opt_include}"
|
|
|
|
else
|
|
|
|
args << "--no-icu"
|
|
|
|
end
|
|
|
|
system "./build.sh", *args
|
|
|
|
|
|
|
|
bin.install "BuildLinux/Release/ch" => "chakra"
|
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
|
|
|
(testpath/"test.js").write("print('Hello world!');\n")
|
|
|
|
assert_equal "Hello world!", shell_output("#{bin}/chakra test.js").chomp
|
|
|
|
end
|
|
|
|
end
|