libbitcoin-server 3.3.0 (new formula)

This is libbitcoin-server, a Bitcoin full node and query server. The
formula depends on libbitcoin-node, which is another formula, and
libbitcoin-protocol, which is defined as a resource here. The
libbitcoin-protocol library, in turn, depends on zeromq, which is why it
is specified as a dependency here.

Also add a `bs` alias.

Closes #18638.

Signed-off-by: ilovezfs <ilovezfs@icloud.com>
master
Sam Jones 2017-09-27 20:45:39 -04:00 committed by ilovezfs
parent 04ceea7fcc
commit 42f90e8731
2 changed files with 58 additions and 0 deletions

1
Aliases/bs Symbolic link
View File

@ -0,0 +1 @@
../Formula/libbitcoin-server.rb

View File

@ -0,0 +1,57 @@
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.3.0.tar.gz"
sha256 "3066ff98af14574edae3e36b056b847558953e501c9b4f626c0428db9933a0ad"
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "libtool" => :build
depends_on "pkg-config" => :build
depends_on "libbitcoin-node"
depends_on "zeromq"
resource "libbitcoin-protocol" do
url "https://github.com/libbitcoin/libbitcoin-protocol/archive/v3.3.0.tar.gz"
sha256 "7902de78b4c646daf2012e04bb7967784f67a6372a8a8d3c77417dabcc4b617d"
end
def install
ENV.prepend_path "PKG_CONFIG_PATH", Formula["libbitcoin"].opt_libexec/"lib/pkgconfig"
ENV.prepend_path "PKG_CONFIG_PATH", Formula["libbitcoin-blockchain"].opt_libexec/"lib/pkgconfig"
ENV.prepend_path "PKG_CONFIG_PATH", Formula["libbitcoin-node"].opt_libexec/"lib/pkgconfig"
ENV.prepend_create_path "PKG_CONFIG_PATH", libexec/"lib/pkgconfig"
resource("libbitcoin-protocol").stage do
system "./autogen.sh"
system "./configure", "--disable-dependency-tracking",
"--disable-silent-rules",
"--prefix=#{libexec}"
system "make", "install"
end
system "./autogen.sh"
system "./configure", "--disable-dependency-tracking",
"--disable-silent-rules",
"--prefix=#{prefix}"
system "make", "install"
end
test do
(testpath/"test.cpp").write <<-EOS.undent
#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",
"-I#{libexec}/include",
"-I#{Formula["libbitcoin-blockchain"].opt_libexec}/include",
"-I#{Formula["libbitcoin-node"].opt_libexec}/include",
"-lbitcoin", "-lbitcoin-server", "-lboost_system",
"-o", "test"
system "./test"
end
end