From 0080827b415489875dddae6d3fe565850c25f16a Mon Sep 17 00:00:00 2001 From: reg_ Date: Mon, 3 Dec 2012 13:27:30 +0000 Subject: [PATCH] bins have different relative path to libs --- src/macosx/cleanup_rpath.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/macosx/cleanup_rpath.py b/src/macosx/cleanup_rpath.py index ec6dcdd..00360db 100755 --- a/src/macosx/cleanup_rpath.py +++ b/src/macosx/cleanup_rpath.py @@ -30,9 +30,11 @@ print("Fixing %s..." % component) basename = os.path.basename(component) try: name, ext = basename.rsplit('.', 1) + is_library = True except ValueError: name = basename ext = '' + is_library = False libname = u'lib%s%s.0.dylib' % (name[0].upper(), name[1:]) # run otool to get a list of deps. @@ -62,7 +64,10 @@ for line in otool_out.split('\n'): match = re.match(r'lib([a-z\_\-\d]+)([\.?\d]*)\.dylib', _basename) if match: print("match: %s" % match.groups()[0]) - newpath = u'@executable_path/../Frameworks/lib%s.dylib' % match.groups()[0] + if is_library: + newpath = u'@executable_path/../Frameworks/lib%s.dylib' % match.groups()[0] + else: + newpath = u'@executable_path/../../Frameworks/lib%s.dylib' % match.groups()[0] print('install_name_tool -change %s %s %s' % (path, newpath, component)) os.system('install_name_tool -change %s %s %s' % (path, newpath, component)) continue