diff --git a/databases/leveldb/Portfile b/databases/leveldb/Portfile
index 75ae19ceee..3c7515e63a 100644
--- a/databases/leveldb/Portfile
+++ b/databases/leveldb/Portfile
@@ -2,19 +2,18 @@
 
 PortSystem          1.0
 PortGroup           github 1.0
-
-# When trying to build a universal variant, build_detect_platform script mistakenly can't find library snappy
-# The following test fails for multiple archs (see https://llvm.org/bugs/show_bug.cgi?id=15403)
-#    # Test whether Snappy library is installed
-#    # https://code.google.com/p/snappy/
-#    $CXX $CXXFLAGS -x c++ - -o $CXXOUTPUT 2>/dev/null  <<EOF
-#    #include <snappy.h>
-#    int main() {}
-#    EOF
-# We therefore use muniversal PortGroup
+PortGroup           cmake 1.1
+platform darwin {
+    if {${os.major} < 13} {
+        PortGroup   cxx11 1.1
+    }
+}
 PortGroup           muniversal 1.0
 
-github.setup        google leveldb 1.20 v
+github.setup        google leveldb 09217fd0677a4fd9713c7a4d774c494a7d3c1f15
+# v1.20-46-g09217fd
+version             1.20.46
+
 categories          databases
 platforms           darwin
 license             BSD
@@ -22,53 +21,37 @@ maintainers         nomaintainer
 description         A fast and lightweight key/value database library by Google
 long_description    A fast and lightweight key/value database library by Google
 
-checksums           rmd160  dd72b89d356031709df9a41da2c31ea2e093361d \
-                    sha256  154d804980d92b08d08dafff8e937ad79a45ef0fe87c9f5d69ea74690f85a933 \
-                    size    223200
-
-depends_lib         port:snappy \
-                    port:gperftools
+worksrcdir          leveldb-git
+distname            leveldb-git
 
-patchfiles          install_name.patch
+checksums           rmd160  3c85f9e3721ba5b35fa0c69e7cffaa987f4c40c8 \
+                    sha256  23a342ba2fdaf8f97e238f4a4257e7291ed1cde97dd6ebe302040dea672d3b00 \
+                    size    226821
 
-use_configure       no
+variant tcmalloc description {leveldb uses tcmalloc (but also all applications using leveldb)} {}
 
-if {[string match *clang* ${configure.cxx}]} {
-    configure.cxxflags-append -stdlib=${configure.cxx_stdlib}
-    configure.ldflags-append -stdlib=${configure.cxx_stdlib}
-}
+depends_lib         port:snappy
+depends_build-append \
+                    port:sqlite3
 
