From 6c8df6022cb288daf6cfa742eff6ab068c1b9562 Mon Sep 17 00:00:00 2001 From: Ryan Pessa Date: Wed, 9 Dec 2015 17:10:36 -0600 Subject: [PATCH] fix hard coded python2 path in sdl2 Android.mk --- pythonforandroid/bootstraps/sdl2/build/jni/src/Android.mk | 4 ++-- pythonforandroid/recipes/sdl2/__init__.py | 6 ++++++ pythonforandroid/toolchain.py | 6 +++++- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/pythonforandroid/bootstraps/sdl2/build/jni/src/Android.mk b/pythonforandroid/bootstraps/sdl2/build/jni/src/Android.mk index 6cc877137b..6c90a3b818 100644 --- a/pythonforandroid/bootstraps/sdl2/build/jni/src/Android.mk +++ b/pythonforandroid/bootstraps/sdl2/build/jni/src/Android.mk @@ -12,12 +12,12 @@ LOCAL_C_INCLUDES := $(LOCAL_PATH)/$(SDL_PATH)/include LOCAL_SRC_FILES := $(SDL_PATH)/src/main/android/SDL_android_main.c \ start.c -LOCAL_CFLAGS += -I$(LOCAL_PATH)/../../../../other_builds/python2/$(ARCH)/python2/python-install/include/python2.7 +LOCAL_CFLAGS += -I$(LOCAL_PATH)/../../../../other_builds/$(PYTHON2_NAME)/$(ARCH)/python2/python-install/include/python2.7 LOCAL_SHARED_LIBRARIES := SDL2 LOCAL_LDLIBS := -lGLESv1_CM -lGLESv2 -llog -lpython2.7 -LOCAL_LDFLAGS += -L$(LOCAL_PATH)/../../../../other_builds/python2/$(ARCH)/python2/python-install/lib $(APPLICATION_ADDITIONAL_LDFLAGS) +LOCAL_LDFLAGS += -L$(LOCAL_PATH)/../../../../other_builds/$(PYTHON2_NAME)/$(ARCH)/python2/python-install/lib $(APPLICATION_ADDITIONAL_LDFLAGS) include $(BUILD_SHARED_LIBRARY) diff --git a/pythonforandroid/recipes/sdl2/__init__.py b/pythonforandroid/recipes/sdl2/__init__.py index 9edec09842..16453921de 100644 --- a/pythonforandroid/recipes/sdl2/__init__.py +++ b/pythonforandroid/recipes/sdl2/__init__.py @@ -21,6 +21,12 @@ def prebuild_arch(self, arch): self.apply_patch('add_nativeSetEnv.patch', arch.arch) shprint(sh.touch, join(build_dir, '.patched')) + def get_recipe_env(self, arch=None): + env = super(LibSDL2Recipe, self).get_recipe_env(arch) + py2 = self.get_recipe('python2', arch.ctx) + env['PYTHON2_NAME'] = py2.get_dir_name() + return env + def build_arch(self, arch): env = self.get_recipe_env(arch) diff --git a/pythonforandroid/toolchain.py b/pythonforandroid/toolchain.py index a99646f767..5c4576ed98 100755 --- a/pythonforandroid/toolchain.py +++ b/pythonforandroid/toolchain.py @@ -1809,9 +1809,13 @@ def get_build_container_dir(self, arch): This returns a different directory depending on what alternative or optional dependencies are being built. ''' + dir_name = self.get_dir_name() + return join(self.ctx.build_dir, 'other_builds', dir_name, arch) + + def get_dir_name(self): choices = self.check_recipe_choices() dir_name = '-'.join([self.name] + choices) - return join(self.ctx.build_dir, 'other_builds', dir_name, arch) + return dir_name def get_build_dir(self, arch): '''Given the arch name, returns the directory where the