[Python-checkins] r68080 - in python/branches/release30-maint: Mac/BuildScript/build-installer.py Mac/BuildScript/resources/Welcome.rtf Mac/IDLE/IDLE.app/Contents/Info.plist Mac/IDLE/IDLE.app/Contents/MacOS/IDLE Mac/Makefile.in Mac/PythonLauncher/Info.plist.in Mac/PythonLauncher/Makefile.in Mac/Tools/bundlebuilder.py Mac/Tools/fixapplepython23.py

benjamin.peterson python-checkins at python.org
Tue Dec 30 21:19:21 CET 2008


Author: benjamin.peterson
Date: Tue Dec 30 21:19:21 2008
New Revision: 68080

Log:
Merged revisions 68062,68064 via svnmerge from 
svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r68062 | ronald.oussoren | 2008-12-30 06:59:02 -0600 (Tue, 30 Dec 2008) | 12 lines
  
  Make it possible to install a framework build of Python 3.x on OSX.
  
  This the build machinery on OSX to re-enable building (and installing)
  PythonLauncher.app and IDLE.app.
  
  This needs ports of fixes to Lib/distutils/util.py and Include/pymacconfig.h
  to be fully functiontional, to be fully functional.
  
  I also have a patch for Makefile.pre.in that I'll post on bugs.python.org
  for review.
........
  r68064 | ronald.oussoren | 2008-12-30 08:16:51 -0600 (Tue, 30 Dec 2008) | 11 lines
  
  Py3k: update OSX installer-generator
  
  This update makes sure that the installer won't write files
  in /usr/local/bin by default. The installer also won't 
  replace /Library/Frameworks/Python.framework/Version/Current.
  
  Both to ensure that the installer doens't break an existing
  install of python 2.x.
........


Added:
   python/branches/release30-maint/Mac/Tools/bundlebuilder.py
      - copied unchanged from r68064, /python/branches/py3k/Mac/Tools/bundlebuilder.py
Modified:
   python/branches/release30-maint/   (props changed)
   python/branches/release30-maint/Mac/BuildScript/build-installer.py
   python/branches/release30-maint/Mac/BuildScript/resources/Welcome.rtf
   python/branches/release30-maint/Mac/IDLE/IDLE.app/Contents/Info.plist
   python/branches/release30-maint/Mac/IDLE/IDLE.app/Contents/MacOS/IDLE
   python/branches/release30-maint/Mac/Makefile.in
   python/branches/release30-maint/Mac/PythonLauncher/Info.plist.in
   python/branches/release30-maint/Mac/PythonLauncher/Makefile.in
   python/branches/release30-maint/Mac/Tools/fixapplepython23.py

Modified: python/branches/release30-maint/Mac/BuildScript/build-installer.py
==============================================================================
--- python/branches/release30-maint/Mac/BuildScript/build-installer.py	(original)
+++ python/branches/release30-maint/Mac/BuildScript/build-installer.py	Tue Dec 30 21:19:21 2008
@@ -196,6 +196,7 @@
             wrappers for lots of Mac OS X API's.
         """,
         postflight="scripts/postflight.framework",
+        selected='selected',
     ),
     dict(
         name="PythonApplications",
@@ -209,6 +210,7 @@
             It also installs a number of examples and demos.
             """,
         required=False,
+        selected='selected',
     ),
     dict(
         name="PythonUnixTools",
@@ -220,6 +222,7 @@
             is not necessary to use MacPython.
             """,
         required=False,
+        selected='unselected',
     ),
     dict(
         name="PythonDocumentation",
@@ -234,6 +237,7 @@
             """,
         postflight="scripts/postflight.documentation",
         required=False,
+        selected='selected',
     ),
     dict(
         name="PythonProfileChanges",
@@ -251,6 +255,7 @@
         topdir="/Library/Frameworks/Python.framework",
         source="/empty-dir",
         required=False,
+        selected='unselected',
     ),
     dict(
         name="PythonSystemFixes",
@@ -264,6 +269,7 @@
         topdir="/Library/Frameworks/Python.framework",
         source="/empty-dir",
         required=False,
+        selected='unselected',
     )
 ]
 
