From 42f90e8731d3928425db7d6d0a7c92e16d29a4b5 Mon Sep 17 00:00:00 2001 From: Sam Jones Date: Wed, 27 Sep 2017 20:45:39 -0400 Subject: [PATCH] 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 --- Aliases/bs | 1 + Formula/libbitcoin-server.rb | 57 ++++++++++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+) create mode 120000 Aliases/bs create mode 100644 Formula/libbitcoin-server.rb diff --git a/Aliases/bs b/Aliases/bs new file mode 120000 index 0000000000..833f33ef54 --- /dev/null +++ b/Aliases/bs @@ -0,0 +1 @@ +../Formula/libbitcoin-server.rb \ No newline at end of file diff --git a/Formula/libbitcoin-server.rb b/Formula/libbitcoin-server.rb new file mode 100644 index 0000000000..f3e9a6cb45 --- /dev/null +++ b/Formula/libbitcoin-server.rb @@ -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 + 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