Skip to content

Commit 6c31e10

Browse files
committed
Fixes pyleveldb recipe
1 parent db53ef6 commit 6c31e10

File tree

2 files changed

+2
-26
lines changed

2 files changed

+2
-26
lines changed

ci/constants.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,6 @@ class TargetPython(Enum):
3939
'protobuf_cpp',
4040
'xeddsa',
4141
'x3dh',
42-
# fatal error: crypt.h: No such file or directory
43-
'pyleveldb',
4442
'pynacl',
4543
'doubleratchet',
4644
# The opencv recipe fails to pass travis tests due to the long processing
@@ -85,8 +83,6 @@ class TargetPython(Enum):
8583
'opencv',
8684
# requires `libpq-dev` system dependency e.g. for `pg_config` binary
8785
'psycopg2',
88-
# fatal error: crypt.h: No such file or directory
89-
'pyleveldb',
9086
'protobuf_cpp',
9187
# most likely some setup in the Docker container, because it works in host
9288
'pyjnius', 'pyopenal',
Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,13 @@
1-
from pythonforandroid.recipe import CompiledComponentsPythonRecipe
2-
from pythonforandroid.toolchain import current_directory
3-
import sh
1+
from pythonforandroid.recipe import CppCompiledComponentsPythonRecipe
42

53

6-
class PyLevelDBRecipe(CompiledComponentsPythonRecipe):
4+
class PyLevelDBRecipe(CppCompiledComponentsPythonRecipe):
75
version = '0.193'
86
url = 'https://pypi.python.org/packages/source/l/leveldb/leveldb-{version}.tar.gz'
97
depends = ['snappy', 'leveldb', ('hostpython2', 'hostpython3'), 'setuptools']
108
patches = ['bindings-only.patch']
119
call_hostpython_via_targetpython = False # Due to setuptools
1210
site_packages_name = 'leveldb'
1311

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-
3212

3313
recipe = PyLevelDBRecipe()

0 commit comments

Comments
 (0)