path: root/utils.py
diff options
authorChristian Tismer <tismer@stackless.com>2015-06-27 01:30:45 +0200
committerChristian Tismer <tismer@stackless.com>2015-06-27 01:30:45 +0200
commitd3e720d8f23b435026f29ade1f6fce320cc6af04 (patch)
treef5cd7b5b474dc50fffc2120f929ff8e324ad84dc /utils.py
parentfab3a2f4ea6013f84d58bddbb936d9797e2fa8f9 (diff)
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.
Diffstat (limited to 'utils.py')
1 files changed, 11 insertions, 5 deletions
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
- 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 ))