* Fixed #18: Builds fail on Ubuntu 13.04 with zlib.h missing.
* Fixed missing rebuild of build.py when the previous build failed.
This commit is contained in:
parent
2642497d3a
commit
97c4e411a4
2 changed files with 27 additions and 2 deletions
|
@ -48,7 +48,19 @@ LOG_LEVELS_C = (RED, BLUE, BLACK)
|
|||
LOG_LEVELS_T = 'EID'
|
||||
|
||||
|
||||
class BuildozerCommandException(Exception):
|
||||
class BuildozerException(Exception):
|
||||
'''
|
||||
Exception raised for general situations buildozer cannot process.
|
||||
'''
|
||||
pass
|
||||
|
||||
|
||||
class BuildozerCommandException(BuildozerException):
|
||||
'''
|
||||
Exception raised when an external command failed.
|
||||
|
||||
See: `Buildozer.cmd()`.
|
||||
'''
|
||||
pass
|
||||
|
||||
|
||||
|
@ -1033,9 +1045,13 @@ def run():
|
|||
# don't show the exception in the command line. The log already show the
|
||||
# command failed.
|
||||
pass
|
||||
except BuildozerException as error:
|
||||
Buildozer().error('%s' % error)
|
||||
|
||||
def run_remote():
|
||||
try:
|
||||
BuildozerRemote().run_command(sys.argv[1:])
|
||||
except BuildozerCommandException:
|
||||
pass
|
||||
except BuildozerException as error:
|
||||
Buildozer().error('%s' % error)
|
||||
|
|
|
@ -19,6 +19,7 @@ import traceback
|
|||
import os
|
||||
from pipes import quote
|
||||
from sys import platform, executable
|
||||
from buildozer import BuildozerException
|
||||
from buildozer.target import Target
|
||||
from os import environ
|
||||
from os.path import join, realpath, expanduser
|
||||
|
@ -105,6 +106,14 @@ class TargetAndroid(Target):
|
|||
self.javac_cmd = self._locate_java('javac')
|
||||
self.keytool_cmd = self._locate_java('keytool')
|
||||
|
||||
_, _, returncode_dpkg = self.buildozer.cmd(
|
||||
'dpkg --version', break_on_error= False)
|
||||
is_debian_like = (returncode_dpkg == 0)
|
||||
if is_debian_like:
|
||||
if not self.buildozer.file_exists('/usr/include/zlib.h'):
|
||||
message = 'zlib headers must be installed, run: sudo apt-get install zlib1g-dev'
|
||||
raise BuildozerException(message)
|
||||
|
||||
checkbin = self.buildozer.checkbin
|
||||
checkbin('Git git', 'git')
|
||||
checkbin('Cython cython', 'cython')
|
||||
|
@ -329,7 +338,7 @@ class TargetAndroid(Target):
|
|||
need_compile = 0
|
||||
if last_requirements != android_requirements:
|
||||
need_compile = 1
|
||||
if not self.buildozer.file_exists(self.pa_dir, 'dist', 'default'):
|
||||
if not self.buildozer.file_exists(self.pa_dir, 'dist', 'default', 'build.py'):
|
||||
need_compile = 1
|
||||
|
||||
if not need_compile:
|
||||
|
|
Loading…
Reference in a new issue