]> granicus.if.org Git - python/commitdiff
Added a hack so we can build applets with a MacPython that uses the
authorJack Jansen <jack.jansen@cwi.nl>
Fri, 15 Nov 2002 00:05:47 +0000 (00:05 +0000)
committerJack Jansen <jack.jansen@cwi.nl>
Fri, 15 Nov 2002 00:05:47 +0000 (00:05 +0000)
OSX 10.2 apple-supplied Python as its base: if we've copied a symlink
as the executable we remove it and install appletrunner in stead.

Mac/Lib/buildtools.py

index 68a6614535f35f8e6fea8a8089547cbdae4ef8be..01b5392e6c3ef884448d12ec0d9228f52983bcc1 100644 (file)
@@ -299,6 +299,17 @@ def process_common_macho(template, progress, code, rsrcname, destname, is_update
                                "Contents/Resources/python.rsrc",
                                ]
                copyapptree(template, destname, exceptlist, progress)
+               # SERIOUS HACK. If we've just copied a symlink as the
+               # executable we assume we're running from the MacPython addon
+               # to 10.2 python. We remove the symlink again and install
+               # the appletrunner script.
+               executable = os.path.join(destname, "Contents/MacOS/python")
+               if os.path.islink(executable):
+                       os.remove(executable)
+                       dummyfp, appletrunner, d2 = imp.find_module('appletrunner')
+                       del dummyfp
+                       shutil.copy2(appletrunner, executable)
+                       os.chmod(executable, 0775)
        # Now either use the .plist file or the default
        if progress:
                progress.label('Create info.plist')