class LibbitcoinNode < Formula desc "Bitcoin Full Node" homepage "https://github.com/libbitcoin/libbitcoin-node" url "https://github.com/libbitcoin/libbitcoin-node/archive/v3.5.0.tar.gz" sha256 "e3a0a96155ca93aa6cba75789c18419f40686a69cbd40c77aa77ca84ccc43cab" bottle do sha256 "1b922407cddc74d2bff6f39e61e6545cbab4e7e65b55ad84abe6224b2c39da49" => :high_sierra sha256 "90770b6f8b25f4d097162fa37e1c0c36e28293e82b71ee89cb963abc687fadf9" => :sierra sha256 "598b58a40ee268630a5cdc05c72b0b5790f066fc13d72d5c29006a8a5c3a0b5c" => :el_capitan end depends_on "autoconf" => :build depends_on "automake" => :build depends_on "libtool" => :build depends_on "pkg-config" => :build depends_on "libbitcoin-blockchain" resource "libbitcoin-network" do url "https://github.com/libbitcoin/libbitcoin-network/archive/v3.5.0.tar.gz" sha256 "e065bd95f64ad5d7b0f882e8759f6b0f81a5fb08f7e971d80f3592a1b5aa8db4" end def install ENV.prepend_path "PKG_CONFIG_PATH", Formula["libbitcoin"].opt_libexec/"lib/pkgconfig" ENV.prepend_path "PKG_CONFIG_PATH", Formula["libbitcoin-blockchain"].opt_libexec/"lib/pkgconfig" ENV.prepend_create_path "PKG_CONFIG_PATH", libexec/"lib/pkgconfig" resource("libbitcoin-network").stage do system "./autogen.sh" system "./configure", "--disable-dependency-tracking", "--disable-silent-rules", "--prefix=#{libexec}" system "make", "install" end system "./autogen.sh" system "./configure", "--disable-dependency-tracking", "--disable-silent-rules", "--prefix=#{prefix}" system "make", "install" bash_completion.install "data/bn" end test do (testpath/"test.cpp").write <<~EOS #include int main() { libbitcoin::node::settings configuration; assert(configuration.sync_peers == 0u); assert(configuration.sync_timeout_seconds == 5u); assert(configuration.refresh_transactions == true); return 0; } EOS system ENV.cxx, "-std=c++11", "test.cpp", "-I#{libexec}/include", "-lbitcoin", "-lbitcoin-node", "-lboost_system", "-o", "test" system "./test" end end