Skip to content

Commit ae59f8a

Browse files
committed
Did basic changes for Python3.8 support
1 parent 32e3805 commit ae59f8a

File tree

4 files changed

+23
-11
lines changed

4 files changed

+23
-11
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ protected static ArrayList<String> getLibraries(File libsDir) {
4444
libsList.add("python3.5m");
4545
libsList.add("python3.6m");
4646
libsList.add("python3.7m");
47+
libsList.add("python3.8m");
4748
libsList.add("main");
4849
return libsList;
4950
}
@@ -64,7 +65,7 @@ public static void loadLibraries(File filesDir, File libsDir) {
6465
// load, and it has failed, give a more
6566
// general error
6667
Log.v(TAG, "Library loading error: " + e.getMessage());
67-
if (lib.startsWith("python3.7") && !foundPython) {
68+
if (lib.startsWith("python3.8") && !foundPython) {
6869
throw new java.lang.RuntimeException("Could not load any libpythonXXX.so");
6970
} else if (lib.startsWith("python")) {
7071
continue;
@@ -81,7 +82,7 @@ public static void loadLibraries(File filesDir, File libsDir) {
8182
} catch(UnsatisfiedLinkError e) {
8283
Log.v(TAG, "Failed to load _io.so or unicodedata.so...but that's okay.");
8384
}
84-
85+
8586
try {
8687
// System.loadLibrary("ctypes");
8788
System.load(filesDirPath + "/lib/python2.7/lib-dynload/_ctypes.so");
@@ -92,4 +93,3 @@ public static void loadLibraries(File filesDir, File libsDir) {
9293
Log.v(TAG, "Loaded everything!");
9394
}
9495
}
95-

pythonforandroid/python.py

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -438,10 +438,19 @@ def build_arch(self, arch):
438438
if not exists('config.status'):
439439
shprint(sh.Command(join(recipe_build_dir, 'configure')))
440440

441-
# Create the Setup file. This copying from Setup.dist
442-
# seems to be the normal and expected procedure.
443-
shprint(sh.cp, join('Modules', 'Setup.dist'),
444-
join(build_dir, 'Modules', 'Setup'))
441+
# Create the Setup file. This copying from Setup.dist is
442+
# the normal and expected procedure before Python 3.8, but
443+
# after this the file with default options is already named "Setup"
444+
setup_dist_location = join('Modules', 'Setup.dist')
445+
if exists(setup_dist_location):
446+
shprint(sh.cp, join('Modules', 'Setup.dist'),
447+
join(build_dir, 'Modules', 'Setup'))
448+
else:
449+
# Check the expected file does exist
450+
setup_location = join('Modules', 'Setup')
451+
if not exists(setup_location):
452+
raise BuildInterruptingException(
453+
"Could not find Setup.dist or Setup in Python build")
445454

446455
shprint(sh.make, '-j', str(cpu_count()), '-C', build_dir)
447456

pythonforandroid/recipes/hostpython3/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class Hostpython3Recipe(HostPythonRecipe):
99
Refactored into the new class
1010
:class:`~pythonforandroid.python.HostPythonRecipe`
1111
'''
12-
version = '3.7.1'
12+
version = '3.8.1'
1313
name = 'hostpython3'
1414
conflicts = ['hostpython2']
1515

pythonforandroid/recipes/python3/__init__.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,17 @@ class Python3Recipe(GuestPythonRecipe):
1818
:class:`~pythonforandroid.python.GuestPythonRecipe`
1919
'''
2020

21-
version = '3.7.1'
21+
version = '3.8.1'
2222
url = 'https://www.python.org/ftp/python/{version}/Python-{version}.tgz'
2323
name = 'python3'
2424

25-
patches = ['patches/fix-ctypes-util-find-library.patch',
26-
'patches/fix-zlib-version.patch']
25+
# patches = ['patches/fix-ctypes-util-find-library.patch',
26+
# 'patches/fix-zlib-version.patch']
27+
28+
patches = ['patches/py381.patch']
2729

2830
if sh.which('lld') is not None:
31+
raise RuntimeError("!!!")
2932
patches = patches + ["patches/remove-fix-cortex-a8.patch"]
3033

3134
depends = ['hostpython3', 'sqlite3', 'openssl', 'libffi']

0 commit comments

Comments
 (0)