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-09-15 19:13:16 +00:00
|
|
|
url "https://iojs.org/dist/v3.3.1/iojs-v3.3.1.tar.xz"
|
|
|
|
sha256 "c5b1a7117b75dca563f66c35ee65db6fc43e25a3756608ad2c4d60087314bd36"
|
2015-01-24 20:27:40 +00:00
|
|
|
|
2015-01-25 01:31:08 +00:00
|
|
|
bottle do
|
2015-09-16 22:48:36 +00:00
|
|
|
sha256 "11365cb0ea6f2317c7ebde018b43d34afd1be5d634ed4c3e63cd86beec733abb" => :el_capitan
|
|
|
|
sha256 "9828d8b1b974f14a4b88c6b9f0eebb6d01d4f5fb1fe84496020e432447f67b7a" => :yosemite
|
|
|
|
sha256 "1e59ce95f7d637ce63bab8da4a5bc8066917e20f9ba3200d658518ca23c85b8c" => :mavericks
|
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-07-20 19:03:51 +00:00
|
|
|
depends_on :python => :build if MacOS.version <= :snow_leopard
|
2015-01-24 20:27:40 +00:00
|
|
|
|
|
|
|
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
|