OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 # Copyright (c) 2011 The Native Client Authors. All rights reserved. | 2 # Copyright (c) 2011 The Native Client 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 """Assemble the final installer for each platform. | 6 """Assemble the final installer for each platform. |
7 | 7 |
8 At this time this is just a tarball. | 8 At this time this is just a tarball. |
9 """ | 9 """ |
10 | 10 |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 os.makedirs(installer_dir, mode=0777) | 63 os.makedirs(installer_dir, mode=0777) |
64 except OSError: | 64 except OSError: |
65 pass | 65 pass |
66 | 66 |
67 # Decide environment to run in per platform. | 67 # Decide environment to run in per platform. |
68 env = os.environ.copy() | 68 env = os.environ.copy() |
69 # Set up the required env variables for the scons builders. | 69 # Set up the required env variables for the scons builders. |
70 env['NACL_SDK_ROOT'] = parent_dir | 70 env['NACL_SDK_ROOT'] = parent_dir |
71 env['NACL_TARGET_PLATFORM'] = '.' # Use the repo's toolchain. | 71 env['NACL_TARGET_PLATFORM'] = '.' # Use the repo's toolchain. |
72 | 72 |
73 # Build the experimental projects. | |
74 bot.BuildStep('build experimental') | |
75 bot.Print('generate_installers is building the experimental projects.') | |
76 experimental_path = os.path.join(home_dir, 'src', 'experimental') | |
77 scons_path = os.path.join(experimental_path, 'scons') | |
78 scons_cmd = scons_path + ' --nacl-platform="."' | |
79 subprocess.check_call(scons_cmd, | |
80 cwd=experimental_path, | |
81 env=env, | |
82 shell=True) | |
83 | |
84 # Use native tar to copy the SDK into the build location | 73 # Use native tar to copy the SDK into the build location |
85 # because copytree has proven to be error prone and is not supported on mac. | 74 # because copytree has proven to be error prone and is not supported on mac. |
86 # We use a buffer for speed here. -1 causes the default OS size to be used. | 75 # We use a buffer for speed here. -1 causes the default OS size to be used. |
87 bot.BuildStep('copy to install dir') | 76 bot.BuildStep('copy to install dir') |
88 bot.Print('generate_installers is copying contents to install directory.') | 77 bot.Print('generate_installers is copying contents to install directory.') |
89 tar_src_dir = os.path.realpath(os.curdir) | 78 tar_src_dir = os.path.realpath(os.curdir) |
90 all_contents = (installer_contents.INSTALLER_CONTENTS + | 79 all_contents = (installer_contents.INSTALLER_CONTENTS + |
91 installer_contents.DOCUMENTATION_FILES) | 80 installer_contents.DOCUMENTATION_FILES) |
92 if sys.platform == 'darwin': | 81 if sys.platform == 'darwin': |
93 all_contents += installer_contents.MAC_ONLY_CONTENTS | 82 all_contents += installer_contents.MAC_ONLY_CONTENTS |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 | 140 |
152 # Clean up. | 141 # Clean up. |
153 shutil.rmtree(temp_dir) | 142 shutil.rmtree(temp_dir) |
154 return 0 | 143 return 0 |
155 | 144 |
156 | 145 |
157 if __name__ == '__main__': | 146 if __name__ == '__main__': |
158 print "Directly running generate_installers.py is no longer supported." | 147 print "Directly running generate_installers.py is no longer supported." |
159 print "Please instead run './scons installer' from the src directory." | 148 print "Please instead run './scons installer' from the src directory." |
160 sys.exit(1) | 149 sys.exit(1) |
OLD | NEW |