def _make_path_absolute_for(self, shlib): cmd = [ 'install_name_tool', '-change', self._linker_path[shlib.path], str(shlib.path), str(self.path) ] log.debug('Exec: "{0}"'.format(' '.join(cmd))) subprocess.check_call(cmd)
def _make_path_relative_for(self, shlib): cmd = [ 'install_name_tool', '-change', self._linker_path[shlib.path], os.path.join('@executable_path', shlib.path.relative(self.path)), str(self.path) ] log.debug('Exec: "{0}"'.format(' '.join(cmd))) subprocess.check_call(cmd)
def _init_dependents(self, binaries, make_shared_library=None): dependents = [] for path in self.find_dependents(): log.debug('Found that %s depends on %s', self.path, path) if not path.is_abs(): raise RuntimeError('dependent {0} is not absolute path'.format(path)) else: dependents.append(path) if path in binaries._internal_path: # shared library already found inside the root path if path not in binaries.root_path: raise RuntimeError('internal {0} not in {1}'.format(path, binaries.root_path)) else: # must be external library if path in binaries.root_path: raise RuntimeError('library {0} in {1}'.format(path, binaries.root_path)) if make_shared_library: make_shared_library(path) self._dependents = tuple(dependents)
def _init_dependents(self, binaries, make_shared_library=None): dependents = [] for path in self.find_dependents(): log.debug('Found that %s depends on %s', self.path, path) if not path.is_abs(): raise RuntimeError( 'dependent {0} is not absolute path'.format(path)) else: dependents.append(path) if path in binaries._internal_path: # shared library already found inside the root path if path not in binaries.root_path: raise RuntimeError('internal {0} not in {1}'.format( path, binaries.root_path)) else: # must be external library if path in binaries.root_path: raise RuntimeError('library {0} in {1}'.format( path, binaries.root_path)) if make_shared_library: make_shared_library(path) self._dependents = tuple(dependents)