8000 Made start.c search ANDROID_UNPACK for crystax · brvier/python-for-android@f385ceb · GitHub
[go: up one dir, main page]

Skip to content

Commit f385ceb

Browse files
committed
Made start.c search ANDROID_UNPACK for crystax
1 parent 57892d5 commit f385ceb

File tree

1 file changed

+9
-6
lines changed
  • pythonforandroid/bootstraps/sdl2/build/jni/src

1 file changed

+9
-6
lines changed

pythonforandroid/bootstraps/sdl2/build/jni/src/start.c

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -104,12 +104,15 @@ int main(int argc, char *argv[]) {
104104

105105
LOGP("Preparing to initialize python");
106106

107-
if (dir_exists("crystax_python/")) {
107+
char crystax_python_dir[256];
108+
snprintf(crystax_python_dir, 256,
109+
"%s/crystax_python", getenv("ANDROID_UNPACK"));
110+
if (dir_exists(crystax_python_dir)) {
108111
LOGP("crystax_python exists");
109112
char paths[256];
110113
snprintf(paths, 256,
111-
"%s/crystax_python/stdlib.zip:%s/crystax_python/modules",
112-
env_argument, env_argument);
114+
"%s/stdlib.zip:%s/modules",
115+
crystax_python_dir, crystax_python_dir);
113116
/* snprintf(paths, 256, "%s/stdlib.zip:%s/modules", env_argument,
114117
* env_argument); */
115118
LOGP("calculated paths to be...");
@@ -166,11 +169,11 @@ int main(int argc, char *argv[]) {
166169
" argument ]\n");
167170
}
168171

169-
if (dir_exists("crystax_python")) {
172+
if (dir_exists(crystax_python_dir)) {
170173
char add_site_packages_dir[256];
171174
snprintf(add_site_packages_dir, 256,
172-
"sys.path.append('%s/crystax_python/site-packages')",
173-
env_argument);
175+
"sys.path.append('%s/site-packages')",
176+
crystax_python_dir);
174177

175178
PyRun_SimpleString("import sys\n"
176179
"sys.argv = ['notaninterpreterreally']\n"

0 commit comments

Comments
 (0)
0