# If True, build standalone app.
standalone = 0
+ # If set, use this for #! lines in stead of sys.executable
+ python = None
+
# If True, add a real main program that emulates sys.argv before calling
# mainprogram
argv_emulation = 0
# XXX we're screwed when the end user has deleted
# /usr/bin/python
hashbang = "/usr/bin/python"
+ elif self.python:
+ hashbang = self.python
else:
hashbang = os.path.realpath(sys.executable)
standalone = self.standalone
--link-exec symlink the executable instead of copying it
--standalone build a standalone application, which is fully
independent of a Python installation
+ --python=FILE Python to use in #! line in stead of current Python
--lib=FILE shared library or framework to be copied into
the bundle
-x, --exclude=MODULE exclude module (with --standalone)
"mainprogram=", "creator=", "nib=", "plist=", "link",
"link-exec", "help", "verbose", "quiet", "argv", "standalone",
"exclude=", "include=", "package=", "strip", "iconfile=",
- "lib=")
+ "lib=", "python=")
try:
options, args = getopt.getopt(sys.argv[1:], shortopts, longopts)
builder.verbosity -= 1
elif opt == '--standalone':
builder.standalone = 1
+ elif opt == '--python':
+ builder.python = arg
elif opt in ('-x', '--exclude'):
builder.excludeModules.append(arg)
elif opt in ('-i', '--include'):
buildtools.process(template, filename, dstfilename, 1)
else:
- SHORTOPTS = "o:r:ne:v?"
- LONGOPTS=("output=", "resource=", "noargv", "extra=", "verbose", "help")
+ SHORTOPTS = "o:r:ne:v?P"
+ LONGOPTS=("output=", "resource=", "noargv", "extra=", "verbose", "help", "python=")
try:
options, args = getopt.getopt(sys.argv[1:], SHORTOPTS, LONGOPTS)
except getopt.error:
if ':' in arg:
arg = arg.split(':')
extras.append(arg)
+ elif opt in ('-P', '--python'):
+ # This is a very dirty trick. We set sys.executable
+ # so that bundlebuilder will use this in the #! line
+ # for the applet bootstrap.
+ sys.executable = arg
elif opt in ('-v', '--verbose'):
verbose = Verbose()
elif opt in ('-?', '--help'):