Skip to content

Commit 345057c

Browse files
committed
Fixed pyjnius build with webviewjni
1 parent 7106409 commit 345057c

File tree

3 files changed

+29
-3
lines changed

3 files changed

+29
-3
lines changed

pythonforandroid/recipes/pyjnius/__init__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@ class PyjniusRecipe(CythonRecipe):
99
version = 'master'
1010
url = 'https://github.com/kivy/pyjnius/archive/{version}.zip'
1111
name = 'pyjnius'
12-
depends = [('python2', 'python3crystax'), ('sdl2', 'sdl'), 'six']
12+
depends = [('python2', 'python3crystax'), ('sdl2', 'sdl', 'webviewjni'), 'six']
1313
site_packages_name = 'jnius'
1414

15-
patches = [('sdl2_jnienv_getter.patch', will_build('sdl2'))]
15+
patches = [('sdl2_jnienv_getter.patch', will_build('sdl2')),
16+
('webviewjni_jnienv_getter.patch', will_build('webviewjni'))]
1617

1718
def postbuild_arch(self, arch):
1819
super(PyjniusRecipe, self).postbuild_arch(arch)
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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 @@
6+
# on android, rely on SDL to get the JNI env
7+
-cdef extern JNIEnv *SDL_ANDROID_GetJNIEnv()
8+
+cdef extern JNIEnv *SDL_AndroidGetJNIEnv()
9+
10+
cdef JNIEnv *get_platform_jnienv():
11+
- return SDL_ANDROID_GetJNIEnv()
12+
+ return <JNIEnv*>SDL_AndroidGetJNIEnv()
13+
diff --git a/setup.py b/setup.py
14+
index 740510f..0c8e55f 100644
15+
--- a/setup.py
16+
+++ b/setup.py
17+
@@ -53,7 +53,7 @@ except ImportError:
18+
19+
if platform == 'android':
20+
# for android, we use SDL...
21+
- libraries = ['sdl', 'log']
22+
+ libraries = ['main', 'log']
23+
library_dirs = ['libs/' + getenv('ARCH')]
24+
elif platform == 'darwin':
25+
import subprocess

pythonforandroid/recipes/webviewjni/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class WebViewJNIRecipe(BootstrapNDKRecipe):
88
url = None
99

1010
depends = [('python2', 'python3crystax')]
11-
conflicts = ['sdl2', 'pygame']
11+
conflicts = ['sdl2', 'pygame', 'sdl']
1212

1313
def should_build(self, arch):
1414
return True

0 commit comments

Comments
 (0)