Ejemplo n.º 1
0
def process_common_macho(template, progress, code, rsrcname, destname, is_update,
        raw=0, others=[], filename=None, destroot=""):
    # Check that we have a filename
    if filename is None:
        raise BuildError, "Need source filename on MacOSX"
    # First make sure the name ends in ".app"
    if destname[-4:] != '.app':
        destname = destname + '.app'
    # Now deduce the short name
    destdir, shortname = os.path.split(destname)
    if shortname[-4:] == '.app':
        # Strip the .app suffix
        shortname = shortname[:-4]
    # And deduce the .plist and .icns names
    plistname = None
    icnsname = None
    if rsrcname and rsrcname[-5:] == '.rsrc':
        tmp = rsrcname[:-5]
        plistname = tmp + '.plist'
        if os.path.exists(plistname):
            icnsname = tmp + '.icns'
            if not os.path.exists(icnsname):
                icnsname = None
        else:
            plistname = None
    if not icnsname:
        dft_icnsname = os.path.join(sys.prefix, 'Resources/Python.app/Contents/Resources/PythonApplet.icns')
        if os.path.exists(dft_icnsname):
            icnsname = dft_icnsname
    if not os.path.exists(rsrcname):
        rsrcname = None
    if progress:
        progress.label('Creating bundle...')
    import bundlebuilder
    builder = bundlebuilder.AppBuilder(verbosity=0)
    builder.mainprogram = filename
    builder.builddir = destdir
    builder.name = shortname
    builder.destroot = destroot
    if rsrcname:
        realrsrcname = macresource.resource_pathname(rsrcname)
        builder.files.append((realrsrcname,
            os.path.join('Contents/Resources', os.path.basename(rsrcname))))
    for o in others:
        if type(o) == str:
            builder.resources.append(o)
        else:
            builder.files.append(o)
    if plistname:
        import plistlib
        builder.plist = plistlib.Plist.fromFile(plistname)
    if icnsname:
        builder.iconfile = icnsname
    if not raw:
        builder.argv_emulation = 1
    builder.setup()
    builder.build()
    if progress:
        progress.label('Done.')
        progress.inc(0)
Ejemplo n.º 2
0
def common_setup():
    app = bundlebuilder.AppBuilder(verbosity=1)

    if len(sys.argv) > 1:    
        app.version = sys.argv[1]

    app.includeModules.append('encodings.ascii')
    app.includeModules.append('encodings.utf_8')
    app.includeModules.append('encodings.latin_1')

    app.excludeModules.append('wx._ogl')
    app.excludeModules.append('wx._xrc')
    app.excludeModules.append('wx._wizard')

    app.iconfile = "neveredit.icns"
    #app.standalone = True
    app.semi_standalone = True
    app.strip = True

    app.libs.append(wxPy + "/lib/libwx_macd-" + libExt)
    app.libs.append(wxPy + "/lib/libwx_macd_stc-" + libExt)
    app.libs.append(wxPy + "/lib/libwx_macd-" + wxPyMajorVersion + ".rsrc")

    app.resources.append("help_nwnlexicon.zip")

    app.argv_emulation = True
    
    return app
Ejemplo n.º 3
0
import bundlebuilder, os
from ipodder.configuration import __version__

#os.system("cp /System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site-packages/wx-2.5.3-mac-unicode/wx/lib/mixins/listctrl.py .")

# I set this to make adding subfolders into the package easier
#packageroot = "/Users/erikdj/eclipse/workspace/iSpider"
packageroot = "./"

# Create the AppBuilder
myapp = bundlebuilder.AppBuilder(verbosity=1)

# Tell it where to find the main script - the one that loads on startup
myapp.mainprogram = os.path.join(packageroot, "gui.py")

myapp.standalone = 1
myapp.name = "Juice"
myapp.iconfile = packageroot + '/iPodder.icns'

# includePackages forces certain packages to be added to the app bundle
myapp.includePackages.append("encodings")
myapp.includePackages.append("_xmlplus")
myapp.includePackages.append("_strptime")
myapp.includePackages.append("gzip")
myapp.includePackages.append("zipfile")
myapp.includePackages.append("platform")
myapp.includePackages.append("optparse")
myapp.includePackages.append("sgmllib")
myapp.includePackages.append("cgi")
myapp.includePackages.append("select")
myapp.includePackages.append("wxPython")