Skip to content

Commit 41b946e

Browse files
committed
Updated pyjnius patch for Webview boostrao
1 parent 81d6f8a commit 41b946e

File tree

1 file changed

+20
-22
lines changed

1 file changed

+20
-22
lines changed
Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,24 @@
1-
diff --git a/jnius/jnius_jvm_android.pxi b/jnius/jnius_jvm_android.pxi
2-
index ac89fec..71daa43 100644
3-
--- a/jnius/jnius_jvm_android.pxi
4-
+++ b/jnius/jnius_jvm_android.pxi
5-
@@ -1,5 +1,5 @@
1+
diff -Naur pyjnius.orig/jnius/env.py pyjnius/jnius/env.py
2+
--- pyjnius.orig/jnius/env.py 2022-05-28 11:16:02.000000000 +0200
3+
+++ pyjnius/jnius/env.py 2022-05-28 11:18:30.000000000 +0200
4+
@@ -268,7 +268,7 @@
5+
6+
class AndroidJavaLocation(UnixJavaLocation):
7+
def get_libraries(self):
8+
- return ['SDL2', 'log']
9+
+ return ['main', 'log']
10+
11+
def get_include_dirs(self):
12+
# When cross-compiling for Android, we should not use the include dirs
13+
diff -Naur pyjnius.orig/jnius/jnius_jvm_android.pxi pyjnius/jnius/jnius_jvm_android.pxi
14+
--- pyjnius.orig/jnius/jnius_jvm_android.pxi 2022-05-28 11:16:02.000000000 +0200
15+
+++ pyjnius/jnius/jnius_jvm_android.pxi 2022-05-28 11:17:17.000000000 +0200
16+
@@ -1,6 +1,6 @@
617
# on android, rely on SDL to get the JNI env
7-
-cdef extern JNIEnv *SDL_ANDROID_GetJNIEnv()
18+
-cdef extern JNIEnv *SDL_AndroidGetJNIEnv()
819
+cdef extern JNIEnv *WebView_AndroidGetJNIEnv()
920

10-
cdef JNIEnv *get_platform_jnienv():
11-
- return SDL_ANDROID_GetJNIEnv()
12-
+ return <JNIEnv*>WebView_AndroidGetJNIEnv()
13-
diff --git a/jnius/env.py b/jnius/env.py
14-
--- a/jnius/env.py
15-
+++ b/jnius/env.py
16-
@@ -185,10 +185,10 @@ except ImportError:
1721

18-
def get_libraries(platform):
19-
if platform == 'android':
20-
# for android, we use SDL...
21-
- return ['sdl', 'log']
22-
+ return ['main', 'log']
23-
24-
elif platform == 'win32':
25-
return ['jvm']
26-
22+
cdef JNIEnv *get_platform_jnienv() except NULL:
23+
- return <JNIEnv*>SDL_AndroidGetJNIEnv()
24+
+ return <JNIEnv*>WebView_AndroidGetJNIEnv()

0 commit comments

Comments
 (0)