summaryrefslogtreecommitdiffstats
path: root/Mac
diff options
context:
space:
mode:
Diffstat (limited to 'Mac')
-rwxr-xr-xMac/BuildScript/build-installer.py63
-rwxr-xr-xMac/BuildScript/scripts/postflight.documentation3
-rwxr-xr-xMac/BuildScript/scripts/postflight.patch-profile21
-rw-r--r--Mac/Makefile.in5
-rwxr-xr-xMac/PythonLauncher/FileSettings.m6
-rw-r--r--Mac/README20
-rw-r--r--Mac/Tools/fixapplepython23.py3
7 files changed, 68 insertions, 53 deletions
diff --git a/Mac/BuildScript/build-installer.py b/Mac/BuildScript/build-installer.py
index 083209b..8bdebe6 100755
--- a/Mac/BuildScript/build-installer.py
+++ b/Mac/BuildScript/build-installer.py
@@ -10,9 +10,10 @@ bootstrap issues (/usr/bin/python is Python 2.3 on OSX 10.4)
Usage: see USAGE variable in the script.
"""
import platform, os, sys, getopt, textwrap, shutil, urllib2, stat, time, pwd
+import grp
-INCLUDE_TIMESTAMP=1
-VERBOSE=1
+INCLUDE_TIMESTAMP = 1
+VERBOSE = 1
from plistlib import Plist
@@ -32,7 +33,7 @@ except ImportError:
def shellQuote(value):
"""
- Return the string value in a form that can savely be inserted into
+ Return the string value in a form that can safely be inserted into
a shell command.
"""
return "'%s'"%(value.replace("'", "'\"'\"'"))
@@ -55,28 +56,28 @@ def getFullVersion():
raise RuntimeError, "Cannot find full version??"
-# The directory we'll use to create the build, will be erased and recreated
-WORKDIR="/tmp/_py"
+# The directory we'll use to create the build (will be erased and recreated)
+WORKDIR = "/tmp/_py"
-# The directory we'll use to store third-party sources, set this to something
+# The directory we'll use to store third-party sources. Set this to something
# else if you don't want to re-fetch required libraries every time.
-DEPSRC=os.path.join(WORKDIR, 'third-party')
-DEPSRC=os.path.expanduser('~/Universal/other-sources')
+DEPSRC = os.path.join(WORKDIR, 'third-party')
+DEPSRC = os.path.expanduser('~/Universal/other-sources')
# Location of the preferred SDK
-SDKPATH="/Developer/SDKs/MacOSX10.4u.sdk"
-#SDKPATH="/"
+SDKPATH = "/Developer/SDKs/MacOSX10.4u.sdk"
+#SDKPATH = "/"
-ARCHLIST=('i386', 'ppc',)
+ARCHLIST = ('i386', 'ppc',)
# Source directory (asume we're in Mac/BuildScript)
-SRCDIR=os.path.dirname(
+SRCDIR = os.path.dirname(
os.path.dirname(
os.path.dirname(
os.path.abspath(__file__
))))
-USAGE=textwrap.dedent("""\
+USAGE = textwrap.dedent("""\
Usage: build_python [options]
Options:
@@ -91,7 +92,7 @@ USAGE=textwrap.dedent("""\
# Instructions for building libraries that are necessary for building a
# batteries included python.
-LIBRARY_RECIPES=[
+LIBRARY_RECIPES = [
dict(
name="Bzip2 1.0.3",
url="http://www.bzip.org/1.0.3/bzip2-1.0.3.tar.gz",
@@ -183,7 +184,7 @@ LIBRARY_RECIPES=[
# Instructions for building packages inside the .mpkg.
-PKG_RECIPES=[
+PKG_RECIPES = [
dict(
name="PythonFramework",
long_name="Python Framework",
@@ -200,7 +201,7 @@ PKG_RECIPES=[
long_name="GUI Applications",
source="/Applications/MacPython %(VER)s",
readme="""\
- This package installs IDLE (an interactive Python IDLE),
+ This package installs IDLE (an interactive Python IDE),
Python Launcher and Build Applet (create application bundles
from python scripts).
@@ -256,8 +257,7 @@ PKG_RECIPES=[
readme="""\
This package updates the system python installation on
Mac OS X 10.3 to ensure that you can build new python extensions
- using that copy of python after installing this version of
- python.
+ using that copy of python after installing this version.
""",
postflight="../Tools/fixapplepython23.py",
topdir="/Library/Frameworks/Python.framework",
@@ -323,7 +323,7 @@ def checkEnvironment():
-def parseOptions(args = None):
+def parseOptions(args=None):
"""
Parse arguments and update global settings.
"""
@@ -636,15 +636,15 @@ def buildPython():
print "Running make"
runCommand("make")
- print "Runing make frameworkinstall"
+ print "Running make frameworkinstall"
runCommand("make frameworkinstall DESTDIR=%s"%(
shellQuote(rootDir)))
- print "Runing make frameworkinstallextras"
+ print "Running make frameworkinstallextras"
runCommand("make frameworkinstallextras DESTDIR=%s"%(
shellQuote(rootDir)))
- print "Copy required shared libraries"
+ print "Copying required shared libraries"
if os.path.exists(os.path.join(WORKDIR, 'libraries', 'Library')):
runCommand("mv %s/* %s"%(
shellQuote(os.path.join(
@@ -657,9 +657,13 @@ def buildPython():
print "Fix file modes"
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)
+ os.chown(os.path.join(dirpath, dn), -1, gid)
+
for fn in filenames:
if os.path.islink(fn):
@@ -668,7 +672,8 @@ def buildPython():
# "chmod g+w $fn"
p = os.path.join(dirpath, fn)
st = os.stat(p)
- os.chmod(p, stat.S_IMODE(st.st_mode) | stat.S_IXGRP)
+ os.chmod(p, stat.S_IMODE(st.st_mode) | stat.S_IWGRP)
+ os.chown(p, -1, gid)
# We added some directories to the search path during the configure
# phase. Remove those because those directories won't be there on
@@ -729,8 +734,8 @@ def patchScript(inPath, outPath):
def packageFromRecipe(targetDir, recipe):
curdir = os.getcwd()
try:
- # The major version (such as 2.5) is included in the pacakge name
- # because haveing two version of python installed at the same time is
+ # The major version (such as 2.5) is included in the package name
+ # because having two version of python installed at the same time is
# common.
pkgname = '%s-%s'%(recipe['name'], getVersion())
srcdir = recipe.get('source')
@@ -904,7 +909,7 @@ def installSize(clear=False, _saved=[]):
def buildDMG():
"""
- Create DMG containing the rootDir
+ Create DMG containing the rootDir.
"""
outdir = os.path.join(WORKDIR, 'diskimage')
if os.path.exists(outdir):
@@ -917,7 +922,7 @@ def buildDMG():
imagepath = imagepath + '.dmg'
os.mkdir(outdir)
- runCommand("hdiutil create -volname 'Univeral MacPython %s' -srcfolder %s %s"%(
+ runCommand("hdiutil create -volname 'Universal MacPython %s' -srcfolder %s %s"%(
getFullVersion(),
shellQuote(os.path.join(WORKDIR, 'installer')),
shellQuote(imagepath)))
@@ -945,6 +950,10 @@ def setIcon(filePath, icnsPath):
ref, isDirectory = Carbon.File.FSPathMakeRef(filePath)
if isDirectory:
+ # There is a problem with getting this into the pax(1) archive,
+ # just ignore directory icons for now.
+ return
+
tmpPath = os.path.join(filePath, "Icon\r")
if not os.path.exists(tmpPath):
fp = open(tmpPath, 'w')
diff --git a/Mac/BuildScript/scripts/postflight.documentation b/Mac/BuildScript/scripts/postflight.documentation
index 85d400f..9f5918e 100755
--- a/Mac/BuildScript/scripts/postflight.documentation
+++ b/Mac/BuildScript/scripts/postflight.documentation
@@ -1,6 +1,5 @@
#!/bin/sh
-# FIXME
PYVER="@PYVER@"
if [ -d /Developer/Documentation ]; then
@@ -8,5 +7,5 @@ if [ -d /Developer/Documentation ]; then
mkdir -p /Developer/Documentation/Python
fi
- ln -fhs /Library/Frameworks/Python.framework/Versions/${PYVER}/Resources/English.lproj/Documentation "/Developer/Documentation/Python/Reference Documentation"
+ ln -fhs /Library/Frameworks/Python.framework/Versions/${PYVER}/Resources/English.lproj/Documentation "/Developer/Documentation/Python/Reference Documentation @PYVER@"
fi
diff --git a/Mac/BuildScript/scripts/postflight.patch-profile b/Mac/BuildScript/scripts/postflight.patch-profile
index c42e11e..5e82f33 100755
--- a/Mac/BuildScript/scripts/postflight.patch-profile
+++ b/Mac/BuildScript/scripts/postflight.patch-profile
@@ -47,22 +47,29 @@ done
echo "${PYTHON_ROOT}/bin is not on your PATH or at least not early enough"
case "${BSH}" in
*csh)
+ if [ -f "${HOME}/.tcshrc" ]; then
+ RC="${HOME}/.tcshrc"
+ else
+ RC="${HOME}/.cshrc"
+ fi
# Create backup copy before patching
- if [ -f "${HOME}/.cshrc" ]; then
- cp -fp "${HOME}/.cshrc" "${HOME}/.cshrc.pysave"
+ if [ -f "${RC}" ]; then
+ cp -fp "${RC}" "${RC}.pysave"
fi
- echo "" >> "${HOME}/.cshrc"
- echo "# Setting PATH for MacPython ${PYVER}" >> "${HOME}/.cshrc"
- echo "# The orginal version is saved in .cshrc.pysave" >> "${HOME}/.cshrc"
- echo "set path=(${PYTHON_ROOT}/bin "'$path'")" >> "${HOME}/.cshrc"
+ echo "" >> "${RC}"
+ echo "# Setting PATH for MacPython ${PYVER}" >> "${RC}"
+ echo "# The orginal version is saved in .cshrc.pysave" >> "${RC}"
+ echo "set path=(${PYTHON_ROOT}/bin "'$path'")" >> "${RC}"
if [ `id -ur` = 0 ]; then
- chown "${USER}" "${HOME}/.cshrc"
+ chown "${USER}" "${RC}"
fi
exit 0
;;
bash)
if [ -e "${HOME}/.bash_profile" ]; then
PR="${HOME}/.bash_profile"
+ elif [ -e "${HOME}/.bash_login" ]; then
+ PR="${HOME}/.bash_login"
elif [ -e "${HOME}/.profile" ]; then
PR="${HOME}/.profile"
else
diff --git a/Mac/Makefile.in b/Mac/Makefile.in
index 11f1438..8b2e1db 100644
--- a/Mac/Makefile.in
+++ b/Mac/Makefile.in
@@ -101,7 +101,7 @@ install_versionedtools:
fi
-pythonw: $(srcdir)/Tools/pythonw.c
+pythonw: $(srcdir)/Tools/pythonw.c Makefile
$(CC) $(LDFLAGS) -o $@ $(srcdir)/Tools/pythonw.c \
-DPYTHONWEXECUTABLE='"$(APPINSTALLDIR)/Contents/MacOS/Python"'
@@ -249,3 +249,6 @@ clean:
rm pythonw
cd PythonLauncher && make clean
cd IDLE && make clean
+
+Makefile: $(srcdir)/Makefile.in ../config.status
+ cd .. && CONFIG_FILES=Mac/Makefile CONFIG_HEADERS= $(SHELL) ./config.status
diff --git a/Mac/PythonLauncher/FileSettings.m b/Mac/PythonLauncher/FileSettings.m
index ba375ba..1f3695e 100755
--- a/Mac/PythonLauncher/FileSettings.m
+++ b/Mac/PythonLauncher/FileSettings.m
@@ -207,7 +207,7 @@
[NSNumber numberWithBool: inspect], @"inspect",
[NSNumber numberWithBool: optimize], @"optimize",
[NSNumber numberWithBool: nosite], @"nosite",
- [NSNumber numberWithBool: nosite], @"nosite",
+ [NSNumber numberWithBool: tabs], @"tabs",
others, @"others",
scriptargs, @"scriptargs",
[NSNumber numberWithBool: with_terminal], @"with_terminal",
@@ -235,7 +235,7 @@
if (value) optimize = [value boolValue];
value = [dict objectForKey: @"nosite"];
if (value) nosite = [value boolValue];
- value = [dict objectForKey: @"nosite"];
+ value = [dict objectForKey: @"tabs"];
if (value) tabs = [value boolValue];
value = [dict objectForKey: @"others"];
if (value) others = [value retain];
@@ -291,7 +291,7 @@
tabs?" -t":"",
others,
[self _replaceSingleQuotes:script],
- scriptargs,
+ scriptargs ? scriptargs : @"",
with_terminal? "&& echo Exit status: $? && exit 1" : " &"];
}
diff --git a/Mac/README b/Mac/README
index 1e58b02..5e74d7b 100644
--- a/Mac/README
+++ b/Mac/README
@@ -48,7 +48,7 @@ will have to do the work yourself if you really want this.
A second reason for using frameworks is that they put Python-related items in
only two places: "/Library/Framework/Python.framework" and
-"/Applications/MacPython 2.5". This simplifies matters for users installing
+"/Applications/MacPython 2.6". This simplifies matters for users installing
Python from a binary distribution if they want to get rid of it again. Moreover,
due to the way frameworks work a user without admin privileges can install a
binary distribution in his or her home directory without recompilation.
@@ -75,7 +75,7 @@ PyObjC.
This directory contains a Makefile that will create a couple of python-related
applications (fullblown OSX .app applications, that is) in
-"/Applications/MacPython 2.3", and a hidden helper application Python.app
+"/Applications/MacPython 2.6", and a hidden helper application Python.app
inside the Python.framework, and unix tools "python" and "pythonw" into
/usr/local/bin. In addition it has a target "installmacsubtree" that installs
the relevant portions of the Mac subtree into the Python.framework.
@@ -90,20 +90,16 @@ in the sequence
3. make install
This sequence will put the framework in /Library/Framework/Python.framework,
-the applications in /Applications/MacPython 2.5 and the unix tools in
+the applications in "/Applications/MacPython 2.6" and the unix tools in
/usr/local/bin.
Installing in another place, for instance $HOME/Library/Frameworks if you have
no admin privileges on your machine, has only been tested very lightly. This
can be done by configuring with --enable-framework=$HOME/Library/Frameworks.
-The other two directories, /Applications/MacPython-2.3 and /usr/local/bin, will
-then also be deposited in $HOME. This is sub-optimal for the unix tools, which
-you would want in $HOME/bin, but there is no easy way to fix this right now.
-
-Note that there are no references to the actual locations in the code or
-resource files, so you are free to move things around afterwards. For example,
-you could use --enable-framework=/tmp/newversion/Library/Frameworks and use
-/tmp/newversion as the basis for an installer or something.
+The other two directories, "/Applications/MacPython-2.6" and /usr/local/bin,
+will then also be deposited in $HOME. This is sub-optimal for the unix tools,
+which you would want in $HOME/bin, but there is no easy way to fix this right
+now.
If you want to install some part, but not all, read the main Makefile. The
frameworkinstall is composed of a couple of sub-targets that install the
@@ -111,7 +107,7 @@ framework itself, the Mac subtree, the applications and the unix tools.
There is an extra target frameworkinstallextras that is not part of the
normal frameworkinstall which installs the Demo and Tools directories
-into /Applications/MacPython-2.3, this is useful for binary distributions.
+into "/Applications/MacPython 2.6", this is useful for binary distributions.
What do all these programs do?
===============================
diff --git a/Mac/Tools/fixapplepython23.py b/Mac/Tools/fixapplepython23.py
index fb8645a..6ba5401 100644
--- a/Mac/Tools/fixapplepython23.py
+++ b/Mac/Tools/fixapplepython23.py
@@ -123,7 +123,8 @@ def main():
makescript(GXX_SCRIPT, "g++")
# Finally fix the makefile
rv = fix(MAKEFILE, do_apply)
- sys.exit(rv)
+ #sys.exit(rv)
+ sys.exit(0)
if __name__ == '__main__':
main()