Skip to content

Commit 6351d8b

Browse files
committed
wip sqlite3 for python2
1 parent 14b7dfc commit 6351d8b

File tree

1 file changed

+17
-5
lines changed

1 file changed

+17
-5
lines changed

pythonforandroid/recipes/python2/__init__.py

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class Python2Recipe(TargetPythonRecipe):
1414

1515
depends = ['hostpython2']
1616
conflicts = ['python3crystax', 'python3']
17-
opt_depends = ['openssl']
17+
opt_depends = ['openssl', 'sqlite3']
1818

1919
patches = ['patches/Python-{version}-xcompile.patch',
2020
'patches/Python-{version}-ctypes-disable-wchar.patch',
@@ -95,11 +95,23 @@ def do_python_build(self, arch):
9595

9696
# TODO need to add a should_build that checks if optional
9797
# dependencies have changed (possibly in a generic way)
98+
setuplocal = join('Modules', 'Setup.local')
99+
file = open(setuplocal, 'w+')
98100
if 'openssl' in self.ctx.recipe_build_order:
99-
openssl_build_dir = Recipe.get_recipe('openssl', self.ctx).get_build_dir(arch.arch)
100-
setuplocal = join('Modules', 'Setup.local')
101-
shprint(sh.cp, join(self.get_recipe_dir(), 'Setup.local-ssl'), setuplocal)
102-
shprint(sh.sed, '-i', 's#^SSL=.*#SSL={}#'.format(openssl_build_dir), setuplocal)
101+
file.writelines([
102+
'SSL=' + Recipe.get_recipe('openssl', self.ctx).get_build_dir(arch.arch) + '\n',
103+
'_ssl _ssl.c -DUSE_SSL',
104+
' -I$(SSL)/include -I$(SSL)/include/openssl',
105+
' -L$(SSL) -lssl -lcrypto',
106+
'\n'])
107+
if 'sqlite3' in self.ctx.recipe_build_order:
108+
file.writelines([
109+
'SQLITE=' + Recipe.get_recipe('sqlite3', self.ctx).get_build_dir(arch.arch) + '\n',
110+
'sqlite3 sqlite3.c -DSQLITE_ENABLE_FTS4',
111+
' -I$(SQLITE)',
112+
' -L$(SQLITE)/obj/local/' + arch.arch + ' -lsqlite3',
113+
'\n'])
114+
file.close()
103115

104116
configure = sh.Command('./configure')
105117
# AND: OFLAG isn't actually set, should it be?

0 commit comments

Comments
 (0)