mirror of
https://git.FreeBSD.org/ports.git
synced 2025-01-12 07:27:57 +00:00
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
This commit is contained in:
parent
a6ce0e6b68
commit
d5b0c609ba
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=431116
@ -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
|
||||
|
29
databases/py-leveldb/files/patch-leveldb_object.cc
Normal file
29
databases/py-leveldb/files/patch-leveldb_object.cc
Normal file
@ -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;
|
||||
|
@ -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,
|
||||
)
|
||||
]
|
||||
|
Loading…
Reference in New Issue
Block a user