-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Python 3.8 support on Android (#2044)
* Did basic changes for Python3.8 support * Added python 3.8.1 patch to git * Added infrastructure for recipe-version-dependent patching * Added --fix-cortex-a8 removal patch for py3.8.1 * Fully set up Python3 patches to work with both 3.7.1 and 3.8.1 * Fixed bugs in is_version_{lt,gt} patching helpers * Replaced func call with pre-existing variable reference * Added some blank lines to make pep8 happy
- Loading branch information
Showing
10 changed files
with
109 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
diff --git a/Lib/ctypes/util.py b/Lib/ctypes/util.py | ||
index 97973bc..053c231 100644 | ||
--- a/Lib/ctypes/util.py | ||
+++ b/Lib/ctypes/util.py | ||
@@ -67,6 +67,13 @@ if os.name == "nt": | ||
return fname | ||
return None | ||
|
||
+# This patch overrides the find_library to look in the right places on | ||
+# Android | ||
+if True: | ||
+ from android._ctypes_library_finder import find_library as _find_lib | ||
+ def find_library(name): | ||
+ return _find_lib(name) | ||
+ | ||
elif os.name == "posix" and sys.platform == "darwin": | ||
from ctypes.macholib.dyld import dyld_find as _dyld_find | ||
def find_library(name): | ||
diff --git a/configure b/configure | ||
index 0914e24..dd00812 100755 | ||
--- a/configure | ||
+++ b/configure | ||
@@ -18673,4 +18673,3 @@ if test "$Py_OPT" = 'false' -a "$Py_DEBUG" != 'true'; then | ||
echo "" >&6 | ||
echo "" >&6 | ||
fi | ||
- | ||
diff --git a/setup.py b/setup.py | ||
index 20d7f35..af15cc2 100644 | ||
--- a/setup.py | ||
+++ b/setup.py | ||
@@ -1501,7 +1501,9 @@ class PyBuildExt(build_ext): | ||
if zlib_inc is not None: | ||
zlib_h = zlib_inc[0] + '/zlib.h' | ||
version = '"0.0.0"' | ||
- version_req = '"1.1.3"' | ||
+ # version_req = '"1.1.3"' | ||
+ version_req = '"{}"'.format( | ||
+ os.environ.get('ZLIB_VERSION', '1.1.3')) | ||
if MACOS and is_macosx_sdk_path(zlib_h): | ||
zlib_h = os.path.join(macosx_sdk_root(), zlib_h[1:]) | ||
with open(zlib_h) as fp: |
18 changes: 18 additions & 0 deletions
18
pythonforandroid/recipes/python3/patches/py3.8.1_fix_cortex_a8.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
diff --git a/configure b/configure | ||
index 0914e24..7517168 100755 | ||
--- a/configure | ||
+++ b/configure | ||
@@ -5642,7 +5642,7 @@ $as_echo_n "checking for the Android arm ABI... " >&6; } | ||
$as_echo "$_arm_arch" >&6; } | ||
if test "$_arm_arch" = 7; then | ||
BASECFLAGS="${BASECFLAGS} -mfloat-abi=softfp -mfpu=vfpv3-d16" | ||
- LDFLAGS="${LDFLAGS} -march=armv7-a -Wl,--fix-cortex-a8" | ||
+ LDFLAGS="${LDFLAGS} -march=armv7-a" | ||
fi | ||
else | ||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: not Android" >&5 | ||
@@ -18673,4 +18673,3 @@ if test "$Py_OPT" = 'false' -a "$Py_DEBUG" != 'true'; then | ||
echo "" >&6 | ||
echo "" >&6 | ||
fi | ||
- |