diff --git a/Formula/libbitcoin-protocol.rb b/Formula/libbitcoin-protocol.rb new file mode 100644 index 0000000000..97d7a5d53f --- /dev/null +++ b/Formula/libbitcoin-protocol.rb @@ -0,0 +1,39 @@ +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" + + 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 + 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", + "-lbitcoin", "-lbitcoin-protocol", "-lboost_system", + "-o", "test" + system "./test" + end +end