schmir / bbfreeze

UNMAINTAINED
http://pypi.python.org/pypi/bbfreeze/
92 stars 22 forks source link

Freezing PySide on OSX #15

Closed RyanHope closed 10 years ago

RyanHope commented 11 years ago

I am not sure if this is unique to PySide but when my PySide app gets frozen by bbfreeze the modulegraph pulls in the proper PySide.Qt.so files but it fails to grab the deps of these files, libpyside and libshiboken*. I have to add something like the following to fix up my build:

def find_n_fix_missing(libs):
    missing = []
    for f in libs:
        output = subprocess.Popen(['otool', '-XL', f], stdout=subprocess.PIPE).communicate()[0]
        for line in output.splitlines():
            libpath = line.strip().split(" ")[0]
            if libpath != f and libpath[0] != "/" and libpath[0] != "@":
                if not libpath in missing and not '.framework' in libpath:
                    missing.append(libpath)
                    shutil.copy(os.path.join('/usr/lib', libpath), libpath)
                subprocess.Popen(['install_name_tool', '-change', libpath, "@executable_path/" + libpath, f])
    if missing:
        find_n_fix_missing(missing)

os.chdir(freezer.distdir)
find_n_fix_missing(glob.glob("*.so") + glob.glob("*.dylib"))
schmir commented 11 years ago

Strictly speaking bbfreeze doesn't support OS X. I once wanted to add support for it, but lost all interest. Why don't you use py2app?

RyanHope commented 11 years ago

Well i've never used macholib or modulegraph but I am skilled enough that I can probably help support OSX on bbfreeze. I need to make builds for OSX, Windows and Linux so I would rather not use multiple build systems.

schmir commented 11 years ago

ok, part of the above should then be implemented in bbfreeze.getdeps. please do that and open a proper pull request.

Doesn't pyinstaller / cxFreeze already do what you want?

RyanHope commented 11 years ago

I tried cx_freeze in the past and again recently, it has so many issues. I like the use of modulegraph and the support for pkg_resources in bbfreeze. Your project seems much cleaner.

schmir commented 11 years ago

ok. then go ahead!

schmir commented 10 years ago

I'm closing this one. OS X isn't supported.