homebrew-core/Formula/libbitcoin-protocol.rb
2019-06-09 22:18:35 +02:00

48 lines
1.7 KiB
Ruby

class LibbitcoinProtocol < Formula
desc "Bitcoin Blockchain Query Protocol"
homepage "https://github.com/libbitcoin/libbitcoin-protocol"
url "https://github.com/libbitcoin/libbitcoin-protocol/archive/v3.5.0.tar.gz"
sha256 "9deac6908489e2d59fb9f89c895c49b00e01902d5fdb661f67d4dbe45b22af76"
revision 3
bottle do
cellar :any
sha256 "d59eee0380a8f2829e2010d4aad1a30128c5c68e22fc4821ec686cda1848854e" => :mojave
sha256 "56505d692e88d7a0664dfb9a9c2f298be15d39ffc84423eeb087ab2e101bcef2" => :high_sierra
sha256 "6cff17534ebdedc1b6183d1d427762c6f818e02bc0b106eb3a5d0ecc75887385" => :sierra
end
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "libtool" => :build
depends_on "pkg-config" => :build
depends_on "libbitcoin"
depends_on "zeromq"
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"
end
test do
(testpath/"test.cpp").write <<~EOS
#include <bitcoin/protocol.hpp>
int main() {
libbitcoin::protocol::zmq::message instance;
instance.enqueue();
assert(!instance.empty());
assert(instance.size() == 1u);
}
EOS
system ENV.cxx, "-std=c++11", "test.cpp", "-o", "test",
"-L#{Formula["libbitcoin"].opt_lib}", "-lbitcoin",
"-L#{lib}", "-lbitcoin-protocol",
"-L#{Formula["boost"].opt_lib}", "-lboost_system"
system "./test"
end
end