Browse Source

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
Donny Lawrence 5 years ago
parent
commit
afba3ba01c
1 changed files with 9 additions and 0 deletions
  1. 9 0
      makepanda/makewheel.py

+ 9 - 0
makepanda/makewheel.py

@@ -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)