68 lines
2.1 KiB
Ruby
68 lines
2.1 KiB
Ruby
class Llnode < Formula
|
|
desc "LLDB plugin for live/post-mortem debugging of node.js apps"
|
|
homepage "https://github.com/indutny/llnode"
|
|
url "https://github.com/indutny/llnode/archive/v1.3.0.tar.gz"
|
|
sha256 "7d7a0c44195adeb0389641148597dfef652ca3736af8bcc90c65e28a0b2ede63"
|
|
|
|
bottle do
|
|
cellar :any
|
|
rebuild 1
|
|
sha256 "ae03daa234b94653f099e135c87a39c40ff5413792de518273edf05a42ade2df" => :sierra
|
|
sha256 "3404e24bed04c1c72c435af6ede163221369afadf0839a080ad1c4053a797e2d" => :el_capitan
|
|
sha256 "3fe3457a75d478ddfa279299baabf16875056e44447153b1e2f3015bd06852f0" => :yosemite
|
|
end
|
|
|
|
depends_on :macos => :yosemite
|
|
depends_on :python => :build
|
|
|
|
resource "gyp" do
|
|
url "https://chromium.googlesource.com/external/gyp.git",
|
|
:revision => "db72e9fcf55ba9d8089f0bc7e447180f8972b5c0"
|
|
end
|
|
|
|
resource "lldb" do
|
|
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
|
|
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
|