-if { [variant_isset universal] } {
-    foreach arch ${configure.universal_archs} {
-        lappend merger_build_env(${arch}) \
-            CFLAGS="${configure.cflags} -arch ${arch}" \
-            CXXFLAGS="${configure.cxxflags} -arch ${arch}" \
-            LDFLAGS="${configure.ldflags} -arch ${arch}"
-    }
+if {[variant_isset tcmalloc]} {
+    depends_lib-append \
+                    port:gperftools
 } else {
-    build.env-append \
-            CFLAGS="${configure.cflags} [get_canonical_archflags cc]" \
-            CXXFLAGS="${configure.cxxflags} [get_canonical_archflags cxx]" \
-            LDFLAGS="${configure.ldflags} [get_canonical_archflags ld]"
+    patchfiles-append \
+                    patch-disable-tcmalloc.diff
 }
 
-build.env-append                          \
-    INSTALL_PATH=${prefix}/lib            \
-    CC="${configure.cc}"                  \
-    CXX="${configure.cxx}"                \
-    OPT="-DNDEBUG"
-
-# muniversal build requires Makefile
-post-extract {
-    set makefile [open ${worksrcpath}/Makefile-Install "w"]
-    puts ${makefile} {install:}
-    puts ${makefile} "\t/usr/bin/install -d -m 0755 \$(DESTDIR)${prefix}/include/leveldb"
-    puts ${makefile} "\t/usr/bin/install -d -m 0755 \$(DESTDIR)${prefix}/include/helpers/memenv"
-    puts ${makefile} "\t/usr/bin/install -m 0644 include/leveldb/*.h \$(DESTDIR)${prefix}/include/leveldb"
-    puts ${makefile} "\t/usr/bin/install -m 0644 helpers/memenv/memenv.h \$(DESTDIR)${prefix}/include/helpers/memenv"
-    puts ${makefile} "\t/bin/cp -R out-shared/libleveldb* \$(DESTDIR)${prefix}/lib"
-    puts ${makefile} "\t/usr/bin/install -m 0644 out-static/lib*.a \$(DESTDIR)${prefix}/lib"
-    close ${makefile}
+configure.args-append \
+                    -DBUILD_SHARED_LIBS=ON \
+                    -DLEVELDB_BUILD_TESTS=OFF
+
+post-destroot {
+    xinstall -m 755 ${build.dir}/leveldbutil ${destroot}${prefix}/bin
+    if {${os.platform} eq "darwin"} {
+        system "install_name_tool -change @rpath/libleveldb.dylib ${prefix}/lib/libleveldb.dylib ${destroot}${prefix}/bin/leveldbutil"
+        ln -s libleveldb.dylib ${destroot}${prefix}/lib/libleveldb.1.dylib
+    } else {
+        ln -s libleveldb.so ${destroot}${prefix}/lib/libleveldb.so.1
+    }
 }
-
-destroot.args-append -f Makefile-Install
diff --git a/databases/leveldb/files/install_name.patch b/databases/leveldb/files/install_name.patch
deleted file mode 100644
index 142df6cf92..0000000000
--- a/databases/leveldb/files/install_name.patch
+++ /dev/null
@@ -1,94 +0,0 @@
-https://github.com/google/leveldb/issues/412
-https://github.com/google/leveldb/pull/413
---- build_detect_platform.orig	2017-03-01 18:08:02.000000000 -0600
-+++ build_detect_platform	2018-03-09 17:08:26.000000000 -0600
-@@ -8,7 +8,10 @@
- #   CXX                         C++ Compiler path
- #   PLATFORM_LDFLAGS            Linker flags
- #   PLATFORM_LIBS               Libraries flags
--#   PLATFORM_SHARED_EXT         Extension for shared libraries
-+#   PLATFORM_SHARED             Set to 'true' if shared libraries shoull be
-+#                               built, empty otherwise.
-+#   PLATFORM_SHARED_BASE        Base filename for shared libraries (before version)
-+#   PLATFORM_SHARED_EXT         Extension for shared libraries (after version)
- #   PLATFORM_SHARED_LDFLAGS     Flags for building shared library
- #                               This flag is embedded just before the name
- #                               of the shared library without intervening spaces
-@@ -59,7 +62,9 @@
- PLATFORM_CXXFLAGS=
- PLATFORM_LDFLAGS=
- PLATFORM_LIBS=
--PLATFORM_SHARED_EXT="so"
-+PLATFORM_SHARED=true
-+PLATFORM_SHARED_BASE="libleveldb.so"
-+PLATFORM_SHARED_EXT=
- PLATFORM_SHARED_LDFLAGS="-shared -Wl,-soname -Wl,"
- PLATFORM_SHARED_CFLAGS="-fPIC"
- PLATFORM_SHARED_VERSIONED=true
-@@ -83,7 +88,8 @@
-     Darwin)
-         PLATFORM=OS_MACOSX
-         COMMON_FLAGS="$MEMCMP_FLAG -DOS_MACOSX"
--        PLATFORM_SHARED_EXT=dylib
-+        PLATFORM_SHARED_BASE=libleveldb
-+        PLATFORM_SHARED_EXT=.dylib
-         [ -z "$INSTALL_PATH" ] && INSTALL_PATH=`pwd`
-         PLATFORM_SHARED_LDFLAGS="-dynamiclib -install_name $INSTALL_PATH/"
-         PORT_FILE=port/port_posix.cc
-@@ -154,7 +160,7 @@
-         [ -z "$INSTALL_PATH" ] && INSTALL_PATH=`pwd`
-         PORT_FILE=port/port_posix.cc
-         PORT_SSE_FILE=port/port_posix_sse.cc
--        PLATFORM_SHARED_EXT=
-+        PLATFORM_SHARED=false
-         PLATFORM_SHARED_LDFLAGS=
-         PLATFORM_SHARED_CFLAGS=
-         PLATFORM_SHARED_VERSIONED=
-@@ -250,6 +256,8 @@
- echo "PLATFORM_CCFLAGS=$PLATFORM_CCFLAGS" >> $OUTPUT
- echo "PLATFORM_CXXFLAGS=$PLATFORM_CXXFLAGS" >> $OUTPUT
- echo "PLATFORM_SSEFLAGS=$PLATFORM_SSEFLAGS" >> $OUTPUT
-+echo "PLATFORM_SHARED=$PLATFORM_SHARED" >> $OUTPUT
-+echo "PLATFORM_SHARED_BASE=$PLATFORM_SHARED_BASE" >> $OUTPUT
- echo "PLATFORM_SHARED_CFLAGS=$PLATFORM_SHARED_CFLAGS" >> $OUTPUT
- echo "PLATFORM_SHARED_EXT=$PLATFORM_SHARED_EXT" >> $OUTPUT
- echo "PLATFORM_SHARED_LDFLAGS=$PLATFORM_SHARED_LDFLAGS" >> $OUTPUT
---- Makefile.orig	2017-03-01 18:08:02.000000000 -0600
-+++ Makefile	2018-03-09 17:14:53.000000000 -0600
-@@ -108,13 +108,13 @@
- default: all
- 
- # Should we build shared libraries?
--ifneq ($(PLATFORM_SHARED_EXT),)
-+ifeq ($(PLATFORM_SHARED),true)
- 
- # Many leveldb test apps use non-exported API's. Only build a subset for testing.
- SHARED_ALLOBJS := $(SHARED_LIBOBJECTS) $(SHARED_MEMENVOBJECTS) $(TESTHARNESS)
- 
-+SHARED_LIB1 = $(PLATFORM_SHARED_BASE)$(PLATFORM_SHARED_EXT)
- ifneq ($(PLATFORM_SHARED_VERSIONED),true)
--SHARED_LIB1 = libleveldb.$(PLATFORM_SHARED_EXT)
- SHARED_LIB2 = $(SHARED_LIB1)
- SHARED_LIB3 = $(SHARED_LIB1)
- SHARED_LIBS = $(SHARED_LIB1)
-@@ -123,9 +123,8 @@
- # Update db.h if you change these.
- SHARED_VERSION_MAJOR = 1
- SHARED_VERSION_MINOR = 20
--SHARED_LIB1 = libleveldb.$(PLATFORM_SHARED_EXT)
--SHARED_LIB2 = $(SHARED_LIB1).$(SHARED_VERSION_MAJOR)
--SHARED_LIB3 = $(SHARED_LIB1).$(SHARED_VERSION_MAJOR).$(SHARED_VERSION_MINOR)
-+SHARED_LIB2 = $(PLATFORM_SHARED_BASE).$(SHARED_VERSION_MAJOR)$(PLATFORM_SHARED_EXT)
-+SHARED_LIB3 = $(PLATFORM_SHARED_BASE).$(SHARED_VERSION_MAJOR).$(SHARED_VERSION_MINOR)$(PLATFORM_SHARED_EXT)
- SHARED_LIBS = $(SHARED_OUTDIR)/$(SHARED_LIB1) $(SHARED_OUTDIR)/$(SHARED_LIB2) $(SHARED_OUTDIR)/$(SHARED_LIB3)
- $(SHARED_OUTDIR)/$(SHARED_LIB1): $(SHARED_OUTDIR)/$(SHARED_LIB3)
- 	ln -fs $(SHARED_LIB3) $(SHARED_OUTDIR)/$(SHARED_LIB1)
-@@ -137,7 +136,7 @@
- $(SHARED_OUTDIR)/$(SHARED_LIB3): $(SHARED_LIBOBJECTS)
- 	$(CXX) $(LDFLAGS) $(PLATFORM_SHARED_LDFLAGS)$(SHARED_LIB2) $(SHARED_LIBOBJECTS) -o $(SHARED_OUTDIR)/$(SHARED_LIB3) $(LIBS)
- 
--endif  # PLATFORM_SHARED_EXT
-+endif  # PLATFORM_SHARED
- 
- all: $(SHARED_LIBS) $(SHARED_PROGRAMS) $(STATIC_OUTDIR)/libleveldb.a $(STATIC_OUTDIR)/libmemenv.a $(STATIC_PROGRAMS)
- 
diff --git a/databases/leveldb/files/patch-disable-tcmalloc.diff b/databases/leveldb/files/patch-disable-tcmalloc.diff
new file mode 100644
index 0000000000..b2934ca0aa
--- /dev/null
+++ b/databases/leveldb/files/patch-disable-tcmalloc.diff
@@ -0,0 +1,13 @@
+diff --git CMakeLists.txt CMakeLists.txt
+index cc1022f..543f72e 100644
+--- CMakeLists.txt
++++ CMakeLists.txt
+@@ -28,7 +28,7 @@ check_include_file("unistd.h" HAVE_UNISTD_H)
+ include(CheckLibraryExists)
+ check_library_exists(crc32c crc32c_value "" HAVE_CRC32C)
+ check_library_exists(snappy snappy_compress "" HAVE_SNAPPY)
+-check_library_exists(tcmalloc malloc "" HAVE_TCMALLOC)
++# check_library_exists(tcmalloc malloc "" HAVE_TCMALLOC)
+ 
+ include(CheckSymbolExists)
+ check_symbol_exists(fdatasync "unistd.h" HAVE_FDATASYNC)
