From 10a838349df979c46a4b306775b68937479dfeb1 Mon Sep 17 00:00:00 2001 From: opacam Date: Wed, 12 Dec 2018 00:09:18 +0100 Subject: [PATCH] Remove unneeded flags and grants python3 compatibility for the apsw recipe The flags that we remove are already set in base class, so no need to set in here also move libraries from LDFLAGS to LIBS --- pythonforandroid/recipes/apsw/__init__.py | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/pythonforandroid/recipes/apsw/__init__.py b/pythonforandroid/recipes/apsw/__init__.py index 68e745961e..6098e4b98c 100644 --- a/pythonforandroid/recipes/apsw/__init__.py +++ b/pythonforandroid/recipes/apsw/__init__.py @@ -6,7 +6,7 @@ class ApswRecipe(PythonRecipe): version = '3.15.0-r1' url = 'https://github.com/rogerbinns/apsw/archive/{version}.tar.gz' - depends = ['sqlite3', 'hostpython2', 'python2', 'setuptools'] + depends = ['sqlite3', ('python2', 'python3'), 'setuptools'] call_hostpython_via_targetpython = False site_packages_name = 'apsw' @@ -24,14 +24,10 @@ def build_arch(self, arch): def get_recipe_env(self, arch): env = super(ApswRecipe, self).get_recipe_env(arch) - env['PYTHON_ROOT'] = self.ctx.get_python_install_dir() - env['CFLAGS'] += ' -I' + env['PYTHON_ROOT'] + '/include/python2.7' + \ - ' -I' + self.get_recipe('sqlite3', self.ctx).get_build_dir(arch.arch) - # Set linker to use the correct gcc - env['LDSHARED'] = env['CC'] + ' -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions' - env['LDFLAGS'] += ' -L' + env['PYTHON_ROOT'] + '/lib' + \ - ' -lpython2.7' + \ - ' -lsqlite3' + sqlite_recipe = self.get_recipe('sqlite3', self.ctx) + env['CFLAGS'] += ' -I' + sqlite_recipe.get_build_dir(arch.arch) + env['LDFLAGS'] += ' -L' + sqlite_recipe.get_lib_dir(arch) + env['LIBS'] = env.get('LIBS', '') + ' -lsqlite3' return env