OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 # Script to install arm choot image for cross building of arm chrome on linux. | 6 # Script to install arm choot image for cross building of arm chrome on linux. |
7 # This script can be run manually but is more often run as part of gclient | 7 # This script can be run manually but is more often run as part of gclient |
8 # hooks. When run from hooks this script should be a no-op on non-linux | 8 # hooks. When run from hooks this script should be a no-op on non-linux |
9 # platforms. | 9 # platforms. |
10 | 10 |
11 # The sysroot image could be constructed from scratch based on the current | 11 # The sysroot image could be constructed from scratch based on the current |
12 # state or precise/arm but for consistency we currently use a pre-built root | 12 # state or precise/arm but for consistency we currently use a pre-built root |
13 # image which was originally designed for building trusted NaCl code. The image | 13 # image which was originally designed for building trusted NaCl code. The image |
14 # will normally need to be rebuilt every time chrome's build dependancies are | 14 # will normally need to be rebuilt every time chrome's build dependancies are |
15 # changed. | 15 # changed. |
16 | 16 |
17 import os | 17 import os |
18 import shutil | 18 import shutil |
19 import subprocess | 19 import subprocess |
20 import sys | 20 import sys |
21 | 21 |
22 | 22 |
23 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) | 23 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) |
24 URL_PREFIX = 'https://commondatastorage.googleapis.com/nativeclient-archive2/too
lchain' | 24 URL_PREFIX = 'https://commondatastorage.googleapis.com/nativeclient-archive2/too
lchain' |
25 REVISION = 8002 | 25 REVISION = 8003 |
26 | 26 |
27 | 27 |
28 def main(args): | 28 def main(args): |
29 if '--linux-only' in args: | 29 if '--linux-only' in args: |
30 # This argument is passed when run from the gclient hooks. | 30 # This argument is passed when run from the gclient hooks. |
31 # In this case we return early on non-linux platforms | 31 # In this case we return early on non-linux platforms |
32 # or if GYP_DEFINES doesn't include target_arch=arm | 32 # or if GYP_DEFINES doesn't include target_arch=arm |
33 if not sys.platform.startswith('linux'): | 33 if not sys.platform.startswith('linux'): |
34 return 0 | 34 return 0 |
35 | 35 |
(...skipping 20 matching lines...) Expand all Loading... |
56 subprocess.check_call(['tar', 'xf', tarball, '-C', sysroot]) | 56 subprocess.check_call(['tar', 'xf', tarball, '-C', sysroot]) |
57 os.remove(tarball) | 57 os.remove(tarball) |
58 | 58 |
59 with open(stamp, 'w') as s: | 59 with open(stamp, 'w') as s: |
60 s.write(url) | 60 s.write(url) |
61 return 0 | 61 return 0 |
62 | 62 |
63 | 63 |
64 if __name__ == '__main__': | 64 if __name__ == '__main__': |
65 sys.exit(main(sys.argv[1:])) | 65 sys.exit(main(sys.argv[1:])) |
OLD | NEW |