Skip to content

Commit

Permalink
Updated pyjnius patch for Webview boostrao
Browse files Browse the repository at this point in the history
  • Loading branch information
misl6 committed May 28, 2022
1 parent 81d6f8a commit 288008a
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 22 deletions.
4 changes: 4 additions & 0 deletions pythonforandroid/recipes/pyjnius/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ class PyjniusRecipe(CythonRecipe):

patches = [('genericndkbuild_jnienv_getter.patch', will_build('genericndkbuild'))]

def apply_patches(self, arch, build_dir=None):
srbang
return super().apply_patches(arch, build_dir)

def get_recipe_env(self, arch):
env = super().get_recipe_env(arch)
# NDKPLATFORM is our switch for detecting Android platform, so can't be None
Expand Down
Original file line number Diff line number Diff line change
@@ -1,26 +1,24 @@
diff --git a/jnius/jnius_jvm_android.pxi b/jnius/jnius_jvm_android.pxi
index ac89fec..71daa43 100644
--- a/jnius/jnius_jvm_android.pxi
+++ b/jnius/jnius_jvm_android.pxi
@@ -1,5 +1,5 @@
diff -Naur pyjnius.orig/jnius/env.py pyjnius/jnius/env.py
--- pyjnius.orig/jnius/env.py 2022-05-28 11:16:02.000000000 +0200
+++ pyjnius/jnius/env.py 2022-05-28 11:18:30.000000000 +0200
@@ -268,7 +268,7 @@

class AndroidJavaLocation(UnixJavaLocation):
def get_libraries(self):
- return ['SDL2', 'log']
+ return ['main', 'log']

def get_include_dirs(self):
# When cross-compiling for Android, we should not use the include dirs
diff -Naur pyjnius.orig/jnius/jnius_jvm_android.pxi pyjnius/jnius/jnius_jvm_android.pxi
--- pyjnius.orig/jnius/jnius_jvm_android.pxi 2022-05-28 11:16:02.000000000 +0200
+++ pyjnius/jnius/jnius_jvm_android.pxi 2022-05-28 11:17:17.000000000 +0200
@@ -1,6 +1,6 @@
# on android, rely on SDL to get the JNI env
-cdef extern JNIEnv *SDL_ANDROID_GetJNIEnv()
-cdef extern JNIEnv *SDL_AndroidGetJNIEnv()
+cdef extern JNIEnv *WebView_AndroidGetJNIEnv()

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

def get_libraries(platform):
if platform == 'android':
# for android, we use SDL...
- return ['sdl', 'log']
+ return ['main', 'log']

elif platform == 'win32':
return ['jvm']

cdef JNIEnv *get_platform_jnienv() except NULL:
- return <JNIEnv*>SDL_AndroidGetJNIEnv()
+ return <JNIEnv*>WebView_AndroidGetJNIEnv()

0 comments on commit 288008a

Please sign in to comment.