File tree Expand file tree Collapse file tree 2 files changed +25
-0
lines changed
pythonforandroid/recipes/python3 Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,8 @@ class Python3Recipe(GuestPythonRecipe):
2121 url = 'https://www.python.org/ftp/python/{version}/Python-{version}.tgz'
2222 name = 'python3'
2323
24+ patches = ["patches/fix-ctypes-util-find-library.patch" ]
25+
2426 depends = ['hostpython3' ]
2527 conflicts = ['python3crystax' , 'python2' , 'python2legacy' ]
2628
Original file line number Diff line number Diff line change 1+ diff --git a/Lib/ctypes/util.py b/Lib/ctypes/util.py
2+ --- a/Lib/ctypes/util.py
3+ +++ b/Lib/ctypes/util.py
4+ @@ -67,4 +67,19 @@
5+ return fname
6+ return None
7+
8+ + # This patch overrides the find_library to look in the right places on
9+ + # Android
10+ + if True:
11+ + def find_library(name):
12+ + # Check the user app libs and system libraries directory:
13+ + app_root = os.path.normpath(os.path.abspath('../../'))
14+ + lib_search_dirs = [os.path.join(app_root, 'lib'), "/system/lib"]
15+ + for lib_dir in lib_search_dirs:
16+ + for filename in os.listdir(lib_dir):
17+ + if filename.endswith('.so') and (
18+ + filename.startswith("lib" + name + ".") or
19+ + filename.startswith(name + ".")):
20+ + return os.path.join(lib_dir, filename)
21+ + return None
22+ +
23+ elif os.name == "posix" and sys.platform == "darwin":
You can’t perform that action at this time.
0 commit comments