makewheel: Support deps referenced by @rpath

The new CMake build system uses @rpath rather than @loader_path when
specifying a library's dependencies. Since rpaths are set by the
executable, we don't need to do any path manipulation to relocate the
libraries to a .app bundle like we do with @loader_path.

Fixes #913
This commit is contained in:
Donny Lawrence 2020-04-20 16:18:28 -05:00 committed by rdb
parent ad296492f8
commit afba3ba01c

View File

@ -424,6 +424,15 @@ class WheelFile(object):
continue
new_dep = os.path.join(deps_path, os.path.relpath(target_dep, os.path.dirname(target_path)))
elif '@rpath' in dep:
# Unlike makepanda, CMake uses @rpath instead of
# @loader_path. This means we can just search for the
# dependencies like normal.
dep_path = dep.replace('@rpath', '.')
target_dep = os.path.dirname(target_path) + '/' + os.path.basename(dep)
self.consider_add_dependency(target_dep, dep_path)
continue
elif dep.startswith('/Library/Frameworks/Python.framework/'):
# Add this dependency if it's in the Python directory.
target_dep = os.path.dirname(target_path) + '/' + os.path.basename(dep)