2009-11-27 04:52:31 +00:00
|
|
|
require 'formula'
|
|
|
|
require 'hardware'
|
|
|
|
|
|
|
|
class V8 <Formula
|
2009-11-15 04:09:23 +00:00
|
|
|
head 'http://v8.googlecode.com/svn/trunk/'
|
2009-11-27 04:52:31 +00:00
|
|
|
homepage 'http://code.google.com/p/v8/'
|
|
|
|
|
|
|
|
depends_on 'scons'
|
|
|
|
|
|
|
|
def install
|
|
|
|
arch = Hardware.is_64_bit? ? 'x64' : 'ia32'
|
2009-11-15 04:09:23 +00:00
|
|
|
|
|
|
|
system "scons",
|
|
|
|
"-j #{Hardware.processor_count}",
|
|
|
|
"arch=#{arch}",
|
|
|
|
"mode=release",
|
|
|
|
"snapshot=on",
|
|
|
|
"library=shared",
|
|
|
|
"visibility=default",
|
|
|
|
"console=readline",
|
|
|
|
"sample=shell"
|
2009-11-27 04:52:31 +00:00
|
|
|
|
|
|
|
include.install(Dir['include/*'])
|
|
|
|
lib.install(Dir['libv8.*'])
|
|
|
|
|
|
|
|
mv('shell', 'v8')
|
|
|
|
bin.install('v8')
|
2010-02-06 23:44:45 +00:00
|
|
|
|
|
|
|
system "install_name_tool -change libv8.dylib #{lib}/libv8.dylib #{bin+'v8'}"
|
2009-11-27 04:52:31 +00:00
|
|
|
end
|
|
|
|
end
|