Skip to content

Commit 1aee8fd

Browse files
authored
Merge pull request #1548 from opacam/python-core-apsw
[CORE UPDATE - PART VII] Apsw for both versions of python
2 parents 23361cb + 10a8383 commit 1aee8fd

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

pythonforandroid/recipes/apsw/__init__.py

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
class ApswRecipe(PythonRecipe):
77
version = '3.15.0-r1'
88
url = 'https://github.com/rogerbinns/apsw/archive/{version}.tar.gz'
9-
depends = ['sqlite3', 'hostpython2', 'python2', 'setuptools']
9+
depends = ['sqlite3', ('python2', 'python3'), 'setuptools']
1010
call_hostpython_via_targetpython = False
1111
site_packages_name = 'apsw'
1212

@@ -24,14 +24,10 @@ def build_arch(self, arch):
2424

2525
def get_recipe_env(self, arch):
2626
env = super(ApswRecipe, self).get_recipe_env(arch)
27-
env['PYTHON_ROOT'] = self.ctx.get_python_install_dir()
28-
env['CFLAGS'] += ' -I' + env['PYTHON_ROOT'] + '/include/python2.7' + \
29-
' -I' + self.get_recipe('sqlite3', self.ctx).get_build_dir(arch.arch)
30-
# Set linker to use the correct gcc
31-
env['LDSHARED'] = env['CC'] + ' -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions'
32-
env['LDFLAGS'] += ' -L' + env['PYTHON_ROOT'] + '/lib' + \
33-
' -lpython2.7' + \
34-
' -lsqlite3'
27+
sqlite_recipe = self.get_recipe('sqlite3', self.ctx)
28+
env['CFLAGS'] += ' -I' + sqlite_recipe.get_build_dir(arch.arch)
29+
env['LDFLAGS'] += ' -L' + sqlite_recipe.get_lib_dir(arch)
30+
env['LIBS'] = env.get('LIBS', '') + ' -lsqlite3'
3531
return env
3632

3733

0 commit comments

Comments
 (0)