Get base dependencies only if we are not building a flatpak.

This commit is contained in:
Matthieu Gautier 2018-11-27 16:02:49 +01:00
parent ce540ca280
commit f41a0dccdb
1 changed files with 34 additions and 33 deletions

View File

@ -249,40 +249,41 @@ for p in (NIGHTLY_KIWIX_ARCHIVES_DIR,
make_release = re.fullmatch(r"[0-9]+\.[0-9]+\.[0-9]+", environ.get('TRAVIS_TAG', '')) is not None make_release = re.fullmatch(r"[0-9]+\.[0-9]+\.[0-9]+", environ.get('TRAVIS_TAG', '')) is not None
# The first thing we need to do is to (potentially) download already compiled base dependencies. if PLATFORM != 'flatpak':
base_dep_archive_name = "base_deps_{os}_{platform}_{version}.tar.gz".format( # The first thing we need to do is to (potentially) download already compiled base dependencies.
os=TRAVIS_OS_NAME, base_dep_archive_name = "base_deps_{os}_{platform}_{version}.tar.gz".format(
platform=PLATFORM, os=TRAVIS_OS_NAME,
version=base_deps_meta_version) platform=PLATFORM,
version=base_deps_meta_version)
print_message("Getting archive {}", base_dep_archive_name) print_message("Getting archive {}", base_dep_archive_name)
try: try:
local_filename, _ = urlretrieve( local_filename, _ = urlretrieve(
'http://tmp.kiwix.org/ci/{}'.format(base_dep_archive_name)) 'http://tmp.kiwix.org/ci/{}'.format(base_dep_archive_name))
with tarfile.open(local_filename) as f: with tarfile.open(local_filename) as f:
f.extractall(str(HOME)) f.extractall(str(HOME))
except URLError: except URLError:
print_message("Cannot get archive. Build dependencies") print_message("Cannot get archive. Build dependencies")
if PLATFORM == 'android': if PLATFORM == 'android':
for arch in ('arm', 'arm64', 'x86', 'x86_64'): for arch in ('arm', 'arm64', 'x86', 'x86_64'):
archive_name = "base_deps_{os}_android_{arch}_{version}.tar.gz".format( archive_name = "base_deps_{os}_android_{arch}_{version}.tar.gz".format(
os=TRAVIS_OS_NAME, os=TRAVIS_OS_NAME,
arch=arch, arch=arch,
version=base_deps_meta_version) version=base_deps_meta_version)
print_message("Getting archive {}", archive_name) print_message("Getting archive {}", archive_name)
try: try:
local_filename, _ = urlretrieve( local_filename, _ = urlretrieve(
'http://tmp.kiwix.org/ci/{}'.format(archive_name)) 'http://tmp.kiwix.org/ci/{}'.format(archive_name))
with tarfile.open(local_filename) as f: with tarfile.open(local_filename) as f:
f.extractall(str(HOME)) f.extractall(str(HOME))
except URLError: except URLError:
pass pass
run_kiwix_build('alldependencies', platform=PLATFORM) run_kiwix_build('alldependencies', platform=PLATFORM)
if SSH_KEY.exists(): if SSH_KEY.exists():
archive = make_deps_archive('alldependencies', full=True) archive = make_deps_archive('alldependencies', full=True)
destination = 'ci@tmp.kiwix.org:/data/tmp/ci/{}' destination = 'ci@tmp.kiwix.org:/data/tmp/ci/{}'
destination = destination.format(base_dep_archive_name) destination = destination.format(base_dep_archive_name)
scp(archive, destination) scp(archive, destination)
# A basic compilation to be sure everything is working (for a PR) # A basic compilation to be sure everything is working (for a PR)