homebrew-core/Formula/libbitcoin-server.rb

53 lines
1.9 KiB
Ruby

class LibbitcoinServer < Formula
desc "Bitcoin Full Node and Query Server"
homepage "https://github.com/libbitcoin/libbitcoin-server"
url "https://github.com/libbitcoin/libbitcoin-server/archive/v3.6.0.tar.gz"
sha256 "283fa7572fcde70a488c93e8298e57f7f9a8e8403e209ac232549b2c433674e1"
license "AGPL-3.0"
revision 6
bottle do
rebuild 1
sha256 arm64_big_sur: "20e59332917da2f92f60ed06e6a2c83516a0a24ca7deef6539723e4d4627cdbb"
sha256 big_sur: "938cff4210a9af3dc898813c69d40de721907b6da1851d8fe5bd1245e1201a85"
sha256 catalina: "a30c9b57cc0e7a513822cac708094844c9180d01ae46408d1e53c19ffd6a970f"
sha256 mojave: "0cc3c97b8d11940fb5805b5d4c60a955e2b089be6f27666e3893c2cf7d617d18"
end
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "libtool" => :build
depends_on "pkg-config" => :build
depends_on "libbitcoin-node"
depends_on "libbitcoin-protocol"
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"
bash_completion.install "data/bs"
end
test do
(testpath/"test.cpp").write <<~EOS
#include <bitcoin/server.hpp>
int main() {
libbitcoin::server::message message(true);
assert(message.secure() == true);
return 0;
}
EOS
system ENV.cxx, "-std=c++11", "test.cpp", "-o", "test",
"-L#{Formula["libbitcoin"].opt_lib}", "-lbitcoin",
"-L#{lib}", "-lbitcoin-server",
"-L#{Formula["boost"].opt_lib}", "-lboost_system"
system "./test"
end
end