Skip to content

Commit 573c198

Browse files
committed
Removed references to ctx.ndk_is_crystax
1 parent 7975119 commit 573c198

File tree

5 files changed

+12
-12
lines changed

5 files changed

+12
-12
lines changed

pythonforandroid/bootstrap.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,8 +235,8 @@ def _unpack_aar(self, aar, arch):
235235

236236
def strip_libraries(self, arch):
237237
info('Stripping libraries')
238-
if self.ctx.ndk_is_crystax:
239-
info('NDK is CrystaX, skipping')
238+
if self.ctx.python_recipe.from_crystax:
239+
info('Python was loaded from CrystaX, skipping strip')
240240
return
241241
env = arch.get_env()
242242
strip = which('arm-linux-androideabi-strip', env['PATH'])

pythonforandroid/bootstraps/sdl2/__init__.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,16 @@ def run_distribute(self):
2828
with current_directory(self.dist_dir):
2929
info('Copying python distribution')
3030

31-
if not exists('private') and not self.ctx.ndk_is_crystax:
31+
if not exists('private') and not self.ctx.python_recipe.from_crystax:
3232
shprint(sh.mkdir, 'private')
33-
if not exists('crystax_python') and self.ctx.ndk_is_crystax:
33+
if not exists('crystax_python') and self.ctx.python_recipe.from_crystax:
3434
shprint(sh.mkdir, 'crystax_python')
3535
shprint(sh.mkdir, 'crystax_python/crystax_python')
3636
if not exists('assets'):
3737
shprint(sh.mkdir, 'assets')
3838

3939
hostpython = sh.Command(self.ctx.hostpython)
40-
if not self.ctx.ndk_is_crystax:
40+
if not self.ctx.python_recipe.from_crystax:
4141
shprint(hostpython, '-OO', '-m', 'compileall',
4242
self.ctx.get_python_install_dir(),
4343
_tail=10, _filterout="^Listing", _critical=True)
@@ -48,7 +48,7 @@ def run_distribute(self):
4848
self.distribute_aars(arch)
4949
self.distribute_javaclasses(self.ctx.javaclass_dir)
5050

51-
if not self.ctx.ndk_is_crystax:
51+
if not self.ctx.python_recipe.from_crystax:
5252
info('Filling private directory')
5353
if not exists(join('private', 'lib')):
5454
info('private/lib does not exist, making')
@@ -85,9 +85,10 @@ def run_distribute(self):
8585
# shprint(sh.rm, '-rf', 'lib-dynload/_ctypes_test.so')
8686
# shprint(sh.rm, '-rf', 'lib-dynload/_testcapi.so')
8787

88-
else: # NDK *is* crystax
88+
else: # Python *is* loaded from crystax
8989
ndk_dir = self.ctx.ndk_dir
90-
python_dir = join(ndk_dir, 'sources', 'python', '3.5',
90+
py_recipe = self.ctx.python_recipe
91+
python_dir = join(ndk_dir, 'sources', 'python', py_recipe.version,
9192
'libs', arch.arch)
9293

9394
shprint(sh.cp, '-r', join(python_dir, 'stdlib.zip'), 'crystax_python/crystax_python')

pythonforandroid/build.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,7 @@ def build_recipes(build_order, python_modules, ctx):
543543
# 4) biglink everything
544544
# AND: Should make this optional
545545
info_main('# Biglinking object files')
546-
if not ctx.ndk_is_crystax:
546+
if not ctx.python_recipe.from_crystax:
547547
biglink(ctx, arch)
548548
else:
549549
info('NDK is crystax, skipping biglink (will this work?)')

pythonforandroid/recipe.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -678,7 +678,7 @@ def install_python_package(self, arch, name=None, env=None, is_dir=True):
678678
# hostpython = sh.Command('python3.5')
679679

680680

681-
if self.ctx.ndk_is_crystax:
681+
if self.ctx.python_recipe.from_crystax:
682682
# hppath = join(dirname(self.hostpython_location), 'Lib',
683683
# 'site-packages')
684684
hpenv = env.copy()
@@ -812,7 +812,7 @@ def build_cython_components(self, arch):
812812

813813
if manually_cythonise:
814814
info('Running cython where appropriate')
815-
if self.ctx.ndk_is_crystax:
815+
if self.ctx.python_recipe.from_crystax:
816816
shprint(sh.find, self.get_build_dir(arch.arch), '-iname', '*.pyx',
817817
'-exec', 'cython', '{}', ';')
818818
# AND: Need to choose cython version more carefully

pythonforandroid/recipes/python3/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ class Python3Recipe(Recipe):
1515

1616
def __init__(self, **kwargs):
1717
super(Python3Recipe, self).__init__(**kwargs)
18-
self.crystax = lambda *args: True if self.ctx.ndk_is_crystax else False
1918

2019
def prebuild_arch(self, arch):
2120
build_dir = self.get_build_container_dir(arch.arch)

0 commit comments

Comments
 (0)