Skip to content

Instantly share code, notes, and snippets.

@aynik
Last active January 16, 2018 19:33
Show Gist options
  • Save aynik/2d45d06c087c1d3eb4f5e24004b4d11c to your computer and use it in GitHub Desktop.
Save aynik/2d45d06c087c1d3eb4f5e24004b4d11c to your computer and use it in GitHub Desktop.
LND homebrew formula
class Lnd < Formula
desc "Lightning Network Daemon"
homepage "http://dev.lightning.community/"
url "https://github.com/lightningnetwork/lnd.git",
:branch => "master"
head "https://github.com/lightningnetwork/lnd.git"
version "0.3.0"
depends_on "go" => :build
def install
ENV["GOPATH"] = buildpath
lnd_path = buildpath/"src/github.com/lightningnetwork/lnd"
lnd_path.install Dir["*"]
cd lnd_path do
system "go", "get", "-u", "github.com/Masterminds/glide"
system "glide", "install"
system "go", "install", ".", "./cmd/..."
end
end
plist_options :manual => "lnd"
def plist; <<~EOS
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>KeepAlive</key>
<dict>
<key>SuccessfulExit</key>
<false/>
</dict>
<key>Label</key>
<string>#{plist_name}</string>
<key>ProgramArguments</key>
<array>
<string>#{opt_bin}/lnd</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>WorkingDirectory</key>
<string>#{var}</string>
<key>StandardErrorPath</key>
<string>#{var}/log/lnd.log</string>
<key>StandardOutPath</key>
<string>#{var}/log/lnd.log</string>
<key>SoftResourceLimits</key>
<dict>
<key>NumberOfFiles</key>
<integer>10240</integer>
</dict>
</dict>
</plist>
EOS
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment