File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed
pythonforandroid/recipes/python2/patches Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change 1+ diff --git a/Lib/ctypes/util.py b/Lib/ctypes/util.py
2+ index 52b3520..01b13a9 100644
3+ --- a/Lib/ctypes/util.py
4+ +++ b/Lib/ctypes/util.py
5+ @@ -71,7 +71,23 @@ if os.name == "ce":
6+ def find_library(name):
7+ return name
8+
9+ - if os.name == "posix" and sys.platform == "darwin":
10+ + # This patch overrides the find_library to look in the right places on
11+ + # Android
12+ + if True:
13+ + def find_library(name):
14+ + # Check the user app lib dir
15+ + app_root = os.path.abspath('./').split(os.path.sep)[0:4]
16+ + lib_search = os.path.sep.join(app_root) + os.path.sep + 'lib'
17+ + for filename in os.listdir(lib_search):
18+ + if filename.endswith('.so') and name in filename:
19+ + return lib_search + os.path.sep + filename
20+ + # Check the normal Android system libraries
21+ + for filename in os.listdir('/system/lib'):
22+ + if filename.endswith('.so') and name in filename:
23+ + return lib_search + os.path.sep + filename
24+ + return None
25+ +
26+ + elif os.name == "posix" and sys.platform == "darwin":
27+ from ctypes.macholib.dyld import dyld_find as _dyld_find
28+ def find_library(name):
29+ possible = ['lib%s.dylib' % name,
You can’t perform that action at this time.
0 commit comments