8000 Merge branch 'arch_support' of github.com:kivy/python-for-android int… · germn/python-for-android@5298c7f · GitHub 8000
[go: up one dir, main page]

Skip to content

Commit 5298c7f

Browse files
committed
Merge branch 'arch_support' of github.com:kivy/python-for-android into feature-hostpython-invoke
Conflicts: pythonforandroid/toolchain.py
2 parents 93cdb23 + d44be85 commit 5298c7f

File tree

28 files changed

+219
-139
lines changed

28 files changed

+219
-139
lines changed

pythonforandroid/bootstraps/empty/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from pythonforandroid.toolchain import Bootstrap, shprint, current_directory, info, warning, ArchAndroid, logger, info_main, which
1+
from pythonforandroid.toolchain import Bootstrap, shprint, current_directory, info, warning, ArchARM, logger, info_main, which
22
from os.path import join, exists
33
from os import walk
44
import glob

pythonforandroid/bootstraps/pygame/__init__.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from pythonforandroid.toolchain import Bootstrap, shprint, current_directory, info, warning, ArchAndroid, info_main
1+
from pythonforandroid.toolchain import Bootstrap, shprint, current_directory, info, warning, ArchARM, info_main
22
from os.path import join, exists
33
from os import walk
44
import glob
@@ -19,8 +19,10 @@ def run_distribute(self):
1919
# self.name)
2020
src_path = join(self.bootstrap_dir, 'build')
2121

22-
# AND: Hardcoding armeabi - naughty!
23-
arch = ArchAndroid(self.ctx)
22+
arch = self.ctx.archs[0]
23+
if len(self.ctx.archs) > 1:
24+
raise ValueError('built for more than one arch, but bootstrap cannot handle that yet')
25+
info('Bootstrap running with arch {}'.format(arch))
2426

2527
with current_directory(self.dist_dir):
2628

@@ -58,7 +60,7 @@ def run_distribute(self):
5860
shprint(sh.mkdir, '-p', join('private', 'include', 'python2.7'))
5961

6062
# AND: Copylibs stuff should go here
61-
shprint(sh.mv, join('libs', 'armeabi', 'libpymodules.so'), 'private/')
63+
shprint(sh.mv, join('libs', arch.arch, 'libpymodules.so'), 'private/')
6264
shprint(sh.cp, join('python-install', 'include' , 'python2.7', 'pyconfig.h'), join('private', 'include', 'python2.7/'))
6365

6466
info('Removing some unwanted files')

pythonforandroid/bootstraps/pygame/build/jni/application/Android.mk

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ LOCAL_CFLAGS := $(foreach D, $(APP_SUBDIRS), -I$(LOCAL_PATH)/$(D)) \
1818
-I$(LOCAL_PATH)/../jpeg \
1919
-I$(LOCAL_PATH)/../intl \
2020
-I$(LOCAL_PATH)/.. \
21-
-I$(LOCAL_PATH)/../../../../other_builds/python2/armeabi/python2/python-install/include/python2.7
21+
-I$(LOCAL_PATH)/../../../../other_builds/python2/$ARCH/python2/python-install/include/python2.7
2222
# -I$(LOCAL_PATH)/../../../../python-install/include/python2.7
2323
# -I$(LOCAL_PATH)/../../../build/python-install/include/python2.7
2424

@@ -39,7 +39,8 @@ LOCAL_STATIC_LIBRARIES := jpeg png
3939
LOCAL_LDLIBS := -lpython2.7 -lGLESv1_CM -ldl -llog -lz
4040

4141
# AND: Another hardcoded path that should be templated
42-
LOCAL_LDFLAGS += -L$(LOCAL_PATH)/../../../../other_builds/python2/armeabi/python2/python-install/lib $(APPLICATION_ADDITIONAL_LDFLAGS)
42+
# AND: NOT TEMPALTED! We can use $ARCH
43+
LOCAL_LDFLAGS += -L$(LOCAL_PATH)/../../../../other_builds/python2/$ARCH/python2/python-install/lib $(APPLICATION_ADDITIONAL_LDFLAGS)
4344

