This repository has been archived by the owner on Feb 1, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 74
/
trusty_install.py
executable file
·76 lines (66 loc) · 2.76 KB
/
trusty_install.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#!/usr/bin/env python
##
## Copyright (c) 2014, Facebook, Inc.
## All rights reserved.
##
## This source code is licensed under the University of Illinois/NCSA Open
## Source License found in the LICENSE file in the root directory of this
## source tree. An additional grant of patent rights can be found in the
## PATENTS file in the same directory.
##
import os, platform
from subprocess import check_call
packages = []
linux_packages = { 'Linux-ARM': 'g++-4.7-arm-linux-gnueabi',
'Linux-X86': 'g++-4.8-multilib',
'Linux-X86_64': 'g++-4.8' }
android_toolchains = { 'Android-ARM': 'arm',
'Android-ARM64': 'aarch64',
'Android-X86': 'x86',
'Android-X86_64': 'x86' }
tizen_toolchains = { 'Tizen-ARM': 'arm',
'Tizen-X86': 'x86' }
target = os.getenv('TARGET')
if target == 'Style':
packages.append('clang-format-3.7')
elif target == 'Registers':
packages.append('flex')
packages.append('bison')
packages.append('g++-4.8')
packages.append('clang-format-3.7')
elif target in linux_packages:
if "CentOS Linux" in platform.linux_distribution():
packages.append('gcc')
else:
# Install gcc even when using clang, so we can run llgs tests.
packages.append(linux_packages[target])
if os.getenv('CLANG') == '1':
packages.append('clang-3.7')
elif target == 'MinGW-X86':
packages.append('g++-mingw-w64-i686')
elif target in android_toolchains:
# Android builds get the toolchain from AOSP.
check_call('./Support/Scripts/prepare-android-toolchain.sh "%s"' % android_toolchains[target], shell=True)
elif target in tizen_toolchains:
# Tizen builds use the android toolchain and link statically.
check_call('./Support/Scripts/prepare-android-toolchain.sh "%s"' % tizen_toolchains[target], shell=True)
# Running LLDB tests requires an install of lldb (for the tests to be able to
# use the lldb python library without us building it).
if os.getenv('LLDB_TESTS') != None:
packages.append('swig')
if "CentOS Linux" in platform.linux_distribution():
packages.append('libedit-devel')
packages.append('libxml2-devel')
packages.append('ncurses-devel')
packages.append('python-devel')
else:
packages.append('lldb-3.7')
packages.append('liblldb-3.7')
packages.append('python-lldb-3.7')
if "Ubuntu" in platform.linux_distribution():
packages.append('realpath')
if len(packages) > 0:
if "CentOS Linux" in platform.linux_distribution():
check_call('sudo yum install -y "%s"' % '" "'.join(packages), shell=True)
else:
check_call('sudo apt-get install -y "%s"' % '" "'.join(packages), shell=True)