homebrew-core/Formula/libbitcoin-protocol.rb
2018-11-08 23:08:26 +01: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 1
bottle do
cellar :any
sha256 "9cde682a8fce446dd2af7644dab2f337b2620bcd0e27e22fe5c8545c5ec71b57" => :mojave
sha256 "d7f2c0e2ae517b0790db5ed6dc31718b998aea499df21f9c677e82bea7c793e9" => :high_sierra
sha256 "767af8ac2de0fb04bc3a41ce4dc234a1d1cc2edc9a87492a043aa8cc510d6883" => :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