2015-01-24 20:27:40 +00:00
|
|
|
class Iojs < Formula
|
2015-06-02 15:53:34 +00:00
|
|
|
desc "npm-compatible platform based on Node.js"
|
2015-01-24 20:27:40 +00:00
|
|
|
homepage "https://iojs.org/"
|
2015-06-01 21:25:16 +00:00
|
|
|
url "https://iojs.org/dist/v2.2.1/iojs-v2.2.1.tar.xz"
|
|
|
|
sha256 "26cce6e3581185ef3b1fe486a86ba9e18d611f6dfe439cfcbcfc8e639436a5bd"
|
2015-01-24 20:27:40 +00:00
|
|
|
|
2015-01-25 01:31:08 +00:00
|
|
|
bottle do
|
2015-06-01 23:01:10 +00:00
|
|
|
sha256 "c24990a50778929555e1b0032eb75884dbd446e3444b359abb1b77bdeb525a61" => :yosemite
|
|
|
|
sha256 "6d2a124a4b806bd0eedd9e066bf44858f35b1164ea29b2761186851c712f31d3" => :mavericks
|
|
|
|
sha256 "fe2a71d264d5aa6c942ccb02179cda693f364a79816e4d3f6dabedccfddeb02c" => :mountain_lion
|
2015-01-25 01:31:08 +00:00
|
|
|
end
|
|
|
|
|
2015-01-25 10:48:07 +00:00
|
|
|
keg_only "iojs conflicts with node (which is currently more established)"
|
2015-01-24 20:27:40 +00:00
|
|
|
|
|
|
|
option "with-debug", "Build with debugger hooks"
|
2015-02-04 02:30:47 +00:00
|
|
|
option "with-icu4c", "Build with Intl (icu4c) support"
|
2015-01-24 20:27:40 +00:00
|
|
|
|
2015-02-04 02:30:47 +00:00
|
|
|
depends_on "pkg-config" => :build
|
|
|
|
depends_on "icu4c" => :optional
|
2015-01-24 20:27:40 +00:00
|
|
|
depends_on :python => :build
|
|
|
|
|
|
|
|
def install
|
|
|
|
args = %W[--prefix=#{prefix} --without-npm]
|
|
|
|
args << "--debug" if build.with? "debug"
|
2015-02-07 01:16:46 +00:00
|
|
|
args << "--with-intl=system-icu" if build.with? "icu4c"
|
2015-02-04 02:30:47 +00:00
|
|
|
|
2015-01-24 20:27:40 +00:00
|
|
|
system "./configure", *args
|
|
|
|
system "make", "install"
|
|
|
|
end
|
|
|
|
|
|
|
|
def caveats; <<-EOS.undent
|
2015-01-25 12:48:37 +00:00
|
|
|
iojs was installed without npm.
|
2015-01-24 20:27:40 +00:00
|
|
|
|
2015-01-25 12:48:37 +00:00
|
|
|
iojs currently requires a patched npm (i.e. not the npm installed by node).
|
2015-01-24 20:27:40 +00:00
|
|
|
EOS
|
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
|
|
|
path = testpath/"test.js"
|
|
|
|
path.write "console.log('hello');"
|
|
|
|
|
|
|
|
output = `#{bin}/iojs #{path}`.strip
|
|
|
|
assert_equal "hello", output
|
|
|
|
assert_equal 0, $?.exitstatus
|
|
|
|
end
|
|
|
|
end
|