Revision 1 as of 2003-09-10 17:50:11

Clear message

BundleBuilder is a script that lets you create applets, or more importantly, standalone Python application bundles on Mac. To create a standalone application bundle on Mac, you need to create a script which starts bundlebuilder, tells it what files and libraries you want to package, and then lets it do its thing. Here is an example script that showcases most of the important features of bundlebuilder:

   1 import bundlebuilder, os
   2 
   3 # I set this to make adding subfolders into the package easier
   4 packageroot = "/Users/kevino/oss/eclass/eclass_builder"
   5 
   6 # Create the AppBuilder
   7 myapp = bundlebuilder.AppBuilder(verbosity=1)
   8 
   9 # Tell it where to find the main script - the one that loads on startup
  10 myapp.mainprogram = os.path.join(packageroot, "editor.py")
  11 
  12 myapp.standalone = 1
  13 myapp.name = "EClass.Builder"
  14 
  15 # includePackages forces certain packages to be added to the app bundle
  16 myapp.includePackages.append("encodings")
  17 myapp.includePackages.append("_xmlplus")
  18 
  19 # Here you add supporting files and/or folders to your bundle
  20 myapp.resources.append(os.path.join(packageroot, "about"))
  21 myapp.resources.append(os.path.join(packageroot, "autorun"))
  22 myapp.resources.append(os.path.join(packageroot, "Graphics"))
  23 
  24 # bundlebuilder does not yet have the capability to detect what shared libraries
  25 # are needed by your app - so in this case I am adding the wxPython libs manually
  26 myapp.libs.append("/usr/local/lib/libwx_macd-2.4.0.dylib")
  27 myapp.libs.append("/usr/local/lib/libwx_macd-2.4.0.rsrc")
  28 
  29 # Here we build the app!
  30 myapp.setup()
  31 myapp.build()

In the future, BundleBuilder will be able to detect and incorporate shared libraries as well, meaning you will only need to worry about adding your own files to the bundle.

Todo: Troubleshooting bundlebuilder problems section?

Unable to edit the page? See the FrontPage for instructions.