50 lines
1.8 KiB
Ruby
50 lines
1.8 KiB
Ruby
class LibbitcoinDatabase < Formula
|
|
desc "Bitcoin High Performance Blockchain Database"
|
|
homepage "https://github.com/libbitcoin/libbitcoin-database"
|
|
url "https://github.com/libbitcoin/libbitcoin-database/archive/v3.5.0.tar.gz"
|
|
sha256 "376ab5abd8d7734a8b678030b9e997c4b1922e422f6e0a185d7daa3eb251db93"
|
|
revision 3
|
|
|
|
bottle do
|
|
cellar :any
|
|
sha256 "b06f8ce8d0cc6fd06570f1e7020ac5c40feed19f67dedaedfba27e93e6663fb8" => :mojave
|
|
sha256 "193c02b48459be7020ec5a4995e6c4d11904011b4841a73bb381d29b83cf114a" => :high_sierra
|
|
sha256 "0ec570d11a7b5c111a2e310f34d9ba90c0c0ad479e9d7b1fe6451db23f6fa22e" => :sierra
|
|
end
|
|
|
|
depends_on "autoconf" => :build
|
|
depends_on "automake" => :build
|
|
depends_on "libtool" => :build
|
|
depends_on "pkg-config" => :build
|
|
depends_on "libbitcoin"
|
|
|
|
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"
|
|
end
|
|
|
|
test do
|
|
(testpath/"test.cpp").write <<~EOS
|
|
#include <bitcoin/database.hpp>
|
|
using namespace libbitcoin::database;
|
|
using namespace libbitcoin::chain;
|
|
int main() {
|
|
static const transaction tx{ 0, 0, input::list{}, output::list{ output{} } };
|
|
unspent_outputs cache(42);
|
|
cache.add(tx, 0, 0, false);
|
|
assert(cache.size() == 1u);
|
|
return 0;
|
|
}
|
|
EOS
|
|
system ENV.cxx, "-std=c++11", "test.cpp", "-o", "test",
|
|
"-L#{Formula["libbitcoin"].opt_lib}", "-lbitcoin",
|
|
"-L#{lib}", "-lbitcoin-database",
|
|
"-L#{Formula["boost"].opt_lib}", "-lboost_system"
|
|
system "./test"
|
|
end
|
|
end
|