-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1877 from surbhicis/py2-ctypes-fixes
fix ctypes-util-find-library issue for python2
- Loading branch information
Showing
2 changed files
with
21 additions
and
1 deletion.
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
19 changes: 19 additions & 0 deletions
19
pythonforandroid/recipes/python2/patches/fix-ctypes-util-find-library.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,19 @@ | ||
diff -u a/Lib/ctypes/util.py b/Lib/ctypes/util.py | ||
--- a/Lib/ctypes/util.py 2019-06-20 18:52:01.372205226 +0200 | ||
+++ b/Lib/ctypes/util.py 2019-06-20 18:51:39.612970779 +0200 | ||
@@ -70,7 +70,14 @@ | ||
def find_library(name): | ||
return name | ||
|
||
-if os.name == "posix" and sys.platform == "darwin": | ||
+# 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): | ||
possible = ['lib%s.dylib' % name, |