diff options
author | Sunpoet Po-Chuan Hsieh <sunpoet@FreeBSD.org> | 2017-01-10 18:36:23 +0000 |
---|---|---|
committer | Sunpoet Po-Chuan Hsieh <sunpoet@FreeBSD.org> | 2017-01-10 18:36:23 +0000 |
commit | d5b0c609ba071292d80342f6f2f01bd3ca868d46 (patch) | |
tree | 3fe8e12663b92916f056fe1771956a33bade0993 /databases | |
parent | devel/gb: Update to version 0.4.3 (diff) |
Use shared library from ports instead of bundled one
- Add patch to remove max_cache which is not in official leveldb 1.19
- Bump PORTREVISION for dependency and package change
Notes
Notes:
svn path=/head/; revision=431116
Diffstat (limited to 'databases')
-rw-r--r-- | databases/py-leveldb/Makefile | 9 | ||||
-rw-r--r-- | databases/py-leveldb/files/patch-leveldb_object.cc | 29 | ||||
-rw-r--r-- | databases/py-leveldb/files/patch-setup.py | 78 |
3 files changed, 114 insertions, 2 deletions
diff --git a/databases/py-leveldb/Makefile b/databases/py-leveldb/Makefile index 5a59ab130613..99c85dc84f75 100644 --- a/databases/py-leveldb/Makefile +++ b/databases/py-leveldb/Makefile @@ -3,6 +3,7 @@ PORTNAME= leveldb PORTVERSION= 0.20 +PORTREVISION= 1 CATEGORIES= databases python MASTER_SITES= CHEESESHOP PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} @@ -12,10 +13,16 @@ 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 diff --git a/databases/py-leveldb/files/patch-leveldb_object.cc b/databases/py-leveldb/files/patch-leveldb_object.cc new file mode 100644 index 000000000000..c76a6414b76a --- /dev/null +++ b/databases/py-leveldb/files/patch-leveldb_object.cc @@ -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; + diff --git a/databases/py-leveldb/files/patch-setup.py b/databases/py-leveldb/files/patch-setup.py index 621de1f10853..0b3f8d16cc09 100644 --- a/databases/py-leveldb/files/patch-setup.py +++ b/databases/py-leveldb/files/patch-setup.py @@ -1,6 +1,23 @@ --- 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', ] @@ -14,3 +31,62 @@ '-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, + ) + ] |