From 2fe8d97b4c51ac3139274622569a5a9ed545310a Mon Sep 17 00:00:00 2001 From: Mathieu Virbel Date: Sat, 6 Jul 2013 16:02:12 +0200 Subject: [PATCH 1/2] use the right 32/64 bits version of NDK depending of the current platform. Credits goes to Dabian Snovna --- buildozer/targets/android.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/buildozer/targets/android.py b/buildozer/targets/android.py index 8120697..4a49781 100644 --- a/buildozer/targets/android.py +++ b/buildozer/targets/android.py @@ -16,6 +16,7 @@ APACHE_ANT_VERSION = '1.8.4' import traceback +import os from pipes import quote from sys import platform, executable from buildozer.target import Target @@ -230,16 +231,21 @@ class TargetAndroid(Target): self.buildozer.info('Android NDK is missing, downloading') if platform in ('win32', 'cygwin'): - archive = 'android-ndk-r{0}-windows.zip' + #FIXME find a way of checking 32/64 bits os (not sys.maxint) + archive = 'android-ndk-r{0}-windows-{1}.zip' + is_64 = False elif platform in ('darwin', ): - archive = 'android-ndk-r{0}-darwin-x86.tar.bz2' - elif platform in ('linux2', 'linux3'): - archive = 'android-ndk-r{0}-linux-x86.tar.bz2' + archive = 'android-ndk-r{0}-darwin-{1}.tar.bz2' + is_64 = (os.uname()[4] == 'x86_64') + elif platform.startswith('linux'): + archive = 'android-ndk-r{0}-linux-{1}.tar.bz2' + is_64 = (os.uname()[4] == 'x86_64') else: raise SystemError('Unsupported platform: {0}'.format(platform)) + architecture = 'x86_64' if is_64 else 'x86' unpacked = 'android-ndk-r{0}' - archive = archive.format(self.android_ndk_version) + archive = archive.format(self.android_ndk_version, architecture) unpacked = unpacked.format(self.android_ndk_version) url = 'http://dl.google.com/android/ndk/' self.buildozer.download(url, archive, From 2642497d3ad41baf14d217181cdec65e1e5e5524 Mon Sep 17 00:00:00 2001 From: Mathieu Virbel Date: Sat, 6 Jul 2013 16:03:15 +0200 Subject: [PATCH 2/2] enhance error message when version capture failed. Credits goes to Dabian Snovna --- buildozer/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/buildozer/__init__.py b/buildozer/__init__.py index f44071f..628e589 100644 --- a/buildozer/__init__.py +++ b/buildozer/__init__.py @@ -498,7 +498,8 @@ class Buildozer(object): match = search(regex, data) if not match: raise Exception( - 'Unable to found capture version in {0}'.format(fn)) + 'Unable to find capture version in {0}\n' + ' (looking for `{1}`)'.format(fn, regex)) version = match.groups()[0] self.debug('Captured version: {0}'.format(version)) return version