homebrew-core/Formula/libbitcoin-protocol.rb
2019-03-21 08:49:48 +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 2
bottle do
cellar :any
sha256 "a935344c0be0b5c6116bb7623184bd356e0d168d4955474d4329aefe0b050c82" => :mojave
sha256 "79cf5123bbb80dd3e6f2d4371f97885a457c3939ab17f82aab227abf392d3d0f" => :high_sierra
sha256 "346fed26498c8c8968ba8142251a75f76f8fbf0cf3a500524848d394deb0ea74" => :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