Skip to content

Commit 01067cb

Browse files
committed
python: update to 3.11.5
1 parent 4ebd3a8 commit 01067cb

File tree

5 files changed

+38
-8
lines changed

5 files changed

+38
-8
lines changed

pythonforandroid/bootstraps/common/build/src/main/java/org/kivy/android/PythonUtil.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ protected static ArrayList<String> getLibraries(File libsDir) {
5555
libsList.add("python3.8");
5656
libsList.add("python3.9");
5757
libsList.add("python3.10");
58+
libsList.add("python3.11");
5859
libsList.add("main");
5960
return libsList;
6061
}
@@ -74,7 +75,7 @@ public static void loadLibraries(File filesDir, File libsDir) {
7475
// load, and it has failed, give a more
7576
// general error
7677
Log.v(TAG, "Library loading error: " + e.getMessage());
77-
if (lib.startsWith("python3.10") && !foundPython) {
78+
if (lib.startsWith("python3.11") && !foundPython) {
7879
throw new RuntimeException("Could not load any libpythonXXX.so");
7980
} else if (lib.startsWith("python")) {
8081
continue;

pythonforandroid/recipes/cython/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
class CythonRecipe(CompiledComponentsPythonRecipe):
55

6-
version = '0.29.28'
6+
version = '0.29.36'
77
url = 'https://github.com/cython/cython/archive/{version}.tar.gz'
88
site_packages_name = 'cython'
99
depends = ['setuptools']

pythonforandroid/recipes/hostpython3/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class HostPython3Recipe(Recipe):
3535
:class:`~pythonforandroid.python.HostPythonRecipe`
3636
'''
3737

38-
version = '3.10.10'
38+
version = '3.11.5'
3939
name = 'hostpython3'
4040

4141
build_subdir = 'native-build'

pythonforandroid/recipes/python3/__init__.py

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class Python3Recipe(TargetPythonRecipe):
5656
:class:`~pythonforandroid.python.GuestPythonRecipe`
5757
'''
5858

59-
version = '3.10.10'
59+
version = '3.11.5'
6060
url = 'https://www.python.org/ftp/python/{version}/Python-{version}.tgz'
6161
name = 'python3'
6262

@@ -71,15 +71,16 @@ class Python3Recipe(TargetPythonRecipe):
7171
# Python 3.8.1 & 3.9.X
7272
('patches/py3.8.1.patch', version_starts_with("3.8")),
7373
('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")),
7575
]
7676

7777
if shutil.which('lld') is not None:
7878
patches = patches + [
7979
("patches/py3.7.1_fix_cortex_a8.patch", version_starts_with("3.7")),
8080
("patches/py3.8.1_fix_cortex_a8.patch", version_starts_with("3.8")),
8181
("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"))
8384
]
8485

8586
depends = ['hostpython3', 'sqlite3', 'openssl', 'libffi']
@@ -101,7 +102,12 @@ class Python3Recipe(TargetPythonRecipe):
101102
'ac_cv_header_sys_eventfd_h=no',
102103
'--prefix={prefix}',
103104
'--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+
105111
'''The configure arguments needed to build the python recipe. Those are
106112
used in method :meth:`build_arch` (if not overwritten like python3's
107113
recipe does).
@@ -218,6 +224,13 @@ def get_recipe_env(self, arch=None, with_flags_in_cc=True):
218224
else:
219225
warning('lld not found, linking without it. '
220226
'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(__)
221234

222235
return env
223236

@@ -323,12 +336,17 @@ def build_arch(self, arch):
323336
*(' '.join(self.configure_args).format(
324337
android_host=env['HOSTARCH'],
325338
android_build=android_build,
339+
python_host_bin=join(self.get_recipe(
340+
'host' + self.name, self.ctx
341+
).get_path_to_python(), "python3"),
326342
prefix=sys_prefix,
327343
exec_prefix=sys_exec_prefix)).split(' '),
328344
_env=env)
329345

346+
# disable parallel build on 3.11 to fix:
347+
# ld: error: unable to find library -lpython3.11
330348
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"),
332350
'INSTSONAME={lib_name}'.format(lib_name=self._libpython),
333351
_env=env
334352
)
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
--- Python-3.11.4/configure 2023-06-07 03:30:27.000000000 +0530
2+
+++ Python-3.11.4.mod/configure 2023-07-08 11:51:11.031135937 +0530
3+
@@ -6994,7 +6994,7 @@
4+
printf "%s\n" "$_arm_arch" >&6; }
5+
if test "$_arm_arch" = 7; then
6+
BASECFLAGS="${BASECFLAGS} -mfloat-abi=softfp -mfpu=vfpv3-d16"
7+
- LDFLAGS="${LDFLAGS} -march=armv7-a -Wl,--fix-cortex-a8"
8+
+ LDFLAGS="${LDFLAGS} -march=armv7-a"
9+
fi
10+
else
11+
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not Android" >&5

0 commit comments

Comments
 (0)