36 lines
1.3 KiB
Ruby
36 lines
1.3 KiB
Ruby
class Leveldb < Formula
|
|
desc "Key-value storage library with ordered mapping"
|
|
homepage "https://github.com/google/leveldb/"
|
|
url "https://github.com/google/leveldb/archive/v1.20.tar.gz"
|
|
sha256 "f5abe8b5b209c2f36560b75f32ce61412f39a2922f7045ae764a2c23335b6664"
|
|
|
|
bottle do
|
|
cellar :any
|
|
sha256 "429fe042688a6c7bab742fd73e518336b4c656af562797e8b3a08b21d4a5453b" => :sierra
|
|
sha256 "161dbb44dada171246c6c00efe96822621cfa366ce8057eac18ec464d20ce072" => :el_capitan
|
|
sha256 "556dd6f11381e5fa8685b79f73ebc602e83d0412af5d8c5f196abd4d2e12be6e" => :yosemite
|
|
end
|
|
|
|
option "with-test", "Verify the build with make check"
|
|
|
|
depends_on "gperftools"
|
|
depends_on "snappy"
|
|
|
|
def install
|
|
system "make"
|
|
system "make", "check" if build.bottle? || build.with?("test")
|
|
|
|
include.install "include/leveldb"
|
|
bin.install "out-static/leveldbutil"
|
|
lib.install "out-static/libleveldb.a"
|
|
lib.install "out-shared/libleveldb.dylib.1.20" => "libleveldb.1.20.dylib"
|
|
lib.install_symlink lib/"libleveldb.1.20.dylib" => "libleveldb.dylib"
|
|
lib.install_symlink lib/"libleveldb.1.20.dylib" => "libleveldb.1.dylib"
|
|
MachO::Tools.change_dylib_id("#{lib}/libleveldb.1.dylib", "#{lib}/libleveldb.1.20.dylib")
|
|
end
|
|
|
|
test do
|
|
assert_match "dump files", shell_output("#{bin}/leveldbutil 2>&1", 1)
|
|
end
|
|
end
|