2016-04-21 15:11:51 +00:00
|
|
|
class Llnode < Formula
|
|
|
|
desc "LLDB plugin for live/post-mortem debugging of node.js apps"
|
2016-11-29 12:23:20 +00:00
|
|
|
homepage "https://github.com/nodejs/llnode"
|
2016-12-07 22:40:27 +00:00
|
|
|
url "https://github.com/nodejs/llnode/archive/v1.4.1.tar.gz"
|
|
|
|
sha256 "4c1e0143e0a580cb393b0c280f538427380a27bbaeb39a53b69f502955ca0231"
|
2016-04-21 15:11:51 +00:00
|
|
|
|
2016-04-21 20:17:50 +00:00
|
|
|
bottle do
|
|
|
|
cellar :any
|
2016-12-08 00:54:09 +00:00
|
|
|
sha256 "f66cf3eb44eadc91286c0ef34e27a906b3c9b50b4f239148e13cd5d9f030e099" => :sierra
|
|
|
|
sha256 "a0fc9c17ae7f1e381002dc9f11cc265cb2e3514beef11bb1d4a2a2614b4f575c" => :el_capitan
|
|
|
|
sha256 "be4cfb77651a0e510c71707557246a8f1e37043773d7c9eea39e5a0d9d1bc89d" => :yosemite
|
2016-04-21 20:17:50 +00:00
|
|
|
end
|
|
|
|
|
2016-09-24 15:45:48 +00:00
|
|
|
depends_on :macos => :yosemite
|
|
|
|
depends_on :python => :build
|
2016-04-21 15:11:51 +00:00
|
|
|
|
|
|
|
resource "gyp" do
|
|
|
|
url "https://chromium.googlesource.com/external/gyp.git",
|
2016-09-24 15:45:48 +00:00
|
|
|
:revision => "db72e9fcf55ba9d8089f0bc7e447180f8972b5c0"
|
2016-04-21 15:11:51 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
resource "lldb" do
|
2016-11-22 00:32:55 +00:00
|
|
|
if MacOS::Xcode.version >= "8.0"
|
|
|
|
# lldb 360.1
|
|
|
|
url "https://github.com/llvm-mirror/lldb.git",
|
|
|
|
:revision => "839b868e2993dcffc7fea898a1167f1cec097a82"
|
|
|
|
else
|
|
|
|
# It claims it to be lldb 350.0 for Xcode 7.3, but in fact it is based
|
|
|
|
# of 34.
|
|
|
|
# Xcode < 7.3 uses 340.4, so I assume we should be safe to go with this.
|
|
|
|
url "http://llvm.org/svn/llvm-project/lldb/tags/RELEASE_34/final/",
|
|
|
|
:using => :svn
|
|
|
|
end
|
2016-04-21 15:11:51 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def install
|
|
|
|
(buildpath/"lldb").install resource("lldb")
|
|
|
|
(buildpath/"tools/gyp").install resource("gyp")
|
|
|
|
|
|
|
|
system "./gyp_llnode"
|
|
|
|
system "make", "-C", "out/"
|
|
|
|
prefix.install "out/Release/llnode.dylib"
|
|
|
|
end
|
|
|
|
|
|
|
|
def caveats; <<-EOS.undent
|
|
|
|
`brew install llnode` does not link the plugin to LLDB PlugIns dir.
|
|
|
|
|
|
|
|
To load this plugin in LLDB, one will need to either
|
|
|
|
|
|
|
|
* Type `plugin load #{opt_prefix}/llnode.dylib` on each run of lldb
|
|
|
|
* Install plugin into PlugIns dir manually:
|
|
|
|
|
|
|
|
mkdir -p ~/Library/Application\\ Support/LLDB/PlugIns
|
|
|
|
ln -sf #{opt_prefix}/llnode.dylib \\
|
|
|
|
~/Library/Application\\ Support/LLDB/PlugIns/
|
|
|
|
EOS
|
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
|
|
|
lldb_out = pipe_output "lldb", <<-EOS.undent
|
|
|
|
plugin load #{opt_prefix}/llnode.dylib
|
|
|
|
help v8
|
|
|
|
quit
|
|
|
|
EOS
|
|
|
|
assert_match /v8 bt/, lldb_out
|
|
|
|
end
|
|
|
|
end
|