class LibbitcoinProtocol < Formula desc "Bitcoin Blockchain Query Protocol" homepage "https://github.com/libbitcoin/libbitcoin-protocol" url "https://github.com/libbitcoin/libbitcoin-protocol/archive/v3.6.0.tar.gz" sha256 "fc41c64f6d3ee78bcccb63fd0879775c62bba5326f38c90b4c6804e2b9e8686e" revision 2 bottle do cellar :any sha256 "1c08dcc19d5b2eb7802cb152e441e32fd766b264c1e97b9837d88a2edc4447cb" => :catalina sha256 "e7dad4f664f27dc5fe89df604daf5e55289133fc99a7a67303869216ab9848fe" => :mojave sha256 "aa121e23ea64bdcedfefeecc296fda96b9c3025cef17227d5b8fa2a7f2867abc" => :high_sierra sha256 "a3fc6e2486cc3f5bdc6fd45c3fac16ab2b6a282e0128bd29904ddcadb937b11f" => :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 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