Hi,

This updates leveldb from an svn snapshot to release 1.5.0.

One thing I'm not sure about is that I'm using upstream's shared library
major/minor numbers rather than setting it to 0.1 or something.

ok?

Index: Makefile
===================================================================
RCS file: /cvs/ports/databases/leveldb/Makefile,v
retrieving revision 1.5
diff -u -p -r1.5 Makefile
--- Makefile    18 Mar 2012 12:56:56 -0000      1.5
+++ Makefile    16 Aug 2012 03:40:53 -0000
@@ -5,12 +5,9 @@ ONLY_FOR_ARCHS=        i386 amd64 arm
 
 COMMENT=       fast and lightweight key/value database library
 
-# svn rev 48, use a small version to allow seemless updating when the
-# project releases a tarball.
-DISTNAME=      leveldb-0.0.48
-SHARED_LIBS=   leveldb 0.0
+DISTNAME=      leveldb-1.5.0
+SHARED_LIBS=   leveldb 1.5
 CATEGORIES=    databases
-REVISION=      1
 
 HOMEPAGE=      http://leveldb.googlecode.com/
 
@@ -20,7 +17,7 @@ PERMIT_PACKAGE_FTP=   Yes
 PERMIT_DISTFILES_CDROM=        Yes
 PERMIT_DISTFILES_FTP=  Yes
 
-MASTER_SITES=  http://distfiles.nl/
+MASTER_SITES=  http://leveldb.googlecode.com/files/
 
 WANTLIB += m stdc++
 
