class Bitcoin < Formula desc "Decentralized, peer to peer payment network" homepage "https://bitcoin.org/" url "https://bitcoin.org/bin/bitcoin-core-0.17.0/bitcoin-0.17.0.tar.gz" sha256 "98ef39e851644bba1ac51edaa53c7c47c20a3980333def7bc642c8261a12785e" bottle do cellar :any sha256 "9706142fea73ff186a4de1db3180f7dc1abe826ca48ba3ac421ed916cc991999" => :mojave sha256 "9fb110426bfc2e4cedb33bf8de7439450934dd6c81abcc183f12bdf3a5c72656" => :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