Skip to content

Commit 13e8501

Browse files
committed
Removed more hardcoded Archs
1 parent 764ab7a commit 13e8501

File tree

3 files changed

+11
-12
lines changed

3 files changed

+11
-12
lines changed

pythonforandroid/recipes/pygame/__init__.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,21 +26,20 @@ def get_recipe_env(self, arch):
2626
ensure_dir(liblink_path)
2727
return env
2828

29-
def prebuild_armeabi(self):
30-
if exists(join(self.get_build_container_dir('armeabi'), '.patched')):
29+
def prebuild_arch(self, arch):
30+
if exists(join(self.get_build_container_dir(arch.arch), '.patched')):
3131
info('Pygame already patched, skipping.')
3232
return
3333
shprint(sh.cp, join(self.get_recipe_dir(), 'Setup'),
34-
join(self.get_build_dir('armeabi'), 'Setup'))
34+
join(self.get_build_dir(arch.arch), 'Setup'))
3535
self.apply_patch(join('patches', 'fix-surface-access.patch'), arch.arch)
3636
self.apply_patch(join('patches', 'fix-array-surface.patch'), arch.arch)
3737
self.apply_patch(join('patches', 'fix-sdl-spam-log.patch'), arch.arch)
38-
shprint(sh.touch, join(self.get_build_container_dir('armeabi'), '.patched'))
38+
shprint(sh.touch, join(self.get_build_container_dir(arch.arch), '.patched'))
3939

40-
def build_armeabi(self):
40+
def build_arch(self, arch):
4141
# AND: I'm going to ignore any extra pythonrecipe or cythonrecipe behaviour for now
4242

43-
arch = ArchARM(self.ctx)
4443
env = self.get_recipe_env(arch)
4544

4645
env['CFLAGS'] = env['CFLAGS'] + ' -I{jni_path}/png -I{jni_path}/jpeg'.format(
@@ -57,7 +56,7 @@ def build_armeabi(self):
5756

5857
env['LDSHARED'] = join(self.ctx.root_dir, 'tools', 'liblink')
5958

60-
with current_directory(self.get_build_dir('armeabi')):
59+
with current_directory(self.get_build_dir(arch.arch)):
6160
info('hostpython is ' + self.ctx.hostpython)
6261
hostpython = sh.Command(self.ctx.hostpython)
6362
shprint(hostpython, 'setup.py', 'install', '-O2', _env=env,

pythonforandroid/recipes/python2/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def do_python_build(self, arch):
9494
hostpython_recipe = Recipe.get_recipe('hostpython2', self.ctx)
9595
shprint(sh.cp, join(hostpython_recipe.get_recipe_dir(), 'Setup'), 'Modules')
9696

97-
env = ArchARM(self.ctx).get_env()
97+
env = arch.get_env()
9898

9999
# AND: Should probably move these to get_recipe_env for
100100
# neatness, but the whole recipe needs tidying along these

pythonforandroid/recipes/sdl/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,22 @@ class LibSDLRecipe(NDKRecipe):
99
depends = ['python2', 'pygame_bootstrap_components']
1010
conflicts = ['sdl2']
1111

12-
def build_armeabi(self):
12+
def build_arch(self, arch):
1313

1414
if exists(join(self.ctx.libs_dir, 'libsdl.so')):
1515
info('libsdl.so already exists, skipping sdl build.')
1616
return
1717

18-
env = ArchARM(self.ctx).get_env()
18+
env = arch.get_env()
1919

2020
with current_directory(self.get_jni_dir()):
2121
shprint(sh.ndk_build, 'V=1', _env=env, _tail=20, _critical=True)
2222

23-
libs_dir = join(self.ctx.bootstrap.build_dir, 'libs', 'armeabi')
23+
libs_dir = join(self.ctx.bootstrap.build_dir, 'libs', arch.arch)
2424
import os
2525
contents = list(os.walk(libs_dir))[0][-1]
2626
for content in contents:
27-
shprint(sh.cp, '-a', join(self.ctx.bootstrap.build_dir, 'libs', 'armeabi', content),
27+
shprint(sh.cp, '-a', join(self.ctx.bootstrap.build_dir, 'libs', arch.arch, content),
2828
self.ctx.libs_dir)
2929

3030

0 commit comments

Comments
 (0)