Skip to content

Commit b9e6e52

Browse files
committed
Fixed hostpython2 recipe to ignore arch
Since this is always built for the desktop, we don't need multiple targets
1 parent 9af971f commit b9e6e52

File tree

2 files changed

+17
-9
lines changed

2 files changed

+17
-9
lines changed

pythonforandroid/recipes/hostpython2/__init__.py

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,32 @@ class Hostpython2Recipe(Recipe):
1212

1313
conflicts = ['hostpython3']
1414

15-
def prebuild_armeabi(self):
15+
def get_build_container_dir(self, arch=None):
16+
choices = self.check_recipe_choices()
17+
dir_name = '-'.join([self.name] + choices)
18+
return join(self.ctx.build_dir, 'other_builds', dir_name, 'desktop')
19+
20+
def get_build_dir(self, arch=None):
21+
return join(self.get_build_container_dir(), self.name)
22+
23+
def prebuild_arch(self, arch):
1624
# Override hostpython Setup?
1725
shprint(sh.cp, join(self.get_recipe_dir(), 'Setup'),
1826
join(self.get_build_dir('armeabi'), 'Modules', 'Setup'))
1927

20-
def build_armeabi(self):
28+
def build_arch(self, arch):
2129
# AND: Should use an i386 recipe system
2230
warning('Running hostpython build. Arch is armeabi! '
2331
'This is naughty, need to fix the Arch system!')
2432

2533
# AND: Fix armeabi again
26-
with current_directory(self.get_build_dir('armeabi')):
34+
with current_directory(self.get_build_dir()):
2735

2836
if exists('hostpython'):
2937
info('hostpython already exists, skipping build')
30-
self.ctx.hostpython = join(self.get_build_dir('armeabi'),
38+
self.ctx.hostpython = join(self.get_build_dir(),
3139
'hostpython')
32-
self.ctx.hostpgen = join(self.get_build_dir('armeabi'),
40+
self.ctx.hostpgen = join(self.get_build_dir(),
3341
'hostpgen')
3442
return
3543

@@ -49,8 +57,8 @@ def build_armeabi(self):
4957
'hostpython build! Exiting.')
5058
exit(1)
5159

52-
self.ctx.hostpython = join(self.get_build_dir('armeabi'), 'hostpython')
53-
self.ctx.hostpgen = join(self.get_build_dir('armeabi'), 'hostpgen')
60+
self.ctx.hostpython = join(self.get_build_dir(), 'hostpython')
61+
self.ctx.hostpgen = join(self.get_build_dir(), 'hostpgen')
5462

5563

5664
recipe = Hostpython2Recipe()

pythonforandroid/toolchain.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ def __getattr__(self, key):
7272
else:
7373
Err_Style = Null_Style
7474
Err_Fore = Null_Fore
75+
Fore = Colo_Fore
76+
Style = Colo_Style
7577

7678
user_dir = dirname(realpath(os.path.curdir))
7779
toolchain_dir = dirname(__file__)
@@ -1120,8 +1122,6 @@ def set_archs(self, arch_names):
11201122
exit(1)
11211123
info('Will compile for the following archs: {}'.format(
11221124
', '.join([arch.arch for arch in self.archs])))
1123-
exit(1)
1124-
11251125

11261126
def prepare_bootstrap(self, bs):
11271127
bs.ctx = self

0 commit comments

Comments
 (0)