homebrew-core/Formula/ipfs.rb
2018-11-05 12:50:07 +08:00

52 lines
1.5 KiB
Ruby

class Ipfs < Formula
desc "Peer-to-peer hypermedia protocol"
homepage "https://ipfs.io/"
url "https://github.com/ipfs/go-ipfs.git",
:tag => "v0.4.18",
:revision => "aefc746f34e5ffdee5fba1915c6603b65a0ebf81"
head "https://github.com/ipfs/go-ipfs.git"
bottle do
cellar :any_skip_relocation
sha256 "338d2a56d12e905ae6916df9aedce66068cfa9368054b5c7d4bdb9877e0c2b06" => :mojave
sha256 "cd05be50fbf6162d208bfbe5300accfa1a08abc7ec2a2230621afbb5319f8491" => :high_sierra
sha256 "b3a9d6f5e74876b0081193a690e470d94d56c290e67e444cfdda67603b85518a" => :sierra
end
depends_on "go" => :build
depends_on "godep" => :build
depends_on "gx"
depends_on "gx-go"
def install
ENV["GOPATH"] = buildpath
(buildpath/"src/github.com/ipfs/go-ipfs").install buildpath.children
cd("src/github.com/ipfs/go-ipfs") { system "make", "install" }
bin.install "bin/ipfs"
end
plist_options :manual => "ipfs daemon"
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>Label</key>
<string>#{plist_name}</string>
<key>ProgramArguments</key>
<array>
<string>#{opt_bin}/ipfs</string>
<string>daemon</string>
</array>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>
EOS
end
test do
system bin/"ipfs", "version"
end
end