|
1 |
| -from pythonforandroid.recipe import CompiledComponentsPythonRecipe |
2 |
| -from pythonforandroid.toolchain import current_directory |
3 |
| -import sh |
| 1 | +from pythonforandroid.recipe import CppCompiledComponentsPythonRecipe |
4 | 2 |
|
5 | 3 |
|
6 |
| -class PyLevelDBRecipe(CompiledComponentsPythonRecipe): |
| 4 | +class PyLevelDBRecipe(CppCompiledComponentsPythonRecipe): |
7 | 5 | version = '0.193'
|
8 | 6 | url = 'https://pypi.python.org/packages/source/l/leveldb/leveldb-{version}.tar.gz'
|
9 | 7 | depends = ['snappy', 'leveldb', ('hostpython2', 'hostpython3'), 'setuptools']
|
10 | 8 | patches = ['bindings-only.patch']
|
11 | 9 | call_hostpython_via_targetpython = False # Due to setuptools
|
12 | 10 | site_packages_name = 'leveldb'
|
13 | 11 |
|
14 |
| - def build_arch(self, arch): |
15 |
| - with current_directory(self.get_build_dir(arch.arch)): |
16 |
| - # Remove source in this pypi package |
17 |
| - sh.rm('-rf', 'leveldb', 'leveldb.egg-info', 'snappy') |
18 |
| - # Use source from leveldb recipe |
19 |
| - sh.ln('-s', self.get_recipe('leveldb', self.ctx).get_build_dir(arch.arch), 'leveldb') |
20 |
| - # Build and install python bindings |
21 |
| - super(PyLevelDBRecipe, self).build_arch(arch) |
22 |
| - |
23 |
| - def get_recipe_env(self, arch): |
24 |
| - env = super(PyLevelDBRecipe, self).get_recipe_env(arch) |
25 |
| - # Copy environment from leveldb recipe |
26 |
| - env.update(self.get_recipe('leveldb', self.ctx).get_recipe_env(arch)) |
27 |
| - # Set linker to use the correct gcc |
28 |
| - env['LDSHARED'] = env['CC'] + ' -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions' |
29 |
| - env['LDFLAGS'] += ' -lleveldb' |
30 |
| - return env |
31 |
| - |
32 | 12 |
|
33 | 13 | recipe = PyLevelDBRecipe()
|
0 commit comments