From d3e720d8f23b435026f29ade1f6fce320cc6af04 Mon Sep 17 00:00:00 2001 From: Christian Tismer Date: Sat, 27 Jun 2015 01:30:45 +0200 Subject: fix an old installer error with rpath. This bug is old, but showed up after I tried to build parts of PySide for Qt5. Problem: There are rpath entries which don't trigger creation of an rpath command. This can be seen when Qt is not linked, and qtcore has an explicit path. --- utils.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'utils.py') diff --git a/utils.py b/utils.py index a1634a139..b8a40dd01 100644 --- a/utils.py +++ b/utils.py @@ -578,11 +578,17 @@ def osx_localize_libpaths(libpath, local_libs, enc_path=None): install_names = osx_get_install_names(libpath) need_rpath = False for install_name in install_names: - if install_name[0] in '/@': + if install_name[0] == '/': + # absolute path, nothing to do continue - back_tick('install_name_tool -change %s @rpath/%s %s' % - (install_name, install_name, libpath)) + # we possibly need to add an rpath command. + # note that a @rpath may be there already, but no rpath command. + # this happens when Qt is not linked (with qt5 this is the default) need_rpath = True + if install_name[0] != '@': + # we need to change a relative path to @rpath + back_tick('install_name_tool -change {ina} @rpath/{ina} {lipa}'.format( + ina=install_name, lipa=libpath )) if need_rpath and enc_path not in osx_get_rpaths(libpath): - back_tick('install_name_tool -add_rpath %s %s' % - (enc_path, libpath)) + back_tick('install_name_tool -add_rpath {epa} {lipa}'.format( + epa=enc_path, lipa=libpath )) -- cgit v1.2.3