How to use the macholib.dyld.dyld_find function in macholib

To help you get started, we’ve selected a few macholib examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github HenriWahl / Nagstamon / build / helpers / pyinstaller-2.1 / PyInstaller / lib / macholib / MachOGraph.py View on Github external
def locate(self, filename):
        assert isinstance(filename, (str, unicode))
        fn = self.trans_table.get(filename)
        if fn is None:
            try:
                fn = dyld_find(filename, env=self.env,
                    executable_path=self.executable_path)
                self.trans_table[filename] = fn
            except ValueError:
                return None
        return fn
github nortd / driveboardapp / other / pyinstaller / PyInstaller / lib / macholib / MachOGraph.py View on Github external
def locate(self, filename):
        assert isinstance(filename, (str, unicode))
        fn = self.trans_table.get(filename)
        if fn is None:
            try:
                fn = dyld_find(filename, env=self.env,
                    executable_path=self.executable_path)
                self.trans_table[filename] = fn
            except ValueError:
                return None
        return fn
github pyinstaller / pyinstaller / PyInstaller / depend / bindepend.py View on Github external
final_lib = os.path.abspath(os.path.join(run_path, lib))
                    rslt.add(final_lib)
                    break
            # Log error if no existing file found.
            if not final_lib:
                logger.error('Can not find path %s (needed by %s)', lib, pth)

        # Macholib has to be used to get absolute path to libraries.
        else:
            # macholib can't handle @loader_path. It has to be
            # handled the same way as @executable_path.
            # It is also replaced by 'exec_path'.
            if lib.startswith('@loader_path'):
                lib = lib.replace('@loader_path', '@executable_path')
            try:
                lib = dyld_find(lib, executable_path=exec_path)
                rslt.add(lib)
            except ValueError:
                logger.error('Can not find path %s (needed by %s)', lib, pth)

    return rslt
github pyinstaller / pyinstaller / PyInstaller / lib / macholib / MachOGraph.py View on Github external
if filename.startswith('@loader_path/') and loader is not None:
            fn = self.trans_table.get((loader.filename, filename))
            if fn is None:
                try:
                    fn = dyld_find(filename, env=self.env,
                        executable_path=self.executable_path,
                        loader=loader.filename)
                    self.trans_table[(loader.filename, filename)] = fn
                except ValueError:
                    return None

        else:
            fn = self.trans_table.get(filename)
            if fn is None:
                try:
                    fn = dyld_find(filename, env=self.env,
                        executable_path=self.executable_path)
                    self.trans_table[filename] = fn
                except ValueError:
                    return None
        return fn