Skip to content

Commit 2160015

Browse files
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.
1 parent a17775f commit 2160015

8 files changed

Lines changed: 1007 additions & 19 deletions

File tree

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
1-
{\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf410
2-
{\fonttbl\f0\fswiss\fcharset77 Helvetica;\f1\fswiss\fcharset77 Helvetica-Bold;}
1+
{\rtf1\ansi\ansicpg1252\cocoartf949\cocoasubrtf430
2+
{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
33
{\colortbl;\red255\green255\blue255;}
44
\paperw11900\paperh16840\margl1440\margr1440\vieww9920\viewh10660\viewkind0
55
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural
66

77
\f0\fs24 \cf0 This package will install
8-
\f1\b MacPython $FULL_VERSION
9-
\f0\b0 for
10-
\f1\b Mac OS X $MACOSX_DEPLOYMENT_TARGET
11-
\f0\b0 .\
8+
\b MacPython $FULL_VERSION
9+
\b0 for
10+
\b Mac OS X $MACOSX_DEPLOYMENT_TARGET
11+
\b0 .\
1212
\
1313
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).\
1414
\
1515
See the ReadMe file for more information.\
1616
\
17-
\
18-
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. }
17+
18+
\b NOTE:
19+
\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. }

Mac/IDLE/IDLE.app/Contents/Info.plist

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
<key>CFBundleExecutable</key>
3737
<string>IDLE</string>
3838
<key>CFBundleGetInfoString</key>
39-
<string>2.6.0, © 001-2006 Python Software Foundation</string>
39+
<string>%version%, © 2001-2008 Python Software Foundation</string>
4040
<key>CFBundleIconFile</key>
4141
<string>IDLE.icns</string>
4242
<key>CFBundleIdentifier</key>
@@ -48,10 +48,10 @@
4848
<key>CFBundlePackageType</key>
4949
<string>APPL</string>
5050
<key>CFBundleShortVersionString</key>
51-
<string>2.6.0</string>
51+
<string>%version%</string>
5252
<key>CFBundleSignature</key>
5353
<string>????</string>
5454
<key>CFBundleVersion</key>
55-
<string>2.6.0</string>
55+
<string>%version%</string>
5656
</dict>
5757
</plist>

Mac/IDLE/IDLE.app/Contents/MacOS/IDLE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/Library/Frameworks/Python.framework/Versions/3.0/Resources/Python.app/Contents/MacOS/Python
1+
#!%prefix%/Resources/Python.app/Contents/MacOS/Python3
22

33
import sys, os
44
execdir = os.path.dirname(sys.argv[0])

Mac/Makefile.in

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,10 @@ install_Python4way: install_Python
216216
install_IDLE:
217217
test -d "$(DESTDIR)$(PYTHONAPPSDIR)" || mkdir -p "$(DESTDIR)$(PYTHONAPPSDIR)"
218218
-test -d "$(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app" && rm -r "$(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app"
219-
cp -PR IDLE/IDLE.app "$(DESTDIR)$(PYTHONAPPSDIR)"
219+
cp -PR "$(srcdir)/IDLE/IDLE.app" "$(DESTDIR)$(PYTHONAPPSDIR)"
220220
ln -sf $(INSTALLED_PYTHONAPP) "$(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app/Contents/MacOS/Python"
221+
sed "s!%prefix%!$(prefix)!g" < "$(srcdir)/IDLE/IDLE.app/Contents/MacOS/IDLE" > "$(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app/Contents/MacOS/IDLE"
222+
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"
221223
touch "$(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app"
222224

223225
$(INSTALLED_PYTHONAPP): install_Python

Mac/PythonLauncher/Info.plist.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
<key>CFBundleExecutable</key>
4141
<string>PythonLauncher</string>
4242
<key>CFBundleGetInfoString</key>
43-
<string>%VERSION%, © 001-2006 Python Software Foundation</string>
43+
<string>%VERSION%, © 2001-2008 Python Software Foundation</string>
4444
<key>CFBundleIconFile</key>
4545
<string>PythonLauncher.icns</string>
4646
<key>CFBundleIdentifier</key>

Mac/PythonLauncher/Makefile.in

