50 lines
1.7 KiB
Ruby
50 lines
1.7 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 4
|
|
|
|
bottle do
|
|
sha256 "2a5f06eaeb8ad0cb95f121186d7a9799846c1723628af1c6fce8da0478bc20ce" => :catalina
|
|
sha256 "6ec0f8733b2abcbfaba25768d0b712d77e5bfe35244c11d76ab6dcf670fc53ec" => :mojave
|
|
sha256 "99a9628d248e7cce8c4fd5ec3f8379a61be0f5d84254897de1509a58e835e82e" => :high_sierra
|
|
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}"
|
|
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
|