homebrew-core/Formula/libbitcoin-server.rb
2017-12-20 16:00:45 +01:00

65 lines
2.4 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.4.0.tar.gz"
sha256 "a2c88f463b85efe8c9b7617332759e9964dbe250273cb473ebbb479be2525ef5"
revision 2
bottle do
sha256 "52d31d7631dd84c1417f2eb8c7c8d207f565ce9a372889909a4333eb2d3934d1" => :high_sierra
sha256 "1ddeef96853973dc736b29ab89751ee6a57df8e2dc91a51eeb5a155f1ed819c4" => :sierra
sha256 "4c6d505dc6e4d7ef7af4d61d222fd71de10c5825cb85db5da08f61bfcf9b4144" => :el_capitan
end
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.4.0.tar.gz"
sha256 "71b1a5b23b4b20f4727693e1e0509af8a0db4623bb27de46e273496ada43a121"
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"
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",
"-I#{libexec}/include",
"-I#{Formula["libbitcoin-node"].opt_libexec}/include",
"-lbitcoin", "-lbitcoin-server", "-lboost_system",
"-o", "test"
system "./test"
end
end