homebrew-core/Formula/libbitcoin-protocol.rb

51 lines
1.8 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.6.0.tar.gz"
sha256 "fc41c64f6d3ee78bcccb63fd0879775c62bba5326f38c90b4c6804e2b9e8686e"
license "AGPL-3.0"
revision 5
bottle do
cellar :any
sha256 "2cb09e5ce9b433b9ab28c843d99b7f79084af63700d2f30fbd7e98e8d731997a" => :big_sur
sha256 "e6d636c0f911028bde68c355ccd8c2559dd5de5c98bccf25e29abf513858f7c8" => :catalina
sha256 "dbf5a7bb317424c6be91de02cd905f8b7363aa44dacbe7615fba646b8d1c5f39" => :mojave
sha256 "ed1cd5adabdafe839a4abf22ead5c697cf6856c5a2e9d135f62615554a13b073" => :high_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