52 lines
1.9 KiB
Ruby
52 lines
1.9 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 6
|
|
|
|
bottle do
|
|
rebuild 1
|
|
sha256 cellar: :any, arm64_big_sur: "cad8c088fda88ee6a4618a1196ff5e49a63cea4e2fd32f6a402dfd4851fbdae3"
|
|
sha256 cellar: :any, big_sur: "1a9a04d1a5645f4f5820fb4fae0b4b03476a7554a070ac3495958525916fcffc"
|
|
sha256 cellar: :any, catalina: "b89dd7742e774bf80a8c2dcab61ffaa25b53bf26e7de720e7724f5b1034cbd87"
|
|
sha256 cellar: :any, mojave: "88406194bac447e36bdf8020f1a0899ac8206834996c48a38ee83d22c640e520"
|
|
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}",
|
|
"--with-boost-libdir=#{Formula["boost"].opt_lib}"
|
|
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
|