@@ -14,7 +14,7 @@ class Python2Recipe(TargetPythonRecipe):
14
14
15
15
depends = ['hostpython2' ]
16
16
conflicts = ['python3crystax' , 'python3' ]
17
- opt_depends = ['openssl' ]
17
+ opt_depends = ['openssl' , 'sqlite3' ]
18
18
19
19
patches = ['patches/Python-{version}-xcompile.patch' ,
20
20
'patches/Python-{version}-ctypes-disable-wchar.patch' ,
@@ -68,9 +68,6 @@ def build_arch(self, arch):
68
68
# return
69
69
70
70
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 )
74
71
75
72
hostpython_recipe = Recipe .get_recipe ('hostpython2' , self .ctx )
76
73
shprint (sh .cp , self .ctx .hostpython , self .get_build_dir (arch .arch ))
@@ -101,6 +98,17 @@ def do_python_build(self, arch):
101
98
shprint (sh .cp , join (self .get_recipe_dir (), 'Setup.local-ssl' ), setuplocal )
102
99
shprint (sh .sed , '-i' , 's#^SSL=.*#SSL={}#' .format (openssl_build_dir ), setuplocal )
103
100
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
+
104
112
configure = sh .Command ('./configure' )
105
113
# AND: OFLAG isn't actually set, should it be?
106
114
shprint (configure ,
0 commit comments