42 lines
1.4 KiB
Ruby
42 lines
1.4 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.3.0.tar.gz"
|
||
|
sha256 "b4d98199ac4629a9857c1eb8819fe8166525bf2dca9ed790a9bbe5dc9c9e9186"
|
||
|
|
||
|
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",
|
||
|
"-lbitcoin", "-lbitcoin-database", "-lboost_system",
|
||
|
"-o", "test"
|
||
|
system "./test"
|
||
|
end
|
||
|
end
|