Skip to content

Commit 1bec42f

Browse files
committed
Fixed arch pass-through in more places
1 parent 480fb46 commit 1bec42f

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

pythonforandroid/recipes/python2/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def prebuild_arch(self, arch):
5151
def build_arch(self, arch):
5252

5353
if not exists(join(self.get_build_dir(arch.arch), 'libpython2.7.so')):
54-
self.do_python_build()
54+
self.do_python_build(arch)
5555

5656
if not exists(self.ctx.get_python_install_dir()):
5757
shprint(sh.cp, '-a', join(self.get_build_dir(arch.arch), 'python-install'),
@@ -77,7 +77,7 @@ def build_arch(self, arch):
7777

7878
# return
7979

80-
def do_python_build(self):
80+
def do_python_build(self, arch):
8181
if 'sqlite' in self.ctx.recipe_build_order:
8282
print('sqlite support not yet enabled in python recipe')
8383
exit(1)

pythonforandroid/toolchain.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -533,12 +533,13 @@ class ArchARM(Arch):
533533
arch = "armeabi"
534534

535535
class ArchARMv7_a(ArchARM):
536-
arch = 'armeabi-v7'
536+
arch = 'armeabi-v7a'
537537

538538
def get_env(self):
539539
env = super(ArchARMv7_a, self).get_env()
540540
env['CFLAGS'] = env['CFLAGS'] + ' -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -mthumb'
541541
env['CXXFLAGS'] = env['CFLAGS']
542+
return env
542543

543544
class Archx86(Arch):
544545
arch = 'x86'
@@ -1918,7 +1919,7 @@ def unpack(self, arch):
19181919
ensure_dir(build_dir)
19191920
# shprint(sh.ln, '-s', user_dir,
19201921
# join(build_dir, get_directory(self.versioned_url)))
1921-
shprint(sh.git, 'clone', user_dir, self.get_build_dir('armeabi'))
1922+
shprint(sh.git, 'clone', user_dir, self.get_build_dir(arch))
19221923
return
19231924

19241925
if self.url is None:
@@ -2225,16 +2226,16 @@ def build_arch(self, arch):
22252226
'''Install the Python module by calling setup.py install with
22262227
the target Python dir.'''
22272228
super(PythonRecipe, self).build_arch(arch)
2228-
self.install_python_package()
2229+
self.install_python_package(arch)
22292230
# @cache_execution
22302231
# def install(self):
22312232
# self.install_python_package()
22322233
# self.reduce_python_package()
22332234

2234-
def install_python_package(self, name=None, env=None, is_dir=True):
2235+
def install_python_package(self, arch, name=None, env=None, is_dir=True):
22352236
'''Automate the installation of a Python package (or a cython
22362237
package where the cython components are pre-built).'''
2237-
arch = self.filtered_archs[0]
2238+
# arch = self.filtered_archs[0] # old kivy-ios way
22382239
if name is None:
22392240
name = self.name
22402241
if env is None:
@@ -2276,7 +2277,7 @@ def build_arch(self, arch):
22762277
# # after everything else but isn't
22772278
# # used by a normal recipe.
22782279
self.build_compiled_components(arch)
2279-
self.install_python_package()
2280+
self.install_python_package(arch)
22802281

22812282
def build_compiled_components(self, arch):
22822283
info('Building compiled components in {}'.format(self.name))
@@ -2305,7 +2306,7 @@ def build_arch(self, arch):
23052306
# # after everything else but isn't
23062307
# # used by a normal recipe.
23072308
self.build_cython_components(arch)
2308-
self.install_python_package()
2309+
self.install_python_package(arch)
23092310

23102311
def build_cython_components(self, arch):
23112312
# AND: Should we use tito's cythonize methods? How do they work?
@@ -2322,7 +2323,7 @@ def build_cython_components(self, arch):
23222323
info('{} first build failed (as expected)'.format(self.name))
23232324

23242325
info('Running cython where appropriate')
2325-
shprint(sh.find, self.get_build_dir('armeabi'), '-iname', '*.pyx',
2326+
shprint(sh.find, self.get_build_dir(arch.arch), '-iname', '*.pyx',
23262327
'-exec', self.ctx.cython, '{}', ';', _env=env)
23272328
info('ran cython')
23282329

@@ -2490,6 +2491,7 @@ def biglink(ctx, arch):
24902491

24912492
# AND: Shouldn't hardcode Arch! In reality need separate
24922493
# build dirs for each arch
2494+
raise ValueError('hardcoded Arch to fix!')
24932495
arch = ArchARM(ctx)
24942496
env = ArchARM(ctx).get_env()
24952497
env['LDFLAGS'] = env['LDFLAGS'] + ' -L{}'.format(

0 commit comments

Comments
 (0)