Skip to content

Commit 91b6e07

Browse files
committed
Added arch argument to should_build
1 parent a9c22fd commit 91b6e07

File tree

6 files changed

+10
-16
lines changed

6 files changed

+10
-16
lines changed

pythonforandroid/bootstraps/sdl2/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ def run_distribute(self):
2020
with open('local.properties', 'w') as fileh:
2121
fileh.write('sdk.dir={}'.format(self.ctx.sdk_dir))
2222

23-
# AND: Hardcoding armeabi - naughty!
2423
arch = self.ctx.archs[0]
2524
if len(self.ctx.archs) > 1:
2625
raise ValueError('built for more than one arch, but bootstrap cannot handle that yet')

pythonforandroid/recipes/freetype/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ class FreetypeRecipe(Recipe):
1212

1313
depends = ['harfbuzz']
1414

15-
def should_build(self):
16-
if exists(join(self.get_build_dir('armeabi'), 'objs', '.libs', 'libfreetype.so')):
15+
def should_build(self, arch):
16+
if exists(join(self.get_build_dir(arch.arch), 'objs', '.libs', 'libfreetype.so')):
1717
return False
1818
return True
1919

pythonforandroid/recipes/harfbuzz/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ class HarfbuzzRecipe(Recipe):
1010
version = '0.9.40'
1111
url = 'http://www.freedesktop.org/software/harfbuzz/release/harfbuzz-{version}.tar.bz2'
1212

13-
def should_build(self):
14-
if exists(join(self.get_build_dir('armeabi'), 'src', '.libs', 'libharfbuzz.so')):
13+
def should_build(self, arch):
14+
if exists(join(self.get_build_dir(arch.arch), 'src', '.libs', 'libharfbuzz.so')):
1515
return False
1616
return True
1717

pythonforandroid/recipes/hostpython2/__init__.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,9 @@ def get_build_dir(self, arch=None):
2323
def prebuild_arch(self, arch):
2424
# Override hostpython Setup?
2525
shprint(sh.cp, join(self.get_recipe_dir(), 'Setup'),
26-
join(self.get_build_dir('armeabi'), 'Modules', 'Setup'))
26+
join(self.get_build_dir(), 'Modules', 'Setup'))
2727

2828
def build_arch(self, arch):
29-
# AND: Should use an i386 recipe system
30-
warning('Running hostpython build. Arch is armeabi! '
31-
'This is naughty, need to fix the Arch system!')
32-
33-
# AND: Fix armeabi again
3429
with current_directory(self.get_build_dir()):
3530

3631
if exists('hostpython'):

pythonforandroid/recipes/openssl/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ class OpenSSLRecipe(Recipe):
88
version = '1.0.2d'
99
url = 'https://www.openssl.org/source/openssl-{version}.tar.gz'
1010

11-
def should_build(self):
12-
return not exists(join(self.get_build_dir('armeabi'), 'libssl.a'))
11+
def should_build(self, arch):
12+
return not exists(join(self.get_build_dir(arch.arch), 'libssl.a'))
1313

1414
def build_arch(self, arch):
1515
env = self.get_recipe_env(arch)

pythonforandroid/toolchain.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2042,7 +2042,7 @@ def prebuild_arch(self, arch):
20422042
else:
20432043
info('{} has no {}, skipping'.format(self.name, prebuild))
20442044

2045-
def should_build(self):
2045+
def should_build(self, arch):
20462046
'''Should perform any necessary test and return True only if it needs
20472047
building again.
20482048
@@ -2211,7 +2211,7 @@ def hostpython_location(self):
22112211
'hostpython')
22122212
return self.ctx.hostpython
22132213

2214-
def should_build(self):
2214+
def should_build(self, arch):
22152215
# AND: This should be different for each arch and use some
22162216
# kind of data store to know what has been built in a given
22172217
# python env
@@ -2417,7 +2417,7 @@ def build_recipes(build_order, python_modules, ctx):
24172417
info_main('# Building recipes')
24182418
for recipe in recipes:
24192419
info_main('Building {} for {}'.format(recipe.name, arch.arch))
2420-
if recipe.should_build():
2420+
if recipe.should_build(arch):
24212421
recipe.build_arch(arch)
24222422
else:
24232423
info('{} said it is already built, skipping'

0 commit comments

Comments
 (0)