51 lines
1.8 KiB
Ruby
51 lines
1.8 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.6.0.tar.gz"
|
|
sha256 "283fa7572fcde70a488c93e8298e57f7f9a8e8403e209ac232549b2c433674e1"
|
|
license "AGPL-3.0"
|
|
revision 5
|
|
|
|
bottle do
|
|
sha256 "d8a87b3d33ffaa1e3b7cfac4f679fe64da1875a8bb09237b3ff60d25d4bfa8ee" => :big_sur
|
|
sha256 "4a2b284d9569ec892e5548e689266abb9b7a2100015207db9045c7b5da114bc5" => :catalina
|
|
sha256 "67d3d042ba2b7b337abb4e88c33c06f28b01b5c5eea7c4e0811b837159c3b354" => :mojave
|
|
sha256 "99da12bdcf85074aa4ea25da7b0d6b16b5bf1c8dea7409a17f96e7ba2012a745" => :high_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
|