@@ -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' ,
@@ -68,9 +68,6 @@ def build_arch(self, arch):
6868 # return
6969
7070 def do_python_build (self , arch ):
71- if 'sqlite' in self .ctx .recipe_build_order :
72- print ('sqlite support not yet enabled in python recipe' )
73- exit (1 )
7471
7572 hostpython_recipe = Recipe .get_recipe ('hostpython2' , self .ctx )
7673 shprint (sh .cp , self .ctx .hostpython , self .get_build_dir (arch .arch ))
@@ -101,6 +98,17 @@ def do_python_build(self, arch):
10198 shprint (sh .cp , join (self .get_recipe_dir (), 'Setup.local-ssl' ), setuplocal )
10299 shprint (sh .sed , '-i' , 's#^SSL=.*#SSL={}#' .format (openssl_build_dir ), setuplocal )
103100
101+ if 'sqlite3' in self .ctx .recipe_build_order :
102+ # Include sqlite3 in python2 build
103+ r = Recipe .get_recipe ('sqlite3' , self .ctx )
104+ i = ' -I' + r .get_build_dir (arch .arch )
105+ l = ' -L' + r .get_lib_dir (arch ) + ' -lsqlite3'
106+ # Insert or append to env
107+ f = 'CPPFLAGS'
108+ env [f ] = env [f ] + i if f in env else i
109+ f = 'LDFLAGS'
110+ env [f ] = env [f ] + l if f in env else l
111+
104112 configure = sh .Command ('./configure' )
105113 # AND: OFLAG isn't actually set, should it be?
106114 shprint (configure ,
0 commit comments