Skip to content

Commit 6c8df60

Browse files
committed
fix hard coded python2 path in sdl2 Android.mk
1 parent 903d661 commit 6c8df60

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

pythonforandroid/bootstraps/sdl2/build/jni/src/Android.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ LOCAL_C_INCLUDES := $(LOCAL_PATH)/$(SDL_PATH)/include
1212
LOCAL_SRC_FILES := $(SDL_PATH)/src/main/android/SDL_android_main.c \
1313
start.c
1414

15-
LOCAL_CFLAGS += -I$(LOCAL_PATH)/../../../../other_builds/python2/$(ARCH)/python2/python-install/include/python2.7
15+
LOCAL_CFLAGS += -I$(LOCAL_PATH)/../../../../other_builds/$(PYTHON2_NAME)/$(ARCH)/python2/python-install/include/python2.7
1616

1717
LOCAL_SHARED_LIBRARIES := SDL2
1818

1919
LOCAL_LDLIBS := -lGLESv1_CM -lGLESv2 -llog -lpython2.7
2020

21-
LOCAL_LDFLAGS += -L$(LOCAL_PATH)/../../../../other_builds/python2/$(ARCH)/python2/python-install/lib $(APPLICATION_ADDITIONAL_LDFLAGS)
21+
LOCAL_LDFLAGS += -L$(LOCAL_PATH)/../../../../other_builds/$(PYTHON2_NAME)/$(ARCH)/python2/python-install/lib $(APPLICATION_ADDITIONAL_LDFLAGS)
2222

2323
include $(BUILD_SHARED_LIBRARY)

pythonforandroid/recipes/sdl2/__init__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@ def prebuild_arch(self, arch):
2121
self.apply_patch('add_nativeSetEnv.patch', arch.arch)
2222
shprint(sh.touch, join(build_dir, '.patched'))
2323

24+
def get_recipe_env(self, arch=None):
25+
env = super(LibSDL2Recipe, self).get_recipe_env(arch)
26+
py2 = self.get_recipe('python2', arch.ctx)
27+
env['PYTHON2_NAME'] = py2.get_dir_name()
28+
return env
29+
2430
def build_arch(self, arch):
2531
env = self.get_recipe_env(arch)
2632

pythonforandroid/toolchain.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1809,9 +1809,13 @@ def get_build_container_dir(self, arch):
18091809
This returns a different directory depending on what
18101810
alternative or optional dependencies are being built.
18111811
'''
1812+
dir_name = self.get_dir_name()
1813+
return join(self.ctx.build_dir, 'other_builds', dir_name, arch)
1814+
1815+
def get_dir_name(self):
18121816
choices = self.check_recipe_choices()
18131817
dir_name = '-'.join([self.name] + choices)
1814-
return join(self.ctx.build_dir, 'other_builds', dir_name, arch)
1818+
return dir_name
18151819

18161820
def get_build_dir(self, arch):
18171821
'''Given the arch name, returns the directory where the

0 commit comments

Comments
 (0)