annotate Mac/BuildScript/build-installer.py @ 82251:bb5a8564e186 2.7

Issue #13153: Tkinter functions now raise TclError instead of ValueError when a unicode argument contains non-BMP character.
author Serhiy Storchaka <storchaka@gmail.com>
date Mon, 18 Feb 2013 13:00:08 +0200
parents c2830debb15a
children 33b156e118c0
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
81799
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
1 #!/usr/bin/env python
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
2 """
67812
d3b4fa2dd728 Merged revisions 88004,88006,88235 via svnmerge from
Ned Deily <nad@acm.org>
parents: 65556
diff changeset
3 This script is used to build "official" universal installers on Mac OS X.
81799
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
4 It requires at least Mac OS X 10.5, Xcode 3, and the 10.4u SDK for
67812
d3b4fa2dd728 Merged revisions 88004,88006,88235 via svnmerge from
Ned Deily <nad@acm.org>
parents: 65556
diff changeset
5 32-bit builds. 64-bit or four-way universal builds require at least
d3b4fa2dd728 Merged revisions 88004,88006,88235 via svnmerge from
Ned Deily <nad@acm.org>
parents: 65556
diff changeset
6 OS X 10.5 and the 10.5 SDK.
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
7
67812
d3b4fa2dd728 Merged revisions 88004,88006,88235 via svnmerge from
Ned Deily <nad@acm.org>
parents: 65556
diff changeset
8 Please ensure that this script keeps working with Python 2.5, to avoid
d3b4fa2dd728 Merged revisions 88004,88006,88235 via svnmerge from
Ned Deily <nad@acm.org>
parents: 65556
diff changeset
9 bootstrap issues (/usr/bin/python is Python 2.5 on OSX 10.5). Sphinx,
d3b4fa2dd728 Merged revisions 88004,88006,88235 via svnmerge from
Ned Deily <nad@acm.org>
parents: 65556
diff changeset
10 which is used to build the documentation, currently requires at least
d3b4fa2dd728 Merged revisions 88004,88006,88235 via svnmerge from
Ned Deily <nad@acm.org>
parents: 65556
diff changeset
11 Python 2.4.
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
12
81799
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
13 In addition to what is supplied with OS X 10.5+ and Xcode 3+, the script
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
14 requires an installed version of hg and a third-party version of
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
15 Tcl/Tk 8.4 (for OS X 10.4 and 10.5 deployment targets) or Tcl/TK 8.5
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
16 (for 10.6 or later) installed in /Library/Frameworks. When installed,
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
17 the Python built by this script will attempt to dynamically link first to
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
18 Tcl and Tk frameworks in /Library/Frameworks if available otherwise fall
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
19 back to the ones in /System/Library/Framework. For the build, we recommend
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
20 installing the most recent ActiveTcl 8.4 or 8.5 version.
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
21
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
22 32-bit-only installer builds are still possible on OS X 10.4 with Xcode 2.5
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
23 and the installation of additional components, such as a newer Python
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
24 (2.5 is needed for Python parser updates), hg, and svn (for the documentation
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
25 build).
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
26
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
27 Usage: see USAGE variable in the script.
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
28 """
81799
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
29 import platform, os, sys, getopt, textwrap, shutil, stat, time, pwd, grp
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
30 try:
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
31 import urllib2 as urllib_request
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
32 except ImportError:
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
33 import urllib.request as urllib_request
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
34
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
35 STAT_0o755 = ( stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
36 | stat.S_IRGRP | stat.S_IXGRP
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
37 | stat.S_IROTH | stat.S_IXOTH )
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
38
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
39 STAT_0o775 = ( stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
40 | stat.S_IRGRP | stat.S_IWGRP | stat.S_IXGRP
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
41 | stat.S_IROTH | stat.S_IXOTH )
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
42
40295
ed2ac8084e04 Whitespace changes to make the source more compliant with PEP8 (SF#1589070)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 40292
diff changeset
43 INCLUDE_TIMESTAMP = 1
ed2ac8084e04 Whitespace changes to make the source more compliant with PEP8 (SF#1589070)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 40292
diff changeset
44 VERBOSE = 1
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
45
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
46 from plistlib import Plist
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
47
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
48 try:
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
49 from plistlib import writePlist
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
50 except ImportError:
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
51 # We're run using python2.3
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
52 def writePlist(plist, path):
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
53 plist.write(path)
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
54
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
55 def shellQuote(value):
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
56 """
40293
5531f46232b7 backport of revision 52644
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 40081
diff changeset
57 Return the string value in a form that can safely be inserted into
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
58 a shell command.
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
59 """
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
60 return "'%s'"%(value.replace("'", "'\"'\"'"))
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
61
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
62 def grepValue(fn, variable):
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
63 variable = variable + '='
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
64 for ln in open(fn, 'r'):
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
65 if ln.startswith(variable):
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
66 value = ln[len(variable):].strip()
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
67 return value[1:-1]
81799
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
68 raise RuntimeError("Cannot find variable %s" % variable[:-1])
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
69
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
70 _cache_getVersion = None
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
71
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
72 def getVersion():
81799
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
73 global _cache_getVersion
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
74 if _cache_getVersion is None:
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
75 _cache_getVersion = grepValue(
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
76 os.path.join(SRCDIR, 'configure'), 'PACKAGE_VERSION')
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
77 return _cache_getVersion
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
78
67812
d3b4fa2dd728 Merged revisions 88004,88006,88235 via svnmerge from
Ned Deily <nad@acm.org>
parents: 65556
diff changeset
79 def getVersionTuple():
d3b4fa2dd728 Merged revisions 88004,88006,88235 via svnmerge from
Ned Deily <nad@acm.org>
parents: 65556
diff changeset
80 return tuple([int(n) for n in getVersion().split('.')])
d3b4fa2dd728 Merged revisions 88004,88006,88235 via svnmerge from
Ned Deily <nad@acm.org>
parents: 65556
diff changeset
81
81799
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
82 def getVersionMajorMinor():
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
83 return tuple([int(n) for n in getVersion().split('.', 2)])
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
84
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
85 _cache_getFullVersion = None
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
86
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
87 def getFullVersion():
81799
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
88 global _cache_getFullVersion
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
89 if _cache_getFullVersion is not None:
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
90 return _cache_getFullVersion
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
91 fn = os.path.join(SRCDIR, 'Include', 'patchlevel.h')
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
92 for ln in open(fn):
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
93 if 'PY_VERSION' in ln:
81799
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
94 _cache_getFullVersion = ln.split()[-1][1:-1]
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
95 return _cache_getFullVersion
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
96 raise RuntimeError("Cannot find full version??")
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
97
40293
5531f46232b7 backport of revision 52644
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 40081
diff changeset
98 # The directory we'll use to create the build (will be erased and recreated)
40295
ed2ac8084e04 Whitespace changes to make the source more compliant with PEP8 (SF#1589070)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 40292
diff changeset
99 WORKDIR = "/tmp/_py"
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
100
40293
5531f46232b7 backport of revision 52644
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 40081
diff changeset
101 # The directory we'll use to store third-party sources. Set this to something
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
102 # else if you don't want to re-fetch required libraries every time.
40295
ed2ac8084e04 Whitespace changes to make the source more compliant with PEP8 (SF#1589070)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 40292
diff changeset
103 DEPSRC = os.path.join(WORKDIR, 'third-party')
ed2ac8084e04 Whitespace changes to make the source more compliant with PEP8 (SF#1589070)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 40292
diff changeset
104 DEPSRC = os.path.expanduser('~/Universal/other-sources')
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
105
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
106 # Location of the preferred SDK
56299
dad7453d0d08 Merged revisions 75147 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 56147
diff changeset
107
dad7453d0d08 Merged revisions 75147 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 56147
diff changeset
108 ### There are some issues with the SDK selection below here,
dad7453d0d08 Merged revisions 75147 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 56147
diff changeset
109 ### The resulting binary doesn't work on all platforms that
dad7453d0d08 Merged revisions 75147 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 56147
diff changeset
110 ### it should. Always default to the 10.4u SDK until that
dad7453d0d08 Merged revisions 75147 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 56147
diff changeset
111 ### isue is resolved.
dad7453d0d08 Merged revisions 75147 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 56147
diff changeset
112 ###
dad7453d0d08 Merged revisions 75147 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 56147
diff changeset
113 ##if int(os.uname()[2].split('.')[0]) == 8:
dad7453d0d08 Merged revisions 75147 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 56147
diff changeset
114 ## # Explicitly use the 10.4u (universal) SDK when
dad7453d0d08 Merged revisions 75147 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 56147
diff changeset
115 ## # building on 10.4, the system headers are not
dad7453d0d08 Merged revisions 75147 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 56147
diff changeset
116 ## # useable for a universal build
dad7453d0d08 Merged revisions 75147 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 56147
diff changeset
117 ## SDKPATH = "/Developer/SDKs/MacOSX10.4u.sdk"
dad7453d0d08 Merged revisions 75147 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 56147
diff changeset
118 ##else:
dad7453d0d08 Merged revisions 75147 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 56147
diff changeset
119 ## SDKPATH = "/"
dad7453d0d08 Merged revisions 75147 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 56147
diff changeset
120
dad7453d0d08 Merged revisions 75147 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 56147
diff changeset
121 SDKPATH = "/Developer/SDKs/MacOSX10.4u.sdk"
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
122
52460
573085015aa8 Merged revisions 70737 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52451
diff changeset
123 universal_opts_map = { '32-bit': ('i386', 'ppc',),
573085015aa8 Merged revisions 70737 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52451
diff changeset
124 '64-bit': ('x86_64', 'ppc64',),
56147
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
125 'intel': ('i386', 'x86_64'),
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
126 '3-way': ('ppc', 'i386', 'x86_64'),
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
127 'all': ('i386', 'ppc', 'x86_64', 'ppc64',) }
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
128 default_target_map = {
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
129 '64-bit': '10.5',
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
130 '3-way': '10.5',
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
131 'intel': '10.5',
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
132 'all': '10.5',
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
133 }
52460
573085015aa8 Merged revisions 70737 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52451
diff changeset
134
573085015aa8 Merged revisions 70737 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52451
diff changeset
135 UNIVERSALOPTS = tuple(universal_opts_map.keys())
573085015aa8 Merged revisions 70737 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52451
diff changeset
136
573085015aa8 Merged revisions 70737 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52451
diff changeset
137 UNIVERSALARCHS = '32-bit'
573085015aa8 Merged revisions 70737 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52451
diff changeset
138
573085015aa8 Merged revisions 70737 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52451
diff changeset
139 ARCHLIST = universal_opts_map[UNIVERSALARCHS]
38946
7c8990cccf9b Use staticly build copies of zlib and bzip2 to build the OSX installer, that
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 38752
diff changeset
140
68503
ee5350f1d0c2 #11515: fix several typos. Patch by Piotr Kasprzyk.
Ezio Melotti <ezio.melotti@gmail.com>
parents: 68256
diff changeset
141 # Source directory (assume we're in Mac/BuildScript)
40295
ed2ac8084e04 Whitespace changes to make the source more compliant with PEP8 (SF#1589070)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 40292
diff changeset
142 SRCDIR = os.path.dirname(
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
143 os.path.dirname(
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
144 os.path.dirname(
38645
a3668e94fc6d mv Mac/OSX/BuildScript one level up
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 38358
diff changeset
145 os.path.abspath(__file__
a3668e94fc6d mv Mac/OSX/BuildScript one level up
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 38358
diff changeset
146 ))))
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
147
52460
573085015aa8 Merged revisions 70737 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52451
diff changeset
148 # $MACOSX_DEPLOYMENT_TARGET -> minimum OS X level
573085015aa8 Merged revisions 70737 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52451
diff changeset
149 DEPTARGET = '10.3'
573085015aa8 Merged revisions 70737 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52451
diff changeset
150
56299
dad7453d0d08 Merged revisions 75147 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 56147
diff changeset
151 target_cc_map = {
81799
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
152 '10.3': ('gcc-4.0', 'g++-4.0'),
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
153 '10.4': ('gcc-4.0', 'g++-4.0'),
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
154 '10.5': ('gcc-4.2', 'g++-4.2'),
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
155 '10.6': ('gcc-4.2', 'g++-4.2'),
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
156 '10.7': ('clang', 'clang++'),
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
157 '10.8': ('clang', 'clang++'),
56299
dad7453d0d08 Merged revisions 75147 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 56147
diff changeset
158 }
dad7453d0d08 Merged revisions 75147 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 56147
diff changeset
159
81799
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
160 CC, CXX = target_cc_map[DEPTARGET]
56299
dad7453d0d08 Merged revisions 75147 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 56147
diff changeset
161
67812
d3b4fa2dd728 Merged revisions 88004,88006,88235 via svnmerge from
Ned Deily <nad@acm.org>
parents: 65556
diff changeset
162 PYTHON_3 = getVersionTuple() >= (3, 0)
d3b4fa2dd728 Merged revisions 88004,88006,88235 via svnmerge from
Ned Deily <nad@acm.org>
parents: 65556
diff changeset
163
40295
ed2ac8084e04 Whitespace changes to make the source more compliant with PEP8 (SF#1589070)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 40292
diff changeset
164 USAGE = textwrap.dedent("""\
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
165 Usage: build_python [options]
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
166
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
167 Options:
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
168 -? or -h: Show this message
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
169 -b DIR
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
170 --build-dir=DIR: Create build here (default: %(WORKDIR)r)
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
171 --third-party=DIR: Store third-party sources here (default: %(DEPSRC)r)
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
172 --sdk-path=DIR: Location of the SDK (default: %(SDKPATH)r)
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
173 --src-dir=DIR: Location of the Python sources (default: %(SRCDIR)r)
52460
573085015aa8 Merged revisions 70737 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52451
diff changeset
174 --dep-target=10.n OS X deployment target (default: %(DEPTARGET)r)
573085015aa8 Merged revisions 70737 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52451
diff changeset
175 --universal-archs=x universal architectures (options: %(UNIVERSALOPTS)r, default: %(UNIVERSALARCHS)r)
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
176 """)% globals()
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
177
81799
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
178 # Dict of object file names with shared library names to check after building.
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
179 # This is to ensure that we ended up dynamically linking with the shared
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
180 # library paths and versions we expected. For example:
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
181 # EXPECTED_SHARED_LIBS['_tkinter.so'] = [
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
182 # '/Library/Frameworks/Tcl.framework/Versions/8.5/Tcl',
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
183 # '/Library/Frameworks/Tk.framework/Versions/8.5/Tk']
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
184 EXPECTED_SHARED_LIBS = {}
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
185
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
186 # Instructions for building libraries that are necessary for building a
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
187 # batteries included python.
52460
573085015aa8 Merged revisions 70737 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52451
diff changeset
188 # [The recipes are defined here for convenience but instantiated later after
573085015aa8 Merged revisions 70737 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52451
diff changeset
189 # command line options have been processed.]
573085015aa8 Merged revisions 70737 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52451
diff changeset
190 def library_recipes():
56147
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
191 result = []
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
192
81799
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
193 LT_10_5 = bool(DEPTARGET < '10.5')
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
194
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
195 if getVersionTuple() >= (3, 3):
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
196 result.extend([
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
197 dict(
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
198 name="XZ 5.0.3",
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
199 url="http://tukaani.org/xz/xz-5.0.3.tar.gz",
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
200 checksum='fefe52f9ecd521de2a8ce38c21a27574',
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
201 configure_pre=[
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
202 '--disable-dependency-tracking',
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
203 ]
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
204 ),
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
205 ])
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
206
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
207 result.extend([
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
208 dict(
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
209 name="NCurses 5.9",
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
210 url="http://ftp.gnu.org/pub/gnu/ncurses/ncurses-5.9.tar.gz",
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
211 checksum='8cb9c412e5f2d96bc6f459aa8c6282a1',
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
212 configure_pre=[
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
213 "--enable-widec",
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
214 "--without-cxx",
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
215 "--without-cxx-binding",
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
216 "--without-ada",
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
217 "--without-curses-h",
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
218 "--enable-shared",
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
219 "--with-shared",
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
220 "--without-debug",
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
221 "--without-normal",
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
222 "--without-tests",
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
223 "--without-manpages",
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
224 "--datadir=/usr/share",
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
225 "--sysconfdir=/etc",
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
226 "--sharedstatedir=/usr/com",
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
227 "--with-terminfo-dirs=/usr/share/terminfo",
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
228 "--with-default-terminfo-dir=/usr/share/terminfo",
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
229 "--libdir=/Library/Frameworks/Python.framework/Versions/%s/lib"%(getVersion(),),
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
230 ],
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
231 patchscripts=[
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
232 ("ftp://invisible-island.net/ncurses//5.9/ncurses-5.9-20120616-patch.sh.bz2",
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
233 "f54bf02a349f96a7c4f0d00922f3a0d4"),
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
234 ],
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
235 useLDFlags=False,
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
236 install='make && make install DESTDIR=%s && cd %s/usr/local/lib && ln -fs ../../../Library/Frameworks/Python.framework/Versions/%s/lib/lib* .'%(
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
237 shellQuote(os.path.join(WORKDIR, 'libraries')),
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
238 shellQuote(os.path.join(WORKDIR, 'libraries')),
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
239 getVersion(),
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
240 ),
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
241 ),
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
242 dict(
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
243 name="SQLite 3.7.13",
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
244 url="http://www.sqlite.org/sqlite-autoconf-3071300.tar.gz",
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
245 checksum='c97df403e8a3d5b67bb408fcd6aabd8e',
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
246 extra_cflags=('-Os '
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
247 '-DSQLITE_ENABLE_FTS4 '
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
248 '-DSQLITE_ENABLE_FTS3_PARENTHESIS '
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
249 '-DSQLITE_ENABLE_RTREE '
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
250 '-DSQLITE_TCL=0 '
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
251 '%s' % ('','-DSQLITE_WITHOUT_ZONEMALLOC ')[LT_10_5]),
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
252 configure_pre=[
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
253 '--enable-threadsafe',
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
254 '--enable-shared=no',
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
255 '--enable-static=yes',
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
256 '--disable-readline',
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
257 '--disable-dependency-tracking',
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
258 ]
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
259 ),
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
260 ])
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
261
56147
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
262 if DEPTARGET < '10.5':
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
263 result.extend([
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
264 dict(
67812
d3b4fa2dd728 Merged revisions 88004,88006,88235 via svnmerge from
Ned Deily <nad@acm.org>
parents: 65556
diff changeset
265 name="Bzip2 1.0.6",
d3b4fa2dd728 Merged revisions 88004,88006,88235 via svnmerge from
Ned Deily <nad@acm.org>
parents: 65556
diff changeset
266 url="http://bzip.org/1.0.6/bzip2-1.0.6.tar.gz",
d3b4fa2dd728 Merged revisions 88004,88006,88235 via svnmerge from
Ned Deily <nad@acm.org>
parents: 65556
diff changeset
267 checksum='00b516f4704d4a7cb50a1d97e6e8e15b',
56147
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
268 configure=None,
81799
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
269 install='make install CC=%s CXX=%s, PREFIX=%s/usr/local/ CFLAGS="-arch %s -isysroot %s"'%(
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
270 CC, CXX,
56147
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
271 shellQuote(os.path.join(WORKDIR, 'libraries')),
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
272 ' -arch '.join(ARCHLIST),
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
273 SDKPATH,
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
274 ),
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
275 ),
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
276 dict(
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
277 name="ZLib 1.2.3",
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
278 url="http://www.gzip.org/zlib/zlib-1.2.3.tar.gz",
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
279 checksum='debc62758716a169df9f62e6ab2bc634',
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
280 configure=None,
81799
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
281 install='make install CC=%s CXX=%s, prefix=%s/usr/local/ CFLAGS="-arch %s -isysroot %s"'%(
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
282 CC, CXX,
56147
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
283 shellQuote(os.path.join(WORKDIR, 'libraries')),
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
284 ' -arch '.join(ARCHLIST),
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
285 SDKPATH,
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
286 ),
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
287 ),
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
288 dict(
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
289 # Note that GNU readline is GPL'd software
67812
d3b4fa2dd728 Merged revisions 88004,88006,88235 via svnmerge from
Ned Deily <nad@acm.org>
parents: 65556
diff changeset
290 name="GNU Readline 6.1.2",
d3b4fa2dd728 Merged revisions 88004,88006,88235 via svnmerge from
Ned Deily <nad@acm.org>
parents: 65556
diff changeset
291 url="http://ftp.gnu.org/pub/gnu/readline/readline-6.1.tar.gz" ,
d3b4fa2dd728 Merged revisions 88004,88006,88235 via svnmerge from
Ned Deily <nad@acm.org>
parents: 65556
diff changeset
292 checksum='fc2f7e714fe792db1ce6ddc4c9fb4ef3',
56147
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
293 patchlevel='0',
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
294 patches=[
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
295 # The readline maintainers don't do actual micro releases, but
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
296 # just ship a set of patches.
81799
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
297 ('http://ftp.gnu.org/pub/gnu/readline/readline-6.1-patches/readline61-001',
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
298 'c642f2e84d820884b0bf9fd176bc6c3f'),
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
299 ('http://ftp.gnu.org/pub/gnu/readline/readline-6.1-patches/readline61-002',
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
300 '1a76781a1ea734e831588285db7ec9b1'),
56147
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
301 ]
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
302 ),
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
303 ])
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
304
67812
d3b4fa2dd728 Merged revisions 88004,88006,88235 via svnmerge from
Ned Deily <nad@acm.org>
parents: 65556
diff changeset
305 if not PYTHON_3:
d3b4fa2dd728 Merged revisions 88004,88006,88235 via svnmerge from
Ned Deily <nad@acm.org>
parents: 65556
diff changeset
306 result.extend([
d3b4fa2dd728 Merged revisions 88004,88006,88235 via svnmerge from
Ned Deily <nad@acm.org>
parents: 65556
diff changeset
307 dict(
d3b4fa2dd728 Merged revisions 88004,88006,88235 via svnmerge from
Ned Deily <nad@acm.org>
parents: 65556
diff changeset
308 name="Sleepycat DB 4.7.25",
d3b4fa2dd728 Merged revisions 88004,88006,88235 via svnmerge from
Ned Deily <nad@acm.org>
parents: 65556
diff changeset
309 url="http://download.oracle.com/berkeley-db/db-4.7.25.tar.gz",
d3b4fa2dd728 Merged revisions 88004,88006,88235 via svnmerge from
Ned Deily <nad@acm.org>
parents: 65556
diff changeset
310 checksum='ec2b87e833779681a0c3a814aa71359e',
d3b4fa2dd728 Merged revisions 88004,88006,88235 via svnmerge from
Ned Deily <nad@acm.org>
parents: 65556
diff changeset
311 buildDir="build_unix",
d3b4fa2dd728 Merged revisions 88004,88006,88235 via svnmerge from
Ned Deily <nad@acm.org>
parents: 65556
diff changeset
312 configure="../dist/configure",
d3b4fa2dd728 Merged revisions 88004,88006,88235 via svnmerge from
Ned Deily <nad@acm.org>
parents: 65556
diff changeset
313 configure_pre=[
d3b4fa2dd728 Merged revisions 88004,88006,88235 via svnmerge from
Ned Deily <nad@acm.org>
parents: 65556
diff changeset
314 '--includedir=/usr/local/include/db4',
d3b4fa2dd728 Merged revisions 88004,88006,88235 via svnmerge from
Ned Deily <nad@acm.org>
parents: 65556
diff changeset
315 ]
d3b4fa2dd728 Merged revisions 88004,88006,88235 via svnmerge from
Ned Deily <nad@acm.org>
parents: 65556
diff changeset
316 ),
d3b4fa2dd728 Merged revisions 88004,88006,88235 via svnmerge from
Ned Deily <nad@acm.org>
parents: 65556
diff changeset
317 ])
56147
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
318
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
319 return result
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
320
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
321
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
322 # Instructions for building packages inside the .mpkg.
56147
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
323 def pkg_recipes():
67812
d3b4fa2dd728 Merged revisions 88004,88006,88235 via svnmerge from
Ned Deily <nad@acm.org>
parents: 65556
diff changeset
324 unselected_for_python3 = ('selected', 'unselected')[PYTHON_3]
56147
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
325 result = [
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
326 dict(
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
327 name="PythonFramework",
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
328 long_name="Python Framework",
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
329 source="/Library/Frameworks/Python.framework",
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
330 readme="""\
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
331 This package installs Python.framework, that is the python
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
332 interpreter and the standard library. This also includes Python
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
333 wrappers for lots of Mac OS X API's.
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
334 """,
56147
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
335 postflight="scripts/postflight.framework",
57912
9da0cf2dffcc An update to the script that's used to build the binary installer: don't install files in
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 56298
diff changeset
336 selected='selected',
56147
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
337 ),
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
338 dict(
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
339 name="PythonApplications",
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
340 long_name="GUI Applications",
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
341 source="/Applications/Python %(VER)s",
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
342 readme="""\
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
343 This package installs IDLE (an interactive Python IDE),
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
344 Python Launcher and Build Applet (create application bundles
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
345 from python scripts).
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
346
56147
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
347 It also installs a number of examples and demos.
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
348 """,
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
349 required=False,
57912
9da0cf2dffcc An update to the script that's used to build the binary installer: don't install files in
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 56298
diff changeset
350 selected='selected',
56147
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
351 ),
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
352 dict(
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
353 name="PythonUnixTools",
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
354 long_name="UNIX command-line tools",
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
355 source="/usr/local/bin",
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
356 readme="""\
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
357 This package installs the unix tools in /usr/local/bin for
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
358 compatibility with older releases of Python. This package
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
359 is not necessary to use Python.
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
360 """,
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
361 required=False,
63143
721e728ac060 Fix for issue 9275: the OSX installer no longer installs links in /usr/local
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 61119
diff changeset
362 selected='selected',
56147
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
363 ),
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
364 dict(
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
365 name="PythonDocumentation",
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
366 long_name="Python Documentation",
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
367 topdir="/Library/Frameworks/Python.framework/Versions/%(VER)s/Resources/English.lproj/Documentation",
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
368 source="/pydocs",
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
369 readme="""\
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
370 This package installs the python documentation at a location
81799
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
371 that is useable for pydoc and IDLE.
56147
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
372 """,
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
373 postflight="scripts/postflight.documentation",
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
374 required=False,
57912
9da0cf2dffcc An update to the script that's used to build the binary installer: don't install files in
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 56298
diff changeset
375 selected='selected',
56147
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
376 ),
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
377 dict(
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
378 name="PythonProfileChanges",
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
379 long_name="Shell profile updater",
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
380 readme="""\
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
381 This packages updates your shell profile to make sure that
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
382 the Python tools are found by your shell in preference of
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
383 the system provided Python tools.
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
384
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
385 If you don't install this package you'll have to add
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
386 "/Library/Frameworks/Python.framework/Versions/%(VER)s/bin"
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
387 to your PATH by hand.
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
388 """,
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
389 postflight="scripts/postflight.patch-profile",
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
390 topdir="/Library/Frameworks/Python.framework",
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
391 source="/empty-dir",
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
392 required=False,
67812
d3b4fa2dd728 Merged revisions 88004,88006,88235 via svnmerge from
Ned Deily <nad@acm.org>
parents: 65556
diff changeset
393 selected=unselected_for_python3,
56147
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
394 ),
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
395 ]
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
396
81799
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
397 if DEPTARGET < '10.4' and not PYTHON_3:
56147
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
398 result.append(
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
399 dict(
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
400 name="PythonSystemFixes",
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
401 long_name="Fix system Python",
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
402 readme="""\
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
403 This package updates the system python installation on
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
404 Mac OS X 10.3 to ensure that you can build new python extensions
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
405 using that copy of python after installing this version.
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
406 """,
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
407 postflight="../Tools/fixapplepython23.py",
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
408 topdir="/Library/Frameworks/Python.framework",
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
409 source="/empty-dir",
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
410 required=False,
67812
d3b4fa2dd728 Merged revisions 88004,88006,88235 via svnmerge from
Ned Deily <nad@acm.org>
parents: 65556
diff changeset
411 selected=unselected_for_python3,
56147
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
412 )
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
413 )
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
414 return result
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
415
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
416 def fatal(msg):
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
417 """
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
418 A fatal error, bail out.
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
419 """
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
420 sys.stderr.write('FATAL: ')
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
421 sys.stderr.write(msg)
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
422 sys.stderr.write('\n')
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
423 sys.exit(1)
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
424
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
425 def fileContents(fn):
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
426 """
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
427 Return the contents of the named file
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
428 """
81799
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
429 return open(fn, 'r').read()
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
430
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
431 def runCommand(commandline):
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
432 """
68588
cd8d3c2d3bce #11565: Fix several typos. Patch by Piotr Kasprzyk.
Ezio Melotti <ezio.melotti@gmail.com>
parents: 68503
diff changeset
433 Run a command and raise RuntimeError if it fails. Output is suppressed
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
434 unless the command fails.
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
435 """
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
436 fd = os.popen(commandline, 'r')
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
437 data = fd.read()
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
438 xit = fd.close()
46197
01a7e66525c2 #2503 make singletons compared with "is" not == or !=
Benjamin Peterson <benjamin@python.org>
parents: 40295
diff changeset
439 if xit is not None:
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
440 sys.stdout.write(data)
81799
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
441 raise RuntimeError("command failed: %s"%(commandline,))
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
442
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
443 if VERBOSE:
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
444 sys.stdout.write(data); sys.stdout.flush()
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
445
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
446 def captureCommand(commandline):
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
447 fd = os.popen(commandline, 'r')
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
448 data = fd.read()
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
449 xit = fd.close()
46197
01a7e66525c2 #2503 make singletons compared with "is" not == or !=
Benjamin Peterson <benjamin@python.org>
parents: 40295
diff changeset
450 if xit is not None:
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
451 sys.stdout.write(data)
81799
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
452 raise RuntimeError("command failed: %s"%(commandline,))
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
453
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
454 return data
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
455
60691
4505eb57b4ca Merged revisions 80179 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 56299
diff changeset
456 def getTclTkVersion(configfile, versionline):
4505eb57b4ca Merged revisions 80179 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 56299
diff changeset
457 """
4505eb57b4ca Merged revisions 80179 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 56299
diff changeset
458 search Tcl or Tk configuration file for version line
4505eb57b4ca Merged revisions 80179 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 56299
diff changeset
459 """
4505eb57b4ca Merged revisions 80179 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 56299
diff changeset
460 try:
4505eb57b4ca Merged revisions 80179 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 56299
diff changeset
461 f = open(configfile, "r")
4505eb57b4ca Merged revisions 80179 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 56299
diff changeset
462 except:
4505eb57b4ca Merged revisions 80179 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 56299
diff changeset
463 fatal("Framework configuration file not found: %s" % configfile)
4505eb57b4ca Merged revisions 80179 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 56299
diff changeset
464
4505eb57b4ca Merged revisions 80179 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 56299
diff changeset
465 for l in f:
4505eb57b4ca Merged revisions 80179 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 56299
diff changeset
466 if l.startswith(versionline):
4505eb57b4ca Merged revisions 80179 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 56299
diff changeset
467 f.close()
4505eb57b4ca Merged revisions 80179 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 56299
diff changeset
468 return l
4505eb57b4ca Merged revisions 80179 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 56299
diff changeset
469
4505eb57b4ca Merged revisions 80179 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 56299
diff changeset
470 fatal("Version variable %s not found in framework configuration file: %s"
4505eb57b4ca Merged revisions 80179 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 56299
diff changeset
471 % (versionline, configfile))
4505eb57b4ca Merged revisions 80179 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 56299
diff changeset
472
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
473 def checkEnvironment():
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
474 """
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
475 Check that we're running on a supported system.
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
476 """
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
477
67812
d3b4fa2dd728 Merged revisions 88004,88006,88235 via svnmerge from
Ned Deily <nad@acm.org>
parents: 65556
diff changeset
478 if sys.version_info[0:2] < (2, 4):
d3b4fa2dd728 Merged revisions 88004,88006,88235 via svnmerge from
Ned Deily <nad@acm.org>
parents: 65556
diff changeset
479 fatal("This script must be run with Python 2.4 or later")
d3b4fa2dd728 Merged revisions 88004,88006,88235 via svnmerge from
Ned Deily <nad@acm.org>
parents: 65556
diff changeset
480
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
481 if platform.system() != 'Darwin':
56147
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
482 fatal("This script should be run on a Mac OS X 10.4 (or later) system")
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
483
56299
dad7453d0d08 Merged revisions 75147 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 56147
diff changeset
484 if int(platform.release().split('.')[0]) < 8:
56147
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
485 fatal("This script should be run on a Mac OS X 10.4 (or later) system")
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
486
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
487 if not os.path.exists(SDKPATH):
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
488 fatal("Please install the latest version of Xcode and the %s SDK"%(
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
489 os.path.basename(SDKPATH[:-4])))
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
490
60691
4505eb57b4ca Merged revisions 80179 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 56299
diff changeset
491 # Because we only support dynamic load of only one major/minor version of
4505eb57b4ca Merged revisions 80179 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 56299
diff changeset
492 # Tcl/Tk, ensure:
4505eb57b4ca Merged revisions 80179 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 56299
diff changeset
493 # 1. there are no user-installed frameworks of Tcl/Tk with version
81799
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
494 # higher than the Apple-supplied system version in
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
495 # SDKROOT/System/Library/Frameworks
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
496 # 2. there is a user-installed framework (usually ActiveTcl) in (or linked
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
497 # in) SDKROOT/Library/Frameworks with the same version as the system
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
498 # version. This allows users to choose to install a newer patch level.
42374
deec4126ffac Mac Buildscript:
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 40293
diff changeset
499
81799
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
500 frameworks = {}
60691
4505eb57b4ca Merged revisions 80179 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 56299
diff changeset
501 for framework in ['Tcl', 'Tk']:
81799
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
502 fwpth = 'Library/Frameworks/%s.framework/Versions/Current' % framework
67812
d3b4fa2dd728 Merged revisions 88004,88006,88235 via svnmerge from
Ned Deily <nad@acm.org>
parents: 65556
diff changeset
503 sysfw = os.path.join(SDKPATH, 'System', fwpth)
81799
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
504 libfw = os.path.join(SDKPATH, fwpth)
60691
4505eb57b4ca Merged revisions 80179 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 56299
diff changeset
505 usrfw = os.path.join(os.getenv('HOME'), fwpth)
81799
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
506 frameworks[framework] = os.readlink(sysfw)
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
507 if not os.path.exists(libfw):
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
508 fatal("Please install a link to a current %s %s as %s so "
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
509 "the user can override the system framework."
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
510 % (framework, frameworks[framework], libfw))
67812
d3b4fa2dd728 Merged revisions 88004,88006,88235 via svnmerge from
Ned Deily <nad@acm.org>
parents: 65556
diff changeset
511 if os.readlink(libfw) != os.readlink(sysfw):
60691
4505eb57b4ca Merged revisions 80179 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 56299
diff changeset
512 fatal("Version of %s must match %s" % (libfw, sysfw) )
4505eb57b4ca Merged revisions 80179 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 56299
diff changeset
513 if os.path.exists(usrfw):
4505eb57b4ca Merged revisions 80179 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 56299
diff changeset
514 fatal("Please rename %s to avoid possible dynamic load issues."
4505eb57b4ca Merged revisions 80179 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 56299
diff changeset
515 % usrfw)
42374
deec4126ffac Mac Buildscript:
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 40293
diff changeset
516
81799
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
517 if frameworks['Tcl'] != frameworks['Tk']:
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
518 fatal("The Tcl and Tk frameworks are not the same version.")
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
519
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
520 # add files to check after build
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
521 EXPECTED_SHARED_LIBS['_tkinter.so'] = [
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
522 "/Library/Frameworks/Tcl.framework/Versions/%s/Tcl"
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
523 % frameworks['Tcl'],
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
524 "/Library/Frameworks/Tk.framework/Versions/%s/Tk"
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
525 % frameworks['Tk'],
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
526 ]
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
527
60691
4505eb57b4ca Merged revisions 80179 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 56299
diff changeset
528 # Remove inherited environment variables which might influence build
4505eb57b4ca Merged revisions 80179 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 56299
diff changeset
529 environ_var_prefixes = ['CPATH', 'C_INCLUDE_', 'DYLD_', 'LANG', 'LC_',
4505eb57b4ca Merged revisions 80179 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 56299
diff changeset
530 'LD_', 'LIBRARY_', 'PATH', 'PYTHON']
4505eb57b4ca Merged revisions 80179 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 56299
diff changeset
531 for ev in list(os.environ):
4505eb57b4ca Merged revisions 80179 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 56299
diff changeset
532 for prefix in environ_var_prefixes:
4505eb57b4ca Merged revisions 80179 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 56299
diff changeset
533 if ev.startswith(prefix) :
81799
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
534 print("INFO: deleting environment variable %s=%s" % (
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
535 ev, os.environ[ev]))
60691
4505eb57b4ca Merged revisions 80179 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 56299
diff changeset
536 del os.environ[ev]
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
537
81799
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
538 base_path = '/bin:/sbin:/usr/bin:/usr/sbin'
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
539 if 'SDK_TOOLS_BIN' in os.environ:
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
540 base_path = os.environ['SDK_TOOLS_BIN'] + ':' + base_path
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
541 # Xcode 2.5 on OS X 10.4 does not include SetFile in its usr/bin;
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
542 # add its fixed location here if it exists
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
543 OLD_DEVELOPER_TOOLS = '/Developer/Tools'
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
544 if os.path.isdir(OLD_DEVELOPER_TOOLS):
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
545 base_path = base_path + ':' + OLD_DEVELOPER_TOOLS
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
546 os.environ['PATH'] = base_path
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
547 print("Setting default PATH: %s"%(os.environ['PATH']))
60741
bf8d5402abff Merged revisions 80232 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 60691
diff changeset
548
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
549
40295
ed2ac8084e04 Whitespace changes to make the source more compliant with PEP8 (SF#1589070)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 40292
diff changeset
550 def parseOptions(args=None):
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
551 """
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
552 Parse arguments and update global settings.
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
553 """
52460
573085015aa8 Merged revisions 70737 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52451
diff changeset
554 global WORKDIR, DEPSRC, SDKPATH, SRCDIR, DEPTARGET
81799
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
555 global UNIVERSALOPTS, UNIVERSALARCHS, ARCHLIST, CC, CXX
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
556
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
557 if args is None:
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
558 args = sys.argv[1:]
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
559
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
560 try:
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
561 options, args = getopt.getopt(args, '?hb',
52460
573085015aa8 Merged revisions 70737 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52451
diff changeset
562 [ 'build-dir=', 'third-party=', 'sdk-path=' , 'src-dir=',
573085015aa8 Merged revisions 70737 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52451
diff changeset
563 'dep-target=', 'universal-archs=', 'help' ])
81799
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
564 except getopt.GetoptError:
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
565 print(sys.exc_info()[1])
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
566 sys.exit(1)
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
567
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
568 if args:
81799
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
569 print("Additional arguments")
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
570 sys.exit(1)
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
571
56147
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
572 deptarget = None
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
573 for k, v in options:
52460
573085015aa8 Merged revisions 70737 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52451
diff changeset
574 if k in ('-h', '-?', '--help'):
81799
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
575 print(USAGE)
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
576 sys.exit(0)
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
577
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
578 elif k in ('-d', '--build-dir'):
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
579 WORKDIR=v
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
580
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
581 elif k in ('--third-party',):
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
582 DEPSRC=v
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
583
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
584 elif k in ('--sdk-path',):
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
585 SDKPATH=v
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
586
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
587 elif k in ('--src-dir',):
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
588 SRCDIR=v
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
589
52460
573085015aa8 Merged revisions 70737 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52451
diff changeset
590 elif k in ('--dep-target', ):
573085015aa8 Merged revisions 70737 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52451
diff changeset
591 DEPTARGET=v
56147
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
592 deptarget=v
52460
573085015aa8 Merged revisions 70737 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52451
diff changeset
593
573085015aa8 Merged revisions 70737 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52451
diff changeset
594 elif k in ('--universal-archs', ):
573085015aa8 Merged revisions 70737 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52451
diff changeset
595 if v in UNIVERSALOPTS:
573085015aa8 Merged revisions 70737 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52451
diff changeset
596 UNIVERSALARCHS = v
573085015aa8 Merged revisions 70737 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52451
diff changeset
597 ARCHLIST = universal_opts_map[UNIVERSALARCHS]
56147
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
598 if deptarget is None:
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
599 # Select alternate default deployment
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
600 # target
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
601 DEPTARGET = default_target_map.get(v, '10.3')
52460
573085015aa8 Merged revisions 70737 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52451
diff changeset
602 else:
81799
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
603 raise NotImplementedError(v)
52460
573085015aa8 Merged revisions 70737 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52451
diff changeset
604
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
605 else:
81799
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
606 raise NotImplementedError(k)
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
607
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
608 SRCDIR=os.path.abspath(SRCDIR)
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
609 WORKDIR=os.path.abspath(WORKDIR)
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
610 SDKPATH=os.path.abspath(SDKPATH)
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
611 DEPSRC=os.path.abspath(DEPSRC)
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
612
81799
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
613 CC, CXX=target_cc_map[DEPTARGET]
56299
dad7453d0d08 Merged revisions 75147 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 56147
diff changeset
614
81799
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
615 print("Settings:")
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
616 print(" * Source directory:", SRCDIR)
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
617 print(" * Build directory: ", WORKDIR)
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
618 print(" * SDK location: ", SDKPATH)
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
619 print(" * Third-party source:", DEPSRC)
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
620 print(" * Deployment target:", DEPTARGET)
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
621 print(" * Universal architectures:", ARCHLIST)
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
622 print(" * C compiler:", CC)
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
623 print(" * C++ compiler:", CXX)
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
624 print("")
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
625
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
626
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
627
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
628
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
629 def extractArchive(builddir, archiveName):
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
630 """
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
631 Extract a source archive into 'builddir'. Returns the path of the
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
632 extracted archive.
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
633
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
634 XXX: This function assumes that archives contain a toplevel directory
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
635 that is has the same name as the basename of the archive. This is
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
636 save enough for anything we use.
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
637 """
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
638 curdir = os.getcwd()
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
639 try:
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
640 os.chdir(builddir)
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
641 if archiveName.endswith('.tar.gz'):
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
642 retval = os.path.basename(archiveName[:-7])
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
643 if os.path.exists(retval):
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
644 shutil.rmtree(retval)
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
645 fp = os.popen("tar zxf %s 2>&1"%(shellQuote(archiveName),), 'r')
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
646
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
647 elif archiveName.endswith('.tar.bz2'):
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
648 retval = os.path.basename(archiveName[:-8])
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
649 if os.path.exists(retval):
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
650 shutil.rmtree(retval)
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
651 fp = os.popen("tar jxf %s 2>&1"%(shellQuote(archiveName),), 'r')
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
652
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
653 elif archiveName.endswith('.tar'):
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
654 retval = os.path.basename(archiveName[:-4])
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
655 if os.path.exists(retval):
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
656 shutil.rmtree(retval)
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
657 fp = os.popen("tar xf %s 2>&1"%(shellQuote(archiveName),), 'r')
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
658
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
659 elif archiveName.endswith('.zip'):
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
660 retval = os.path.basename(archiveName[:-4])
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
661 if os.path.exists(retval):
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
662 shutil.rmtree(retval)
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
663 fp = os.popen("unzip %s 2>&1"%(shellQuote(archiveName),), 'r')
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
664
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
665 data = fp.read()
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
666 xit = fp.close()
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
667 if xit is not None:
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
668 sys.stdout.write(data)
81799
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
669 raise RuntimeError("Cannot extract %s"%(archiveName,))
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
670
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
671 return os.path.join(builddir, retval)
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
672
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
673 finally:
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
674 os.chdir(curdir)
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
675
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
676 def downloadURL(url, fname):
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
677 """
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
678 Download the contents of the url into the file.
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
679 """
81799
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
680 fpIn = urllib_request.urlopen(url)
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
681 fpOut = open(fname, 'wb')
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
682 block = fpIn.read(10240)
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
683 try:
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
684 while block:
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
685 fpOut.write(block)
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
686 block = fpIn.read(10240)
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
687 fpIn.close()
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
688 fpOut.close()
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
689 except:
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
690 try:
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
691 os.unlink(fname)
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
692 except:
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
693 pass
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
694
81799
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
695 def verifyThirdPartyFile(url, checksum, fname):
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
696 """
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
697 Download file from url to filename fname if it does not already exist.
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
698 Abort if file contents does not match supplied md5 checksum.
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
699 """
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
700 name = os.path.basename(fname)
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
701 if os.path.exists(fname):
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
702 print("Using local copy of %s"%(name,))
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
703 else:
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
704 print("Did not find local copy of %s"%(name,))
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
705 print("Downloading %s"%(name,))
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
706 downloadURL(url, fname)
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
707 print("Archive for %s stored as %s"%(name, fname))
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
708 if os.system(
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
709 'MD5=$(openssl md5 %s) ; test "${MD5##*= }" = "%s"'
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
710 % (shellQuote(fname), checksum) ):
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
711 fatal('MD5 checksum mismatch for file %s' % fname)
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
712
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
713 def buildRecipe(recipe, basedir, archList):
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
714 """
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
715 Build software using a recipe. This function does the
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
716 'configure;make;make install' dance for C software, with a possibility
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
717 to customize this process, basically a poor-mans DarwinPorts.
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
718 """
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
719 curdir = os.getcwd()
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
720
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
721 name = recipe['name']
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
722 url = recipe['url']
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
723 configure = recipe.get('configure', './configure')
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
724 install = recipe.get('install', 'make && make install DESTDIR=%s'%(
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
725 shellQuote(basedir)))
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
726
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
727 archiveName = os.path.split(url)[-1]
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
728 sourceArchive = os.path.join(DEPSRC, archiveName)
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
729
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
730 if not os.path.exists(DEPSRC):
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
731 os.mkdir(DEPSRC)
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
732
81799
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
733 verifyThirdPartyFile(url, recipe['checksum'], sourceArchive)
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
734 print("Extracting archive for %s"%(name,))
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
735 buildDir=os.path.join(WORKDIR, '_bld')
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
736 if not os.path.exists(buildDir):
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
737 os.mkdir(buildDir)
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
738
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
739 workDir = extractArchive(buildDir, sourceArchive)
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
740 os.chdir(workDir)
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
741 if 'buildDir' in recipe:
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
742 os.chdir(recipe['buildDir'])
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
743
81799
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
744 for patch in recipe.get('patches', ()):
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
745 if isinstance(patch, tuple):
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
746 url, checksum = patch
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
747 fn = os.path.join(DEPSRC, os.path.basename(url))
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
748 verifyThirdPartyFile(url, checksum, fn)
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
749 else:
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
750 # patch is a file in the source directory
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
751 fn = os.path.join(curdir, patch)
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
752 runCommand('patch -p%s < %s'%(recipe.get('patchlevel', 1),
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
753 shellQuote(fn),))
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
754
81799
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
755 for patchscript in recipe.get('patchscripts', ()):
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
756 if isinstance(patchscript, tuple):
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
757 url, checksum = patchscript
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
758 fn = os.path.join(DEPSRC, os.path.basename(url))
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
759 verifyThirdPartyFile(url, checksum, fn)
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
760 else:
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
761 # patch is a file in the source directory
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
762 fn = os.path.join(curdir, patchscript)
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
763 if fn.endswith('.bz2'):
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
764 runCommand('bunzip2 -fk %s' % shellQuote(fn))
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
765 fn = fn[:-4]
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
766 runCommand('sh %s' % shellQuote(fn))
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
767 os.unlink(fn)
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
768
38946
7c8990cccf9b Use staticly build copies of zlib and bzip2 to build the OSX installer, that
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 38752
diff changeset
769 if configure is not None:
7c8990cccf9b Use staticly build copies of zlib and bzip2 to build the OSX installer, that
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 38752
diff changeset
770 configure_args = [
7c8990cccf9b Use staticly build copies of zlib and bzip2 to build the OSX installer, that
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 38752
diff changeset
771 "--prefix=/usr/local",
7c8990cccf9b Use staticly build copies of zlib and bzip2 to build the OSX installer, that
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 38752
diff changeset
772 "--enable-static",
7c8990cccf9b Use staticly build copies of zlib and bzip2 to build the OSX installer, that
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 38752
diff changeset
773 "--disable-shared",
7c8990cccf9b Use staticly build copies of zlib and bzip2 to build the OSX installer, that
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 38752
diff changeset
774 #"CPP=gcc -arch %s -E"%(' -arch '.join(archList,),),
7c8990cccf9b Use staticly build copies of zlib and bzip2 to build the OSX installer, that
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 38752
diff changeset
775 ]
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
776
38946
7c8990cccf9b Use staticly build copies of zlib and bzip2 to build the OSX installer, that
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 38752
diff changeset
777 if 'configure_pre' in recipe:
7c8990cccf9b Use staticly build copies of zlib and bzip2 to build the OSX installer, that
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 38752
diff changeset
778 args = list(recipe['configure_pre'])
7c8990cccf9b Use staticly build copies of zlib and bzip2 to build the OSX installer, that
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 38752
diff changeset
779 if '--disable-static' in args:
7c8990cccf9b Use staticly build copies of zlib and bzip2 to build the OSX installer, that
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 38752
diff changeset
780 configure_args.remove('--enable-static')
7c8990cccf9b Use staticly build copies of zlib and bzip2 to build the OSX installer, that
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 38752
diff changeset
781 if '--enable-shared' in args:
7c8990cccf9b Use staticly build copies of zlib and bzip2 to build the OSX installer, that
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 38752
diff changeset
782 configure_args.remove('--disable-shared')
7c8990cccf9b Use staticly build copies of zlib and bzip2 to build the OSX installer, that
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 38752
diff changeset
783 configure_args.extend(args)
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
784
38946
7c8990cccf9b Use staticly build copies of zlib and bzip2 to build the OSX installer, that
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 38752
diff changeset
785 if recipe.get('useLDFlags', 1):
7c8990cccf9b Use staticly build copies of zlib and bzip2 to build the OSX installer, that
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 38752
diff changeset
786 configure_args.extend([
81799
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
787 "CFLAGS=%s-mmacosx-version-min=%s -arch %s -isysroot %s "
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
788 "-I%s/usr/local/include"%(
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
789 recipe.get('extra_cflags', ''),
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
790 DEPTARGET,
38946
7c8990cccf9b Use staticly build copies of zlib and bzip2 to build the OSX installer, that
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 38752
diff changeset
791 ' -arch '.join(archList),
7c8990cccf9b Use staticly build copies of zlib and bzip2 to build the OSX installer, that
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 38752
diff changeset
792 shellQuote(SDKPATH)[1:-1],
7c8990cccf9b Use staticly build copies of zlib and bzip2 to build the OSX installer, that
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 38752
diff changeset
793 shellQuote(basedir)[1:-1],),
81799
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
794 "LDFLAGS=-mmacosx-version-min=%s -syslibroot,%s -L%s/usr/local/lib -arch %s"%(
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
795 DEPTARGET,
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
796 shellQuote(SDKPATH)[1:-1],
38946
7c8990cccf9b Use staticly build copies of zlib and bzip2 to build the OSX installer, that
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 38752
diff changeset
797 shellQuote(basedir)[1:-1],
7c8990cccf9b Use staticly build copies of zlib and bzip2 to build the OSX installer, that
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 38752
diff changeset
798 ' -arch '.join(archList)),
7c8990cccf9b Use staticly build copies of zlib and bzip2 to build the OSX installer, that
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 38752
diff changeset
799 ])
7c8990cccf9b Use staticly build copies of zlib and bzip2 to build the OSX installer, that
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 38752
diff changeset
800 else:
7c8990cccf9b Use staticly build copies of zlib and bzip2 to build the OSX installer, that
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 38752
diff changeset
801 configure_args.extend([
81799
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
802 "CFLAGS=%s-mmacosx-version-min=%s -arch %s -isysroot %s "
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
803 "-I%s/usr/local/include"%(
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
804 recipe.get('extra_cflags', ''),
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
805 DEPTARGET,
38946
7c8990cccf9b Use staticly build copies of zlib and bzip2 to build the OSX installer, that
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 38752
diff changeset
806 ' -arch '.join(archList),
7c8990cccf9b Use staticly build copies of zlib and bzip2 to build the OSX installer, that
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 38752
diff changeset
807 shellQuote(SDKPATH)[1:-1],
7c8990cccf9b Use staticly build copies of zlib and bzip2 to build the OSX installer, that
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 38752
diff changeset
808 shellQuote(basedir)[1:-1],),
7c8990cccf9b Use staticly build copies of zlib and bzip2 to build the OSX installer, that
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 38752
diff changeset
809 ])
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
810
38946
7c8990cccf9b Use staticly build copies of zlib and bzip2 to build the OSX installer, that
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 38752
diff changeset
811 if 'configure_post' in recipe:
81799
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
812 configure_args = configure_args + list(recipe['configure_post'])
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
813
38946
7c8990cccf9b Use staticly build copies of zlib and bzip2 to build the OSX installer, that
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 38752
diff changeset
814 configure_args.insert(0, configure)
7c8990cccf9b Use staticly build copies of zlib and bzip2 to build the OSX installer, that
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 38752
diff changeset
815 configure_args = [ shellQuote(a) for a in configure_args ]
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
816
81799
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
817 print("Running configure for %s"%(name,))
38946
7c8990cccf9b Use staticly build copies of zlib and bzip2 to build the OSX installer, that
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 38752
diff changeset
818 runCommand(' '.join(configure_args) + ' 2>&1')
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
819
81799
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
820 print("Running install for %s"%(name,))
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
821 runCommand('{ ' + install + ' ;} 2>&1')
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
822
81799
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
823 print("Done %s"%(name,))
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
824 print("")
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
825
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
826 os.chdir(curdir)
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
827
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
828 def buildLibraries():
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
829 """
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
830 Build our dependencies into $WORKDIR/libraries/usr/local
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
831 """
81799
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
832 print("")
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
833 print("Building required libraries")
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
834 print("")
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
835 universal = os.path.join(WORKDIR, 'libraries')
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
836 os.mkdir(universal)
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
837 os.makedirs(os.path.join(universal, 'usr', 'local', 'lib'))
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
838 os.makedirs(os.path.join(universal, 'usr', 'local', 'include'))
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
839
52460
573085015aa8 Merged revisions 70737 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52451
diff changeset
840 for recipe in library_recipes():
38946
7c8990cccf9b Use staticly build copies of zlib and bzip2 to build the OSX installer, that
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 38752
diff changeset
841 buildRecipe(recipe, universal, ARCHLIST)
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
842
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
843
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
844
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
845 def buildPythonDocs():
52451
2d38de002bbe Merged revisions 70727 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52005
diff changeset
846 # This stores the documentation as Resources/English.lproj/Documentation
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
847 # inside the framwork. pydoc and IDLE will pick it up there.
81799
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
848 print("Install python documentation")
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
849 rootDir = os.path.join(WORKDIR, '_root')
52451
2d38de002bbe Merged revisions 70727 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52005
diff changeset
850 buildDir = os.path.join('../../Doc')
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
851 docdir = os.path.join(rootDir, 'pydocs')
52451
2d38de002bbe Merged revisions 70727 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52005
diff changeset
852 curDir = os.getcwd()
2d38de002bbe Merged revisions 70727 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52005
diff changeset
853 os.chdir(buildDir)
2d38de002bbe Merged revisions 70727 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52005
diff changeset
854 runCommand('make update')
60860
5b726c601e22 Merged revisions 80355 via svnmerge from
Martin v. Löwis <martin@v.loewis.de>
parents: 60741
diff changeset
855 runCommand("make html PYTHON='%s'" % os.path.abspath(sys.executable))
52451
2d38de002bbe Merged revisions 70727 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52005
diff changeset
856 os.chdir(curDir)
2d38de002bbe Merged revisions 70727 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52005
diff changeset
857 if not os.path.exists(docdir):
2d38de002bbe Merged revisions 70727 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52005
diff changeset
858 os.mkdir(docdir)
56299
dad7453d0d08 Merged revisions 75147 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 56147
diff changeset
859 os.rename(os.path.join(buildDir, 'build', 'html'), docdir)
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
860
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
861
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
862 def buildPython():
81799
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
863 print("Building a universal python for %s architectures" % UNIVERSALARCHS)
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
864
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
865 buildDir = os.path.join(WORKDIR, '_bld', 'python')
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
866 rootDir = os.path.join(WORKDIR, '_root')
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
867
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
868 if os.path.exists(buildDir):
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
869 shutil.rmtree(buildDir)
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
870 if os.path.exists(rootDir):
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
871 shutil.rmtree(rootDir)
67812
d3b4fa2dd728 Merged revisions 88004,88006,88235 via svnmerge from
Ned Deily <nad@acm.org>
parents: 65556
diff changeset
872 os.makedirs(buildDir)
d3b4fa2dd728 Merged revisions 88004,88006,88235 via svnmerge from
Ned Deily <nad@acm.org>
parents: 65556
diff changeset
873 os.makedirs(rootDir)
d3b4fa2dd728 Merged revisions 88004,88006,88235 via svnmerge from
Ned Deily <nad@acm.org>
parents: 65556
diff changeset
874 os.makedirs(os.path.join(rootDir, 'empty-dir'))
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
875 curdir = os.getcwd()
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
876 os.chdir(buildDir)
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
877
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
878 # Not sure if this is still needed, the original build script
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
879 # claims that parts of the install assume python.exe exists.
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
880 os.symlink('python', os.path.join(buildDir, 'python.exe'))
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
881
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
882 # Extract the version from the configure file, needed to calculate
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
883 # several paths.
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
884 version = getVersion()
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
885
52469
268b8eb31f49 Merged revisions 70746 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52460
diff changeset
886 # Since the extra libs are not in their installed framework location
268b8eb31f49 Merged revisions 70746 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52460
diff changeset
887 # during the build, augment the library path so that the interpreter
268b8eb31f49 Merged revisions 70746 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52460
diff changeset
888 # will find them during its extension import sanity checks.
268b8eb31f49 Merged revisions 70746 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52460
diff changeset
889 os.environ['DYLD_LIBRARY_PATH'] = os.path.join(WORKDIR,
268b8eb31f49 Merged revisions 70746 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52460
diff changeset
890 'libraries', 'usr', 'local', 'lib')
81799
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
891 print("Running configure...")
52460
573085015aa8 Merged revisions 70737 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52451
diff changeset
892 runCommand("%s -C --enable-framework --enable-universalsdk=%s "
573085015aa8 Merged revisions 70737 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52451
diff changeset
893 "--with-universal-archs=%s "
67812
d3b4fa2dd728 Merged revisions 88004,88006,88235 via svnmerge from
Ned Deily <nad@acm.org>
parents: 65556
diff changeset
894 "%s "
52460
573085015aa8 Merged revisions 70737 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52451
diff changeset
895 "LDFLAGS='-g -L%s/libraries/usr/local/lib' "
573085015aa8 Merged revisions 70737 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52451
diff changeset
896 "OPT='-g -O3 -I%s/libraries/usr/local/include' 2>&1"%(
573085015aa8 Merged revisions 70737 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52451
diff changeset
897 shellQuote(os.path.join(SRCDIR, 'configure')), shellQuote(SDKPATH),
573085015aa8 Merged revisions 70737 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52451
diff changeset
898 UNIVERSALARCHS,
67812
d3b4fa2dd728 Merged revisions 88004,88006,88235 via svnmerge from
Ned Deily <nad@acm.org>
parents: 65556
diff changeset
899 (' ', '--with-computed-gotos ')[PYTHON_3],
52460
573085015aa8 Merged revisions 70737 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52451
diff changeset
900 shellQuote(WORKDIR)[1:-1],
38354
957727f2ff09 - Remove previous version of the binary distribution script for OSX
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 38273
diff changeset
901 shellQuote(WORKDIR)[1:-1]))
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
902
81799
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
903 print("Running make")
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
904 runCommand("make")
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
905
81799
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
906 print("Running make install")
67812
d3b4fa2dd728 Merged revisions 88004,88006,88235 via svnmerge from
Ned Deily <nad@acm.org>
parents: 65556
diff changeset
907 runCommand("make install DESTDIR=%s"%(
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
908 shellQuote(rootDir)))
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
909
81799
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
910 print("Running make frameworkinstallextras")
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
911 runCommand("make frameworkinstallextras DESTDIR=%s"%(
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
912 shellQuote(rootDir)))
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
913
52469
268b8eb31f49 Merged revisions 70746 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52460
diff changeset
914 del os.environ['DYLD_LIBRARY_PATH']
81799
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
915 print("Copying required shared libraries")
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
916 if os.path.exists(os.path.join(WORKDIR, 'libraries', 'Library')):
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
917 runCommand("mv %s/* %s"%(
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
918 shellQuote(os.path.join(
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
919 WORKDIR, 'libraries', 'Library', 'Frameworks',
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
920 'Python.framework', 'Versions', getVersion(),
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
921 'lib')),
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
922 shellQuote(os.path.join(WORKDIR, '_root', 'Library', 'Frameworks',
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
923 'Python.framework', 'Versions', getVersion(),
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
924 'lib'))))
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
925
81799
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
926 print("Fix file modes")
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
927 frmDir = os.path.join(rootDir, 'Library', 'Frameworks', 'Python.framework')
40081
0dac6de0fe78 Macosx: fix permission problem in generated installer
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 39851
diff changeset
928 gid = grp.getgrnam('admin').gr_gid
0dac6de0fe78 Macosx: fix permission problem in generated installer
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 39851
diff changeset
929
81799
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
930 shared_lib_error = False
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
931 for dirpath, dirnames, filenames in os.walk(frmDir):
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
932 for dn in dirnames:
81799
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
933 os.chmod(os.path.join(dirpath, dn), STAT_0o775)
40081
0dac6de0fe78 Macosx: fix permission problem in generated installer
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 39851
diff changeset
934 os.chown(os.path.join(dirpath, dn), -1, gid)
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
935
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
936 for fn in filenames:
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
937 if os.path.islink(fn):
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
938 continue
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
939
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
940 # "chmod g+w $fn"
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
941 p = os.path.join(dirpath, fn)
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
942 st = os.stat(p)
40081
0dac6de0fe78 Macosx: fix permission problem in generated installer
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 39851
diff changeset
943 os.chmod(p, stat.S_IMODE(st.st_mode) | stat.S_IWGRP)
0dac6de0fe78 Macosx: fix permission problem in generated installer
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 39851
diff changeset
944 os.chown(p, -1, gid)
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
945
81799
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
946 if fn in EXPECTED_SHARED_LIBS:
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
947 # check to see that this file was linked with the
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
948 # expected library path and version
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
949 data = captureCommand("otool -L %s" % shellQuote(p))
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
950 for sl in EXPECTED_SHARED_LIBS[fn]:
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
951 if ("\t%s " % sl) not in data:
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
952 print("Expected shared lib %s was not linked with %s"
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
953 % (sl, p))
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
954 shared_lib_error = True
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
955
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
956 if shared_lib_error:
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
957 fatal("Unexpected shared library errors.")
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
958
67812
d3b4fa2dd728 Merged revisions 88004,88006,88235 via svnmerge from
Ned Deily <nad@acm.org>
parents: 65556
diff changeset
959 if PYTHON_3:
d3b4fa2dd728 Merged revisions 88004,88006,88235 via svnmerge from
Ned Deily <nad@acm.org>
parents: 65556
diff changeset
960 LDVERSION=None
d3b4fa2dd728 Merged revisions 88004,88006,88235 via svnmerge from
Ned Deily <nad@acm.org>
parents: 65556
diff changeset
961 VERSION=None
d3b4fa2dd728 Merged revisions 88004,88006,88235 via svnmerge from
Ned Deily <nad@acm.org>
parents: 65556
diff changeset
962 ABIFLAGS=None
d3b4fa2dd728 Merged revisions 88004,88006,88235 via svnmerge from
Ned Deily <nad@acm.org>
parents: 65556
diff changeset
963
d3b4fa2dd728 Merged revisions 88004,88006,88235 via svnmerge from
Ned Deily <nad@acm.org>
parents: 65556
diff changeset
964 fp = open(os.path.join(buildDir, 'Makefile'), 'r')
d3b4fa2dd728 Merged revisions 88004,88006,88235 via svnmerge from
Ned Deily <nad@acm.org>
parents: 65556
diff changeset
965 for ln in fp:
d3b4fa2dd728 Merged revisions 88004,88006,88235 via svnmerge from
Ned Deily <nad@acm.org>
parents: 65556
diff changeset
966 if ln.startswith('VERSION='):
d3b4fa2dd728 Merged revisions 88004,88006,88235 via svnmerge from
Ned Deily <nad@acm.org>
parents: 65556
diff changeset
967 VERSION=ln.split()[1]
d3b4fa2dd728 Merged revisions 88004,88006,88235 via svnmerge from
Ned Deily <nad@acm.org>
parents: 65556
diff changeset
968 if ln.startswith('ABIFLAGS='):
d3b4fa2dd728 Merged revisions 88004,88006,88235 via svnmerge from
Ned Deily <nad@acm.org>
parents: 65556
diff changeset
969 ABIFLAGS=ln.split()[1]
d3b4fa2dd728 Merged revisions 88004,88006,88235 via svnmerge from
Ned Deily <nad@acm.org>
parents: 65556
diff changeset
970 if ln.startswith('LDVERSION='):
d3b4fa2dd728 Merged revisions 88004,88006,88235 via svnmerge from
Ned Deily <nad@acm.org>
parents: 65556
diff changeset
971 LDVERSION=ln.split()[1]
d3b4fa2dd728 Merged revisions 88004,88006,88235 via svnmerge from
Ned Deily <nad@acm.org>
parents: 65556
diff changeset
972 fp.close()
d3b4fa2dd728 Merged revisions 88004,88006,88235 via svnmerge from
Ned Deily <nad@acm.org>
parents: 65556
diff changeset
973
d3b4fa2dd728 Merged revisions 88004,88006,88235 via svnmerge from
Ned Deily <nad@acm.org>
parents: 65556
diff changeset
974 LDVERSION = LDVERSION.replace('$(VERSION)', VERSION)
d3b4fa2dd728 Merged revisions 88004,88006,88235 via svnmerge from
Ned Deily <nad@acm.org>
parents: 65556
diff changeset
975 LDVERSION = LDVERSION.replace('$(ABIFLAGS)', ABIFLAGS)
d3b4fa2dd728 Merged revisions 88004,88006,88235 via svnmerge from
Ned Deily <nad@acm.org>
parents: 65556
diff changeset
976 config_suffix = '-' + LDVERSION
d3b4fa2dd728 Merged revisions 88004,88006,88235 via svnmerge from
Ned Deily <nad@acm.org>
parents: 65556
diff changeset
977 else:
d3b4fa2dd728 Merged revisions 88004,88006,88235 via svnmerge from
Ned Deily <nad@acm.org>
parents: 65556
diff changeset
978 config_suffix = '' # Python 2.x
d3b4fa2dd728 Merged revisions 88004,88006,88235 via svnmerge from
Ned Deily <nad@acm.org>
parents: 65556
diff changeset
979
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
980 # We added some directories to the search path during the configure
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
981 # phase. Remove those because those directories won't be there on
81799
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
982 # the end-users system. Also remove the directories from _sysconfigdata.py
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
983 # (added in 3.3) if it exists.
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
984
81799
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
985 path_to_lib = os.path.join(rootDir, 'Library', 'Frameworks',
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
986 'Python.framework', 'Versions',
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
987 version, 'lib', 'python%s'%(version,))
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
988 paths = [os.path.join(path_to_lib, 'config' + config_suffix, 'Makefile'),
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
989 os.path.join(path_to_lib, '_sysconfigdata.py')]
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
990 for path in paths:
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
991 if not os.path.exists(path):
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
992 continue
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
993 fp = open(path, 'r')
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
994 data = fp.read()
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
995 fp.close()
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
996
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
997 data = data.replace(' -L%s/libraries/usr/local/lib'%(WORKDIR,), '')
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
998 data = data.replace(' -I%s/libraries/usr/local/include'%(WORKDIR,), '')
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
999 fp = open(path, 'w')
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
1000 fp.write(data)
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
1001 fp.close()
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1002
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1003 # Add symlinks in /usr/local/bin, using relative links
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1004 usr_local_bin = os.path.join(rootDir, 'usr', 'local', 'bin')
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1005 to_framework = os.path.join('..', '..', '..', 'Library', 'Frameworks',
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1006 'Python.framework', 'Versions', version, 'bin')
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1007 if os.path.exists(usr_local_bin):
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1008 shutil.rmtree(usr_local_bin)
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1009 os.makedirs(usr_local_bin)
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1010 for fn in os.listdir(
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1011 os.path.join(frmDir, 'Versions', version, 'bin')):
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1012 os.symlink(os.path.join(to_framework, fn),
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1013 os.path.join(usr_local_bin, fn))
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1014
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1015 os.chdir(curdir)
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1016
67812
d3b4fa2dd728 Merged revisions 88004,88006,88235 via svnmerge from
Ned Deily <nad@acm.org>
parents: 65556
diff changeset
1017 if PYTHON_3:
d3b4fa2dd728 Merged revisions 88004,88006,88235 via svnmerge from
Ned Deily <nad@acm.org>
parents: 65556
diff changeset
1018 # Remove the 'Current' link, that way we don't accidently mess
d3b4fa2dd728 Merged revisions 88004,88006,88235 via svnmerge from
Ned Deily <nad@acm.org>
parents: 65556
diff changeset
1019 # with an already installed version of python 2
d3b4fa2dd728 Merged revisions 88004,88006,88235 via svnmerge from
Ned Deily <nad@acm.org>
parents: 65556
diff changeset
1020 os.unlink(os.path.join(rootDir, 'Library', 'Frameworks',
d3b4fa2dd728 Merged revisions 88004,88006,88235 via svnmerge from
Ned Deily <nad@acm.org>
parents: 65556
diff changeset
1021 'Python.framework', 'Versions', 'Current'))
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1022
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1023 def patchFile(inPath, outPath):
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1024 data = fileContents(inPath)
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1025 data = data.replace('$FULL_VERSION', getFullVersion())
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1026 data = data.replace('$VERSION', getVersion())
52460
573085015aa8 Merged revisions 70737 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52451
diff changeset
1027 data = data.replace('$MACOSX_DEPLOYMENT_TARGET', ''.join((DEPTARGET, ' or later')))
65556
6dcf61447c33 Merged revisions 85742 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 63143
diff changeset
1028 data = data.replace('$ARCHITECTURES', ", ".join(universal_opts_map[UNIVERSALARCHS]))
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1029 data = data.replace('$INSTALL_SIZE', installSize())
38752
5a994d26a3cf - Change fixapplepython23.py to ensure that it will run with /usr/bin/python
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 38650
diff changeset
1030
5a994d26a3cf - Change fixapplepython23.py to ensure that it will run with /usr/bin/python
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 38650
diff changeset
1031 # This one is not handy as a template variable
5a994d26a3cf - Change fixapplepython23.py to ensure that it will run with /usr/bin/python
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 38650
diff changeset
1032 data = data.replace('$PYTHONFRAMEWORKINSTALLDIR', '/Library/Frameworks/Python.framework')
81799
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
1033 fp = open(outPath, 'w')
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1034 fp.write(data)
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1035 fp.close()
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1036
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1037 def patchScript(inPath, outPath):
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1038 data = fileContents(inPath)
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1039 data = data.replace('@PYVER@', getVersion())
81799
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
1040 fp = open(outPath, 'w')
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1041 fp.write(data)
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1042 fp.close()
81799
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
1043 os.chmod(outPath, STAT_0o755)
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1044
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1045
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1046
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1047 def packageFromRecipe(targetDir, recipe):
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1048 curdir = os.getcwd()
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1049 try:
40293
5531f46232b7 backport of revision 52644
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 40081
diff changeset
1050 # The major version (such as 2.5) is included in the package name
5531f46232b7 backport of revision 52644
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 40081
diff changeset
1051 # because having two version of python installed at the same time is
38752
5a994d26a3cf - Change fixapplepython23.py to ensure that it will run with /usr/bin/python
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 38650
diff changeset
1052 # common.
5a994d26a3cf - Change fixapplepython23.py to ensure that it will run with /usr/bin/python
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 38650
diff changeset
1053 pkgname = '%s-%s'%(recipe['name'], getVersion())
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1054 srcdir = recipe.get('source')
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1055 pkgroot = recipe.get('topdir', srcdir)
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1056 postflight = recipe.get('postflight')
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1057 readme = textwrap.dedent(recipe['readme'])
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1058 isRequired = recipe.get('required', True)
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1059
81799
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
1060 print("- building package %s"%(pkgname,))
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1061
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1062 # Substitute some variables
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1063 textvars = dict(
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1064 VER=getVersion(),
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1065 FULLVER=getFullVersion(),
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1066 )
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1067 readme = readme % textvars
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1068
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1069 if pkgroot is not None:
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1070 pkgroot = pkgroot % textvars
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1071 else:
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1072 pkgroot = '/'
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1073
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1074 if srcdir is not None:
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1075 srcdir = os.path.join(WORKDIR, '_root', srcdir[1:])
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1076 srcdir = srcdir % textvars
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1077
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1078 if postflight is not None:
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1079 postflight = os.path.abspath(postflight)
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1080
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1081 packageContents = os.path.join(targetDir, pkgname + '.pkg', 'Contents')
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1082 os.makedirs(packageContents)
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1083
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1084 if srcdir is not None:
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1085 os.chdir(srcdir)
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1086 runCommand("pax -wf %s . 2>&1"%(shellQuote(os.path.join(packageContents, 'Archive.pax')),))
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1087 runCommand("gzip -9 %s 2>&1"%(shellQuote(os.path.join(packageContents, 'Archive.pax')),))
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1088 runCommand("mkbom . %s 2>&1"%(shellQuote(os.path.join(packageContents, 'Archive.bom')),))
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1089
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1090 fn = os.path.join(packageContents, 'PkgInfo')
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1091 fp = open(fn, 'w')
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1092 fp.write('pmkrpkg1')
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1093 fp.close()
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1094
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1095 rsrcDir = os.path.join(packageContents, "Resources")
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1096 os.mkdir(rsrcDir)
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1097 fp = open(os.path.join(rsrcDir, 'ReadMe.txt'), 'w')
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1098 fp.write(readme)
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1099 fp.close()
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1100
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1101 if postflight is not None:
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1102 patchScript(postflight, os.path.join(rsrcDir, 'postflight'))
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1103
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1104 vers = getFullVersion()
81799
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
1105 major, minor = getVersionMajorMinor()
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1106 pl = Plist(
52460
573085015aa8 Merged revisions 70737 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52451
diff changeset
1107 CFBundleGetInfoString="Python.%s %s"%(pkgname, vers,),
573085015aa8 Merged revisions 70737 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52451
diff changeset
1108 CFBundleIdentifier='org.python.Python.%s'%(pkgname,),
573085015aa8 Merged revisions 70737 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52451
diff changeset
1109 CFBundleName='Python.%s'%(pkgname,),
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1110 CFBundleShortVersionString=vers,
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1111 IFMajorVersion=major,
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1112 IFMinorVersion=minor,
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1113 IFPkgFormatVersion=0.10000000149011612,
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1114 IFPkgFlagAllowBackRev=False,
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1115 IFPkgFlagAuthorizationAction="RootAuthorization",
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1116 IFPkgFlagDefaultLocation=pkgroot,
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1117 IFPkgFlagFollowLinks=True,
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1118 IFPkgFlagInstallFat=True,
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1119 IFPkgFlagIsRequired=isRequired,
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1120 IFPkgFlagOverwritePermissions=False,
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1121 IFPkgFlagRelocatable=False,
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1122 IFPkgFlagRestartAction="NoRestart",
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1123 IFPkgFlagRootVolumeOnly=True,
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1124 IFPkgFlagUpdateInstalledLangauges=False,
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1125 )
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1126 writePlist(pl, os.path.join(packageContents, 'Info.plist'))
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1127
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1128 pl = Plist(
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1129 IFPkgDescriptionDescription=readme,
52460
573085015aa8 Merged revisions 70737 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52451
diff changeset
1130 IFPkgDescriptionTitle=recipe.get('long_name', "Python.%s"%(pkgname,)),
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1131 IFPkgDescriptionVersion=vers,
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1132 )
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1133 writePlist(pl, os.path.join(packageContents, 'Resources', 'Description.plist'))
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1134
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1135 finally:
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1136 os.chdir(curdir)
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1137
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1138
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1139 def makeMpkgPlist(path):
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1140
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1141 vers = getFullVersion()
81799
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
1142 major, minor = getVersionMajorMinor()
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1143
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1144 pl = Plist(
52460
573085015aa8 Merged revisions 70737 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52451
diff changeset
1145 CFBundleGetInfoString="Python %s"%(vers,),
573085015aa8 Merged revisions 70737 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52451
diff changeset
1146 CFBundleIdentifier='org.python.Python',
573085015aa8 Merged revisions 70737 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52451
diff changeset
1147 CFBundleName='Python',
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1148 CFBundleShortVersionString=vers,
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1149 IFMajorVersion=major,
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1150 IFMinorVersion=minor,
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1151 IFPkgFlagComponentDirectory="Contents/Packages",
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1152 IFPkgFlagPackageList=[
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1153 dict(
38752
5a994d26a3cf - Change fixapplepython23.py to ensure that it will run with /usr/bin/python
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 38650
diff changeset
1154 IFPkgFlagPackageLocation='%s-%s.pkg'%(item['name'], getVersion()),
57912
9da0cf2dffcc An update to the script that's used to build the binary installer: don't install files in
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 56298
diff changeset
1155 IFPkgFlagPackageSelection=item.get('selected', 'selected'),
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1156 )
56147
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
1157 for item in pkg_recipes()
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1158 ],
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1159 IFPkgFormatVersion=0.10000000149011612,
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1160 IFPkgFlagBackgroundScaling="proportional",
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1161 IFPkgFlagBackgroundAlignment="left",
38752
5a994d26a3cf - Change fixapplepython23.py to ensure that it will run with /usr/bin/python
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 38650
diff changeset
1162 IFPkgFlagAuthorizationAction="RootAuthorization",
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1163 )
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1164
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1165 writePlist(pl, path)
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1166
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1167
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1168 def buildInstaller():
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1169
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1170 # Zap all compiled files
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1171 for dirpath, _, filenames in os.walk(os.path.join(WORKDIR, '_root')):
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1172 for fn in filenames:
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1173 if fn.endswith('.pyc') or fn.endswith('.pyo'):
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1174 os.unlink(os.path.join(dirpath, fn))
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1175
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1176 outdir = os.path.join(WORKDIR, 'installer')
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1177 if os.path.exists(outdir):
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1178 shutil.rmtree(outdir)
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1179 os.mkdir(outdir)
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1180
52460
573085015aa8 Merged revisions 70737 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52451
diff changeset
1181 pkgroot = os.path.join(outdir, 'Python.mpkg', 'Contents')
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1182 pkgcontents = os.path.join(pkgroot, 'Packages')
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1183 os.makedirs(pkgcontents)
56147
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
1184 for recipe in pkg_recipes():
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1185 packageFromRecipe(pkgcontents, recipe)
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1186
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1187 rsrcDir = os.path.join(pkgroot, 'Resources')
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1188
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1189 fn = os.path.join(pkgroot, 'PkgInfo')
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1190 fp = open(fn, 'w')
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1191 fp.write('pmkrpkg1')
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1192 fp.close()
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1193
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1194 os.mkdir(rsrcDir)
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1195
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1196 makeMpkgPlist(os.path.join(pkgroot, 'Info.plist'))
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1197 pl = Plist(
52460
573085015aa8 Merged revisions 70737 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52451
diff changeset
1198 IFPkgDescriptionTitle="Python",
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1199 IFPkgDescriptionVersion=getVersion(),
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1200 )
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1201
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1202 writePlist(pl, os.path.join(pkgroot, 'Resources', 'Description.plist'))
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1203 for fn in os.listdir('resources'):
38354
957727f2ff09 - Remove previous version of the binary distribution script for OSX
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 38273
diff changeset
1204 if fn == '.svn': continue
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1205 if fn.endswith('.jpg'):
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1206 shutil.copy(os.path.join('resources', fn), os.path.join(rsrcDir, fn))
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1207 else:
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1208 patchFile(os.path.join('resources', fn), os.path.join(rsrcDir, fn))
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1209
38752
5a994d26a3cf - Change fixapplepython23.py to ensure that it will run with /usr/bin/python
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 38650
diff changeset
1210 shutil.copy("../../LICENSE", os.path.join(rsrcDir, 'License.txt'))
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1211
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1212
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1213 def installSize(clear=False, _saved=[]):
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1214 if clear:
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1215 del _saved[:]
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1216 if not _saved:
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1217 data = captureCommand("du -ks %s"%(
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1218 shellQuote(os.path.join(WORKDIR, '_root'))))
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1219 _saved.append("%d"%((0.5 + (int(data.split()[0]) / 1024.0)),))
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1220 return _saved[0]
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1221
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1222
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1223 def buildDMG():
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1224 """
40293
5531f46232b7 backport of revision 52644
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 40081
diff changeset
1225 Create DMG containing the rootDir.
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1226 """
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1227 outdir = os.path.join(WORKDIR, 'diskimage')
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1228 if os.path.exists(outdir):
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1229 shutil.rmtree(outdir)
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1230
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1231 imagepath = os.path.join(outdir,
56147
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
1232 'python-%s-macosx%s'%(getFullVersion(),DEPTARGET))
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1233 if INCLUDE_TIMESTAMP:
56147
273c234800c1 Merged revisions 74981 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52514
diff changeset
1234 imagepath = imagepath + '-%04d-%02d-%02d'%(time.localtime()[:3])
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1235 imagepath = imagepath + '.dmg'
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1236
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1237 os.mkdir(outdir)
52460
573085015aa8 Merged revisions 70737 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52451
diff changeset
1238 volname='Python %s'%(getFullVersion())
573085015aa8 Merged revisions 70737 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52451
diff changeset
1239 runCommand("hdiutil create -format UDRW -volname %s -srcfolder %s %s"%(
573085015aa8 Merged revisions 70737 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52451
diff changeset
1240 shellQuote(volname),
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1241 shellQuote(os.path.join(WORKDIR, 'installer')),
52460
573085015aa8 Merged revisions 70737 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52451
diff changeset
1242 shellQuote(imagepath + ".tmp.dmg" )))
573085015aa8 Merged revisions 70737 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52451
diff changeset
1243
573085015aa8 Merged revisions 70737 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52451
diff changeset
1244
573085015aa8 Merged revisions 70737 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52451
diff changeset
1245 if not os.path.exists(os.path.join(WORKDIR, "mnt")):
573085015aa8 Merged revisions 70737 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52451
diff changeset
1246 os.mkdir(os.path.join(WORKDIR, "mnt"))
573085015aa8 Merged revisions 70737 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52451
diff changeset
1247 runCommand("hdiutil attach %s -mountroot %s"%(
573085015aa8 Merged revisions 70737 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52451
diff changeset
1248 shellQuote(imagepath + ".tmp.dmg"), shellQuote(os.path.join(WORKDIR, "mnt"))))
573085015aa8 Merged revisions 70737 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52451
diff changeset
1249
573085015aa8 Merged revisions 70737 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52451
diff changeset
1250 # Custom icon for the DMG, shown when the DMG is mounted.
573085015aa8 Merged revisions 70737 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52451
diff changeset
1251 shutil.copy("../Icons/Disk Image.icns",
573085015aa8 Merged revisions 70737 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52451
diff changeset
1252 os.path.join(WORKDIR, "mnt", volname, ".VolumeIcon.icns"))
81799
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
1253 runCommand("SetFile -a C %s/"%(
52460
573085015aa8 Merged revisions 70737 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52451
diff changeset
1254 shellQuote(os.path.join(WORKDIR, "mnt", volname)),))
573085015aa8 Merged revisions 70737 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52451
diff changeset
1255
573085015aa8 Merged revisions 70737 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52451
diff changeset
1256 runCommand("hdiutil detach %s"%(shellQuote(os.path.join(WORKDIR, "mnt", volname))))
573085015aa8 Merged revisions 70737 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52451
diff changeset
1257
573085015aa8 Merged revisions 70737 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52451
diff changeset
1258 setIcon(imagepath + ".tmp.dmg", "../Icons/Disk Image.icns")
573085015aa8 Merged revisions 70737 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52451
diff changeset
1259 runCommand("hdiutil convert %s -format UDZO -o %s"%(
573085015aa8 Merged revisions 70737 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52451
diff changeset
1260 shellQuote(imagepath + ".tmp.dmg"), shellQuote(imagepath)))
573085015aa8 Merged revisions 70737 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52451
diff changeset
1261 setIcon(imagepath, "../Icons/Disk Image.icns")
573085015aa8 Merged revisions 70737 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52451
diff changeset
1262
573085015aa8 Merged revisions 70737 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52451
diff changeset
1263 os.unlink(imagepath + ".tmp.dmg")
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1264
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1265 return imagepath
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1266
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1267
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1268 def setIcon(filePath, icnsPath):
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1269 """
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1270 Set the custom icon for the specified file or directory.
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1271 """
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1272
61120
7a35e0b8ae08 Merged revisions 80653 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 60860
diff changeset
1273 dirPath = os.path.normpath(os.path.dirname(__file__))
7a35e0b8ae08 Merged revisions 80653 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 60860
diff changeset
1274 toolPath = os.path.join(dirPath, "seticon.app/Contents/MacOS/seticon")
52451
2d38de002bbe Merged revisions 70727 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52005
diff changeset
1275 if not os.path.exists(toolPath) or os.stat(toolPath).st_mtime < os.stat(dirPath + '/seticon.m').st_mtime:
2d38de002bbe Merged revisions 70727 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52005
diff changeset
1276 # NOTE: The tool is created inside an .app bundle, otherwise it won't work due
2d38de002bbe Merged revisions 70727 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52005
diff changeset
1277 # to connections to the window server.
61120
7a35e0b8ae08 Merged revisions 80653 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 60860
diff changeset
1278 appPath = os.path.join(dirPath, "seticon.app/Contents/MacOS")
7a35e0b8ae08 Merged revisions 80653 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 60860
diff changeset
1279 if not os.path.exists(appPath):
7a35e0b8ae08 Merged revisions 80653 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 60860
diff changeset
1280 os.makedirs(appPath)
52451
2d38de002bbe Merged revisions 70727 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52005
diff changeset
1281 runCommand("cc -o %s %s/seticon.m -framework Cocoa"%(
2d38de002bbe Merged revisions 70727 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52005
diff changeset
1282 shellQuote(toolPath), shellQuote(dirPath)))
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1283
52451
2d38de002bbe Merged revisions 70727 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52005
diff changeset
1284 runCommand("%s %s %s"%(shellQuote(os.path.abspath(toolPath)), shellQuote(icnsPath),
2d38de002bbe Merged revisions 70727 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52005
diff changeset
1285 shellQuote(filePath)))
42374
deec4126ffac Mac Buildscript:
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 40293
diff changeset
1286
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1287 def main():
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1288 # First parse options and check if we can perform our work
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1289 parseOptions()
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1290 checkEnvironment()
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1291
52460
573085015aa8 Merged revisions 70737 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52451
diff changeset
1292 os.environ['MACOSX_DEPLOYMENT_TARGET'] = DEPTARGET
56299
dad7453d0d08 Merged revisions 75147 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 56147
diff changeset
1293 os.environ['CC'] = CC
81799
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
1294 os.environ['CXX'] = CXX
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1295
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1296 if os.path.exists(WORKDIR):
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1297 shutil.rmtree(WORKDIR)
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1298 os.mkdir(WORKDIR)
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1299
60691
4505eb57b4ca Merged revisions 80179 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 56299
diff changeset
1300 os.environ['LC_ALL'] = 'C'
4505eb57b4ca Merged revisions 80179 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 56299
diff changeset
1301
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1302 # Then build third-party libraries such as sleepycat DB4.
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1303 buildLibraries()
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1304
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1305 # Now build python itself
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1306 buildPython()
52514
ecf8424d7422 Merged revisions 70802 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52469
diff changeset
1307
ecf8424d7422 Merged revisions 70802 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52469
diff changeset
1308 # And then build the documentation
ecf8424d7422 Merged revisions 70802 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52469
diff changeset
1309 # Remove the Deployment Target from the shell
ecf8424d7422 Merged revisions 70802 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52469
diff changeset
1310 # environment, it's no longer needed and
ecf8424d7422 Merged revisions 70802 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52469
diff changeset
1311 # an unexpected build target can cause problems
ecf8424d7422 Merged revisions 70802 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52469
diff changeset
1312 # when Sphinx and its dependencies need to
ecf8424d7422 Merged revisions 70802 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52469
diff changeset
1313 # be (re-)installed.
ecf8424d7422 Merged revisions 70802 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52469
diff changeset
1314 del os.environ['MACOSX_DEPLOYMENT_TARGET']
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1315 buildPythonDocs()
52514
ecf8424d7422 Merged revisions 70802 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52469
diff changeset
1316
ecf8424d7422 Merged revisions 70802 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52469
diff changeset
1317
ecf8424d7422 Merged revisions 70802 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52469
diff changeset
1318 # Prepare the applications folder
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1319 fn = os.path.join(WORKDIR, "_root", "Applications",
49431
2e794757bdc8 Merged revisions 66766-66767,66771-66772,66774,66776,66783-66787,66790,66793,66797 via svnmerge from
Benjamin Peterson <benjamin@python.org>
parents: 46626
diff changeset
1320 "Python %s"%(getVersion(),), "Update Shell Profile.command")
52005
eb2c35dd225a Merged revisions 70167 via svnmerge from
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 49431
diff changeset
1321 patchScript("scripts/postflight.patch-profile", fn)
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1322
49431
2e794757bdc8 Merged revisions 66766-66767,66771-66772,66774,66776,66783-66787,66790,66793,66797 via svnmerge from
Benjamin Peterson <benjamin@python.org>
parents: 46626
diff changeset
1323 folder = os.path.join(WORKDIR, "_root", "Applications", "Python %s"%(
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1324 getVersion(),))
81799
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
1325 os.chmod(folder, STAT_0o755)
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1326 setIcon(folder, "../Icons/Python Folder.icns")
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1327
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1328 # Create the installer
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1329 buildInstaller()
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1330
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1331 # And copy the readme into the directory containing the installer
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1332 patchFile('resources/ReadMe.txt', os.path.join(WORKDIR, 'installer', 'ReadMe.txt'))
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1333
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1334 # Ditto for the license file.
38752
5a994d26a3cf - Change fixapplepython23.py to ensure that it will run with /usr/bin/python
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 38650
diff changeset
1335 shutil.copy('../../LICENSE', os.path.join(WORKDIR, 'installer', 'License.txt'))
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1336
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1337 fp = open(os.path.join(WORKDIR, 'installer', 'Build.txt'), 'w')
81799
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
1338 fp.write("# BUILD INFO\n")
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
1339 fp.write("# Date: %s\n" % time.ctime())
c2830debb15a Issue #14018: Backport OS X installer updates from 3.3.
Ned Deily <nad@acm.org>
parents: 68588
diff changeset
1340 fp.write("# By: %s\n" % pwd.getpwuid(os.getuid()).pw_gecos)
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1341 fp.close()
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1342
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1343 # And copy it to a DMG
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1344 buildDMG()
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1345
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1346 if __name__ == "__main__":
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1347 main()