aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
Diffstat (limited to 'Library')
-rw-r--r--Library/Formula/leveldb.rb24
1 files changed, 24 insertions, 0 deletions
diff --git a/Library/Formula/leveldb.rb b/Library/Formula/leveldb.rb
index 4a9cb8263..64cc61c5e 100644
--- a/Library/Formula/leveldb.rb
+++ b/Library/Formula/leveldb.rb
@@ -7,6 +7,12 @@ class Leveldb < Formula
depends_on 'snappy' => :build
+ # tcmalloc causes segfault during linking on OSX
+ # https://code.google.com/p/leveldb/issues/detail?id=131
+ def patches
+ DATA
+ end
+
def install
system "make"
system "make leveldbutil"
@@ -18,3 +24,21 @@ class Leveldb < Formula
lib.install_symlink lib/'libleveldb.1.9.dylib' => 'libleveldb.1.dylib'
end
end
+
+__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"