@@ -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' ,
@@ -95,11 +95,23 @@ def do_python_build(self, arch):
95
95
96
96
# TODO need to add a should_build that checks if optional
97
97
# dependencies have changed (possibly in a generic way)
98
+ setuplocal = join ('Modules' , 'Setup.local' )
99
+ file = open (setuplocal , 'w+' )
98
100
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 ()
103
115
104
116
configure = sh .Command ('./configure' )
105
117
# AND: OFLAG isn't actually set, should it be?
0 commit comments