rocksdb 3.5 (new formula)
This commit is contained in:
parent
3d680c9c49
commit
c33e3348a1
1 changed files with 43 additions and 0 deletions
43
Formula/rocksdb.rb
Normal file
43
Formula/rocksdb.rb
Normal file
|
@ -0,0 +1,43 @@
|
|||
require "formula"
|
||||
|
||||
class Rocksdb < Formula
|
||||
homepage "http://rocksdb.org"
|
||||
url "https://github.com/facebook/rocksdb/archive/3.5.fb.tar.gz"
|
||||
sha1 "f8bd52914835a0839548eaca7f755128ed759991"
|
||||
version "3.5"
|
||||
|
||||
needs :cxx11
|
||||
depends_on "snappy"
|
||||
depends_on "lz4"
|
||||
|
||||
def install
|
||||
ENV.cxx11
|
||||
system "make", "clean"
|
||||
system "make", "static_lib"
|
||||
system "make", "shared_lib"
|
||||
system "make", "install", "INSTALL_PATH=#{prefix}"
|
||||
end
|
||||
|
||||
test do
|
||||
(testpath/"test.cpp").write <<-EOS.undent
|
||||
#include <assert.h>
|
||||
#include <rocksdb/options.h>
|
||||
#include <rocksdb/memtablerep.h>
|
||||
using namespace rocksdb;
|
||||
int main() {
|
||||
Options options;
|
||||
options.memtable_factory.reset(
|
||||
NewHashSkipListRepFactory(16));
|
||||
return 0;
|
||||
}
|
||||
EOS
|
||||
|
||||
system ENV.cxx, "test.cpp", "-o", "db_test", "-v", "-std=c++11",
|
||||
"-stdlib=libc++",
|
||||
"-lstdc++",
|
||||
"-lrocksdb",
|
||||
"-lz", "-lbz2",
|
||||
"-lsnappy", "-llz4"
|
||||
system "./db_test"
|
||||
end
|
||||
end
|
Loading…
Reference in a new issue