Skip to content

Commit 580c7fe

Browse files
Fix for issue #2573: Can't change the framework name on OS X builds
This introduces a new configure option: --with-framework-name=NAME (defaulting to 'Python'). This allows you to install several copies of the Python framework with different names (such as a normal build and a debug build).
1 parent ee340e5 commit 580c7fe

13 files changed

Lines changed: 77 additions & 57 deletions

File tree

Mac/BuildScript/build-installer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ def getFullVersion():
199199
dict(
200200
name="PythonApplications",
201201
long_name="GUI Applications",
202-
source="/Applications/MacPython %(VER)s",
202+
source="/Applications/Python %(VER)s",
203203
readme="""\
204204
This package installs IDLE (an interactive Python IDE),
205205
Python Launcher and Build Applet (create application bundles

Mac/BuildScript/resources/ReadMe.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ environment, an applet builder), plus a set of pre-built
1919
extension modules that open up specific Macintosh technologies
2020
to Python programs (Carbon, AppleScript, Quicktime, more).
2121

22-
The installer puts the applications in "MacPython $VERSION"
22+
The installer puts the applications in "Python $VERSION"
2323
in your Applications folder, command-line tools in
2424
/usr/local/bin and the underlying machinery in
2525
$PYTHONFRAMEWORKINSTALLDIR.

Mac/IDLE/Makefile.in

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ srcdir= @srcdir@
99
VERSION= @VERSION@
1010
UNIVERSALSDK=@UNIVERSALSDK@
1111
builddir= ../..
12+
PYTHONFRAMEWORK=@PYTHONFRAMEWORK@
1213

1314
RUNSHARED= @RUNSHARED@
1415
BUILDEXE= @BUILDEXEEXT@
@@ -21,7 +22,7 @@ MACOSX_DEPLOYMENT_TARGET=@CONFIGURE_MACOSX_DEPLOYMENT_TARGET@
2122

2223
BUNDLEBULDER=$(srcdir)/../../Lib/plat-mac/bundlebuilder.py
2324

24-
PYTHONAPPSDIR=/Applications/MacPython $(VERSION)
25+
PYTHONAPPSDIR=/Applications/$(PYTHONFRAMEWORK) $(VERSION)
2526

2627
all: IDLE.app
2728

Mac/Makefile.in

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,16 @@ BUILDPYTHON=$(builddir)/python$(BUILDEXE)
1313
DESTDIR=
1414
LDFLAGS=@LDFLAGS@
1515
FRAMEWORKUNIXTOOLSPREFIX=@FRAMEWORKUNIXTOOLSPREFIX@
16+
PYTHONFRAMEWORK=@PYTHONFRAMEWORK@
17+
1618

1719
# These are normally glimpsed from the previous set
1820
bindir=$(prefix)/bin
19-
PYTHONAPPSDIR=/Applications/MacPython $(VERSION)
21+
PYTHONAPPSDIR=/Applications/$(PYTHONFRAMEWORK) $(VERSION)
2022
APPINSTALLDIR=$(prefix)/Resources/Python.app
2123

2224
# Variables for installing the "normal" unix binaries
23-
INSTALLED_PYTHONAPP=$(APPINSTALLDIR)/Contents/MacOS/Python
25+
INSTALLED_PYTHONAPP=$(APPINSTALLDIR)/Contents/MacOS/$(PYTHONFRAMEWORK)
2426

2527
# Items more-or-less copied from the main Makefile
2628
DIRMODE=755
@@ -103,7 +105,7 @@ install_versionedtools:
103105

104106
pythonw: $(srcdir)/Tools/pythonw.c Makefile
105107
$(CC) $(LDFLAGS) -o $@ $(srcdir)/Tools/pythonw.c \
106-
-DPYTHONWEXECUTABLE='"$(APPINSTALLDIR)/Contents/MacOS/Python"'
108+
-DPYTHONWEXECUTABLE='"$(APPINSTALLDIR)/Contents/MacOS/$(PYTHONFRAMEWORK)"'
107109

108110

109111
install_PythonLauncher:
@@ -155,7 +157,7 @@ install_Python:
155157
esac; \
156158
done; \
157159
done
158-
$(INSTALL_PROGRAM) $(STRIPFLAG) $(BUILDPYTHON) "$(DESTDIR)$(APPINSTALLDIR)/Contents/MacOS/Python"
160+
$(INSTALL_PROGRAM) $(STRIPFLAG) $(BUILDPYTHON) "$(DESTDIR)$(APPINSTALLDIR)/Contents/MacOS/$(PYTHONFRAMEWORK)"
159161

160162
install_IDLE:
161163
cd IDLE && make install
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<key>CFBundleExecutable</key>
2121
<string>Python</string>
2222
<key>CFBundleGetInfoString</key>
23-
<string>2.5alpha0, (c) 2004 Python Software Foundation.</string>
23+
<string>@VERSION@, (c) 2004 Python Software Foundation.</string>
2424
<key>CFBundleHelpBookFolder</key>
2525
<array>
2626
<string>Documentation</string>
@@ -33,21 +33,21 @@
3333
<key>CFBundleIconFile</key>
3434
<string>PythonInterpreter.icns</string>
3535
<key>CFBundleIdentifier</key>
36-
<string>org.python.python</string>
36+
<string>@PYTHONFRAMEWORKIDENTIFIER@.app</string>
3737
<key>CFBundleInfoDictionaryVersion</key>
3838
<string>6.0</string>
3939
<key>CFBundleLongVersionString</key>
40-
<string>2.5alpha0, (c) 2004 Python Software Foundation.</string>
40+
<string>@VERSION@, (c) 2004-2008 Python Software Foundation.</string>
4141
<key>CFBundleName</key>
4242
<string>Python</string>
4343
<key>CFBundlePackageType</key>
4444
<string>APPL</string>
4545
<key>CFBundleShortVersionString</key>
46-
<string>2.5alpha0</string>
46+
<string>@VERSION@</string>
4747
<key>CFBundleSignature</key>
4848
<string>PytX</string>
4949
<key>CFBundleVersion</key>
50-
<string>2.5alpha0</string>
50+
<string>@VERSION@</string>
5151
<key>CSResourcesFileMapped</key>
5252
<true/>
5353
<key>LSRequiresCarbon</key>
-656 Bytes
Binary file not shown.
-358 Bytes
Binary file not shown.
Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,20 @@
99
<key>CFBundleGetInfoString</key>
1010
<string>Python Runtime and Library</string>
1111
<key>CFBundleIdentifier</key>
12-
<string>org.python.python</string>
12+
<string>@PYTHONFRAMEWORKIDENTIFIER@</string>
1313
<key>CFBundleInfoDictionaryVersion</key>
1414
<string>6.0</string>
1515
<key>CFBundleName</key>
1616
<string>Python</string>
1717
<key>CFBundlePackageType</key>
1818
<string>FMWK</string>
1919
<key>CFBundleShortVersionString</key>
20-
<string>2.5</string>
20+
<string>%VERSION%, (c) 2004-2008 Python Software Foundation.</string>
21+
<key>CFBundleLongVersionString</key>
22+
<string>%VERSION%, (c) 2004-2008 Python Software Foundation.</string>
2123
<key>CFBundleSignature</key>
2224
<string>????</string>
2325
<key>CFBundleVersion</key>
24-
<string>2.5</string>
26+
<string>%VERSION%</string>
2527
</dict>
2628
</plist>

Mac/Resources/framework/version.plist

Lines changed: 0 additions & 18 deletions
This file was deleted.

Makefile.pre.in

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -418,18 +418,16 @@ libpython$(VERSION).sl: $(LIBRARY_OBJS)
418418
# This rule is here for OPENSTEP/Rhapsody/MacOSX. It builds a temporary
419419
# minimal framework (not including the Lib directory and such) in the current
420420
# directory.
421-
RESSRCDIR=$(srcdir)/Mac/Resources/framework
421+
RESSRCDIR=Mac/Resources/framework
422422
$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK): \
423423
$(LIBRARY) \
424-
$(RESSRCDIR)/Info.plist \
425-
$(RESSRCDIR)/version.plist \
426-
$(RESSRCDIR)/English.lproj/InfoPlist.strings
424+
$(RESSRCDIR)/Info.plist
427425
$(INSTALL) -d -m $(DIRMODE) $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)
428426
if test "${UNIVERSALSDK}"; then \
429427
$(CC) -o $(LDLIBRARY) -arch i386 -arch ppc -dynamiclib \
430428
-isysroot "${UNIVERSALSDK}" \
431429
-all_load $(LIBRARY) -Wl,-single_module \
432-
-install_name $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Versions/$(VERSION)/Python \
430+
-install_name $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK) \
433431
-compatibility_version $(VERSION) \
434432
-current_version $(VERSION); \
435433
else \
@@ -440,10 +438,6 @@ $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK): \
440438
$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/Resources/English.lproj
441439
$(INSTALL_DATA) $(RESSRCDIR)/Info.plist \
442440
$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/Resources/Info.plist
443-
$(INSTALL_DATA) $(RESSRCDIR)/version.plist \
444-
$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/Resources/version.plist
445-
$(INSTALL_DATA) $(RESSRCDIR)/English.lproj/InfoPlist.strings \
446-
$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/Resources/English.lproj/InfoPlist.strings
447441
$(LN) -fsn $(VERSION) $(PYTHONFRAMEWORKDIR)/Versions/Current
448442
$(LN) -fsn Versions/Current/$(PYTHONFRAMEWORK) $(PYTHONFRAMEWORKDIR)/$(PYTHONFRAMEWORK)
449443
$(LN) -fsn Versions/Current/Headers $(PYTHONFRAMEWORKDIR)/Headers
@@ -1030,12 +1024,9 @@ frameworkinstallstructure: $(LDLIBRARY)
10301024
fi; \
10311025
done
10321026
$(LN) -fsn include/python$(VERSION) $(DESTDIR)$(prefix)/Headers
1033-
$(INSTALL_DATA) $(RESSRCDIR)/Info.plist $(DESTDIR)$(prefix)/Resources/Info.plist
1034-
$(INSTALL_DATA) $(RESSRCDIR)/version.plist $(DESTDIR)$(prefix)/Resources/version.plist
1035-
$(INSTALL_DATA) $(RESSRCDIR)/English.lproj/InfoPlist.strings \
1036-
$(DESTDIR)$(prefix)/Resources/English.lproj/InfoPlist.strings
1027+
sed 's/%VERSION%/'"`$(RUNSHARED) ./$(BUILDPYTHON) -c 'import platform; print platform.python_version()'`"'/g' < $(RESSRCDIR)/Info.plist > $(DESTDIR)$(prefix)/Resources/Info.plist
10371028
$(LN) -fsn $(VERSION) $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Versions/Current
1038-
$(LN) -fsn Versions/Current/Python $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Python
1029+
$(LN) -fsn Versions/Current/$(PYTHONFRAMEWORK) $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/$(PYTHONFRAMEWORK)
10391030
$(LN) -fsn Versions/Current/Headers $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Headers
10401031
$(LN) -fsn Versions/Current/Resources $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Resources
10411032
$(INSTALL_SHARED) $(LDLIBRARY) $(DESTDIR)$(PYTHONFRAMEWORKPREFIX)/$(LDLIBRARY)
@@ -1044,7 +1035,7 @@ frameworkinstallstructure: $(LDLIBRARY)
10441035
# Install a number of symlinks to keep software that expects a normal unix
10451036
# install (which includes python-config) happy.
10461037
frameworkinstallmaclib:
1047-
ln -fs "../../../Python" "$(DESTDIR)$(prefix)/lib/python$(VERSION)/config/libpython$(VERSION).a"
1038+
ln -fs "../../../$(PYTHONFRAMEWORK)" "$(DESTDIR)$(prefix)/lib/python$(VERSION)/config/libpython$(VERSION).a"
10481039
cd Mac && $(MAKE) installmacsubtree DESTDIR="$(DESTDIR)"
10491040

10501041
# This installs the IDE, the Launcher and other apps into /Applications

0 commit comments

Comments
 (0)