1
1
2
2
from toolchain import Recipe , shprint
3
+ from os .path import exists , join
4
+ from os import uname
3
5
import sh
4
6
5
7
class Python2Recipe (Recipe ):
@@ -9,6 +11,31 @@ class Python2Recipe(Recipe):
9
11
10
12
depends = ['hostpython2' ]
11
13
14
+ def prebuild_armeabi (self ):
15
+ build_dir = self .get_build_dir ('armeabi' )
16
+ if exists (join (build_dir , '.patched' )):
17
+ print ('Python2 already patched, skipping.' )
18
+ return
19
+ self .apply_patch (join ('patches' , 'Python-{}-xcompile.patch' .format (self .version )))
20
+ self .apply_patch (join ('patches' , 'disable-modules.patch' ))
21
+ self .apply_patch (join ('patches' , 'fix-locale.patch' ))
22
+ self .apply_patch (join ('patches' , 'fix-gethostbyaddr.patch' ))
23
+ self .apply_patch (join ('patches' , 'fix-setup-flags.patch' ))
24
+ self .apply_patch (join ('patches' , 'fix-filesystemdefaultencoding.patch' ))
25
+ self .apply_patch (join ('patches' , 'fix-termios.patch' ))
26
+ self .apply_patch (join ('patches' , 'custom-loader.patch' ))
27
+ self .apply_patch (join ('patches' , 'verbose-compilation.patch' ))
28
+ self .apply_patch (join ('patches' , 'fix-remove-corefoundation.patch' ))
29
+ self .apply_patch (join ('patches' , 'fix-dynamic-lookup.patch' ))
30
+ self .apply_patch (join ('patches' , 'fix-dlfcn.patch' ))
31
+
32
+ if uname ()[0 ] == 'Linux' :
33
+ self .apply_patch (join ('patches' , 'fix-configure-darwin.patch' ))
34
+ self .apply_patch (join ('patches' , 'fix-distutils-darwin.patch' ))
35
+
36
+ shprint (sh .touch , join (build_dir , 'patched' ))
37
+
38
+
12
39
def build_arch (self , arch ):
13
40
# shprint(sh.xcodebuild,
14
41
# "ONLY_ACTIVE_ARCH=NO",
0 commit comments