From f55af300a95eccec877a21ab12456bec906988a5 Mon Sep 17 00:00:00 2001 From: "Felix C. Stegerman" Date: Sat, 17 Oct 2020 20:05:34 +0200 Subject: [PATCH] support Python 3.9 & update Python to 3.9.0 --- .../src/main/java/org/kivy/android/PythonUtil.java | 3 ++- pythonforandroid/recipes/hostpython3/__init__.py | 2 +- pythonforandroid/recipes/python3/__init__.py | 10 ++++++---- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/pythonforandroid/bootstraps/common/build/src/main/java/org/kivy/android/PythonUtil.java b/pythonforandroid/bootstraps/common/build/src/main/java/org/kivy/android/PythonUtil.java index ebb3286024..c25c4b7a47 100644 --- a/pythonforandroid/bootstraps/common/build/src/main/java/org/kivy/android/PythonUtil.java +++ b/pythonforandroid/bootstraps/common/build/src/main/java/org/kivy/android/PythonUtil.java @@ -44,6 +44,7 @@ protected static ArrayList getLibraries(File libsDir) { libsList.add("python3.6m"); libsList.add("python3.7m"); libsList.add("python3.8m"); + libsList.add("python3.9m"); libsList.add("main"); return libsList; } @@ -63,7 +64,7 @@ public static void loadLibraries(File filesDir, File libsDir) { // load, and it has failed, give a more // general error Log.v(TAG, "Library loading error: " + e.getMessage()); - if (lib.startsWith("python3.8") && !foundPython) { + if (lib.startsWith("python3.9") && !foundPython) { throw new RuntimeException("Could not load any libpythonXXX.so"); } else if (lib.startsWith("python")) { continue; diff --git a/pythonforandroid/recipes/hostpython3/__init__.py b/pythonforandroid/recipes/hostpython3/__init__.py index ba32a141fa..cb0bb4a127 100644 --- a/pythonforandroid/recipes/hostpython3/__init__.py +++ b/pythonforandroid/recipes/hostpython3/__init__.py @@ -33,7 +33,7 @@ class HostPython3Recipe(Recipe): :class:`~pythonforandroid.python.HostPythonRecipe` ''' - version = '3.8.5' + version = '3.9.0' name = 'hostpython3' build_subdir = 'native-build' diff --git a/pythonforandroid/recipes/python3/__init__.py b/pythonforandroid/recipes/python3/__init__.py index b6ef9021a6..aed3b80bab 100644 --- a/pythonforandroid/recipes/python3/__init__.py +++ b/pythonforandroid/recipes/python3/__init__.py @@ -56,7 +56,7 @@ class Python3Recipe(TargetPythonRecipe): :class:`~pythonforandroid.python.GuestPythonRecipe` ''' - version = '3.8.5' + version = '3.9.0' url = 'https://www.python.org/ftp/python/{version}/Python-{version}.tgz' name = 'python3' @@ -67,14 +67,16 @@ class Python3Recipe(TargetPythonRecipe): ('patches/py3.7.1_fix-ctypes-util-find-library.patch', version_starts_with("3.7")), ('patches/py3.7.1_fix-zlib-version.patch', version_starts_with("3.7")), - # Python 3.8.1 - ('patches/py3.8.1.patch', version_starts_with("3.8")) + # Python 3.8.1 & 3.9.0 + ('patches/py3.8.1.patch', version_starts_with("3.8")), + ('patches/py3.8.1.patch', version_starts_with("3.9")) ] if sh.which('lld') is not None: patches = patches + [ ("patches/py3.7.1_fix_cortex_a8.patch", version_starts_with("3.7")), - ("patches/py3.8.1_fix_cortex_a8.patch", version_starts_with("3.8")) + ("patches/py3.8.1_fix_cortex_a8.patch", version_starts_with("3.8")), + ("patches/py3.8.1_fix_cortex_a8.patch", version_starts_with("3.9")) ] depends = ['hostpython3', 'sqlite3', 'openssl', 'libffi']