Lines changed: 52 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,63 @@ PYTHONFRAMEWORK=@PYTHONFRAMEWORK@
1919
MACOSX_DEPLOYMENT_TARGET=@CONFIGURE_MACOSX_DEPLOYMENT_TARGET@
2020
@EXPORT_MACOSX_DEPLOYMENT_TARGET@export MACOSX_DEPLOYMENT_TARGET
2121

22-
BUNDLEBULDER=$(srcdir)/../../Lib/plat-mac/bundlebuilder.py
22+
BUNDLEBULDER=$(srcdir)/../Tools/bundlebuilder.py
2323

2424
PYTHONAPPSDIR=/Applications/$(PYTHONFRAMEWORK) $(VERSION)
2525
OBJECTS=FileSettings.o MyAppDelegate.o MyDocument.o PreferencesWindowController.o doscript.o main.o
2626

27-
install:
27+
install: Python\ Launcher.app
2828
test -d "$(DESTDIR)$(PYTHONAPPSDIR)" || mkdir -p "$(DESTDIR)$(PYTHONAPPSDIR)"
2929
-test -d "$(DESTDIR)$(PYTHONAPPSDIR)/Python Launcher.app" && rm -r "$(DESTDIR)$(PYTHONAPPSDIR)/Python Launcher.app"
3030
cp -r "Python Launcher.app" "$(DESTDIR)$(PYTHONAPPSDIR)"
3131
touch "$(DESTDIR)$(PYTHONAPPSDIR)/Python Launcher.app"
32+
33+
34+
clean:
35+
rm -f *.o "Python Launcher"
36+
rm -rf "Python Launcher.app"
37+
38+
Python\ Launcher.app: Info.plist \
39+
Python\ Launcher $(srcdir)/../Icons/PythonLauncher.icns \
40+
$(srcdir)/../Icons/PythonSource.icns \
41+
$(srcdir)/../Icons/PythonCompiled.icns \
42+
$(srcdir)/factorySettings.plist
43+
rm -fr "Python Launcher.app"
44+
$(RUNSHARED) $(BUILDPYTHON) $(BUNDLEBULDER) \
45+
--builddir=. \
46+
--name="Python Launcher" \
47+
--executable="Python Launcher" \
48+
--iconfile=$(srcdir)/../Icons/PythonLauncher.icns \
49+
--bundle-id=org.python.PythonLauncher \
50+
--resource=$(srcdir)/../Icons/PythonSource.icns \
51+
--resource=$(srcdir)/../Icons/PythonCompiled.icns \
52+
--resource=$(srcdir)/English.lproj \
53+
--resource=$(srcdir)/factorySettings.plist \
54+
--plist Info.plist \
55+
build
56+
find "Python Launcher.app" -name '.svn' -print0 | xargs -0 rm -r
57+
58+
59+
FileSettings.o: $(srcdir)/FileSettings.m
60+
$(CC) $(CFLAGS) -o $@ -c $(srcdir)/FileSettings.m
61+
62+
MyAppDelegate.o: $(srcdir)/MyAppDelegate.m
63+
$(CC) $(CFLAGS) -o $@ -c $(srcdir)/MyAppDelegate.m
64+
65+
MyDocument.o: $(srcdir)/MyDocument.m
66+
$(CC) $(CFLAGS) -o $@ -c $(srcdir)/MyDocument.m
67+
68+
PreferencesWindowController.o: $(srcdir)/PreferencesWindowController.m
69+
$(CC) $(CFLAGS) -o $@ -c $(srcdir)/PreferencesWindowController.m
70+
71+
doscript.o: $(srcdir)/doscript.m
72+
$(CC) $(CFLAGS) -o $@ -c $(srcdir)/doscript.m
73+
74+
main.o: $(srcdir)/main.m
75+
$(CC) $(CFLAGS) -o $@ -c $(srcdir)/main.m
76+
77+
Python\ Launcher: $(OBJECTS)
78+
$(CC) $(LDFLAGS) -o "Python Launcher" $(OBJECTS) -framework AppKit -framework Carbon
79+
80+
Info.plist: $(srcdir)/Info.plist.in
81+
sed 's/%VERSION%/'"`$(RUNSHARED) $(BUILDPYTHON) -c 'import platform; print(platform.python_version())'`"'/g' < $(srcdir)/Info.plist.in > Info.plist

0 commit comments

Comments
 (0)