class Bitcoin < Formula desc "Decentralized, peer to peer payment network" homepage "https://bitcoin.org/" url "https://bitcoin.org/bin/bitcoin-core-0.17.1/bitcoin-0.17.1.tar.gz" sha256 "3e564fb5cf832f39e930e19c83ea53e09cfe6f93a663294ed83a32e194bda42a" bottle do cellar :any sha256 "9f31d9597cb82823d23baf05afbfa6a3e177a8a5ee043a4f618cb3b248515f8d" => :mojave sha256 "dbdd16f4c04598c60c8a1b6835e42570582b8ee81a8ef509cd308b292658406c" => :high_sierra sha256 "574444c09a0d32df7c4942daebc06946c7ce06b32a4ee8e044b2ddc51da8d0e3" => :sierra 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 Label #{plist_name} ProgramArguments #{opt_bin}/bitcoind RunAtLoad EOS end test do system "#{bin}/test_bitcoin" end end