2019-07-14 22:46:59 +00:00
|
|
|
class Quickjs < Formula
|
|
|
|
desc "Small and embeddable JavaScript engine"
|
|
|
|
homepage "https://bellard.org/quickjs/"
|
2019-07-21 16:57:51 +00:00
|
|
|
url "https://bellard.org/quickjs/quickjs-2019-07-21.tar.xz"
|
|
|
|
sha256 "a906bed24c57dc9501b84a5bb4514f7eac58db82b721116ec5abe868490e53cc"
|
2019-07-14 22:46:59 +00:00
|
|
|
|
2019-07-18 17:21:53 +00:00
|
|
|
bottle do
|
|
|
|
sha256 "989215f264fc3240904342524457b923da278d6edd53e8fb44dad1f370b4e64f" => :mojave
|
|
|
|
sha256 "0f472d5f083df02c3516f42c43333f09fd6e2734da64ce7a4ae027a7e4dc808f" => :high_sierra
|
|
|
|
sha256 "3fbf3dfc902c9e68415088325ec7ec6f16e1c69204b3cd3432046d6bed14896e" => :sierra
|
|
|
|
end
|
|
|
|
|
2019-07-14 22:46:59 +00:00
|
|
|
def install
|
2019-07-21 16:57:51 +00:00
|
|
|
system "make", "install", "prefix=#{prefix}", "CONFIG_M32="
|
2019-07-14 22:46:59 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
2019-07-21 16:57:51 +00:00
|
|
|
output = shell_output("#{bin}/qjs --eval 'const js=\"JS\"; console.log(`Q${js}${(7 + 35)}`);'").strip
|
|
|
|
assert_match /^QJS42/, output
|
2019-07-14 22:46:59 +00:00
|
|
|
|
|
|
|
path = testpath/"test.js"
|
|
|
|
path.write "console.log('hello');"
|
|
|
|
system "#{bin}/qjsc", path
|
|
|
|
output = shell_output(testpath/"a.out").strip
|
|
|
|
assert_equal "hello", output
|
|
|
|
end
|
|
|
|
end
|