Index: distinfo
===================================================================
RCS file: /cvs/ports/databases/leveldb/distinfo,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 distinfo
--- distinfo    19 Aug 2011 06:44:00 -0000      1.1.1.1
+++ distinfo    16 Aug 2012 03:40:53 -0000
@@ -1,5 +1,5 @@
-MD5 (leveldb-0.0.48.tar.gz) = EpwqrYc2JOX3ml3Td4gmnQ==
-RMD160 (leveldb-0.0.48.tar.gz) = u1efJYCf33kWh7Bc4HnqHjhKCaA=
-SHA1 (leveldb-0.0.48.tar.gz) = CzmBnOP/olwh4pZec8wAjq4363U=
-SHA256 (leveldb-0.0.48.tar.gz) = a9D1oDdS0PjXWoEh22r23vRDkaPdzHQjE6xnwMhYQLg=
-SIZE (leveldb-0.0.48.tar.gz) = 174794
+MD5 (leveldb-1.5.0.tar.gz) = Z5fhmgqfm7HBujVr+JIn8A==
+RMD160 (leveldb-1.5.0.tar.gz) = Gi4LhiLZpd6Nf5Sbw4DYd7eFrcE=
+SHA1 (leveldb-1.5.0.tar.gz) = tbRf90Bl8kLDf0ZbE9r7kllyykM=
+SHA256 (leveldb-1.5.0.tar.gz) = y3NImvhNnZfT59I0ovXjoMif+ttlfn3Z6QRyJ3eOV7o=
+SIZE (leveldb-1.5.0.tar.gz) = 199231
Index: patches/patch-Makefile
===================================================================
RCS file: /cvs/ports/databases/leveldb/patches/patch-Makefile,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 patch-Makefile
--- patches/patch-Makefile      19 Aug 2011 06:44:00 -0000      1.1.1.1
+++ patches/patch-Makefile      16 Aug 2012 03:40:53 -0000
@@ -1,67 +0,0 @@
-$OpenBSD: patch-Makefile,v 1.1.1.1 2011/08/19 06:44:00 jasper Exp $
-
-- Allow ${CC} and ${OPT} to be overriden, to help packagers.
-  http://code.google.com/p/leveldb/issues/detail?id=32
-
-- Provide a shared library
-  http://code.google.com/p/leveldb/issues/detail?id=27
-
---- Makefile.orig      Fri Aug  5 22:40:49 2011
-+++ Makefile   Thu Aug 18 17:18:19 2011
-@@ -2,13 +2,15 @@
- # Use of this source code is governed by a BSD-style license that can be
- # found in the LICENSE file. See the AUTHORS file for names of contributors.
- 
--CC = g++
-+CC ?= g++
- 
-+SONAME_MAJOR?=0
-+SONAME_MINOR?=0
- #-----------------------------------------------
- # Uncomment exactly one of the lines labelled (A), (B), and (C) below
- # to switch between compilation modes.
- 
--OPT = -O2 -DNDEBUG       # (A) Production use (optimized mode)
-+OPT ?= -O2 -DNDEBUG       # (A) Production use (optimized mode)
- # OPT = -g2              # (B) Debug mode, w/ full line-level debugging 
symbols
- # OPT = -O2 -g2 -DNDEBUG # (C) Profiling mode: opt, but w/debugging symbols
- #-----------------------------------------------
-@@ -36,7 +38,7 @@ else
- GOOGLE_PERFTOOLS_LDFLAGS=
- endif
- 
--CFLAGS = -c -I. -I./include $(PORT_CFLAGS) $(PLATFORM_CFLAGS) $(OPT) 
$(SNAPPY_CFLAGS)
-+CFLAGS += -c -I. -I./include $(PORT_CFLAGS) $(PLATFORM_CFLAGS) $(OPT) 
$(SNAPPY_CFLAGS) -fPIC
- 
- LDFLAGS=$(PLATFORM_LDFLAGS) $(SNAPPY_LDFLAGS) $(GOOGLE_PERFTOOLS_LDFLAGS)
- 
-@@ -102,20 +104,28 @@ PROGRAMS = db_bench $(TESTS)
- BENCHMARKS = db_bench_sqlite3 db_bench_tree_db
- 
- LIBRARY = libleveldb.a
-+SHARED_LIBRARY = libleveldb.so
- 
--all: $(LIBRARY)
-+all: $(LIBRARY) $(SHARED_LIBRARY)
- 
- check: $(PROGRAMS) $(TESTS)
-       for t in $(TESTS); do echo "***** Running $$t"; ./$$t || exit 1; done
- 
- clean:
-       -rm -f $(PROGRAMS) $(BENCHMARKS) $(LIBRARY) */*.o */*/*.o ios-x86/*/*.o 
ios-arm/*/*.o
-+      -rm -f $(SHARED_LIBRARY).* $(SHARED_LIBRARY)
-       -rm -rf ios-x86/* ios-arm/*
-       -rm build_config.mk
- 
- $(LIBRARY): $(LIBOBJECTS)
-       rm -f $@
-       $(AR) -rs $@ $(LIBOBJECTS)
-+
-+$(SHARED_LIBRARY): $(LIBOBJECTS)
-+      rm -f $@
-+      $(CC) -shared -Wl,-soname -Wl,$@.$(SONAME_MAJOR) $(LIBOBJECTS) 
$(LDFLAGS) -o $@.$(SONAME_MAJOR).$(SONAME_MINOR)
-+      ln -s $@.$(SONAME_MAJOR).$(SONAME_MINOR) $@.$(SONAME_MAJOR)
-+      ln -s $@.$(SONAME_MAJOR).$(SONAME_MINOR) $@
- 
- db_bench: db/db_bench.o $(LIBOBJECTS) $(TESTUTIL)
-       $(CC) $(LDFLAGS) db/db_bench.o $(LIBOBJECTS) $(TESTUTIL) -o $@
Index: patches/patch-build_detect_platform
===================================================================
RCS file: /cvs/ports/databases/leveldb/patches/patch-build_detect_platform,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 patch-build_detect_platform
--- patches/patch-build_detect_platform 19 Aug 2011 06:44:00 -0000      1.1.1.1
+++ patches/patch-build_detect_platform 16 Aug 2012 03:40:53 -0000
@@ -1,18 +1,47 @@
 $OpenBSD: patch-build_detect_platform,v 1.1.1.1 2011/08/19 06:44:00 jasper Exp 
$
 
-Add OpenBSD support: http://code.google.com/p/leveldb/issues/detail?id=31
+Skip checks for <cstdatomic>, snappy and tcmalloc.  We don't
+have any of these, and with our current binutils, c++ -o /dev/null
+deletes /dev/null, which is kind of bad.
 
---- build_detect_platform.orig Wed Jul 27 03:46:25 2011
-+++ build_detect_platform      Thu Aug 18 17:06:57 2011
-@@ -35,6 +35,11 @@ case `uname -s` in
-         echo "PLATFORM_CFLAGS=-D_REENTRANT -DOS_FREEBSD"  >> build_config.mk
-         echo "PLATFORM_LDFLAGS=-lpthread" >> build_config.mk
-         ;;
-+    OpenBSD)
-+        PLATFORM=OS_OPENBSD
-+        echo "PLATFORM_CFLAGS=-D_REENTRANT -DOS_OPENBSD"  >> build_config.mk
-+        echo "PLATFORM_LDFLAGS=-pthread" >> build_config.mk
-+        ;;
-     *)
-         echo "Unknown platform!"
-         exit 1
+--- build_detect_platform.orig Fri Aug 10 17:36:01 2012
++++ build_detect_platform      Fri Aug 10 17:36:32 2012
+@@ -132,36 +132,8 @@ if [ "$CROSS_COMPILE" = "true" ]; then
+     # Cross-compiling; do not try any compilation tests.
+     true
+ else
+-    # If -std=c++0x works, use <cstdatomic>.  Otherwise use port_posix.h.
+-    $CXX $CFLAGS -std=c++0x -x c++ - -o /dev/null 2>/dev/null  <<EOF
+-      #include <cstdatomic>
+-      int main() {}
+-EOF
+-    if [ "$?" = 0 ]; then
+-        COMMON_FLAGS="$COMMON_FLAGS -DLEVELDB_PLATFORM_POSIX 
-DLEVELDB_CSTDATOMIC_PRESENT"
+-        PLATFORM_CXXFLAGS="-std=c++0x"
+-    else
+-        COMMON_FLAGS="$COMMON_FLAGS -DLEVELDB_PLATFORM_POSIX"
+-    fi
+-
+-    # Test whether Snappy library is installed
+-    # http://code.google.com/p/snappy/
+-    $CXX $CFLAGS -x c++ - -o /dev/null 2>/dev/null  <<EOF
+-      #include <snappy.h>
+-      int main() {}
+-EOF
+-    if [ "$?" = 0 ]; then
+-        COMMON_FLAGS="$COMMON_FLAGS -DSNAPPY"
+-        PLATFORM_LDFLAGS="$PLATFORM_LDFLAGS -lsnappy"
+-    fi
+-
+-    # Test whether tcmalloc is available
+-    $CXX $CFLAGS -x c++ - -o /dev/null -ltcmalloc 2>/dev/null  <<EOF
+-      int main() {}
+-EOF
+-    if [ "$?" = 0 ]; then
+-        PLATFORM_LDFLAGS="$PLATFORM_LDFLAGS -ltcmalloc"
+-    fi
++    # skip checks for <cstdatomic>, snappy and tcmalloc
++    COMMON_FLAGS="$COMMON_FLAGS -DLEVELDB_PLATFORM_POSIX"
+ fi
+ 
+ PLATFORM_CCFLAGS="$PLATFORM_CCFLAGS $COMMON_FLAGS"
Index: patches/patch-port_port_posix_h
===================================================================
RCS file: /cvs/ports/databases/leveldb/patches/patch-port_port_posix_h,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 patch-port_port_posix_h
--- patches/patch-port_port_posix_h     19 Aug 2011 06:44:00 -0000      1.1.1.1
+++ patches/patch-port_port_posix_h     16 Aug 2012 03:40:53 -0000
@@ -1,36 +1,15 @@
 $OpenBSD: patch-port_port_posix_h,v 1.1.1.1 2011/08/19 06:44:00 jasper Exp $
 
-Add OpenBSD support: http://code.google.com/p/leveldb/issues/detail?id=31
+#define PLATFORM_IS_LITTLE_ENDIAN appropriately.
+See http://code.google.com/p/leveldb/issues/detail?id=98
 
---- port/port_posix.h.orig     Wed Jul 27 03:46:25 2011
-+++ port/port_posix.h  Thu Aug 18 17:06:57 2011
-@@ -7,7 +7,11 @@
- #ifndef STORAGE_LEVELDB_PORT_PORT_POSIX_H_
- #define STORAGE_LEVELDB_PORT_PORT_POSIX_H_
- 
--#if defined(OS_MACOSX) || defined(OS_FREEBSD)
-+#if defined(OS_OPENBSD)
-+  #include <sys/types.h>
-+#endif
-+
-+#if defined(OS_MACOSX) || defined(OS_FREEBSD) || defined(OS_OPENBSD)
-   #include <machine/endian.h>
- #elif defined(OS_SOLARIS)
-   #include <sys/isa_defs.h>
-@@ -33,13 +37,14 @@
- #define IS_LITTLE_ENDIAN (__BYTE_ORDER == __LITTLE_ENDIAN)
+--- port/port_posix.h.orig     Thu May 31 02:56:59 2012
++++ port/port_posix.h  Thu Aug 16 12:00:33 2012
+@@ -25,6 +25,7 @@
+       defined(OS_DRAGONFLYBSD) || defined(OS_ANDROID)
+   #include <sys/types.h>
+   #include <sys/endian.h>
++  #define PLATFORM_IS_LITTLE_ENDIAN (_BYTE_ORDER == _LITTLE_ENDIAN)
+ #else
+   #include <endian.h>
  #endif
- 
--#if defined(OS_MACOSX) || defined(OS_SOLARIS) || defined(OS_FREEBSD)
-+#if defined(OS_MACOSX) || defined(OS_SOLARIS) || defined(OS_FREEBSD) || \
-+      defined(OS_OPENBSD)
- #define fread_unlocked fread
- #define fwrite_unlocked fwrite
- #define fflush_unlocked fflush
- #endif
- 
--#if defined(OS_MACOSX) || defined(OS_FREEBSD)
-+#if defined(OS_MACOSX) || defined(OS_FREEBSD) || defined(OS_OPENBSD)
- #define fdatasync fsync
- #endif
- 
Index: patches/patch-util_coding_cc
===================================================================
RCS file: patches/patch-util_coding_cc
diff -N patches/patch-util_coding_cc
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-util_coding_cc        16 Aug 2012 03:40:53 -0000
@@ -0,0 +1,25 @@
+$OpenBSD$
+
+Use the endianness #define from port_posix.h
+See http://code.google.com/p/leveldb/issues/detail?id=110
+
+--- util/coding.cc.orig        Thu Aug 16 12:00:57 2012
++++ util/coding.cc     Thu Aug 16 12:01:16 2012
+@@ -7,7 +7,7 @@
+ namespace leveldb {
+ 
+ void EncodeFixed32(char* buf, uint32_t value) {
+-#if __BYTE_ORDER == __LITTLE_ENDIAN
++#if PLATFORM_IS_LITTLE_ENDIAN
+   memcpy(buf, &value, sizeof(value));
+ #else
+   buf[0] = value & 0xff;
+@@ -18,7 +18,7 @@ void EncodeFixed32(char* buf, uint32_t value) {
+ }
+ 
+ void EncodeFixed64(char* buf, uint64_t value) {
+-#if __BYTE_ORDER == __LITTLE_ENDIAN
++#if PLATFORM_IS_LITTLE_ENDIAN
+   memcpy(buf, &value, sizeof(value));
+ #else
+   buf[0] = value & 0xff;
Index: pkg/PLIST
===================================================================
RCS file: /cvs/ports/databases/leveldb/pkg/PLIST,v
retrieving revision 1.2
diff -u -p -r1.2 PLIST
--- pkg/PLIST   18 Mar 2012 12:56:56 -0000      1.2
+++ pkg/PLIST   16 Aug 2012 03:40:53 -0000
@@ -6,6 +6,7 @@ include/leveldb/cache.h
 include/leveldb/comparator.h
 include/leveldb/db.h
 include/leveldb/env.h
+include/leveldb/filter_policy.h
 include/leveldb/iterator.h
 include/leveldb/options.h
 include/leveldb/slice.h
  

Reply via email to