Skip to content

Commit 229b0ef

Browse files
committed
Merge branch 'KeyWeeUsr-fix_unpack_dir'
2 parents 3e5e576 + 7aee014 commit 229b0ef

File tree

9 files changed

+13
-7
lines changed

9 files changed

+13
-7
lines changed

pythonforandroid/bootstraps/pygame/build/src/org/renpy/android/SDLSurfaceView.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -706,6 +706,7 @@ public void run() {
706706
nativeResize(mWidth, mHeight);
707707
nativeInitJavaCallbacks();
708708
nativeSetEnv("ANDROID_PRIVATE", mFilesDirectory);
709+
nativeSetEnv("ANDROID_UNPACK", mFilesDirectory);
709710
nativeSetEnv("ANDROID_ARGUMENT", mArgument);
710711
nativeSetEnv("ANDROID_APP_PATH", mArgument);
711712
nativeSetEnv("PYTHONOPTIMIZE", "2");

pythonforandroid/bootstraps/sdl2/build/src/org/kivy/android/PythonActivity.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ protected void onPostExecute(String result) {
172172
String mFilesDirectory = mActivity.getFilesDir().getAbsolutePath();
173173
Log.v(TAG, "Setting env vars for start.c and Python to use");
174174
SDLActivity.nativeSetEnv("ANDROID_PRIVATE", mFilesDirectory);
175+
SDLActivity.nativeSetEnv("ANDROID_UNPACK", app_root_dir);
175176
SDLActivity.nativeSetEnv("PYTHONHOME", app_root_dir);
176177
SDLActivity.nativeSetEnv("PYTHONPATH", app_root_dir + ":" + app_root_dir + "/lib");
177178
SDLActivity.nativeSetEnv("PYTHONOPTIMIZE", "2");

pythonforandroid/bootstraps/service_only/build/src/org/kivy/android/PythonService.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ public abstract class PythonService extends Service implements Runnable {
2626
private String pythonName;
2727
private String pythonHome;
2828
private String pythonPath;
29+
private String androidUnpack;
2930
private String serviceEntrypoint;
3031
private String pythonServiceArgument;
3132

@@ -70,6 +71,7 @@ public int onStartCommand(Intent intent, int flags, int startId) {
7071
pythonName = extras.getString("pythonName");
7172
pythonHome = extras.getString("pythonHome");
7273
pythonPath = extras.getString("pythonPath");
74+
androidUnpack = extras.getString("androidUnpack");
7375
pythonServiceArgument = extras.getString("pythonServiceArgument");
7476

7577
Log.v(TAG, "Starting Python thread");
@@ -127,7 +129,7 @@ public void onDestroy() {
127129
public void run() {
128130
PythonUtil.loadLibraries(getFilesDir());
129131
nativeStart(androidPrivate, androidArgument, serviceEntrypoint, pythonName, pythonHome,
130-
pythonPath, pythonServiceArgument);
132+
pythonPath, pythonServiceArgument, androidUnpack);
131133
stopSelf();
132134
}
133135

@@ -143,5 +145,5 @@ public void run() {
143145
public static native void nativeStart(String androidPrivate, String androidArgument,
144146
String serviceEntrypoint, String pythonName,
145147
String pythonHome, String pythonPath,
146-
String pythonServiceArgument);
148+
String pythonServiceArgument, String androidUnpack);
147149
}

pythonforandroid/bootstraps/service_only/build/templates/Service.tmpl.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ public static void start(Context ctx, String pythonServiceArgument) {
4040
intent.putExtra("serviceDescription", "");
4141
intent.putExtra("pythonName", "{{ name }}");
4242
intent.putExtra("pythonHome", argument);
43+
intent.putExtra("androidUnpack", argument);
4344
intent.putExtra("pythonPath", argument + ":" + argument + "/lib");
4445
intent.putExtra("pythonServiceArgument", pythonServiceArgument);
4546
ctx.startService(intent);

pythonforandroid/bootstraps/webview/build/src/org/kivy/android/PythonActivity.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ public boolean shouldOverrideUrlLoading(WebView view, String url) {
158158
PythonActivity.nativeSetEnv("ANDROID_PRIVATE", mFilesDirectory);
159159
PythonActivity.nativeSetEnv("ANDROID_ARGUMENT", mFilesDirectory);
160160
PythonActivity.nativeSetEnv("ANDROID_APP_PATH", mFilesDirectory);
161+
PythonActivity.nativeSetEnv("ANDROID_UNPACK", mFilesDirectory);
161162
PythonActivity.nativeSetEnv("ANDROID_ENTRYPOINT", "main.pyo");
162163
PythonActivity.nativeSetEnv("PYTHONHOME", mFilesDirectory);
163164
PythonActivity.nativeSetEnv("PYTHONPATH", mFilesDirectory + ":" + mFilesDirectory + "/lib");

pythonforandroid/recipes/flask/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class FlaskRecipe(PythonRecipe):
99
# 0.10.1 at least for now
1010
url = 'https://github.com/pallets/flask/archive/{version}.zip'
1111

12-
depends = [('python2', 'python3crystax'), 'setuptools']
12+
depends = [('python2', 'python3crystax'), 'setuptools', 'genericndkbuild']
1313

1414
python_depends = ['jinja2', 'werkzeug', 'markupsafe', 'itsdangerous', 'click']
1515

pythonforandroid/recipes/pyjnius/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ 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', 'genericndkbuild'), 'six']
12+
depends = [('python2', 'python3crystax'), ('genericndkbuild', 'sdl2', 'sdl'), 'six']
1313
site_packages_name = 'jnius'
1414

1515
patches = [('sdl2_jnienv_getter.patch', will_build('sdl2')),

pythonforandroid/recipes/python2/patches/custom-loader.patch

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
+
1818
+ /* Ensure we have access to libpymodules. */
1919
+ if (libpymodules == -1) {
20-
+ printf("ANDROID_APP_PATH = %s\n", getenv("ANDROID_APP_PATH"));
21-
+ PyOS_snprintf(pathbuf, sizeof(pathbuf), "%s/libpymodules.so", getenv("ANDROID_APP_PATH"));
20+
+ printf("ANDROID_UNPACK = %s\n", getenv("ANDROID_UNPACK"));
21+
+ PyOS_snprintf(pathbuf, sizeof(pathbuf), "%s/libpymodules.so", getenv("ANDROID_UNPACK"));
2222
+ libpymodules = dlopen(pathbuf, RTLD_NOW);
2323
+
2424
+ if (libpymodules == NULL) {

testapps/setup_pygame.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from setuptools import find_packages
44

55
options = {'apk': {'debug': None,
6-
'requirements': 'pygame,pyjnius,kivy,python2',
6+
'requirements': 'pygame,pyjnius,kivy,python2,android',
77
'android-api': 19,
88
'ndk-dir': '/home/asandy/android/crystax-ndk-10.3.2',
99
'dist-name': 'bdisttest_pygame',

0 commit comments

Comments
 (0)