2012-05-01 01:38:50 +00:00
|
|
|
require 'formula'
|
|
|
|
|
|
|
|
class Leveldb < Formula
|
|
|
|
homepage 'https://code.google.com/p/leveldb/'
|
2013-01-18 02:47:14 +00:00
|
|
|
url 'https://leveldb.googlecode.com/files/leveldb-1.9.0.tar.gz'
|
|
|
|
sha1 '4d832277120912211998a2334fb975b995d51885'
|
2012-05-01 01:38:50 +00:00
|
|
|
|
|
|
|
depends_on 'snappy' => :build
|
|
|
|
|
2013-02-16 20:07:42 +00:00
|
|
|
# tcmalloc causes segfault during linking on OSX
|
|
|
|
# https://code.google.com/p/leveldb/issues/detail?id=131
|
|
|
|
def patches
|
|
|
|
DATA
|
|
|
|
end
|
|
|
|
|
2012-05-01 01:38:50 +00:00
|
|
|
def install
|
|
|
|
system "make"
|
2013-02-04 19:17:11 +00:00
|
|
|
system "make leveldbutil"
|
2012-05-01 01:38:50 +00:00
|
|
|
include.install "include/leveldb"
|
2013-02-04 19:17:11 +00:00
|
|
|
bin.install 'leveldbutil'
|
2012-09-02 22:37:29 +00:00
|
|
|
lib.install 'libleveldb.a'
|
2013-01-18 02:47:14 +00:00
|
|
|
lib.install 'libleveldb.dylib.1.9' => 'libleveldb.1.9.dylib'
|
|
|
|
lib.install_symlink lib/'libleveldb.1.9.dylib' => 'libleveldb.dylib'
|
|
|
|
lib.install_symlink lib/'libleveldb.1.9.dylib' => 'libleveldb.1.dylib'
|
2012-05-01 01:38:50 +00:00
|
|
|
end
|
|
|
|
end
|
2013-02-16 20:07:42 +00:00
|
|
|
|
|
|
|
__END__
|
|
|
|
--- a/build_detect_platform 2013-01-07 16:07:29.000000000 -0500
|
|
|
|
+++ b/build_detect_platform 2013-02-16 14:28:06.000000000 -0500
|
|
|
|
@@ -178,13 +178,6 @@
|
|
|
|
PLATFORM_LIBS="$PLATFORM_LIBS -lsnappy"
|
|
|
|
fi
|
|
|
|
|
|
|
|
- # Test whether tcmalloc is available
|
|
|
|
- $CXX $CXXFLAGS -x c++ - -o /dev/null -ltcmalloc 2>/dev/null <<EOF
|
|
|
|
- int main() {}
|
|
|
|
-EOF
|
|
|
|
- if [ "$?" = 0 ]; then
|
|
|
|
- PLATFORM_LIBS="$PLATFORM_LIBS -ltcmalloc"
|
|
|
|
- fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
PLATFORM_CCFLAGS="$PLATFORM_CCFLAGS $COMMON_FLAGS"
|