8000 Merge pull request #1273 from inclement/revert_b88767d6206e303c858035… · kvlee/python-for-android@8980826 · GitHub
[go: up one dir, main page]

Skip to content

Commit 8980826

Browse files
authored
Merge pull request kivy#1273 from inclement/revert_b88767d6206e303c8580358029c9fbb8f7d73aec
Revert "Merge pull request kivy#1252 from Iqoqo/master"
2 parents b88767d + 3c73a79 commit 8980826

File tree

4 files changed

+5
-21
lines changed

4 files changed

+5
-21
lines changed

pythonforandroid/archs.py

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@
99

1010
class Arch(object):
1111

12-
include_prefix = None
13-
'''The prefix for the include dir in the NDK.'''
14-
1512
toolchain_prefix = None
1613
'''The prefix for the toolchain dir in the NDK.'''
1714

@@ -47,7 +44,7 @@ def get_env(self, with_flags_in_cc=True):
4744
# post-15 NDK per
4845
# https://android.googlesource.com/platform/ndk/+/ndk-r15-release/docs/UnifiedHeaders.md
4946
env['CFLAGS'] += ' -isystem {}/sysroot/usr/include/{}'.format(
50-
self.ctx.ndk_dir, self.ctx.include_prefix)
47+
self.ctx.ndk_dir, self.ctx.toolchain_prefix)
5148
else:
5249
sysroot = self.ctx.ndk_platform
5350
env['CFLAGS'] += ' -I{}'.format(self.ctx.ndk_platform)
@@ -70,12 +67,10 @@ def get_env(self, with_flags_in_cc=True):
7067
if py_platform in ['linux2', 'linux3']:
7168
py_platform = 'linux'
7269

73-
include_prefix = self.ctx.include_prefix
7470
toolchain_prefix = self.ctx.toolchain_prefix
7571
toolchain_version = self.ctx.toolchain_version
7672
command_prefix = self.command_prefix
7773

78-
env['INCLUDE_PREFIX'] = include_prefix
7974
env['TOOLCHAIN_PREFIX'] = toolchain_prefix
8075
env['TOOLCHAIN_VERSION'] = toolchain_version
8176

@@ -143,7 +138,6 @@ def get_env(self, with_flags_in_cc=True):
143138

144139
class ArchARM(Arch):
145140
arch = "armeabi"
146-
include_prefix = 'arm-linux-androideabi'
147141
toolchain_prefix = 'arm-linux-androideabi'
148142
command_prefix = 'arm-linux-androideabi'
149143
platform_dir = 'arch-arm'
@@ -163,7 +157,6 @@ def get_env(self, with_flags_in_cc=True):
163157

164158
class Archx86(Arch):
165159
arch = 'x86'
166-
include_prefix = 'i686-linux-android'
167160
toolchain_prefix = 'x86'
168161
command_prefix = 'i686-linux-android'
169162
platform_dir = 'arch-x86'
@@ -178,8 +171,7 @@ def get_env(self, with_flags_in_cc=True):
178171

179172
class Archx86_64(Arch):
180173
arch = 'x86_64'
181-
include_prefix = 'x86_64-linux-android'
182-
toolchain_prefix = 'x86_64'
174+
toolchain_prefix = 'x86'
183175
command_prefix = 'x86_64-linux-android'
184176
platform_dir = 'arch-x86'
185177

@@ -193,7 +185,6 @@ def get_env(self, with_flags_in_cc=True):
193185

194186
class ArchAarch_64(Arch):
195187
arch = 'arm64-v8a'
196-
include_prefix = 'aarch64-linux-android'
197188
toolchain_prefix = 'aarch64-linux-android'
198189
command_prefix = 'aarch64-linux-android'
199190
platform_dir = 'arch-arm64'

pythonforandroid/build.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,6 @@ def prepare_build_environment(self, user_sdk_dir, user_ndk_dir,
364364
# This would need to be changed if supporting multiarch APKs
365365
arch = self.archs[0]
366366
platform_dir = arch.platform_dir
367-
include_prefix = arch.include_prefix
368367
toolchain_prefix = arch.toolchain_prefix
369368
toolchain_version = None
370369
self.ndk_platform = join(
@@ -381,13 +380,6 @@ def prepare_build_environment(self, user_sdk_dir, user_ndk_dir,
381380
if py_platform in ['linux2', 'linux3']:
382381
py_platform = 'linux'
383382

384-
self.include_prefix = include_prefix
385-
include_path = join(self.ndk_dir, 'sysroot/usr/include/', self.include_prefix)
386-
if not os.path.isdir(include_path):
387-
warning('include directory doesn\'t exist: {}'.format(
388-
include_path))
389-
ok = False
390-
391383
toolchain_versions = []
392384
toolchain_path = join(self.ndk_dir, 'toolchains')
393385
if os.path.isdir(toolchain_path):
@@ -454,7 +446,6 @@ def __init__(self):
454446
self._ndk_ver = None
455447
self.ndk = None
456448

457-
self.include_prefix = None
458449
self.toolchain_prefix = None
459450
self.toolchain_version = None
460451

pythonforandroid/recipes/numpy/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ def get_recipe_env(self, arch):
4848
def prebuild_arch(self, arch):
4949
super(NumpyRecipe, self).prebuild_arch(arch)
5050

51+
warning('Numpy is built assuming the archiver name is '
52+
'arm-linux-androideabi-ar, which may not always be true!')
5153

5254

5355
recipe = NumpyRecipe()

pythonforandroid/recipes/numpy/patches/ar.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
self.mkpath(os.path.dirname(output_filename))
66
tmp_objects = objects + self.objects
77
+ from os import environ
8-
+ self.archiver[0] = environ["AR"]
8+
+ self.archiver[0] = 'arm-linux-androideabi-ar'
99
while tmp_objects:
1010
objects = tmp_objects[:50]
1111
tmp_objects = tmp_objects[50:]

0 commit comments

Comments
 (0)
0