48 lines
1.6 KiB
Ruby
48 lines
1.6 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"
|
|
revision 4
|
|
|
|
bottle do
|
|
sha256 "137557beba1a3119146037eb7a7f2bbac5a3403567ab7b502da5e642c491523a" => :mojave
|
|
sha256 "82951841b2e7704cc3923711bf7ef77a97c3d0582429e25ad20badbc16a4a8dc" => :high_sierra
|
|
sha256 "1a291e74db23b6a7489b554aeffa44f915f7cbc8604205c944b85180a1d2918f" => :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
|