homebrew-core/Formula/libbitcoin-node.rb
2018-11-08 23:08:26 +01:00

50 lines
1.7 KiB
Ruby

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"
revision 2
bottle do
sha256 "ee41f18784cf98b2cfd6060f0e3fe9f8f6ec37451a9878092e375c272e8ca164" => :mojave
sha256 "e901829a39b3d9c82cd548a2199ff177f66a7b39f17cc75b8316b6a9da8e6b31" => :high_sierra
sha256 "58d1a6da15bd06108da253e52df4d26082f10eed14022c52576c2e9405f7183f" => :sierra
end
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "libtool" => :build
depends_on "pkg-config" => :build
depends_on "libbitcoin-blockchain"
depends_on "libbitcoin-network"
def install
ENV.prepend_path "PKG_CONFIG_PATH", Formula["libbitcoin"].opt_libexec/"lib/pkgconfig"
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 <bitcoin/node.hpp>
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", "-o", "test",
"-L#{Formula["libbitcoin"].opt_lib}", "-lbitcoin",
"-L#{lib}", "-lbitcoin-node",
"-L#{Formula["boost"].opt_lib}", "-lboost_system"
system "./test"
end
end