OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 # Copyright 2013 The Chromium Authors. All rights reserved. | 2 # Copyright 2013 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 """Downloads, builds (with instrumentation) and installs shared libraries.""" | 6 """Downloads, builds (with instrumentation) and installs shared libraries.""" |
7 | 7 |
8 import argparse | 8 import argparse |
9 import os | 9 import os |
10 import platform | 10 import platform |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 # Touch a text file to indicate package is installed. | 176 # Touch a text file to indicate package is installed. |
177 stamp_file = os.path.join(self._destdir, '%s.txt' % self._package) | 177 stamp_file = os.path.join(self._destdir, '%s.txt' % self._package) |
178 open(stamp_file, 'w').close() | 178 open(stamp_file, 'w').close() |
179 | 179 |
180 # Remove downloaded package and generated temporary build files. Failed | 180 # Remove downloaded package and generated temporary build files. Failed |
181 # builds intentionally skip this step to help debug build failures. | 181 # builds intentionally skip this step to help debug build failures. |
182 if self._clobber: | 182 if self._clobber: |
183 self.shell_call('rm -rf %s' % self._working_dir) | 183 self.shell_call('rm -rf %s' % self._working_dir) |
184 | 184 |
185 def fix_rpaths(self, directory): | 185 def fix_rpaths(self, directory): |
186 # TODO(earthdok): reimplement fix_rpaths.sh in Python. | 186 # TODO(eugenis): reimplement fix_rpaths.sh in Python. |
187 script = real_path('scripts/fix_rpaths.sh') | 187 script = real_path('scripts/fix_rpaths.sh') |
188 self.shell_call("%s %s" % (script, directory)) | 188 self.shell_call("%s %s" % (script, directory)) |
189 | 189 |
190 def temp_dir(self): | 190 def temp_dir(self): |
191 """Returns the directory which will be passed to `make install'.""" | 191 """Returns the directory which will be passed to `make install'.""" |
192 return os.path.join(self._source_dir, 'debian', 'instrumented_build') | 192 return os.path.join(self._source_dir, 'debian', 'instrumented_build') |
193 | 193 |
194 def temp_libdir(self): | 194 def temp_libdir(self): |
195 """Returns the directory under temp_dir() containing the DSOs.""" | 195 """Returns the directory under temp_dir() containing the DSOs.""" |
196 return os.path.join(self.temp_dir(), self._libdir) | 196 return os.path.join(self.temp_dir(), self._libdir) |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
427 builder = LibcapBuilder(args, clobber) | 427 builder = LibcapBuilder(args, clobber) |
428 elif args.build_method == 'custom_libpci3': | 428 elif args.build_method == 'custom_libpci3': |
429 builder = Libpci3Builder(args, clobber) | 429 builder = Libpci3Builder(args, clobber) |
430 else: | 430 else: |
431 raise Exception('Unrecognized build method: %s' % args.build_method) | 431 raise Exception('Unrecognized build method: %s' % args.build_method) |
432 | 432 |
433 builder.download_build_install() | 433 builder.download_build_install() |
434 | 434 |
435 if __name__ == '__main__': | 435 if __name__ == '__main__': |
436 main() | 436 main() |
OLD | NEW |