Chromium Code Reviews| Index: third_party/instrumented_libraries/download_build_install.py |
| diff --git a/third_party/instrumented_libraries/download_build_install.py b/third_party/instrumented_libraries/download_build_install.py |
| index d6637a5feec4531a655c16ed869c264b9c5b8e36..c63476d872ce9584fa6e9c77f86e7d3749cb9fac 100755 |
| --- a/third_party/instrumented_libraries/download_build_install.py |
| +++ b/third_party/instrumented_libraries/download_build_install.py |
| @@ -30,9 +30,10 @@ class ScopedChangeDirectory(object): |
| os.chdir(self.old_path) |
| -def get_script_absolute_path(): |
| - return os.path.dirname(os.path.abspath(__file__)) |
| +script_absolute_path = os.path.dirname(os.path.abspath(__file__)) |
|
Alexander Potapenko
2014/11/17 19:29:00
I think global variables are named in CAPITAL_CASE
|
| +def get_script_absolute_path(): |
| + return script_absolute_path |
| def get_package_build_dependencies(package): |
| command = 'apt-get -s build-dep %s | grep Inst | cut -d " " -f 2' % package |
| @@ -86,6 +87,11 @@ def run_shell_commands(commands, verbose=False, environment=None): |
| shell_call(command, verbose, environment) |
| +def fix_rpaths(destdir): |
| + # TODO(earthdok): reimplement fix_rpaths.sh in Python. |
| + shell_call("%s/fix_rpaths.sh %s/lib" % (get_script_absolute_path(), destdir)) |
| + |
| + |
| def destdir_configure_make_install(parsed_arguments, environment, |
| install_prefix): |
| configure_command = './configure %s' % parsed_arguments.extra_configure_flags |
| @@ -102,10 +108,13 @@ def destdir_configure_make_install(parsed_arguments, environment, |
| '%s install -j1' % make_command, |
| # Kill the .la files. They contain absolute paths, and will cause build |
| # errors in dependent libraries. |
| - 'rm %s/lib/*.la -f' % destdir, |
| - # Now move the contents of the temporary destdir to their final place. |
| - 'cp %s/* %s/ -rdf' % (destdir, install_prefix)], |
| + 'rm %s/lib/*.la -f' % destdir], |
| parsed_arguments.verbose, environment) |
|
Alexander Potapenko
2014/11/17 19:29:00
Please fix the indentation.
|
| + fix_rpaths(destdir) |
| + shell_call( |
| + # Now move the contents of the temporary destdir to their final place. |
| + 'cp %s/* %s/ -rdf' % (destdir, install_prefix), |
| + parsed_arguments.verbose, environment) |
| def nss_make_and_copy(parsed_arguments, environment, install_prefix): |
| @@ -136,6 +145,7 @@ def nss_make_and_copy(parsed_arguments, environment, install_prefix): |
| # -j is not supported |
| shell_call('make %s' % ' '.join(make_args), parsed_arguments.verbose, |
| environment) |
| + fix_rpaths(os.getcwd()) |
| # 'make install' is not supported. Copy the DSOs manually. |
| install_dir = '%s/lib/' % install_prefix |
| for (dirpath, dirnames, filenames) in os.walk('./lib/'): |
| @@ -154,8 +164,9 @@ def libcap2_make_install(parsed_arguments, environment, install_prefix): |
| for name in['CC', 'CXX', 'CFLAGS', 'CXXFLAGS', 'LDFLAGS']] |
| shell_call('make -j%s %s' % (parsed_arguments.jobs, ' '.join(make_args)), |
| parsed_arguments.verbose, environment) |
| + destdir = '%s/debian/instrumented_build' % os.getcwd() |
| install_args = [ |
| - 'DESTDIR=%s' % install_prefix, |
| + 'DESTDIR=%s' % destdir, |
| # Do not install in lib64/. |
| 'lib=lib', |
| # Skip a step that requires sudo. |
| @@ -164,6 +175,11 @@ def libcap2_make_install(parsed_arguments, environment, install_prefix): |
| shell_call('make -j%s install %s' % |
| (parsed_arguments.jobs, ' '.join(install_args)), |
| parsed_arguments.verbose, environment) |
| + fix_rpaths(destdir) |
| + shell_call([ |
| + # Now move the contents of the temporary destdir to their final place. |
| + 'cp %s/* %s/ -rdf' % (destdir, install_prefix)], |
| + parsed_arguments.verbose, environment) |
| def libpci3_make_install(parsed_arguments, environment, install_prefix): |
| @@ -203,6 +219,7 @@ def libpci3_make_install(parsed_arguments, environment, install_prefix): |
| parsed_arguments.jobs, |
| ' '.join(install_args + paths))], |
| parsed_arguments.verbose, environment) |
| + fix_rpaths(destdir) |
| # Now move the contents of the temporary destdir to their final place. |
| run_shell_commands([ |
| 'cp %s/* %s/ -rd' % (destdir, install_prefix), |