Skip to content

Commit 5304fea

Browse files
authored
update pyjnius recipe (#2036)
1 parent 3a155e3 commit 5304fea

File tree

3 files changed

+27
-24
lines changed

3 files changed

+27
-24
lines changed

pythonforandroid/recipes/pyjnius/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
class PyjniusRecipe(CythonRecipe):
99
# "6553ad4" is one commit after last release (1.2.0)
1010
# it fixes method resolution, required for resolving requestPermissions()
11-
version = '6553ad4'
11+
version = '1.2.1'
1212
url = 'https://github.com/kivy/pyjnius/archive/{version}.zip'
1313
name = 'pyjnius'
1414
depends = [('genericndkbuild', 'sdl2'), 'six']

pythonforandroid/recipes/pyjnius/genericndkbuild_jnienv_getter.patch

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,17 @@ index ac89fec..71daa43 100644
1010
cdef JNIEnv *get_platform_jnienv():
1111
- return SDL_ANDROID_GetJNIEnv()
1212
+ return <JNIEnv*>WebView_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:
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:
1817

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
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+

pythonforandroid/recipes/pyjnius/sdl2_jnienv_getter.patch

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,18 @@ index ac89fec..71daa43 100644
1010
cdef JNIEnv *get_platform_jnienv():
1111
- return SDL_ANDROID_GetJNIEnv()
1212
+ return <JNIEnv*>SDL_AndroidGetJNIEnv()
13-
diff --git a/setup.py b/setup.py
13+
diff --git a/env.py b/env.py
1414
index 740510f..0c8e55f 100644
15-
--- a/setup.py
16-
+++ b/setup.py
17-
@@ -53,7 +53,7 @@ except ImportError:
15+
--- a/jnius/env.py
16+
+++ b/jnius/env.py
17+
@@ -185,10 +185,10 @@ except ImportError:
1818

19-
if PLATFORM == 'android':
20-
# for android, we use SDL...
21-
- LIBRARIES = ['sdl', 'log']
22-
+ LIBRARIES = ['SDL2', 'log']
23-
LIBRARY_DIRS = ['libs/' + getenv('ARCH')]
24-
elif PLATFORM == 'darwin':
25-
import subprocess
19+
def get_libraries(platform):
20+
if platform == 'android':
21+
# for android, we use SDL...
22+
- return ['sdl', 'log']
23+
+ return ['SDL2', 'log']
24+
25+
elif platform == 'win32':
26+
return ['jvm']
27+

0 commit comments

Comments
 (0)