Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(120)

Unified Diff: third_party/instrumented_libraries/download_build_install.py

Issue 723033006: Instrumented libraries: overhaul RPATH handling. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/instrumented_libraries/fix_rpaths.sh » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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),
« no previous file with comments | « no previous file | third_party/instrumented_libraries/fix_rpaths.sh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698