Commit 21600159 authored by Ronald Oussoren's avatar Ronald Oussoren

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.
parent a17775fa
{\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf410 {\rtf1\ansi\ansicpg1252\cocoartf949\cocoasubrtf430
{\fonttbl\f0\fswiss\fcharset77 Helvetica;\f1\fswiss\fcharset77 Helvetica-Bold;} {\fonttbl\f0\fswiss\fcharset0 Helvetica;}
{\colortbl;\red255\green255\blue255;} {\colortbl;\red255\green255\blue255;}
\paperw11900\paperh16840\margl1440\margr1440\vieww9920\viewh10660\viewkind0 \paperw11900\paperh16840\margl1440\margr1440\vieww9920\viewh10660\viewkind0
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural
\f0\fs24 \cf0 This package will install \f0\fs24 \cf0 This package will install
\f1\b MacPython $FULL_VERSION \b MacPython $FULL_VERSION
\f0\b0 for \b0 for
\f1\b Mac OS X $MACOSX_DEPLOYMENT_TARGET \b Mac OS X $MACOSX_DEPLOYMENT_TARGET
\f0\b0 .\ \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).\ 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.\ 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. } \b NOTE:
\ No newline at end of file \b0 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
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
<key>CFBundleExecutable</key> <key>CFBundleExecutable</key>
<string>IDLE</string> <string>IDLE</string>
<key>CFBundleGetInfoString</key> <key>CFBundleGetInfoString</key>
<string>2.6.0, © 001-2006 Python Software Foundation</string> <string>%version%, © 2001-2008 Python Software Foundation</string>
<key>CFBundleIconFile</key> <key>CFBundleIconFile</key>
<string>IDLE.icns</string> <string>IDLE.icns</string>
<key>CFBundleIdentifier</key> <key>CFBundleIdentifier</key>
...@@ -48,10 +48,10 @@ ...@@ -48,10 +48,10 @@
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>APPL</string> <string>APPL</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>2.6.0</string> <string>%version%</string>
<key>CFBundleSignature</key> <key>CFBundleSignature</key>
<string>????</string> <string>????</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>2.6.0</string> <string>%version%</string>
</dict> </dict>
</plist> </plist>
#!/Library/Frameworks/Python.framework/Versions/3.0/Resources/Python.app/Contents/MacOS/Python #!%prefix%/Resources/Python.app/Contents/MacOS/Python3
import sys, os import sys, os
execdir = os.path.dirname(sys.argv[0]) execdir = os.path.dirname(sys.argv[0])
......
...@@ -216,8 +216,10 @@ install_Python4way: install_Python ...@@ -216,8 +216,10 @@ install_Python4way: install_Python
install_IDLE: install_IDLE:
test -d "$(DESTDIR)$(PYTHONAPPSDIR)" || mkdir -p "$(DESTDIR)$(PYTHONAPPSDIR)" test -d "$(DESTDIR)$(PYTHONAPPSDIR)" || mkdir -p "$(DESTDIR)$(PYTHONAPPSDIR)"
-test -d "$(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app" && rm -r "$(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app" -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" 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" touch "$(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app"
$(INSTALLED_PYTHONAPP): install_Python $(INSTALLED_PYTHONAPP): install_Python
......
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
<key>CFBundleExecutable</key> <key>CFBundleExecutable</key>
<string>PythonLauncher</string> <string>PythonLauncher</string>
<key>CFBundleGetInfoString</key> <key>CFBundleGetInfoString</key>
<string>%VERSION%, © 001-2006 Python Software Foundation</string> <string>%VERSION%, © 2001-2008 Python Software Foundation</string>
<key>CFBundleIconFile</key> <key>CFBundleIconFile</key>
<string>PythonLauncher.icns</string> <string>PythonLauncher.icns</string>
<key>CFBundleIdentifier</key> <key>CFBundleIdentifier</key>
......
...@@ -19,13 +19,63 @@ PYTHONFRAMEWORK=@PYTHONFRAMEWORK@ ...@@ -19,13 +19,63 @@ PYTHONFRAMEWORK=@PYTHONFRAMEWORK@
MACOSX_DEPLOYMENT_TARGET=@CONFIGURE_MACOSX_DEPLOYMENT_TARGET@ MACOSX_DEPLOYMENT_TARGET=@CONFIGURE_MACOSX_DEPLOYMENT_TARGET@
@EXPORT_MACOSX_DEPLOYMENT_TARGET@export MACOSX_DEPLOYMENT_TARGET @EXPORT_MACOSX_DEPLOYMENT_TARGET@export MACOSX_DEPLOYMENT_TARGET
BUNDLEBULDER=$(srcdir)/../../Lib/plat-mac/bundlebuilder.py BUNDLEBULDER=$(srcdir)/../Tools/bundlebuilder.py
PYTHONAPPSDIR=/Applications/$(PYTHONFRAMEWORK) $(VERSION) PYTHONAPPSDIR=/Applications/$(PYTHONFRAMEWORK) $(VERSION)
OBJECTS=FileSettings.o MyAppDelegate.o MyDocument.o PreferencesWindowController.o doscript.o main.o 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)" || mkdir -p "$(DESTDIR)$(PYTHONAPPSDIR)"
-test -d "$(DESTDIR)$(PYTHONAPPSDIR)/Python Launcher.app" && rm -r "$(DESTDIR)$(PYTHONAPPSDIR)/Python Launcher.app" -test -d "$(DESTDIR)$(PYTHONAPPSDIR)/Python Launcher.app" && rm -r "$(DESTDIR)$(PYTHONAPPSDIR)/Python Launcher.app"
cp -r "Python Launcher.app" "$(DESTDIR)$(PYTHONAPPSDIR)" cp -r "Python Launcher.app" "$(DESTDIR)$(PYTHONAPPSDIR)"
touch "$(DESTDIR)$(PYTHONAPPSDIR)/Python Launcher.app" 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
This diff is collapsed.
...@@ -14,7 +14,7 @@ status also when nothing needs to be fixed. ...@@ -14,7 +14,7 @@ status also when nothing needs to be fixed.
""" """
import sys import sys
import os import os
import gestalt as _gestalt import platform
MAKEFILE='/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/config/Makefile' MAKEFILE='/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/config/Makefile'
CHANGES=(( CHANGES=((
...@@ -99,11 +99,12 @@ def main(): ...@@ -99,11 +99,12 @@ def main():
print("fixapplypython23: no fix is needed on MacOSX on Intel") print("fixapplypython23: no fix is needed on MacOSX on Intel")
sys.exit(0) 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') print('fixapplepython23: no fix needed on MacOSX < 10.3')
sys.exit(0) sys.exit(0)
if gestalt.gestalt('sysv') >= 0x1040: if osver >= '10.4':
print('fixapplepython23: no fix needed on MacOSX >= 10.4') print('fixapplepython23: no fix needed on MacOSX >= 10.4')
sys.exit(0) sys.exit(0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment