summaryrefslogtreecommitdiffstats
path: root/Lib/plat-mac/bundlebuilder.py
diff options
context:
space:
mode:
authorJust van Rossum <just@letterror.com>2003-03-21 09:26:59 (GMT)
committerJust van Rossum <just@letterror.com>2003-03-21 09:26:59 (GMT)
commit15624d850b65a0be8e944e9f17849799e3e7ede5 (patch)
tree8111db2729b390ec4ef71522443f7e3528ee45a0 /Lib/plat-mac/bundlebuilder.py
parent718d307df838c0fefa674560f39a2a777b408e72 (diff)
downloadcpython-15624d850b65a0be8e944e9f17849799e3e7ede5.zip
cpython-15624d850b65a0be8e944e9f17849799e3e7ede5.tar.gz
cpython-15624d850b65a0be8e944e9f17849799e3e7ede5.tar.bz2
Patch #681927 from Robin Dunn: add option to add shared libraries or
frameworks to the bundle.
Diffstat (limited to 'Lib/plat-mac/bundlebuilder.py')
-rwxr-xr-xLib/plat-mac/bundlebuilder.py16
1 files changed, 15 insertions, 1 deletions
diff --git a/Lib/plat-mac/bundlebuilder.py b/Lib/plat-mac/bundlebuilder.py
index 5fe2c60..2a32499 100755
--- a/Lib/plat-mac/bundlebuilder.py
+++ b/Lib/plat-mac/bundlebuilder.py
@@ -94,6 +94,10 @@ class BundleBuilder(Defaults):
# (eg. "Contents/Resources/MyStuff/SomeFile.ext).
files = []
+ # List of shared libraries (dylibs, Frameworks) to bundle with the app
+ # will be placed in Contents/Frameworks
+ libs = []
+
# Directory where the bundle will be assembled.
builddir = "build"
@@ -168,6 +172,9 @@ class BundleBuilder(Defaults):
for path in self.resources:
files.append((path, pathjoin("Contents", "Resources",
os.path.basename(path))))
+ for path in self.libs:
+ files.append((path, pathjoin("Contents", "Frameworks",
+ os.path.basename(path))))
if self.symlink:
self.message("Making symbolic links", 1)
msg = "Making symlink from"
@@ -268,12 +275,14 @@ import sys, os
execdir = os.path.dirname(sys.argv[0])
executable = os.path.join(execdir, "%(executable)s")
resdir = os.path.join(os.path.dirname(execdir), "Resources")
+libdir = os.path.join(os.path.dirname(execdir), "Frameworks")
mainprogram = os.path.join(resdir, "%(mainprogram)s")
sys.argv.insert(1, mainprogram)
os.environ["PYTHONPATH"] = resdir
os.environ["PYTHONHOME"] = resdir
os.environ["PYTHONEXECUTABLE"] = executable
+os.environ["DYLD_LIBRARY_PATH"] = libdir
os.execve(executable, sys.argv, os.environ)
"""
@@ -697,6 +706,8 @@ Options:
--link-exec symlink the executable instead of copying it
--standalone build a standalone application, which is fully
independent of a Python installation
+ --lib=FILE shared library or framework to be copied into
+ the bundle
-x, --exclude=MODULE exclude module (with --standalone)
-i, --include=MODULE include module (with --standalone)
--package=PACKAGE include a whole package (with --standalone)
@@ -720,7 +731,8 @@ def main(builder=None):
longopts = ("builddir=", "name=", "resource=", "file=", "executable=",
"mainprogram=", "creator=", "nib=", "plist=", "link",
"link-exec", "help", "verbose", "quiet", "argv", "standalone",
- "exclude=", "include=", "package=", "strip", "iconfile=")
+ "exclude=", "include=", "package=", "strip", "iconfile=",
+ "lib=")
try:
options, args = getopt.getopt(sys.argv[1:], shortopts, longopts)
@@ -750,6 +762,8 @@ def main(builder=None):
builder.creator = arg
elif opt == '--iconfile':
builder.iconfile = arg
+ elif opt == "--lib":
+ builder.libs.append(arg)
elif opt == "--nib":
builder.nibname = arg
elif opt in ('-p', '--plist'):