homebrew-core/Formula/bitcoin.rb
2018-09-20 08:47:18 +02:00

71 lines
2 KiB
Ruby

class Bitcoin < Formula
desc "Decentralized, peer to peer payment network"
homepage "https://bitcoin.org/"
url "https://bitcoin.org/bin/bitcoin-core-0.16.3/bitcoin-0.16.3.tar.gz"
sha256 "836eed97dfc79cff09f356e8fbd6a6ef2de840fb9ff20ebffb51ccffdb100218"
bottle do
cellar :any
sha256 "0036ef31623df2e23673c4f7ddcb8a10a6f39c14d1f37251d0afb350cfcff9ad" => :mojave
sha256 "b5dd1e541138711af6c445778c015d7d0fd5c52f47922b0e4c09eda9722a2f07" => :high_sierra
sha256 "514c648b977a5eeae33576b234a579bf503549b00c1c618923e7a6af7516375c" => :sierra
sha256 "d16b0be096d586e62d91e13b29231bc5a498bda28f84e3c18cb0bcee6a3fa88d" => :el_capitan
end
head do
url "https://github.com/bitcoin/bitcoin.git"
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "libtool" => :build
end
depends_on "pkg-config" => :build
depends_on "berkeley-db@4"
depends_on "boost"
depends_on "libevent"
depends_on "miniupnpc"
depends_on "openssl"
depends_on "zeromq"
needs :cxx11
def install
if MacOS.version == :el_capitan && MacOS::Xcode.installed? &&
MacOS::Xcode.version >= "8.0"
ENV.delete("SDKROOT")
end
system "./autogen.sh" if build.head?
system "./configure", "--disable-dependency-tracking",
"--disable-silent-rules",
"--with-boost-libdir=#{Formula["boost"].opt_lib}",
"--prefix=#{prefix}"
system "make", "install"
pkgshare.install "share/rpcauth"
end
plist_options :manual => "bitcoind"
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}/bitcoind</string>
</array>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>
EOS
end
test do
system "#{bin}/test_bitcoin"
end
end