@@ -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,18 @@ 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
+ sqlite3recipe = Recipe .get_recipe ('sqlite3' , self .ctx )
103
+ sqlite_inc_dir = sqlite3recipe .get_build_dir (arch .arch )
104
+ sqlite_libs_dir = sqlite3recipe .get_lib_dir (arch )
105
+ env ['CFLAGS' ] += ' -I' + sqlite_inc_dir
106
+ env ['LDFLAGS' ] += ' -L' + sqlite_libs_dir + ' -lsqlite3'
107
+ self .apply_patch ('patches/enable-sqlite3.patch' , arch .arch )
108
+ shprint (sh .sed , '-i' , 's#SQLITE_RECIPE_INC#{}#' .format (sqlite_inc_dir ),
109
+ join (self .get_build_dir (arch .arch ), 'setup.py' ))
110
+ shprint (sh .sed , '-i' , 's#SQLITE_RECIPE_LIB#{}#' .format (sqlite_libs_dir ),
111
+ join (self .get_build_dir (arch .arch ), 'setup.py' ))
112
+
104
113
configure = sh .Command ('./configure' )
105
114
# AND: OFLAG isn't actually set, should it be?
106
115
shprint (configure ,
0 commit comments