From 4114698c410fd8eca217b49e47c0a0242dc44e5e Mon Sep 17 00:00:00 2001 From: Paul Brussee Date: Thu, 14 Apr 2016 15:26:35 +0200 Subject: [PATCH] Include sqlite3 in python2 build; --- pythonforandroid/recipes/python2/__init__.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/pythonforandroid/recipes/python2/__init__.py b/pythonforandroid/recipes/python2/__init__.py index 10eeda2519..84bee9ef01 100644 --- a/pythonforandroid/recipes/python2/__init__.py +++ b/pythonforandroid/recipes/python2/__init__.py @@ -14,7 +14,7 @@ class Python2Recipe(TargetPythonRecipe): depends = ['hostpython2'] conflicts = ['python3crystax', 'python3'] - opt_depends = ['openssl'] + opt_depends = ['openssl','sqlite3'] patches = ['patches/Python-{version}-xcompile.patch', 'patches/Python-{version}-ctypes-disable-wchar.patch', @@ -68,9 +68,6 @@ def build_arch(self, arch): # return def do_python_build(self, arch): - if 'sqlite' in self.ctx.recipe_build_order: - print('sqlite support not yet enabled in python recipe') - exit(1) hostpython_recipe = Recipe.get_recipe('hostpython2', self.ctx) shprint(sh.cp, self.ctx.hostpython, self.get_build_dir(arch.arch)) @@ -101,6 +98,17 @@ def do_python_build(self, arch): shprint(sh.cp, join(self.get_recipe_dir(), 'Setup.local-ssl'), setuplocal) shprint(sh.sed, '-i', 's#^SSL=.*#SSL={}#'.format(openssl_build_dir), setuplocal) + if 'sqlite3' in self.ctx.recipe_build_order: + # Include sqlite3 in python2 build + r = Recipe.get_recipe('sqlite3', self.ctx) + i = ' -I' + r.get_build_dir(arch.arch) + l = ' -L' + r.get_lib_dir(arch) + ' -lsqlite3' + # Insert or append to env + f = 'CPPFLAGS' + env[f] = env[f] + i if f in env else i + f = 'LDFLAGS' + env[f] = env[f] + l if f in env else l + configure = sh.Command('./configure') # AND: OFLAG isn't actually set, should it be? shprint(configure,