@@ -56,7 +56,7 @@ class Python3Recipe(TargetPythonRecipe):
56
56
:class:`~pythonforandroid.python.GuestPythonRecipe`
57
57
'''
58
58
59
- version = '3.10.10 '
59
+ version = '3.11.5 '
60
60
url = 'https://www.python.org/ftp/python/{version}/Python-{version}.tgz'
61
61
name = 'python3'
62
62
@@ -71,15 +71,16 @@ class Python3Recipe(TargetPythonRecipe):
71
71
# Python 3.8.1 & 3.9.X
72
72
('patches/py3.8.1.patch' , version_starts_with ("3.8" )),
73
73
('patches/py3.8.1.patch' , version_starts_with ("3.9" )),
74
- ('patches/py3.8.1.patch' , version_starts_with ("3.10" ))
74
+ ('patches/py3.8.1.patch' , version_starts_with ("3.10" )),
75
75
]
76
76
77
77
if shutil .which ('lld' ) is not None :
78
78
patches = patches + [
79
79
("patches/py3.7.1_fix_cortex_a8.patch" , version_starts_with ("3.7" )),
80
80
("patches/py3.8.1_fix_cortex_a8.patch" , version_starts_with ("3.8" )),
81
81
("patches/py3.8.1_fix_cortex_a8.patch" , version_starts_with ("3.9" )),
82
- ("patches/py3.8.1_fix_cortex_a8.patch" , version_starts_with ("3.10" ))
82
+ ("patches/py3.8.1_fix_cortex_a8.patch" , version_starts_with ("3.10" )),
83
+ ("patches/py3.11.4_fix_cortex_a8.patch" , version_starts_with ("3.11" ))
83
84
]
84
85
85
86
depends = ['hostpython3' , 'sqlite3' , 'openssl' , 'libffi' ]
@@ -101,7 +102,12 @@ class Python3Recipe(TargetPythonRecipe):
101
102
'ac_cv_header_sys_eventfd_h=no' ,
102
103
'--prefix={prefix}' ,
103
104
'--exec-prefix={exec_prefix}' ,
104
- '--enable-loadable-sqlite-extensions' )
105
+ '--enable-loadable-sqlite-extensions'
106
+ )
107
+
108
+ if version_starts_with ("3.11" ):
109
+ configure_args += ('--with-build-python={python_host_bin}' ,)
110
+
105
111
'''The configure arguments needed to build the python recipe. Those are
106
112
used in method :meth:`build_arch` (if not overwritten like python3's
107
113
recipe does).
@@ -218,6 +224,13 @@ def get_recipe_env(self, arch=None, with_flags_in_cc=True):
218
224
else :
219
225
warning ('lld not found, linking without it. '
220
226
'Consider installing lld if linker errors occur.' )
227
+
228
+ if 'MAKEFLAGS' in env .keys () and version_starts_with ("3.11" ):
229
+ if "-j" in env ['MAKEFLAGS' ]:
230
+ __ = env ['MAKEFLAGS' ].split (" " )
231
+ __ .pop (__ .index ("-j" ) + 1 ) # -j 10, here pop 10
232
+ __ .pop (__ .index ("-j" )) # here pop '-j'
233
+ env ["MAKEFLAGS" ] = " " .join (__ )
221
234
222
235
return env
223
236
@@ -323,12 +336,17 @@ def build_arch(self, arch):
323
336
* (' ' .join (self .configure_args ).format (
324
337
android_host = env ['HOSTARCH' ],
325
338
android_build = android_build ,
339
+ python_host_bin = join (self .get_recipe (
340
+ 'host' + self .name , self .ctx
341
+ ).get_path_to_python (), "python3" ),
326
342
prefix = sys_prefix ,
327
343
exec_prefix = sys_exec_prefix )).split (' ' ),
328
344
_env = env )
329
345
346
+ # disable parallel build on 3.11 to fix:
347
+ # ld: error: unable to find library -lpython3.11
330
348
shprint (
331
- sh .make , 'all' , '-j' , str (cpu_count ()),
349
+ sh .make , 'all' , '-j' , ( str (cpu_count ()) if not version_starts_with ( "3.11" ) else "1" ),
332
350
'INSTSONAME={lib_name}' .format (lib_name = self ._libpython ),
333
351
_env = env
334
352
)
0 commit comments