aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/v8.rb
blob: d92edc3524493e551d42646f072e81411c8f6ebd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
require 'formula'

class V8 <Formula
  head 'http://v8.googlecode.com/svn/trunk/'
  homepage 'http://code.google.com/p/v8/'

  depends_on 'scons'

  def install
    arch = Hardware.is_64_bit? ? 'x64' : 'ia32'

    system "scons",
            "-j #{Hardware.processor_count}",
            "arch=#{arch}",
            "mode=release",
            "snapshot=on",
            "library=shared",
            "visibility=default",
            "console=readline",
            "sample=shell"

    include.install Dir['include/*']
    lib.install Dir['libv8.*']
    bin.install 'shell' => 'v8'

    system "install_name_tool -change libv8.dylib #{lib}/libv8.dylib #{bin}/v8"
  end
end