4445
LIBS_WITH_LONG_SYMBOLS := $(strip $(shell \
4546
for f in $(LOCAL_PATH)/../../libs/$ARCH/*.so ; do \

pythonforandroid/bootstraps/sdl2/__init__.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from pythonforandroid.toolchain import Bootstrap, shprint, current_directory, info, warning, ArchAndroid, info_main
1+
from pythonforandroid.toolchain import Bootstrap, shprint, current_directory, info, warning, ArchARM, info_main
22
from os.path import join, exists
33
from os import walk
44
import glob
@@ -21,7 +21,10 @@ def run_distribute(self):
2121
fileh.write('sdk.dir={}'.format(self.ctx.sdk_dir))
2222

2323
# AND: Hardcoding armeabi - naughty!
24-
arch = ArchAndroid(self.ctx)
24+
arch = self.ctx.archs[0]
25+
if len(self.ctx.archs) > 1:
26+
raise ValueError('built for more than one arch, but bootstrap cannot handle that yet')
27+
info('Bootstrap running with arch {}'.format(arch))
2528

2629
with current_directory(self.dist_dir):
2730
info('Copying python distribution')
@@ -32,7 +35,6 @@ def run_distribute(self):
3235
shprint(sh.mkdir, 'assets')
3336

3437
hostpython = sh.Command(self.ctx.hostpython)
35-
# AND: This *doesn't* need to be in arm env?
3638
shprint(hostpython, '-OO', '-m', 'compileall',
3739
self.ctx.get_python_install_dir(),
3840
_tail=10, _filterout="^Listing", _critical=True)
@@ -50,8 +52,8 @@ def run_distribute(self):
5052
shprint(sh.mkdir, '-p', join('private', 'include', 'python2.7'))
5153

5254
# AND: Copylibs stuff should go here
53-
if exists(join('libs', 'armeabi', 'libpymodules.so')):
54-
shprint(sh.mv, join('libs', 'armeabi', 'libpymodules.so'), 'private/')
55+
if exists(join('libs', arch.arch, 'libpymodules.so')):
56+
shprint(sh.mv, join('libs', arch.arch, 'libpymodules.so'), 'private/')
5557
shprint(sh.cp, join('python-install', 'include' , 'python2.7', 'pyconfig.h'), join('private', 'include', 'python2.7/'))
5658

5759
info('Removing some unwanted files')

pythonforandroid/bootstraps/sdl2/build/jni/Application.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
# APP_STL := stlport_static
55

66
# APP_ABI := armeabi armeabi-v7a x86
7-
APP_ABI := armeabi
7+
APP_ABI := $(ARCH)

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/armeabi/python2/python-install/include/python2.7
15+
LOCAL_CFLAGS += -I$(LOCAL_PATH)/../../../../other_builds/python2/$(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/armeabi/python2/python-install/lib $(APPLICATION_ADDITIONAL_LDFLAGS)
21+
LOCAL_LDFLAGS += -L$(LOCAL_PATH)/../../../../other_builds/python2/$(ARCH)/python2/python-install/lib $(APPLICATION_ADDITIONAL_LDFLAGS)
2222

2323
include $(BUILD_SHARED_LIBRARY)

pythonforandroid/bootstraps/sdl2python3/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from pythonforandroid.toolchain import Bootstrap, shprint, current_directory, info, warning, ArchAndroid, info_main
1+
from pythonforandroid.toolchain import Bootstrap, shprint, current_directory, info, warning, ArchARM, info_main
22
from os.path import join, exists
33
from os import walk
44
import glob
@@ -23,7 +23,7 @@ def run_distribute(self):
2323
fileh.write('sdk.dir={}'.format(self.ctx.sdk_dir))
2424

2525
# AND: Hardcoding armeabi - naughty!
26-
arch = ArchAndroid(self.ctx)
26+
arch = ArchARM(self.ctx)
2727

2828
with current_directory(self.dist_dir):
2929
info('Copying python distribution')

pythonforandroid/recipes/android/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
from pythonforandroid.toolchain import CythonRecipe, shprint, ensure_dir, current_directory, ArchAndroid, IncludedFilesBehaviour
2+
from pythonforandroid.toolchain import CythonRecipe, shprint, ensure_dir, current_directory, ArchARM, IncludedFilesBehaviour
33
import sh
44
from os.path import exists, join
55

pythonforandroid/recipes/freetype/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
from pythonforandroid.toolchain import Recipe, shprint, get_directory, current_directory, ArchAndroid
2+
from pythonforandroid.toolchain import Recipe, shprint, get_directory, current_directory, ArchARM
33
from os.path import exists, join, realpath
44
from os import uname
55
import glob

pythonforandroid/recipes/harfbuzz/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
from pythonforandroid.toolchain import Recipe, shprint, get_directory, current_directory, ArchAndroid
2+
from pythonforandroid.toolchain import Recipe, shprint, get_directory, current_directory, ArchARM
33
from os.path import exists, join, realpath
44
from os import uname
55
import glob

0 commit comments

Comments
 (0)
0