@@ -662,6 +668,8 @@
     frmDir = os.path.join(rootDir, 'Library', 'Frameworks', 'Python.framework')
     gid = grp.getgrnam('admin').gr_gid
 
+
+
     for dirpath, dirnames, filenames in os.walk(frmDir):
         for dn in dirnames:
             os.chmod(os.path.join(dirpath, dn), 0775)
@@ -708,6 +716,11 @@
 
     os.chdir(curdir)
 
+    # Remove the 'Current' link, that way we don't accidently mess with an already installed
+    # version of python
+    os.unlink(os.path.join(rootDir, 'Library', 'Frameworks', 'Python.framework', 'Versions', 'Current'))
+
+
 
 
 def patchFile(inPath, outPath):
@@ -842,7 +855,7 @@
             IFPkgFlagPackageList=[
                 dict(
                     IFPkgFlagPackageLocation='%s-%s.pkg'%(item['name'], getVersion()),
-                    IFPkgFlagPackageSelection='selected'
+                    IFPkgFlagPackageSelection=item['selected'],
                 )
                 for item in PKG_RECIPES
             ],

Modified: python/branches/release30-maint/Mac/BuildScript/resources/Welcome.rtf
==============================================================================
--- python/branches/release30-maint/Mac/BuildScript/resources/Welcome.rtf	(original)
+++ python/branches/release30-maint/Mac/BuildScript/resources/Welcome.rtf	Tue Dec 30 21:19:21 2008
@@ -1,18 +1,20 @@
-{\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf410
-{\fonttbl\f0\fswiss\fcharset77 Helvetica;\f1\fswiss\fcharset77 Helvetica-Bold;}
+{\rtf1\ansi\ansicpg1252\cocoartf949\cocoasubrtf430
+{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
 {\colortbl;\red255\green255\blue255;}
 \paperw11900\paperh16840\margl1440\margr1440\vieww9920\viewh10660\viewkind0
 \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural
 
 \f0\fs24 \cf0 This package will install 
-\f1\b MacPython $FULL_VERSION
-\f0\b0  for 
-\f1\b Mac OS X $MACOSX_DEPLOYMENT_TARGET
-\f0\b0 .\
+\b MacPython $FULL_VERSION
+\b0  for 
+\b Mac OS X $MACOSX_DEPLOYMENT_TARGET
+\b0 .\
 \
 MacPython consists of the Python programming language interpreter, plus a set of programs to allow easy access to it for Mac users (an integrated development environment, an applet builder), plus a set of pre-built extension modules that open up specific Macintosh technologies to Python programs (Carbon, AppleScript, Quicktime, more).\
 \
 See the ReadMe file for more information.\
 \
-\
-This package will by default update your shell profile to ensure that this version of Python is on the search path of your shell. Please deselect the "Shell profile updater" package on the package customization screen  if you want to avoid this modification. }
\ No newline at end of file
+
+\b NOTE: 
+\b0 This package will by default update not your shell profile, and will also not install\
+files in /usr/local. }
\ No newline at end of file

Modified: python/branches/release30-maint/Mac/IDLE/IDLE.app/Contents/Info.plist
==============================================================================
--- python/branches/release30-maint/Mac/IDLE/IDLE.app/Contents/Info.plist	(original)
+++ python/branches/release30-maint/Mac/IDLE/IDLE.app/Contents/Info.plist	Tue Dec 30 21:19:21 2008
@@ -36,7 +36,7 @@
 	<key>CFBundleExecutable</key>
 	<string>IDLE</string>
 	<key>CFBundleGetInfoString</key>
-	<string>2.6.0, © 001-2006 Python Software Foundation</string>
+	<string>%version%, © 2001-2008 Python Software Foundation</string>
 	<key>CFBundleIconFile</key>
 	<string>IDLE.icns</string>
 	<key>CFBundleIdentifier</key>
@@ -48,10 +48,10 @@
 	<key>CFBundlePackageType</key>
 	<string>APPL</string>
 	<key>CFBundleShortVersionString</key>
-	<string>2.6.0</string>
+	<string>%version%</string>
 	<key>CFBundleSignature</key>
 	<string>????</string>
 	<key>CFBundleVersion</key>
-	<string>2.6.0</string>
+	<string>%version%</string>
 </dict>
 </plist>

Modified: python/branches/release30-maint/Mac/IDLE/IDLE.app/Contents/MacOS/IDLE
==============================================================================
--- python/branches/release30-maint/Mac/IDLE/IDLE.app/Contents/MacOS/IDLE	(original)
+++ python/branches/release30-maint/Mac/IDLE/IDLE.app/Contents/MacOS/IDLE	Tue Dec 30 21:19:21 2008
@@ -1,4 +1,4 @@
-#!/Library/Frameworks/Python.framework/Versions/3.0/Resources/Python.app/Contents/MacOS/Python
+#!%prefix%/Resources/Python.app/Contents/MacOS/Python3
 
 import sys, os
 execdir = os.path.dirname(sys.argv[0])

Modified: python/branches/release30-maint/Mac/Makefile.in
==============================================================================
--- python/branches/release30-maint/Mac/Makefile.in	(original)
+++ python/branches/release30-maint/Mac/Makefile.in	Tue Dec 30 21:19:21 2008
@@ -216,8 +216,10 @@
 install_IDLE:
 	test -d "$(DESTDIR)$(PYTHONAPPSDIR)" || mkdir -p "$(DESTDIR)$(PYTHONAPPSDIR)"
 	-test -d "$(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app" && rm -r "$(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app"
-	cp -PR IDLE/IDLE.app "$(DESTDIR)$(PYTHONAPPSDIR)"
+	cp -PR "$(srcdir)/IDLE/IDLE.app" "$(DESTDIR)$(PYTHONAPPSDIR)"
 	ln -sf $(INSTALLED_PYTHONAPP) "$(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app/Contents/MacOS/Python"
+	sed "s!%prefix%!$(prefix)!g" < "$(srcdir)/IDLE/IDLE.app/Contents/MacOS/IDLE" > "$(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app/Contents/MacOS/IDLE"
+	sed "s!%version%!`$(RUNSHARED) $(BUILDPYTHON) -c 'import platform; print(platform.python_version())'`!g" < "$(srcdir)/IDLE/IDLE.app/Contents/Info.plist" > "$(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app/Contents/Info.plist"
 	touch "$(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app"
 
 $(INSTALLED_PYTHONAPP): install_Python

Modified: python/branches/release30-maint/Mac/PythonLauncher/Info.plist.in
==============================================================================
--- python/branches/release30-maint/Mac/PythonLauncher/Info.plist.in	(original)
+++ python/branches/release30-maint/Mac/PythonLauncher/Info.plist.in	Tue Dec 30 21:19:21 2008
@@ -40,7 +40,7 @@
 	<key>CFBundleExecutable</key>
 	<string>PythonLauncher</string>
 	<key>CFBundleGetInfoString</key>
-	<string>%VERSION%, © 001-2006 Python Software Foundation</string>
+	<string>%VERSION%, © 2001-2008 Python Software Foundation</string>
 	<key>CFBundleIconFile</key>
 	<string>PythonLauncher.icns</string>
 	<key>CFBundleIdentifier</key>

Modified: python/branches/release30-maint/Mac/PythonLauncher/Makefile.in
==============================================================================
--- python/branches/release30-maint/Mac/PythonLauncher/Makefile.in	(original)
+++ python/branches/release30-maint/Mac/PythonLauncher/Makefile.in	Tue Dec 30 21:19:21 2008
@@ -19,13 +19,63 @@
 MACOSX_DEPLOYMENT_TARGET=@CONFIGURE_MACOSX_DEPLOYMENT_TARGET@
 @EXPORT_MACOSX_DEPLOYMENT_TARGET at export MACOSX_DEPLOYMENT_TARGET
 
-BUNDLEBULDER=$(srcdir)/../../Lib/plat-mac/bundlebuilder.py
+BUNDLEBULDER=$(srcdir)/../Tools/bundlebuilder.py
 
 PYTHONAPPSDIR=/Applications/$(PYTHONFRAMEWORK) $(VERSION)
 OBJECTS=FileSettings.o MyAppDelegate.o MyDocument.o PreferencesWindowController.o doscript.o main.o
 
-install:
+install: Python\ Launcher.app
 	test -d "$(DESTDIR)$(PYTHONAPPSDIR)" || mkdir -p "$(DESTDIR)$(PYTHONAPPSDIR)"
 	-test -d "$(DESTDIR)$(PYTHONAPPSDIR)/Python Launcher.app" && rm -r "$(DESTDIR)$(PYTHONAPPSDIR)/Python Launcher.app"
 	cp -r "Python Launcher.app" "$(DESTDIR)$(PYTHONAPPSDIR)"
 	touch "$(DESTDIR)$(PYTHONAPPSDIR)/Python Launcher.app"
+
+
+clean:
+	rm -f *.o "Python Launcher"
+	rm -rf "Python Launcher.app"
+
+Python\ Launcher.app:  Info.plist \
+		Python\ Launcher $(srcdir)/../Icons/PythonLauncher.icns \
+		$(srcdir)/../Icons/PythonSource.icns \
+		$(srcdir)/../Icons/PythonCompiled.icns \
+		$(srcdir)/factorySettings.plist
+	rm -fr "Python Launcher.app"
+	$(RUNSHARED) $(BUILDPYTHON) $(BUNDLEBULDER) \
+		--builddir=. \
+		--name="Python Launcher" \
+		--executable="Python Launcher" \
+		--iconfile=$(srcdir)/../Icons/PythonLauncher.icns \
+		--bundle-id=org.python.PythonLauncher \
+		--resource=$(srcdir)/../Icons/PythonSource.icns \
+		--resource=$(srcdir)/../Icons/PythonCompiled.icns \
+		--resource=$(srcdir)/English.lproj \
+		--resource=$(srcdir)/factorySettings.plist \
+		--plist Info.plist \
+		build
+	find "Python Launcher.app" -name '.svn' -print0 | xargs -0 rm -r
+		
+
+FileSettings.o: $(srcdir)/FileSettings.m
+	$(CC) $(CFLAGS) -o $@ -c $(srcdir)/FileSettings.m
+
+MyAppDelegate.o: $(srcdir)/MyAppDelegate.m
+	$(CC) $(CFLAGS) -o $@ -c $(srcdir)/MyAppDelegate.m
+
+MyDocument.o: $(srcdir)/MyDocument.m
+	$(CC) $(CFLAGS) -o $@ -c $(srcdir)/MyDocument.m
+
+PreferencesWindowController.o: $(srcdir)/PreferencesWindowController.m
+	$(CC) $(CFLAGS) -o $@ -c $(srcdir)/PreferencesWindowController.m
+
+doscript.o: $(srcdir)/doscript.m
+	$(CC) $(CFLAGS) -o $@ -c $(srcdir)/doscript.m
+
+main.o: $(srcdir)/main.m
+	$(CC) $(CFLAGS) -o $@ -c $(srcdir)/main.m
+
+Python\ Launcher: $(OBJECTS)
+	$(CC) $(LDFLAGS) -o "Python Launcher" $(OBJECTS) -framework AppKit -framework Carbon
+
+Info.plist: $(srcdir)/Info.plist.in
+	sed 's/%VERSION%/'"`$(RUNSHARED) $(BUILDPYTHON) -c 'import platform; print(platform.python_version())'`"'/g' < $(srcdir)/Info.plist.in > Info.plist

Modified: python/branches/release30-maint/Mac/Tools/fixapplepython23.py
==============================================================================
--- python/branches/release30-maint/Mac/Tools/fixapplepython23.py	(original)
+++ python/branches/release30-maint/Mac/Tools/fixapplepython23.py	Tue Dec 30 21:19:21 2008
@@ -14,7 +14,7 @@
 """
 import sys
 import os
-import gestalt as _gestalt
+import platform
 
 MAKEFILE='/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/config/Makefile'
 CHANGES=((
@@ -99,11 +99,12 @@
         print("fixapplypython23: no fix is needed on MacOSX on Intel")
         sys.exit(0)
 
-    if gestalt.gestalt('sysv') < 0x1030:
+    osver =  platform.mac_ver()
+    if osver != '10.3' and os.ver < '10.3.':
         print('fixapplepython23: no fix needed on MacOSX < 10.3')
         sys.exit(0)
 
-    if gestalt.gestalt('sysv') >= 0x1040:
+    if osver >= '10.4':
         print('fixapplepython23: no fix needed on MacOSX >= 10.4')
         sys.exit(0)
 


More information about the Python-checkins mailing list