2019-07-14 22:46:59 +00:00
|
|
|
class Quickjs < Formula
|
|
|
|
desc "Small and embeddable JavaScript engine"
|
|
|
|
homepage "https://bellard.org/quickjs/"
|
2019-08-10 17:24:28 +00:00
|
|
|
url "https://bellard.org/quickjs/quickjs-2019-08-10.tar.xz"
|
|
|
|
sha256 "c6a9c676ead0e84f249f4d27ac6626b4fdb37aa6b4b7c46f94f95071204840fe"
|
2019-07-14 22:46:59 +00:00
|
|
|
|
2019-07-18 17:21:53 +00:00
|
|
|
bottle do
|
2019-08-10 17:32:34 +00:00
|
|
|
sha256 "255460f41d15a44c7f7da0894db878abfa7500d80945e8f3411bc9f0372ac9ed" => :mojave
|
|
|
|
sha256 "9e6435e1df1fa19fb53089a3f4843a1906cd966ed895e39f1bf81f04e99f40ca" => :high_sierra
|
|
|
|
sha256 "f221f3be11a7464d7bd3e364b953279ebb57c36fbd086c5c49593a7e7baf90ed" => :sierra
|
2019-07-18 17:21:53 +00:00
|
|
|
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
|