homebrew-core/Formula/libbitcoin-server.rb
2018-02-06 01:12:54 -08:00

64 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.5.0.tar.gz"
sha256 "37ef8d572fb7400565655501ffdea5d07a1de10f3d9fa823d33e2bf68ef8c3ce"
bottle do
sha256 "b6c66446d989f0985423f5e70292c132fa1e067448a2e29fca547efdd9035dd8" => :high_sierra
sha256 "44140603b51b0d9438b5dd120baf7ff5a593078128585224c1e39954a255caea" => :sierra
sha256 "fa76c183e2c4068ba16068dd9f1b286d1803909d4d707035fd5ce5aae4958e33" => :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.5.0.tar.gz"
sha256 "9deac6908489e2d59fb9f89c895c49b00e01902d5fdb661f67d4dbe45b22af76"
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