summaryrefslogtreecommitdiffstats
path: root/Mac/BuildScript
diff options
context:
space:
mode:
Diffstat (limited to 'Mac/BuildScript')
-rw-r--r--Mac/BuildScript/README.txt12
-rwxr-xr-xMac/BuildScript/build-installer.py101
-rw-r--r--Mac/BuildScript/resources/ReadMe.txt30
-rw-r--r--Mac/BuildScript/resources/Welcome.rtf18
-rwxr-xr-xMac/BuildScript/scripts/postflight.ensurepip65
5 files changed, 142 insertions, 84 deletions
diff --git a/Mac/BuildScript/README.txt b/Mac/BuildScript/README.txt
index 56c769a..0a6b544 100644
--- a/Mac/BuildScript/README.txt
+++ b/Mac/BuildScript/README.txt
@@ -8,7 +8,7 @@ $DESTROOT, massages that installation to remove .pyc files and such, creates
an Installer package from the installation plus other files in ``resources``
and ``scripts`` and placed that on a ``.dmg`` disk image.
-As of Python 3.3.0, PSF practice is to build two installer variants
+For Python 3.4.0, PSF practice is to build two installer variants
for each release.
1. 32-bit-only, i386 and PPC universal, capable on running on all machines
@@ -22,8 +22,8 @@ for each release.
- builds the following third-party libraries
* NCurses 5.9 (http://bugs.python.org/issue15037)
- * SQLite 3.7.13
- * XZ 5.0.3
+ * SQLite 3.8.1
+ * XZ 5.0.5
- uses system-supplied versions of third-party libraries
@@ -56,14 +56,14 @@ for each release.
- builds the following third-party libraries
* NCurses 5.9 (http://bugs.python.org/issue15037)
- * SQLite 3.7.13
- * XZ 5.0.3
+ * SQLite 3.8.1
+ * XZ 5.0.5
- uses system-supplied versions of third-party libraries
* readline module links with Apple BSD editline (libedit)
- - requires ActiveState Tcl/Tk 8.5.9 (or later) to be installed for building
+ - requires ActiveState Tcl/Tk 8.5.15 (or later) to be installed for building
- recommended build environment:
diff --git a/Mac/BuildScript/build-installer.py b/Mac/BuildScript/build-installer.py
index fd5d5c3..7c1d90f 100755
--- a/Mac/BuildScript/build-installer.py
+++ b/Mac/BuildScript/build-installer.py
@@ -193,7 +193,8 @@ def library_recipes():
LT_10_5 = bool(DEPTARGET < '10.5')
- if (DEPTARGET > '10.5') and (getVersionTuple() >= (3, 4)):
+# Disable for now
+ if (DEPTARGET > '10.5') and (getVersionTuple() >= (3, 5)):
result.extend([
dict(
name="Tcl 8.5.15",
@@ -237,9 +238,9 @@ def library_recipes():
if getVersionTuple() >= (3, 3):
result.extend([
dict(
- name="XZ 5.0.3",
- url="http://tukaani.org/xz/xz-5.0.3.tar.gz",
- checksum='fefe52f9ecd521de2a8ce38c21a27574',
+ name="XZ 5.0.5",
+ url="http://tukaani.org/xz/xz-5.0.5.tar.gz",
+ checksum='19d924e066b6fff0bc9d1981b4e53196',
configure_pre=[
'--disable-dependency-tracking',
]
@@ -282,9 +283,9 @@ def library_recipes():
),
),
dict(
- name="SQLite 3.7.13",
- url="http://www.sqlite.org/sqlite-autoconf-3071300.tar.gz",
- checksum='c97df403e8a3d5b67bb408fcd6aabd8e',
+ name="SQLite 3.8.3.1",
+ url="http://www.sqlite.org/2014/sqlite-autoconf-3080301.tar.gz",
+ checksum='509ff98d8dc9729b618b7e96612079c6',
extra_cflags=('-Os '
'-DSQLITE_ENABLE_FTS4 '
'-DSQLITE_ENABLE_FTS3_PARENTHESIS '
@@ -364,6 +365,7 @@ def library_recipes():
# Instructions for building packages inside the .mpkg.
def pkg_recipes():
unselected_for_python3 = ('selected', 'unselected')[PYTHON_3]
+ unselected_for_lt_python34 = ('selected', 'unselected')[getVersionTuple() < (3, 4)]
result = [
dict(
name="PythonFramework",
@@ -432,10 +434,27 @@ def pkg_recipes():
topdir="/Library/Frameworks/Python.framework",
source="/empty-dir",
required=False,
- selected=unselected_for_python3,
+ selected=unselected_for_lt_python34,
),
]
+ if getVersionTuple() >= (3, 4):
+ result.append(
+ dict(
+ name="PythonInstallPip",
+ long_name="Install or upgrade pip",
+ readme="""\
+ This package installs (or upgrades from an earlier version)
+ pip, a tool for installing and managing Python packages.
+ """,
+ postflight="scripts/postflight.ensurepip",
+ topdir="/Library/Frameworks/Python.framework",
+ source="/empty-dir",
+ required=False,
+ selected='selected',
+ )
+ )
+
if DEPTARGET < '10.4' and not PYTHON_3:
result.append(
dict(
@@ -453,6 +472,7 @@ def pkg_recipes():
selected=unselected_for_python3,
)
)
+
return result
def fatal(msg):
@@ -567,20 +587,6 @@ def checkEnvironment():
% frameworks['Tk'],
]
- # For 10.6+ builds, we build two versions of _tkinter:
- # - the traditional version (renamed to _tkinter_library.so) linked
- # with /Library/Frameworks/{Tcl,Tk}.framework
- # - the default version linked with our builtin copies of Tcl and Tk
- if (DEPTARGET > '10.5') and (getVersionTuple() >= (3, 4)):
- EXPECTED_SHARED_LIBS['_tkinter_library.so'] = \
- EXPECTED_SHARED_LIBS['_tkinter.so']
- EXPECTED_SHARED_LIBS['_tkinter.so'] = [
- "/Library/Frameworks/Python.framework/Versions/%s/lib/libtcl%s.dylib"
- % (getVersion(), frameworks['Tcl']),
- "/Library/Frameworks/Python.framework/Versions/%s/lib/libtk%s.dylib"
- % (getVersion(), frameworks['Tk']),
- ]
-
# Remove inherited environment variables which might influence build
environ_var_prefixes = ['CPATH', 'C_INCLUDE_', 'DYLD_', 'LANG', 'LC_',
'LD_', 'LIBRARY_', 'PATH', 'PYTHON']
@@ -955,34 +961,19 @@ def buildPython():
runCommand("%s -C --enable-framework --enable-universalsdk=%s "
"--with-universal-archs=%s "
"%s "
+ "%s "
"LDFLAGS='-g -L%s/libraries/usr/local/lib' "
"CFLAGS='-g -I%s/libraries/usr/local/include' 2>&1"%(
shellQuote(os.path.join(SRCDIR, 'configure')), shellQuote(SDKPATH),
UNIVERSALARCHS,
(' ', '--with-computed-gotos ')[PYTHON_3],
+ (' ', '--without-ensurepip ')[getVersionTuple() >= (3, 4)],
shellQuote(WORKDIR)[1:-1],
shellQuote(WORKDIR)[1:-1]))
print("Running make")
runCommand("make")
- # For deployment targets of 10.6 and higher, we build our own version
- # of Tcl and Cocoa Aqua Tk libs because the Apple-supplied Tk 8.5 is
- # out-of-date and has critical bugs. Save the _tkinter.so that was
- # linked with /Library/Frameworks/{Tck,Tk}.framework and build
- # another _tkinter.so linked with our builtin Tcl and Tk libs.
- if (DEPTARGET > '10.5') and (getVersionTuple() >= (3, 4)):
- runCommand("find build -name '_tkinter.so' "
- " -execdir mv '{}' _tkinter_library.so \;")
- print("Running make to build builtin _tkinter")
- runCommand("make TCLTK_INCLUDES='-I%s/libraries/usr/local/include' "
- "TCLTK_LIBS='-L%s/libraries/usr/local/lib -ltcl8.5 -ltk8.5'"%(
- shellQuote(WORKDIR)[1:-1],
- shellQuote(WORKDIR)[1:-1]))
- # make a copy which will be moved to lib-tkinter later
- runCommand("find build -name '_tkinter.so' "
- " -execdir cp -p '{}' _tkinter_builtin.so \;")
-
print("Running make install")
runCommand("make install DESTDIR=%s"%(
shellQuote(rootDir)))
@@ -1007,27 +998,11 @@ def buildPython():
'Python.framework', 'Versions',
version, 'lib', 'python%s'%(version,))
- # If we made multiple versions of _tkinter, move them to
- # their own directories under python lib. This allows
- # users to select which to import by manipulating sys.path
- # directly or with PYTHONPATH.
-
- if (DEPTARGET > '10.5') and (getVersionTuple() >= (3, 4)):
- TKINTERS = ['builtin', 'library']
- tkinter_moves = [('_tkinter_' + tkn + '.so',
- os.path.join(path_to_lib, 'lib-tkinter', tkn))
- for tkn in TKINTERS]
- # Create the destination directories under lib-tkinter.
- # The permissions and uid/gid will be fixed up next.
- for tkm in tkinter_moves:
- os.makedirs(tkm[1])
-
print("Fix file modes")
frmDir = os.path.join(rootDir, 'Library', 'Frameworks', 'Python.framework')
gid = grp.getgrnam('admin').gr_gid
shared_lib_error = False
- moves_list = []
for dirpath, dirnames, filenames in os.walk(frmDir):
for dn in dirnames:
os.chmod(os.path.join(dirpath, dn), STAT_0o775)
@@ -1053,25 +1028,9 @@ def buildPython():
% (sl, p))
shared_lib_error = True
- # If this is a _tkinter variant, move it to its own directory
- # now that we have fixed its permissions and checked that it
- # was linked properly. The directory was created earlier.
- # The files are moved after the entire tree has been walked
- # since the shared library checking depends on the files
- # having unique names.
- if (DEPTARGET > '10.5') and (getVersionTuple() >= (3, 4)):
- for tkm in tkinter_moves:
- if fn == tkm[0]:
- moves_list.append(
- (p, os.path.join(tkm[1], '_tkinter.so')))
-
if shared_lib_error:
fatal("Unexpected shared library errors.")
- # Now do the moves.
- for ml in moves_list:
- shutil.move(ml[0], ml[1])
-
if PYTHON_3:
LDVERSION=None
VERSION=None
diff --git a/Mac/BuildScript/resources/ReadMe.txt b/Mac/BuildScript/resources/ReadMe.txt
index 212d963..e061a06 100644
--- a/Mac/BuildScript/resources/ReadMe.txt
+++ b/Mac/BuildScript/resources/ReadMe.txt
@@ -28,6 +28,36 @@ of the Tcl/Tk frameworks. Visit http://www.python.org/download/mac/tcltk/
for current information about supported and recommended versions of
Tcl/Tk for this version of Python and of Mac OS X.
+ **NEW* As of Python 3.4.0b1:
+
+New Installation Options and Defaults
+=====================================
+
+The Python installer now includes an option to automatically install
+or upgrade pip, a tool for installing and managing Python packages.
+This option is enabled by default and no Internet access is required.
+If you do not want the installer to do this, select the "Customize"
+option at the "Installation Type" step and uncheck the "Install or
+ugprade pip" option.
+
+To make it easier to use scripts installed by third-party Python
+packages, with pip or by other means, the "Shell profile updater"
+option is now enabled by default, as has been the case with Python
+2.7.x installers. You can also turn this option off by selecting
+"Customize" and unchecking the "Shell profile updater" option. You
+can also update your shell profile later by launching the "Update
+Shell Profile" command found in the /Applications/Python $VERSION
+folder. You may need to start a new terminal window for the
+changes to take effect.
+
+Python.org Python $VERSION and 2.7.x versions can both be installed and
+will not conflict. Command names for Python 3 contain a 3 in them,
+python3 (or python$VERSION), idle3 (or idle$VERSION), pip3 (or pip$VERSION), etc.
+Python 2.7 command names contain a 2 or no digit: python2 (or
+python2.7 or python), idle2 (or idle2.7 or idle), etc. If you want to
+use pip with Python 2.7.x, you will need to download and install a
+separate copy of it from the Python Package Index
+(https://pypi.python.org/pypi).
Using this version of Python on OS X
====================================
diff --git a/Mac/BuildScript/resources/Welcome.rtf b/Mac/BuildScript/resources/Welcome.rtf
index 239d76e..886ebfe 100644
--- a/Mac/BuildScript/resources/Welcome.rtf
+++ b/Mac/BuildScript/resources/Welcome.rtf
@@ -1,5 +1,5 @@
{\rtf1\ansi\ansicpg1252\cocoartf1187\cocoasubrtf400
-\cocoascreenfonts1{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
+\cocoascreenfonts1{\fonttbl\f0\fswiss\fcharset0 Helvetica;\f1\fmodern\fcharset0 CourierNewPSMT;}
{\colortbl;\red255\green255\blue255;}
\paperw11905\paperh16837\margl1440\margr1440\vieww9640\viewh10620\viewkind0
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640
@@ -16,13 +16,17 @@
\b IDLE
\b0 and a set of pre-built extension modules that open up specific Macintosh technologies to Python programs.\
\
-See the ReadMe file and the Python documentation for more information.\
-\
-\b NOTE:
-\b0 This package will not update your shell profile by default. Double-click
-\b Update Shell Profile
-\b0 at any time to make $FULL_VERSION the default Python 3 version. This version can co-exist with other installed versions of Python 3 and Python 2.\
+\b NEW for Python 3.4:
+\b0 This package now updates your shell profile by default to make $FULL_VERSION the default Python 3 version. This version can co-exist with other installed versions of Python 3 and Python 2. This package also installs a version of
+\f1 pip
+\f0 , the recommended tool for installing and managing Python packages. Type\
+\
+
+\f1 pip3.4 --help
+\f0 \
+\
+for an overview. See the ReadMe file and the Python documentation for more information.\
\
\b IMPORTANT:
diff --git a/Mac/BuildScript/scripts/postflight.ensurepip b/Mac/BuildScript/scripts/postflight.ensurepip
new file mode 100755
index 0000000..3b97c47
--- /dev/null
+++ b/Mac/BuildScript/scripts/postflight.ensurepip
@@ -0,0 +1,65 @@
+#!/bin/sh
+#
+# Install/upgrade pip.
+#
+
+PYVER="@PYVER@"
+PYMAJOR="3"
+FWK="/Library/Frameworks/Python.framework/Versions/${PYVER}"
+RELFWKBIN="../../..${FWK}/bin"
+
+umask 022
+
+"${FWK}/bin/python${PYVER}" -m ensurepip --upgrade
+
+"${FWK}/bin/python${PYVER}" -Wi \
+ "${FWK}/lib/python${PYVER}/compileall.py" \
+ -f -x badsyntax \
+ "${FWK}/lib/python${PYVER}/site-packages"
+
+"${FWK}/bin/python${PYVER}" -Wi -O \
+ "${FWK}/lib/python${PYVER}/compileall.py" \
+ -f -x badsyntax \
+ "${FWK}/lib/python${PYVER}/site-packages"
+
+chgrp -R admin "${FWK}/lib/python${PYVER}/site-packages" "${FWK}/bin"
+chmod -R g+w "${FWK}/lib/python${PYVER}/site-packages" "${FWK}/bin"
+
+# We do not know if the user selected the Python command-line tools
+# package that installs symlinks to /usr/local/bin. So we assume
+# that the command-line tools package has already completed or was
+# not selected and we will only install /usr/local/bin symlinks for
+# pip et al if there are /usr/local/bin/python* symlinks to our
+# framework bin directory.
+
+if [ -d /usr/local/bin ] ; then
+ (
+ cd /usr/local/bin
+ # Create pipx.y and easy_install-x.y links if /usr/local/bin/pythonx.y
+ # is linked to this framework version
+ if [ "$(readlink -n ./python${PYVER})" = "${RELFWKBIN}/python${PYVER}" ] ; then
+ for fn in "pip${PYVER}" "easy_install-${PYVER}" ;
+ do
+ if [ -e "${RELFWKBIN}/${fn}" ] ; then
+ rm -f ./${fn}
+ ln -s "${RELFWKBIN}/${fn}" "./${fn}"
+ chgrp -h admin "./${fn}"
+ chmod -h g+w "./${fn}"
+ fi
+ done
+ fi
+ # Create pipx link if /usr/local/bin/pythonx is linked to this version
+ if [ "$(readlink -n ./python${PYMAJOR})" = "${RELFWKBIN}/python${PYMAJOR}" ] ; then
+ for fn in "pip${PYMAJOR}" ;
+ do
+ if [ -e "${RELFWKBIN}/${fn}" ] ; then
+ rm -f ./${fn}
+ ln -s "${RELFWKBIN}/${fn}" "./${fn}"
+ chgrp -h admin "./${fn}"
+ chmod -h g+w "./${fn}"
+ fi
+ done
+ fi
+ )
+fi
+exit 0