Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit be3e1f7

Browse files
committed
Python.app is now a hidden application, deep in the framework. It will
be invoked by PythonLauncher when needed. Also changed the names of various variables in the Makefile to match what the main Makefile has.
1 parent 2fc993d commit be3e1f7

2 files changed

Lines changed: 31 additions & 32 deletions

File tree

Mac/OSX/Makefile

Lines changed: 29 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,20 @@
33
# commandline in that case.
44

55
# assume user was invoking from Mac/OSX directory and building in source tree
6-
PYTHONBUILDDIR = ../..
7-
PYTHONSRCDIR = ../..
6+
builddir = ../..
7+
srcdir = ../..
8+
VERSION=2.3
89

9-
INSTALLDIR=/Library/Frameworks/Python.framework/Versions/Current
10+
prefix=/Library/Frameworks/Python.framework/Versions/$(VERSION)
1011
PYTHONAPPSDIR=/Applications/Python
11-
APPINSTALLDIR=$(PYTHONAPPSDIR)/Python.app
12+
APPINSTALLDIR=$(prefix)/Resources/Python.app
1213

1314
# Variables for installing the "normal" unix binaries
1415
UNIXBINDIR=/usr/local/bin
15-
INSTALLED_PYTHON=$(INSTALLDIR)/bin/python
16+
INSTALLED_PYTHON=$(prefix)/bin/python
1617
INSTALLED_PYTHONW=$(APPINSTALLDIR)/Contents/MacOS/python
1718

1819
# Items more-or-less copied from the main Makefile
19-
VERSION=2.3
2020
DIRMODE=755
2121
INSTALL=/usr/bin/install -c
2222
INSTALL_SYMLINK=/usr/bin/install -l as
@@ -26,32 +26,31 @@ INSTALL_DATA= ${INSTALL} -m 644
2626
STRIPFLAG=-s
2727
OPT=-g -O3 -Wall -Wstrict-prototypes -Wno-long-double -no-cpp-precomp \
2828
-fno-common -dynamic
29-
INCLUDES=-I$(PYTHONBUILDDIR) -I$(PYTHONSRCDIR)/Include \
30-
-I$(PYTHONSRCDIR)/Mac/Include
29+
INCLUDES=-I$(builddir) -I$(srcdir)/Include -I$(srcdir)/Mac/Include
3130
DEFINES=-DHAVE_CONFIG_H
3231

3332
CFLAGS=$(OPT) $(DEFINES) $(INCLUDES)
34-
LDFLAGS=-F$(PYTHONBUILDDIR) -framework System -framework Python -framework Carbon \
33+
LDFLAGS=-F$(builddir) -framework System -framework Python -framework Carbon \
3534
-framework Foundation
3635
CC=cc
3736
LD=cc
3837
REZ=/Developer/Tools/Rez
3938
DEREZ=/Developer/Tools/DeRez
4039

41-
OBJECTS=$(PYTHONBUILDDIR)/Mac/Python/macmain.o \
42-
$(PYTHONBUILDDIR)/Mac/Python/macgetargv.o
40+
OBJECTS=$(builddir)/Mac/Python/macmain.o \
41+
$(builddir)/Mac/Python/macgetargv.o
4342

44-
PYTHON=$(PYTHONBUILDDIR)/python.exe
45-
APPTEMPLATE=$(PYTHONSRCDIR)/Mac/OSXResources/app
43+
PYTHON=$(builddir)/python.exe
44+
APPTEMPLATE=$(srcdir)/Mac/OSXResources/app
4645
APPSUBDIRS=MacOS Resources Resources/English.lproj
47-
RESOURCEDIR=$(PYTHONSRCDIR)/Mac/Resources
46+
RESOURCEDIR=$(srcdir)/Mac/Resources
4847
RESOURCEFILE=python.rsrc
49-
RFCONVERTER=$(PYTHONSRCDIR)/Mac/Lib/applesingle.py
48+
RFCONVERTER=$(srcdir)/Mac/Lib/applesingle.py
5049

5150
install_all: install_PythonLauncher install_Python install_IDE
5251

5352
install_PythonLauncher:
54-
cd $(PYTHONSRCDIR)/Mac/OSX/PythonLauncher/PythonLauncher.pbproj ; \
53+
cd $(srcdir)/Mac/OSX/PythonLauncher/PythonLauncher.pbproj ; \
5554
pbxbuild -target PythonLauncher -buildstyle Deployment DSTROOT=/ install
5655

5756
install_Python: pythonforbundle
@@ -102,12 +101,12 @@ install_Python: pythonforbundle
102101
$(INSTALL_DATA) $(RESOURCEFILE) $(APPINSTALLDIR)/Contents/Resources/$(RESOURCEFILE)
103102

104103
install_IDE: $(INSTALLED_PYTHONW)
105-
$(INSTALLED_PYTHONW) $(PYTHONSRCDIR)/Mac/scripts/BuildApplet.py \
104+
$(INSTALLED_PYTHONW) $(srcdir)/Mac/scripts/BuildApplet.py \
106105
--output $(PYTHONAPPSDIR)/PythonIDE.app --noargv \
107-
$(PYTHONSRCDIR)/Mac/Tools/IDE/PythonIDE.py
106+
$(srcdir)/Mac/Tools/IDE/PythonIDE.py
108107

