|
1 |
| ---- pyleveldb/setup.py 2014-03-28 02:51:24.000000000 +0100 |
2 |
| -+++ pyleveldb-patch/setup.py 2016-03-02 11:52:13.780678586 +0100 |
3 |
| -@@ -7,41 +7,22 @@ |
4 |
| - # |
5 |
| - # See LICENSE for details. |
6 |
| - |
7 |
| --import glob |
8 |
| --import platform |
9 |
| --import sys |
10 |
| -- |
| 1 | +This patch force to only build the python bindings, and to do so, we modify |
| 2 | +the setup.py file in oder that finds our compiled libraries (libleveldb.so and |
| 3 | +libsnappy.so) |
| 4 | +--- leveldb-0.194/setup.py.orig 2016-09-17 02:05:55.000000000 +0200 |
| 5 | ++++ leveldb-0.194/setup.py 2019-02-26 16:57:40.997435911 +0100 |
| 6 | +@@ -11,44 +11,25 @@ import platform |
| 7 | + import sys |
| 8 | + |
11 | 9 | from setuptools import setup, Extension
|
12 |
| - |
13 |
| --system,node,release,version,machine,processor = platform.uname() |
| 10 | ++from os import environ |
| 11 | + |
| 12 | + system, node, release, version, machine, processor = platform.uname() |
14 | 13 | -common_flags = [
|
| 14 | +- '-I./leveldb/include', |
| 15 | +- '-I./leveldb', |
| 16 | +- '-I./snappy', |
15 | 17 | +extra_compile_args = [
|
16 |
| - '-I./leveldb/include', |
17 |
| - '-I./leveldb', |
18 |
| -- '-I./snappy', |
19 |
| -+ '-I./leveldb/snappy', |
20 |
| - '-I.', |
21 |
| -- '-fno-builtin-memcmp', |
22 |
| - '-O2', |
23 |
| - '-fPIC', |
24 |
| - '-DNDEBUG', |
25 |
| - '-DSNAPPY', |
26 |
| --] |
27 |
| -- |
| 18 | ++ '-I{}/include'.format(environ.get('LEVELDB_BUILD_PATH')), |
| 19 | ++ '-I{}'.format(environ.get('LEVELDB_BUILD_PATH')), |
| 20 | ++ '-I{}'.format(environ.get('SNAPPY_BUILD_PATH')), |
| 21 | ++ '-I.', |
| 22 | + '-I.', |
| 23 | +- '-fno-builtin-memcmp', |
| 24 | + '-O2', |
| 25 | + '-fPIC', |
| 26 | + '-DNDEBUG', |
| 27 | + '-DSNAPPY', |
| 28 | ++ '-pthread', |
| 29 | ++ '-Wall', |
| 30 | ++ '-D_REENTRANT', |
| 31 | ++ '-DOS_ANDROID', |
| 32 | + ] |
| 33 | + |
28 | 34 | -if system == 'Darwin':
|
29 |
| -- extra_compile_args = common_flags + [ |
30 |
| -- '-DOS_MACOSX', |
31 |
| -+ '-Wall', |
32 |
| - '-DLEVELDB_PLATFORM_POSIX', |
33 |
| -- '-Wno-error=unused-command-line-argument-hard-error-in-future', |
34 |
| -- ] |
| 35 | +- extra_compile_args = common_flags + [ |
| 36 | +- '-DOS_MACOSX', |
| 37 | +- '-DLEVELDB_PLATFORM_POSIX', |
| 38 | +- '-Wno-error=unused-command-line-argument-hard-error-in-future', |
| 39 | +- ] |
35 | 40 | -elif system == 'Linux':
|
| 41 | +- extra_compile_args = common_flags + [ |
| 42 | +- '-pthread', |
| 43 | +- '-Wall', |
| 44 | +- '-DOS_LINUX', |
| 45 | +- '-DLEVELDB_PLATFORM_POSIX', |
| 46 | +- ] |
| 47 | +-elif system == 'SunOS': |
36 | 48 | - extra_compile_args = common_flags + [
|
37 | 49 | - '-pthread',
|
38 |
| -- '-Wall', |
39 |
| -- '-DOS_LINUX', |
| 50 | +- '-Wall', |
| 51 | +- '-DOS_SOLARIS', |
40 | 52 | - '-DLEVELDB_PLATFORM_POSIX',
|
41 | 53 | - ]
|
42 | 54 | -else:
|
43 |
| -- print >>sys.stderr, "Don't know how to compile leveldb for %s!" % system |
44 |
| -- sys.exit(0) |
45 |
| -+ '-D_REENTRANT', |
46 |
| -+ '-DOS_ANDROID', |
47 |
| -+] |
48 |
| - |
| 55 | +- sys.stderr.write("Don't know how to compile leveldb for %s!\n" % system) |
| 56 | +- sys.exit(1) |
| 57 | +- |
49 | 58 | setup(
|
50 |
| - name = 'leveldb', |
51 |
| -@@ -75,52 +56,6 @@ |
52 |
| - ext_modules = [ |
53 |
| - Extension('leveldb', |
54 |
| - sources = [ |
55 |
| -- # snappy |
56 |
| -- './snappy/snappy.cc', |
57 |
| -- './snappy/snappy-stubs-internal.cc', |
58 |
| -- './snappy/snappy-sinksource.cc', |
59 |
| -- './snappy/snappy-c.cc', |
| 59 | + name = 'leveldb', |
| 60 | + version = '0.194', |
| 61 | +@@ -81,57 +62,11 @@ setup( |
| 62 | + ext_modules = [ |
| 63 | + Extension('leveldb', |
| 64 | + sources = [ |
| 65 | +- # snappy |
| 66 | +- './snappy/snappy.cc', |
| 67 | +- './snappy/snappy-stubs-internal.cc', |
| 68 | +- './snappy/snappy-sinksource.cc', |
| 69 | +- './snappy/snappy-c.cc', |
60 | 70 | -
|
61 |
| -- #leveldb |
62 |
| -- 'leveldb/db/builder.cc', |
63 |
| -- 'leveldb/db/c.cc', |
64 |
| -- 'leveldb/db/db_impl.cc', |
65 |
| -- 'leveldb/db/db_iter.cc', |
66 |
| -- 'leveldb/db/dbformat.cc', |
67 |
| -- 'leveldb/db/filename.cc', |
68 |
| -- 'leveldb/db/log_reader.cc', |
69 |
| -- 'leveldb/db/log_writer.cc', |
70 |
| -- 'leveldb/db/memtable.cc', |
71 |
| -- 'leveldb/db/repair.cc', |
72 |
| -- 'leveldb/db/table_cache.cc', |
73 |
| -- 'leveldb/db/version_edit.cc', |
74 |
| -- 'leveldb/db/version_set.cc', |
75 |
| -- 'leveldb/db/write_batch.cc', |
76 |
| -- 'leveldb/table/block.cc', |
77 |
| -- 'leveldb/table/block_builder.cc', |
78 |
| -- 'leveldb/table/filter_block.cc', |
79 |
| -- 'leveldb/table/format.cc', |
80 |
| -- 'leveldb/table/iterator.cc', |
81 |
| -- 'leveldb/table/merger.cc', |
82 |
| -- 'leveldb/table/table.cc', |
83 |
| -- 'leveldb/table/table_builder.cc', |
84 |
| -- 'leveldb/table/two_level_iterator.cc', |
85 |
| -- 'leveldb/util/arena.cc', |
86 |
| -- 'leveldb/util/bloom.cc', |
87 |
| -- 'leveldb/util/cache.cc', |
88 |
| -- 'leveldb/util/coding.cc', |
89 |
| -- 'leveldb/util/comparator.cc', |
90 |
| -- 'leveldb/util/crc32c.cc', |
91 |
| -- 'leveldb/util/env.cc', |
92 |
| -- 'leveldb/util/env_posix.cc', |
93 |
| -- 'leveldb/util/filter_policy.cc', |
94 |
| -- 'leveldb/util/hash.cc', |
95 |
| -- 'leveldb/util/histogram.cc', |
96 |
| -- 'leveldb/util/logging.cc', |
97 |
| -- 'leveldb/util/options.cc', |
98 |
| -- 'leveldb/util/status.cc', |
99 |
| -- 'leveldb/port/port_posix.cc', |
| 71 | +- #leveldb |
| 72 | +- 'leveldb/db/builder.cc', |
| 73 | +- 'leveldb/db/c.cc', |
| 74 | +- 'leveldb/db/db_impl.cc', |
| 75 | +- 'leveldb/db/db_iter.cc', |
| 76 | +- 'leveldb/db/dbformat.cc', |
| 77 | +- 'leveldb/db/filename.cc', |
| 78 | +- 'leveldb/db/log_reader.cc', |
| 79 | +- 'leveldb/db/log_writer.cc', |
| 80 | +- 'leveldb/db/memtable.cc', |
| 81 | +- 'leveldb/db/repair.cc', |
| 82 | +- 'leveldb/db/table_cache.cc', |
| 83 | +- 'leveldb/db/version_edit.cc', |
| 84 | +- 'leveldb/db/version_set.cc', |
| 85 | +- 'leveldb/db/write_batch.cc', |
| 86 | +- 'leveldb/table/block.cc', |
| 87 | +- 'leveldb/table/block_builder.cc', |
| 88 | +- 'leveldb/table/filter_block.cc', |
| 89 | +- 'leveldb/table/format.cc', |
| 90 | +- 'leveldb/table/iterator.cc', |
| 91 | +- 'leveldb/table/merger.cc', |
| 92 | +- 'leveldb/table/table.cc', |
| 93 | +- 'leveldb/table/table_builder.cc', |
| 94 | +- 'leveldb/table/two_level_iterator.cc', |
| 95 | +- 'leveldb/util/arena.cc', |
| 96 | +- 'leveldb/util/bloom.cc', |
| 97 | +- 'leveldb/util/cache.cc', |
| 98 | +- 'leveldb/util/coding.cc', |
| 99 | +- 'leveldb/util/comparator.cc', |
| 100 | +- 'leveldb/util/crc32c.cc', |
| 101 | +- 'leveldb/util/env.cc', |
| 102 | +- 'leveldb/util/env_posix.cc', |
| 103 | +- 'leveldb/util/filter_policy.cc', |
| 104 | +- 'leveldb/util/hash.cc', |
| 105 | +- 'leveldb/util/histogram.cc', |
| 106 | +- 'leveldb/util/logging.cc', |
| 107 | +- 'leveldb/util/options.cc', |
| 108 | +- 'leveldb/util/status.cc', |
| 109 | +- 'leveldb/port/port_posix.cc', |
100 | 110 | -
|
101 |
| - # python stuff |
102 |
| - 'leveldb_ext.cc', |
103 |
| - 'leveldb_object.cc', |
| 111 | + # python stuff |
| 112 | + 'leveldb_ext.cc', |
| 113 | + 'leveldb_object.cc', |
| 114 | + ], |
| 115 | +- libraries = ['stdc++'], |
| 116 | ++ libraries = ['snappy', 'leveldb', 'stdc++', 'c++_shared'], |
| 117 | + extra_compile_args = extra_compile_args, |
| 118 | + ) |
| 119 | + ] |
0 commit comments