Skip to content

Commit

Permalink
Include sqlite3 in python2 build;
Browse files Browse the repository at this point in the history
  • Loading branch information
brussee committed Apr 20, 2016
1 parent 5f2a1ca commit 4114698
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions pythonforandroid/recipes/python2/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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))
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 4114698

Please sign in to comment.