Index: head/databases/py-leveldb/Makefile =================================================================== --- head/databases/py-leveldb/Makefile (revision 431115) +++ head/databases/py-leveldb/Makefile (revision 431116) @@ -1,23 +1,30 @@ # Created by: Sunpoet Po-Chuan Hsieh # $FreeBSD$ PORTNAME= leveldb PORTVERSION= 0.20 +PORTREVISION= 1 CATEGORIES= databases python MASTER_SITES= CHEESESHOP PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} MAINTAINER= sunpoet@FreeBSD.org COMMENT= Thread-safe Python binding for LevelDB LICENSE= BSD3CLAUSE +LIB_DEPENDS= libleveldb.so:databases/leveldb + PORTSCOUT= skipv:0.194 USE_PYTHON= autoplist concurrent distutils -USES= python +USES= localbase python + +post-patch: + @${REINPLACE_CMD} -e 's|%%LOCALBASE%%|${LOCALBASE}|' ${WRKSRC}/${PYSETUP} + @${RM} -r ${WRKSRC}/leveldb/ ${WRKSRC}/snappy/ post-install: ${STRIP_CMD} ${STAGEDIR}${PYTHON_SITELIBDIR}/leveldb.so .include Index: head/databases/py-leveldb/files/patch-leveldb_object.cc =================================================================== --- head/databases/py-leveldb/files/patch-leveldb_object.cc (nonexistent) +++ head/databases/py-leveldb/files/patch-leveldb_object.cc (revision 431116) @@ -0,0 +1,29 @@ +--- leveldb_object.cc.orig 2016-12-27 23:03:15 UTC ++++ leveldb_object.cc +@@ -901,9 +901,8 @@ static int PyLevelDB_init(PyLevelDB* sel + int block_size = 4096; + int max_open_files = 1000; + int block_restart_interval = 16; +- int max_file_size = 2 << 20; + const char* kwargs[] = {"filename", "create_if_missing", "error_if_exists", "paranoid_checks", "write_buffer_size", +- "block_size", "max_open_files", "block_restart_interval", "block_cache_size", "max_file_size", "comparator", 0}; ++ "block_size", "max_open_files", "block_restart_interval", "block_cache_size", "comparator", 0}; + + PyObject* comparator = 0; + +@@ -917,7 +916,6 @@ static int PyLevelDB_init(PyLevelDB* sel + &max_open_files, + &block_restart_interval, + &block_cache_size, +- &max_file_size, + &comparator)) + return -1; + +@@ -963,7 +961,6 @@ static int PyLevelDB_init(PyLevelDB* sel + self->_options->block_restart_interval = block_restart_interval; + self->_options->compression = leveldb::kSnappyCompression; + self->_options->block_cache = self->_cache; +- self->_options->max_file_size = max_file_size; + self->_options->comparator = self->_comparator; + leveldb::Status status; + Property changes on: head/databases/py-leveldb/files/patch-leveldb_object.cc ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/databases/py-leveldb/files/patch-setup.py =================================================================== --- head/databases/py-leveldb/files/patch-setup.py (revision 431115) +++ head/databases/py-leveldb/files/patch-setup.py (revision 431116) @@ -1,16 +1,92 @@ --- setup.py.orig 2016-12-27 23:05:34 UTC +++ setup.py -@@ -31,11 +31,11 @@ if system == 'Darwin': +@@ -14,15 +14,11 @@ from setuptools import setup, Extension + + system, node, release, version, machine, processor = platform.uname() + common_flags = [ +- '-I./leveldb/include', +- '-I./leveldb', +- '-I./snappy', ++ '-I%%LOCALBASE%%/include', + '-I.', + '-fno-builtin-memcmp', + '-O2', + '-fPIC', +- '-DNDEBUG', +- '-DSNAPPY', + ] + + if system == 'Darwin': +@@ -31,11 +27,11 @@ if system == 'Darwin': '-DLEVELDB_PLATFORM_POSIX', '-Wno-error=unused-command-line-argument-hard-error-in-future', ] -elif system == 'Linux': +elif system == 'FreeBSD': extra_compile_args = common_flags + [ '-pthread', '-Wall', - '-DOS_LINUX', + '-DOS_FREEBSD', '-DLEVELDB_PLATFORM_POSIX', ] else: +@@ -74,57 +70,11 @@ setup( + ext_modules = [ + Extension('leveldb', + sources = [ +- # snappy +- './snappy/snappy.cc', +- './snappy/snappy-stubs-internal.cc', +- './snappy/snappy-sinksource.cc', +- './snappy/snappy-c.cc', +- +- #leveldb +- 'leveldb/db/builder.cc', +- 'leveldb/db/c.cc', +- 'leveldb/db/db_impl.cc', +- 'leveldb/db/db_iter.cc', +- 'leveldb/db/dbformat.cc', +- 'leveldb/db/filename.cc', +- 'leveldb/db/log_reader.cc', +- 'leveldb/db/log_writer.cc', +- 'leveldb/db/memtable.cc', +- 'leveldb/db/repair.cc', +- 'leveldb/db/table_cache.cc', +- 'leveldb/db/version_edit.cc', +- 'leveldb/db/version_set.cc', +- 'leveldb/db/write_batch.cc', +- 'leveldb/table/block.cc', +- 'leveldb/table/block_builder.cc', +- 'leveldb/table/filter_block.cc', +- 'leveldb/table/format.cc', +- 'leveldb/table/iterator.cc', +- 'leveldb/table/merger.cc', +- 'leveldb/table/table.cc', +- 'leveldb/table/table_builder.cc', +- 'leveldb/table/two_level_iterator.cc', +- 'leveldb/util/arena.cc', +- 'leveldb/util/bloom.cc', +- 'leveldb/util/cache.cc', +- 'leveldb/util/coding.cc', +- 'leveldb/util/comparator.cc', +- 'leveldb/util/crc32c.cc', +- 'leveldb/util/env.cc', +- 'leveldb/util/env_posix.cc', +- 'leveldb/util/filter_policy.cc', +- 'leveldb/util/hash.cc', +- 'leveldb/util/histogram.cc', +- 'leveldb/util/logging.cc', +- 'leveldb/util/options.cc', +- 'leveldb/util/status.cc', +- 'leveldb/port/port_posix.cc', +- + # python stuff + 'leveldb_ext.cc', + 'leveldb_object.cc', + ], +- libraries = ['stdc++'], ++ libraries = ['leveldb'], + extra_compile_args = extra_compile_args, + ) + ]