How to use the macholib.MachOStandalone.MachOStandalone 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 pyinstaller / pyinstaller / PyInstaller / lib / macholib / macho_standalone.py View on Github external
def standaloneApp(path):
    if not (os.path.isdir(path) and os.path.exists(
            os.path.join(path, 'Contents'))):
        print('%s: %s does not look like an app bundle'
            % (sys.argv[0], path))
        sys.exit(1)
    files = MachOStandalone(path).run()
    strip_files(files)
github nortd / driveboardapp / other / pyinstaller / PyInstaller / lib / macholib / macho_standalone.py View on Github external
def standaloneApp(path):
    if not os.path.isdir(path) and os.path.exists(
            os.path.join(path, 'Contents')):
        raise SystemExit('%s: %s does not look like an app bundle'
            % (sys.argv[0], path))
    files = MachOStandalone(path).run()
    strip_files(files)
github metachris / py2app / py2app / build_app.py View on Github external
print("_tkinter already linked against system Tcl/Tk")


def get_zipfile(dist, semi_standalone=False):
    if sys.version_info[0] == 3:
        if semi_standalone:
            return "python%d.%d/site-packages.zip"%(sys.version_info[:2])
        else:
            return "python%d%d.zip"%(sys.version_info[:2])
    return getattr(dist, "zipfile", None) or "site-packages.zip"

def framework_copy_condition(src):
    # Skip Headers, .svn, and CVS dirs
    return skipscm(src) and os.path.basename(src) != 'Headers'

class PythonStandalone(macholib.MachOStandalone.MachOStandalone):
    def __init__(self, appbuilder, *args, **kwargs):
        super(PythonStandalone, self).__init__(*args, **kwargs)
        self.appbuilder = appbuilder

    def copy_dylib(self, src):
        dest = os.path.join(self.dest, os.path.basename(src))
        if os.path.islink(src):
            dest = os.path.join(self.dest, os.path.basename(os.path.realpath(src)))

            # Ensure that the orginal name also exists, avoids problems when
            # the filename is used from Python (see issue #65)
            #
            # NOTE: The if statement checks that the target link won't
            #       point to itself, needed for systems like homebrew that
            #       store symlinks in "public" locations that point to
            #       files of the same name in a per-package install location.