109-
LIBDEST=$(INSTALLDIR)/Mac/Lib
110-
LIBSRC=$(PYTHONSRCDIR)/Mac/Lib
108+
LIBDEST=$(prefix)/Mac/Lib
109+
LIBSRC=$(srcdir)/Mac/Lib
111110
LIBSUBDIRS= \
112111
Carbon \
113112
lib-scriptpackages \
@@ -122,8 +121,8 @@ LIBSUBDIRS= \
122121
mkcwproject/template \
123122
mkcwproject/template-carbon \
124123
mkcwproject/template-ppc
125-
TOOLSDEST=$(INSTALLDIR)/Mac/Tools
126-
TOOLSSRC=$(PYTHONSRCDIR)/Mac/Tools
124+
TOOLSDEST=$(prefix)/Mac/Tools
125+
TOOLSSRC=$(srcdir)/Mac/Tools
127126
TOOLSSUBDIRS=IDE
128127
installmacsubtree:
129128
@for i in $(LIBDEST) $(TOOLSDEST); \
@@ -215,7 +214,7 @@ installmacsubtree:
215214
done; \
216215
done
217216

218-
$(INSTALL_DATA) $(PYTHONSRCDIR)/Mac/OSX/Mac.pth $(INSTALLDIR)/lib/python$(VERSION)/site-packages/
217+
$(INSTALL_DATA) $(srcdir)/Mac/OSX/Mac.pth $(prefix)/lib/python$(VERSION)/site-packages/
219218

220219
# Put symlinks "python" and "pythonw" in the standard place
221220
$(INSTALLED_PYTHONW): install_Python
@@ -229,17 +228,17 @@ installunixprograms: $(INSTALLED_PYTHON) $(INSTALLED_PYTHONW) pythonw.sh
229228
# This is for development purposes: create a Mac.pth that refers to the source
230229
# directories
231230
dontinstallmacsubtree:
232-
l=`cd $(PYTHONSRCDIR)/Mac/Lib; pwd`; \
233-
echo $$l > $(INSTALLDIR)/lib/python$(VERSION)/site-packages/Mac.pth ; \
234-
echo $$l/lib-scriptpackages >> $(INSTALLDIR)/lib/python$(VERSION)/site-packages/Mac.pth
231+
l=`cd $(srcdir)/Mac/Lib; pwd`; \
232+
echo $$l > $(prefix)/lib/python$(VERSION)/site-packages/Mac.pth ; \
233+
echo $$l/lib-scriptpackages >> $(prefix)/lib/python$(VERSION)/site-packages/Mac.pth
235234

236235
pythonforbundle: $(OBJECTS)
237236
$(LD) $(LDFLAGS) $(OBJECTS) -o pythonforbundle
238237

239238
# Rules to build each file in OBJECTS - is there a better way?
240-
$(PYTHONBUILDDIR)/Mac/Python/macmain.o: $(PYTHONSRCDIR)/Mac/Python/macmain.c
241-
$(CC) $(CFLAGS) -c $(PYTHONSRCDIR)/Mac/Python/macmain.c -o $@
239+
$(builddir)/Mac/Python/macmain.o: $(srcdir)/Mac/Python/macmain.c
240+
$(CC) $(CFLAGS) -c $(srcdir)/Mac/Python/macmain.c -o $@
242241

243-
$(PYTHONBUILDDIR)/Mac/Python/macgetargv.o: $(PYTHONSRCDIR)/Mac/Python/macgetargv.c
244-
$(CC) $(CFLAGS) -c $(PYTHONSRCDIR)/Mac/Python/macgetargv.c -o $@
242+
$(builddir)/Mac/Python/macgetargv.o: $(srcdir)/Mac/Python/macgetargv.c
243+
$(CC) $(CFLAGS) -c $(srcdir)/Mac/Python/macgetargv.c -o $@
245244

Mac/OSX/PythonLauncher/FileSettings.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,10 @@ - (id)factorySettingsForFileType: (NSString *)filetype
5959
others = @"";
6060
if ([filetype isEqualToString: @"Python Script"] ||
6161
[filetype isEqualToString: @"Python Bytecode Document"]) {
62-
interpreter = @"/usr/local/bin/python";
62+
interpreter = @"/Library/Frameworks/Python.framework/Versions/Current/bin/python";
6363
with_terminal = YES;
6464
} else if ([filetype isEqualToString: @"Python GUI Script"]) {
65-
interpreter = @"/Applications/Python.app/Contents/MacOS/python";
65+
interpreter = @"/Library/Frameworks/Python.framework/Versions/Current/Resources/Python.app/Contents/MacOS/python";
6666
with_terminal = NO;
6767
} else {
6868
NSLog(@"Funny File Type: %@\n", filetype);

0 commit comments

Comments
 (0)