annotate Mac/BuildScript/build-installer.py @ 65035:87f4b32905df 2.7

Cosmetic fix to use print function.
author Hirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp>
date Fri, 01 Oct 2010 10:48:47 +0000
parents 721e728ac060
children 6dcf61447c33
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
59518
ef48e48f066e normalize shebang lines to #!/usr/bin/env python
Benjamin Peterson <benjamin@python.org>
parents: 57912
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 """
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
3 This script is used to build the "official unofficial" universal build on
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
4 Mac OS X. It requires Mac OS X 10.4, Xcode 2.2 and the 10.4u SDK to do its
52459
974c2bef2800 * Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52450
diff changeset
5 work. 64-bit or four-way universal builds require at least OS X 10.5 and
974c2bef2800 * Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52450
diff changeset
6 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
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
8 Please ensure that this script keeps working with Python 2.3, to avoid
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
9 bootstrap issues (/usr/bin/python is Python 2.3 on OSX 10.4)
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
10
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
11 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
12 """
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
13 import platform, os, sys, getopt, textwrap, shutil, urllib2, stat, time, pwd
40082
66b83d1ba2fc MacOSX: fix permission problem in the generated installer
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 39852
diff changeset
14 import grp
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
15
40295
ed2ac8084e04 Whitespace changes to make the source more compliant with PEP8 (SF#1589070)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 40292
diff changeset
16 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
17 VERBOSE = 1
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
18
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
19 from plistlib import Plist
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
20
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
21 import MacOS
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
22
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
23 try:
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
24 from plistlib import writePlist
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
25 except ImportError:
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
26 # 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
27 def writePlist(plist, path):
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
28 plist.write(path)
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
29
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
30 def shellQuote(value):
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
31 """
40292
cbe133d72e39 Fix a number of typos in strings and comments (sf#1589070)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 40144
diff changeset
32 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
33 a shell command.
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
34 """
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
35 return "'%s'"%(value.replace("'", "'\"'\"'"))
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
36
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
37 def grepValue(fn, variable):
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
38 variable = variable + '='
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
39 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
40 if ln.startswith(variable):
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
41 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
42 return value[1:-1]
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
43
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
44 def getVersion():
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
45 return grepValue(os.path.join(SRCDIR, 'configure'), 'PACKAGE_VERSION')
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
46
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
47 def getFullVersion():
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
48 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
49 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
50 if 'PY_VERSION' in ln:
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
51 return ln.split()[-1][1:-1]
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
52
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
53 raise RuntimeError, "Cannot find full version??"
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
54
40292
cbe133d72e39 Fix a number of typos in strings and comments (sf#1589070)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 40144
diff changeset
55 # 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
56 WORKDIR = "/tmp/_py"
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
57
40292
cbe133d72e39 Fix a number of typos in strings and comments (sf#1589070)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 40144
diff changeset
58 # 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
59 # 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
60 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
61 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
62
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
63 # Location of the preferred SDK
56298
f99bca6ab0dc Fix for issue6957: ensure that the OSX installer
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 56145
diff changeset
64
f99bca6ab0dc Fix for issue6957: ensure that the OSX installer
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 56145
diff changeset
65 ### There are some issues with the SDK selection below here,
f99bca6ab0dc Fix for issue6957: ensure that the OSX installer
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 56145
diff changeset
66 ### The resulting binary doesn't work on all platforms that
f99bca6ab0dc Fix for issue6957: ensure that the OSX installer
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 56145
diff changeset
67 ### it should. Always default to the 10.4u SDK until that
f99bca6ab0dc Fix for issue6957: ensure that the OSX installer
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 56145
diff changeset
68 ### isue is resolved.
f99bca6ab0dc Fix for issue6957: ensure that the OSX installer
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 56145
diff changeset
69 ###
f99bca6ab0dc Fix for issue6957: ensure that the OSX installer
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 56145
diff changeset
70 ##if int(os.uname()[2].split('.')[0]) == 8:
f99bca6ab0dc Fix for issue6957: ensure that the OSX installer
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 56145
diff changeset
71 ## # Explicitly use the 10.4u (universal) SDK when
f99bca6ab0dc Fix for issue6957: ensure that the OSX installer
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 56145
diff changeset
72 ## # building on 10.4, the system headers are not
f99bca6ab0dc Fix for issue6957: ensure that the OSX installer
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 56145
diff changeset
73 ## # useable for a universal build
f99bca6ab0dc Fix for issue6957: ensure that the OSX installer
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 56145
diff changeset
74 ## SDKPATH = "/Developer/SDKs/MacOSX10.4u.sdk"
f99bca6ab0dc Fix for issue6957: ensure that the OSX installer
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 56145
diff changeset
75 ##else:
f99bca6ab0dc Fix for issue6957: ensure that the OSX installer
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 56145
diff changeset
76 ## SDKPATH = "/"
f99bca6ab0dc Fix for issue6957: ensure that the OSX installer
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 56145
diff changeset
77
f99bca6ab0dc Fix for issue6957: ensure that the OSX installer
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 56145
diff changeset
78 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
79
52459
974c2bef2800 * Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52450
diff changeset
80 universal_opts_map = { '32-bit': ('i386', 'ppc',),
974c2bef2800 * Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52450
diff changeset
81 '64-bit': ('x86_64', 'ppc64',),
56145
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
82 'intel': ('i386', 'x86_64'),
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
83 '3-way': ('ppc', 'i386', 'x86_64'),
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
84 'all': ('i386', 'ppc', 'x86_64', 'ppc64',) }
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
85 default_target_map = {
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
86 '64-bit': '10.5',
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
87 '3-way': '10.5',
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
88 'intel': '10.5',
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
89 'all': '10.5',
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
90 }
52459
974c2bef2800 * Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52450
diff changeset
91
974c2bef2800 * Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52450
diff changeset
92 UNIVERSALOPTS = tuple(universal_opts_map.keys())
974c2bef2800 * Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52450
diff changeset
93
974c2bef2800 * Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52450
diff changeset
94 UNIVERSALARCHS = '32-bit'
974c2bef2800 * Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52450
diff changeset
95
974c2bef2800 * Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52450
diff changeset
96 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
97
38645
a3668e94fc6d mv Mac/OSX/BuildScript one level up
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 38358
diff changeset
98 # Source directory (asume 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
99 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
100 os.path.dirname(
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
101 os.path.dirname(
38645
a3668e94fc6d mv Mac/OSX/BuildScript one level up
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 38358
diff changeset
102 os.path.abspath(__file__
a3668e94fc6d mv Mac/OSX/BuildScript one level up
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 38358
diff changeset
103 ))))
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
104
52459
974c2bef2800 * Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52450
diff changeset
105 # $MACOSX_DEPLOYMENT_TARGET -> minimum OS X level
974c2bef2800 * Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52450
diff changeset
106 DEPTARGET = '10.3'
974c2bef2800 * Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52450
diff changeset
107
56298
f99bca6ab0dc Fix for issue6957: ensure that the OSX installer
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 56145
diff changeset
108 target_cc_map = {
f99bca6ab0dc Fix for issue6957: ensure that the OSX installer
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 56145
diff changeset
109 '10.3': 'gcc-4.0',
f99bca6ab0dc Fix for issue6957: ensure that the OSX installer
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 56145
diff changeset
110 '10.4': 'gcc-4.0',
f99bca6ab0dc Fix for issue6957: ensure that the OSX installer
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 56145
diff changeset
111 '10.5': 'gcc-4.0',
f99bca6ab0dc Fix for issue6957: ensure that the OSX installer
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 56145
diff changeset
112 '10.6': 'gcc-4.2',
f99bca6ab0dc Fix for issue6957: ensure that the OSX installer
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 56145
diff changeset
113 }
f99bca6ab0dc Fix for issue6957: ensure that the OSX installer
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 56145
diff changeset
114
f99bca6ab0dc Fix for issue6957: ensure that the OSX installer
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 56145
diff changeset
115 CC = target_cc_map[DEPTARGET]
f99bca6ab0dc Fix for issue6957: ensure that the OSX installer
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 56145
diff changeset
116
40295
ed2ac8084e04 Whitespace changes to make the source more compliant with PEP8 (SF#1589070)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 40292
diff changeset
117 USAGE = textwrap.dedent("""\
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
118 Usage: build_python [options]
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
119
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
120 Options:
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
121 -? 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
122 -b DIR
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
123 --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
124 --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
125 --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
126 --src-dir=DIR: Location of the Python sources (default: %(SRCDIR)r)
52459
974c2bef2800 * Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52450
diff changeset
127 --dep-target=10.n OS X deployment target (default: %(DEPTARGET)r)
974c2bef2800 * Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52450
diff changeset
128 --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
129 """)% globals()
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
130
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
131
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
132 # 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
133 # batteries included python.
52459
974c2bef2800 * Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52450
diff changeset
134 # [The recipes are defined here for convenience but instantiated later after
974c2bef2800 * Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52450
diff changeset
135 # command line options have been processed.]
974c2bef2800 * Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52450
diff changeset
136 def library_recipes():
56145
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
137 result = []
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
138
56145
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
139 if DEPTARGET < '10.5':
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
140 result.extend([
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
141 dict(
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
142 name="Bzip2 1.0.5",
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
143 url="http://www.bzip.org/1.0.5/bzip2-1.0.5.tar.gz",
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
144 checksum='3c15a0c8d1d3ee1c46a1634d00617b1a',
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
145 configure=None,
56298
f99bca6ab0dc Fix for issue6957: ensure that the OSX installer
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 56145
diff changeset
146 install='make install CC=%s PREFIX=%s/usr/local/ CFLAGS="-arch %s -isysroot %s"'%(
f99bca6ab0dc Fix for issue6957: ensure that the OSX installer
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 56145
diff changeset
147 CC,
56145
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
148 shellQuote(os.path.join(WORKDIR, 'libraries')),
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
149 ' -arch '.join(ARCHLIST),
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
150 SDKPATH,
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
151 ),
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
152 ),
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
153 dict(
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
154 name="ZLib 1.2.3",
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
155 url="http://www.gzip.org/zlib/zlib-1.2.3.tar.gz",
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
156 checksum='debc62758716a169df9f62e6ab2bc634',
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
157 configure=None,
56298
f99bca6ab0dc Fix for issue6957: ensure that the OSX installer
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 56145
diff changeset
158 install='make install CC=%s prefix=%s/usr/local/ CFLAGS="-arch %s -isysroot %s"'%(
f99bca6ab0dc Fix for issue6957: ensure that the OSX installer
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 56145
diff changeset
159 CC,
56145
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
160 shellQuote(os.path.join(WORKDIR, 'libraries')),
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
161 ' -arch '.join(ARCHLIST),
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
162 SDKPATH,
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
163 ),
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
164 ),
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
165 dict(
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
166 # Note that GNU readline is GPL'd software
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
167 name="GNU Readline 5.1.4",
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
168 url="http://ftp.gnu.org/pub/gnu/readline/readline-5.1.tar.gz" ,
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
169 checksum='7ee5a692db88b30ca48927a13fd60e46',
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
170 patchlevel='0',
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
171 patches=[
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
172 # The readline maintainers don't do actual micro releases, but
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
173 # just ship a set of patches.
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
174 'http://ftp.gnu.org/pub/gnu/readline/readline-5.1-patches/readline51-001',
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
175 'http://ftp.gnu.org/pub/gnu/readline/readline-5.1-patches/readline51-002',
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
176 'http://ftp.gnu.org/pub/gnu/readline/readline-5.1-patches/readline51-003',
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
177 'http://ftp.gnu.org/pub/gnu/readline/readline-5.1-patches/readline51-004',
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
178 ]
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
179 ),
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
180 dict(
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
181 name="SQLite 3.6.11",
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
182 url="http://www.sqlite.org/sqlite-3.6.11.tar.gz",
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
183 checksum='7ebb099696ab76cc6ff65dd496d17858',
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
184 configure_pre=[
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
185 '--enable-threadsafe',
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
186 '--enable-tempstore',
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
187 '--enable-shared=no',
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
188 '--enable-static=yes',
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
189 '--disable-tcl',
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
190 ]
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
191 ),
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
192 dict(
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
193 name="NCurses 5.5",
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
194 url="http://ftp.gnu.org/pub/gnu/ncurses/ncurses-5.5.tar.gz",
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
195 checksum='e73c1ac10b4bfc46db43b2ddfd6244ef',
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
196 configure_pre=[
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
197 "--without-cxx",
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
198 "--without-ada",
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
199 "--without-progs",
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
200 "--without-curses-h",
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
201 "--enable-shared",
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
202 "--with-shared",
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
203 "--datadir=/usr/share",
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
204 "--sysconfdir=/etc",
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
205 "--sharedstatedir=/usr/com",
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
206 "--with-terminfo-dirs=/usr/share/terminfo",
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
207 "--with-default-terminfo-dir=/usr/share/terminfo",
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
208 "--libdir=/Library/Frameworks/Python.framework/Versions/%s/lib"%(getVersion(),),
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
209 "--enable-termcap",
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
210 ],
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
211 patches=[
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
212 "ncurses-5.5.patch",
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
213 ],
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
214 useLDFlags=False,
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
215 install='make && make install DESTDIR=%s && cd %s/usr/local/lib && ln -fs ../../../Library/Frameworks/Python.framework/Versions/%s/lib/lib* .'%(
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
216 shellQuote(os.path.join(WORKDIR, 'libraries')),
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
217 shellQuote(os.path.join(WORKDIR, 'libraries')),
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
218 getVersion(),
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
219 ),
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
220 ),
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
221 ])
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
222
56145
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
223 result.extend([
52459
974c2bef2800 * Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52450
diff changeset
224 dict(
974c2bef2800 * Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52450
diff changeset
225 name="Sleepycat DB 4.7.25",
974c2bef2800 * Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52450
diff changeset
226 url="http://download.oracle.com/berkeley-db/db-4.7.25.tar.gz",
974c2bef2800 * Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52450
diff changeset
227 checksum='ec2b87e833779681a0c3a814aa71359e',
974c2bef2800 * Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52450
diff changeset
228 buildDir="build_unix",
974c2bef2800 * Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52450
diff changeset
229 configure="../dist/configure",
974c2bef2800 * Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52450
diff changeset
230 configure_pre=[
974c2bef2800 * Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52450
diff changeset
231 '--includedir=/usr/local/include/db4',
974c2bef2800 * Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52450
diff changeset
232 ]
974c2bef2800 * Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52450
diff changeset
233 ),
56145
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
234 ])
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
235
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
236 return result
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
237
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
238
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
239 # Instructions for building packages inside the .mpkg.
56145
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
240 def pkg_recipes():
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
241 result = [
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
242 dict(
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
243 name="PythonFramework",
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
244 long_name="Python Framework",
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
245 source="/Library/Frameworks/Python.framework",
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
246 readme="""\
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
247 This package installs Python.framework, that is the python
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
248 interpreter and the standard library. This also includes Python
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
249 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
250 """,
56145
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
251 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
252 selected='selected',
56145
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
253 ),
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
254 dict(
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
255 name="PythonApplications",
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
256 long_name="GUI Applications",
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
257 source="/Applications/Python %(VER)s",
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
258 readme="""\
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
259 This package installs IDLE (an interactive Python IDE),
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
260 Python Launcher and Build Applet (create application bundles
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
261 from python scripts).
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
262
56145
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
263 It also installs a number of examples and demos.
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
264 """,
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
265 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
266 selected='selected',
56145
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
267 ),
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
268 dict(
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
269 name="PythonUnixTools",
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
270 long_name="UNIX command-line tools",
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
271 source="/usr/local/bin",
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
272 readme="""\
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
273 This package installs the unix tools in /usr/local/bin for
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
274 compatibility with older releases of Python. This package
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
275 is not necessary to use Python.
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
276 """,
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
277 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
278 selected='selected',
56145
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
279 ),
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
280 dict(
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
281 name="PythonDocumentation",
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
282 long_name="Python Documentation",
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
283 topdir="/Library/Frameworks/Python.framework/Versions/%(VER)s/Resources/English.lproj/Documentation",
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
284 source="/pydocs",
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
285 readme="""\
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
286 This package installs the python documentation at a location
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
287 that is useable for pydoc and IDLE. If you have installed Xcode
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
288 it will also install a link to the documentation in
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
289 /Developer/Documentation/Python
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
290 """,
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
291 postflight="scripts/postflight.documentation",
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
292 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
293 selected='selected',
56145
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
294 ),
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
295 dict(
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
296 name="PythonProfileChanges",
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
297 long_name="Shell profile updater",
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
298 readme="""\
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
299 This packages updates your shell profile to make sure that
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
300 the Python tools are found by your shell in preference of
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
301 the system provided Python tools.
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
302
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
303 If you don't install this package you'll have to add
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
304 "/Library/Frameworks/Python.framework/Versions/%(VER)s/bin"
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
305 to your PATH by hand.
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
306 """,
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
307 postflight="scripts/postflight.patch-profile",
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
308 topdir="/Library/Frameworks/Python.framework",
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
309 source="/empty-dir",
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
310 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
311 selected='selected',
56145
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
312 ),
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
313 ]
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
314
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
315 if DEPTARGET < '10.4':
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
316 result.append(
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
317 dict(
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
318 name="PythonSystemFixes",
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
319 long_name="Fix system Python",
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
320 readme="""\
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
321 This package updates the system python installation on
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
322 Mac OS X 10.3 to ensure that you can build new python extensions
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
323 using that copy of python after installing this version.
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
324 """,
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
325 postflight="../Tools/fixapplepython23.py",
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
326 topdir="/Library/Frameworks/Python.framework",
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
327 source="/empty-dir",
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
328 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
329 selected='selected',
56145
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
330 )
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
331 )
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
332 return result
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
333
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
334 def fatal(msg):
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
335 """
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
336 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
337 """
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
338 sys.stderr.write('FATAL: ')
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
339 sys.stderr.write(msg)
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
340 sys.stderr.write('\n')
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
341 sys.exit(1)
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
342
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
343 def fileContents(fn):
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
344 """
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
345 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
346 """
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
347 return open(fn, 'rb').read()
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
348
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
349 def runCommand(commandline):
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
350 """
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
351 Run a command and raise RuntimeError if it fails. Output is surpressed
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
352 unless the command fails.
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
353 """
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
354 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
355 data = fd.read()
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
356 xit = fd.close()
46197
01a7e66525c2 #2503 make singletons compared with "is" not == or !=
Benjamin Peterson <benjamin@python.org>
parents: 40295
diff changeset
357 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
358 sys.stdout.write(data)
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
359 raise RuntimeError, "command failed: %s"%(commandline,)
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
360
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
361 if VERBOSE:
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
362 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
363
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
364 def captureCommand(commandline):
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
365 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
366 data = fd.read()
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
367 xit = fd.close()
46197
01a7e66525c2 #2503 make singletons compared with "is" not == or !=
Benjamin Peterson <benjamin@python.org>
parents: 40295
diff changeset
368 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
369 sys.stdout.write(data)
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
370 raise RuntimeError, "command failed: %s"%(commandline,)
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
371
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
372 return data
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
373
60686
22737a99bf8c Add check to build-installer.py to ensure that
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 59518
diff changeset
374 def getTclTkVersion(configfile, versionline):
22737a99bf8c Add check to build-installer.py to ensure that
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 59518
diff changeset
375 """
22737a99bf8c Add check to build-installer.py to ensure that
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 59518
diff changeset
376 search Tcl or Tk configuration file for version line
22737a99bf8c Add check to build-installer.py to ensure that
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 59518
diff changeset
377 """
22737a99bf8c Add check to build-installer.py to ensure that
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 59518
diff changeset
378 try:
22737a99bf8c Add check to build-installer.py to ensure that
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 59518
diff changeset
379 f = open(configfile, "r")
22737a99bf8c Add check to build-installer.py to ensure that
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 59518
diff changeset
380 except:
22737a99bf8c Add check to build-installer.py to ensure that
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 59518
diff changeset
381 fatal("Framework configuration file not found: %s" % configfile)
22737a99bf8c Add check to build-installer.py to ensure that
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 59518
diff changeset
382
22737a99bf8c Add check to build-installer.py to ensure that
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 59518
diff changeset
383 for l in f:
22737a99bf8c Add check to build-installer.py to ensure that
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 59518
diff changeset
384 if l.startswith(versionline):
22737a99bf8c Add check to build-installer.py to ensure that
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 59518
diff changeset
385 f.close()
22737a99bf8c Add check to build-installer.py to ensure that
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 59518
diff changeset
386 return l
22737a99bf8c Add check to build-installer.py to ensure that
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 59518
diff changeset
387
22737a99bf8c Add check to build-installer.py to ensure that
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 59518
diff changeset
388 fatal("Version variable %s not found in framework configuration file: %s"
22737a99bf8c Add check to build-installer.py to ensure that
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 59518
diff changeset
389 % (versionline, configfile))
22737a99bf8c Add check to build-installer.py to ensure that
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 59518
diff changeset
390
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
391 def checkEnvironment():
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
392 """
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
393 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
394 """
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
395
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
396 if platform.system() != 'Darwin':
56145
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
397 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
398
56298
f99bca6ab0dc Fix for issue6957: ensure that the OSX installer
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 56145
diff changeset
399 if int(platform.release().split('.')[0]) < 8:
56145
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
400 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
401
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
402 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
403 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
404 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
405
60686
22737a99bf8c Add check to build-installer.py to ensure that
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 59518
diff changeset
406 # Because we only support dynamic load of only one major/minor version of
22737a99bf8c Add check to build-installer.py to ensure that
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 59518
diff changeset
407 # Tcl/Tk, ensure:
22737a99bf8c Add check to build-installer.py to ensure that
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 59518
diff changeset
408 # 1. there are no user-installed frameworks of Tcl/Tk with version
22737a99bf8c Add check to build-installer.py to ensure that
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 59518
diff changeset
409 # higher than the Apple-supplied system version
22737a99bf8c Add check to build-installer.py to ensure that
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 59518
diff changeset
410 # 2. there is a user-installed framework in /Library/Frameworks with the
22737a99bf8c Add check to build-installer.py to ensure that
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 59518
diff changeset
411 # same version as the system version. This allows users to choose
22737a99bf8c Add check to build-installer.py to ensure that
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 59518
diff changeset
412 # to install a newer patch level.
22737a99bf8c Add check to build-installer.py to ensure that
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 59518
diff changeset
413
22737a99bf8c Add check to build-installer.py to ensure that
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 59518
diff changeset
414 for framework in ['Tcl', 'Tk']:
22737a99bf8c Add check to build-installer.py to ensure that
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 59518
diff changeset
415 fw = dict(lower=framework.lower(),
22737a99bf8c Add check to build-installer.py to ensure that
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 59518
diff changeset
416 upper=framework.upper(),
22737a99bf8c Add check to build-installer.py to ensure that
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 59518
diff changeset
417 cap=framework.capitalize())
22737a99bf8c Add check to build-installer.py to ensure that
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 59518
diff changeset
418 fwpth = "Library/Frameworks/%(cap)s.framework/%(lower)sConfig.sh" % fw
22737a99bf8c Add check to build-installer.py to ensure that
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 59518
diff changeset
419 sysfw = os.path.join('/System', fwpth)
22737a99bf8c Add check to build-installer.py to ensure that
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 59518
diff changeset
420 libfw = os.path.join('/', fwpth)
22737a99bf8c Add check to build-installer.py to ensure that
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 59518
diff changeset
421 usrfw = os.path.join(os.getenv('HOME'), fwpth)
22737a99bf8c Add check to build-installer.py to ensure that
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 59518
diff changeset
422 version = "%(upper)s_VERSION" % fw
22737a99bf8c Add check to build-installer.py to ensure that
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 59518
diff changeset
423 if getTclTkVersion(libfw, version) != getTclTkVersion(sysfw, version):
22737a99bf8c Add check to build-installer.py to ensure that
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 59518
diff changeset
424 fatal("Version of %s must match %s" % (libfw, sysfw) )
22737a99bf8c Add check to build-installer.py to ensure that
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 59518
diff changeset
425 if os.path.exists(usrfw):
22737a99bf8c Add check to build-installer.py to ensure that
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 59518
diff changeset
426 fatal("Please rename %s to avoid possible dynamic load issues."
22737a99bf8c Add check to build-installer.py to ensure that
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 59518
diff changeset
427 % usrfw)
22737a99bf8c Add check to build-installer.py to ensure that
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 59518
diff changeset
428
22737a99bf8c Add check to build-installer.py to ensure that
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 59518
diff changeset
429 # Remove inherited environment variables which might influence build
22737a99bf8c Add check to build-installer.py to ensure that
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 59518
diff changeset
430 environ_var_prefixes = ['CPATH', 'C_INCLUDE_', 'DYLD_', 'LANG', 'LC_',
22737a99bf8c Add check to build-installer.py to ensure that
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 59518
diff changeset
431 'LD_', 'LIBRARY_', 'PATH', 'PYTHON']
22737a99bf8c Add check to build-installer.py to ensure that
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 59518
diff changeset
432 for ev in list(os.environ):
22737a99bf8c Add check to build-installer.py to ensure that
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 59518
diff changeset
433 for prefix in environ_var_prefixes:
22737a99bf8c Add check to build-installer.py to ensure that
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 59518
diff changeset
434 if ev.startswith(prefix) :
22737a99bf8c Add check to build-installer.py to ensure that
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 59518
diff changeset
435 print "INFO: deleting environment variable %s=%s" % (
22737a99bf8c Add check to build-installer.py to ensure that
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 59518
diff changeset
436 ev, os.environ[ev])
22737a99bf8c Add check to build-installer.py to ensure that
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 59518
diff changeset
437 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
438
60739
5927fdf5d48c Explicitly set system default for $PATH to
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 60686
diff changeset
439 os.environ['PATH'] = '/bin:/sbin:/usr/bin:/usr/sbin'
5927fdf5d48c Explicitly set system default for $PATH to
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 60686
diff changeset
440 print "Setting default PATH: %s"%(os.environ['PATH'])
5927fdf5d48c Explicitly set system default for $PATH to
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 60686
diff changeset
441
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
442
40295
ed2ac8084e04 Whitespace changes to make the source more compliant with PEP8 (SF#1589070)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 40292
diff changeset
443 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
444 """
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
445 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
446 """
52459
974c2bef2800 * Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52450
diff changeset
447 global WORKDIR, DEPSRC, SDKPATH, SRCDIR, DEPTARGET
56298
f99bca6ab0dc Fix for issue6957: ensure that the OSX installer
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 56145
diff changeset
448 global UNIVERSALOPTS, UNIVERSALARCHS, ARCHLIST, CC
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
449
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
450 if args is None:
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
451 args = sys.argv[1:]
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
452
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
453 try:
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
454 options, args = getopt.getopt(args, '?hb',
52459
974c2bef2800 * Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52450
diff changeset
455 [ 'build-dir=', 'third-party=', 'sdk-path=' , 'src-dir=',
974c2bef2800 * Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52450
diff changeset
456 'dep-target=', 'universal-archs=', 'help' ])
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
457 except getopt.error, msg:
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
458 print msg
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
459 sys.exit(1)
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
460
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
461 if args:
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
462 print "Additional arguments"
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
463 sys.exit(1)
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
464
56145
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
465 deptarget = None
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
466 for k, v in options:
52459
974c2bef2800 * Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52450
diff changeset
467 if k in ('-h', '-?', '--help'):
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
468 print USAGE
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
469 sys.exit(0)
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
470
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
471 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
472 WORKDIR=v
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
473
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
474 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
475 DEPSRC=v
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 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
478 SDKPATH=v
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
479
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
480 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
481 SRCDIR=v
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
482
52459
974c2bef2800 * Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52450
diff changeset
483 elif k in ('--dep-target', ):
974c2bef2800 * Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52450
diff changeset
484 DEPTARGET=v
56145
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
485 deptarget=v
52459
974c2bef2800 * Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52450
diff changeset
486
974c2bef2800 * Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52450
diff changeset
487 elif k in ('--universal-archs', ):
974c2bef2800 * Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52450
diff changeset
488 if v in UNIVERSALOPTS:
974c2bef2800 * Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52450
diff changeset
489 UNIVERSALARCHS = v
974c2bef2800 * Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52450
diff changeset
490 ARCHLIST = universal_opts_map[UNIVERSALARCHS]
56145
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
491 if deptarget is None:
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
492 # Select alternate default deployment
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
493 # target
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
494 DEPTARGET = default_target_map.get(v, '10.3')
52459
974c2bef2800 * Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52450
diff changeset
495 else:
974c2bef2800 * Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52450
diff changeset
496 raise NotImplementedError, v
974c2bef2800 * Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52450
diff changeset
497
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
498 else:
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
499 raise NotImplementedError, k
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
500
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
501 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
502 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
503 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
504 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
505
56298
f99bca6ab0dc Fix for issue6957: ensure that the OSX installer
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 56145
diff changeset
506 CC=target_cc_map[DEPTARGET]
f99bca6ab0dc Fix for issue6957: ensure that the OSX installer
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 56145
diff changeset
507
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
508 print "Settings:"
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
509 print " * Source directory:", SRCDIR
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
510 print " * Build directory: ", WORKDIR
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
511 print " * SDK location: ", SDKPATH
52459
974c2bef2800 * Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52450
diff changeset
512 print " * Third-party source:", DEPSRC
974c2bef2800 * Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52450
diff changeset
513 print " * Deployment target:", DEPTARGET
974c2bef2800 * Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52450
diff changeset
514 print " * Universal architectures:", ARCHLIST
56298
f99bca6ab0dc Fix for issue6957: ensure that the OSX installer
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 56145
diff changeset
515 print " * C compiler:", CC
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
516 print ""
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
517
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
518
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
519
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
520
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
521 def extractArchive(builddir, archiveName):
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
522 """
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
523 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
524 extracted archive.
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
525
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
526 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
527 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
528 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
529 """
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
530 curdir = os.getcwd()
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
531 try:
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
532 os.chdir(builddir)
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
533 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
534 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
535 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
536 shutil.rmtree(retval)
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
537 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
538
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
539 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
540 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
541 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
542 shutil.rmtree(retval)
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
543 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
544
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
545 elif archiveName.endswith('.tar'):
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
546 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
547 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
548 shutil.rmtree(retval)
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
549 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
550
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
551 elif archiveName.endswith('.zip'):
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
552 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
553 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
554 shutil.rmtree(retval)
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
555 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
556
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
557 data = fp.read()
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
558 xit = fp.close()
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
559 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
560 sys.stdout.write(data)
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
561 raise RuntimeError, "Cannot extract %s"%(archiveName,)
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
562
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
563 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
564
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
565 finally:
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
566 os.chdir(curdir)
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 KNOWNSIZES = {
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
569 "http://ftp.gnu.org/pub/gnu/readline/readline-5.1.tar.gz": 7952742,
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
570 "http://downloads.sleepycat.com/db-4.4.20.tar.gz": 2030276,
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
571 }
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
572
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
573 def downloadURL(url, fname):
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
574 """
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
575 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
576 """
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
577 try:
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
578 size = os.path.getsize(fname)
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
579 except OSError:
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
580 pass
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
581 else:
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
582 if KNOWNSIZES.get(url) == size:
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
583 print "Using existing file for", url
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
584 return
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
585 fpIn = urllib2.urlopen(url)
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
586 fpOut = open(fname, 'wb')
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
587 block = fpIn.read(10240)
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
588 try:
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
589 while block:
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
590 fpOut.write(block)
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
591 block = fpIn.read(10240)
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
592 fpIn.close()
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
593 fpOut.close()
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
594 except:
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
595 try:
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
596 os.unlink(fname)
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
597 except:
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
598 pass
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
599
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
600 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
601 """
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
602 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
603 '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
604 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
605 """
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
606 curdir = os.getcwd()
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 name = recipe['name']
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
609 url = recipe['url']
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
610 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
611 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
612 shellQuote(basedir)))
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
613
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
614 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
615 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
616
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
617 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
618 os.mkdir(DEPSRC)
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
619
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
620
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
621 if os.path.exists(sourceArchive):
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
622 print "Using local copy of %s"%(name,)
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
623
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
624 else:
52459
974c2bef2800 * Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52450
diff changeset
625 print "Did not find local copy of %s"%(name,)
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
626 print "Downloading %s"%(name,)
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
627 downloadURL(url, sourceArchive)
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
628 print "Archive for %s stored as %s"%(name, sourceArchive)
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
629
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
630 print "Extracting archive for %s"%(name,)
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
631 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
632 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
633 os.mkdir(buildDir)
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
634
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
635 workDir = extractArchive(buildDir, sourceArchive)
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
636 os.chdir(workDir)
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
637 if 'buildDir' in recipe:
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
638 os.chdir(recipe['buildDir'])
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
639
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
640
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
641 for fn in recipe.get('patches', ()):
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
642 if fn.startswith('http://'):
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
643 # Download the patch before applying it.
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
644 path = os.path.join(DEPSRC, os.path.basename(fn))
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
645 downloadURL(fn, path)
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
646 fn = path
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
647
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
648 fn = os.path.join(curdir, fn)
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
649 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
650 shellQuote(fn),))
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
651
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
652 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
653 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
654 "--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
655 "--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
656 "--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
657 #"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
658 ]
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
659
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
660 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
661 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
662 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
663 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
664 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
665 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
666 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
667
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
668 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
669 configure_args.extend([
7c8990cccf9b Use staticly build copies of zlib and bzip2 to build the OSX installer, that
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 38752
diff changeset
670 "CFLAGS=-arch %s -isysroot %s -I%s/usr/local/include"%(
7c8990cccf9b Use staticly build copies of zlib and bzip2 to build the OSX installer, that
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 38752
diff changeset
671 ' -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
672 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
673 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
674 "LDFLAGS=-syslibroot,%s -L%s/usr/local/lib -arch %s"%(
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
675 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
676 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
677 ' -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
678 ])
7c8990cccf9b Use staticly build copies of zlib and bzip2 to build the OSX installer, that
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 38752
diff changeset
679 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
680 configure_args.extend([
7c8990cccf9b Use staticly build copies of zlib and bzip2 to build the OSX installer, that
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 38752
diff changeset
681 "CFLAGS=-arch %s -isysroot %s -I%s/usr/local/include"%(
7c8990cccf9b Use staticly build copies of zlib and bzip2 to build the OSX installer, that
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 38752
diff changeset
682 ' -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
683 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
684 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
685 ])
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
686
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
687 if 'configure_post' 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
688 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
689
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
690 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
691 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
692
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
693 print "Running configure for %s"%(name,)
7c8990cccf9b Use staticly build copies of zlib and bzip2 to build the OSX installer, that
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 38752
diff changeset
694 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
695
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
696 print "Running install for %s"%(name,)
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
697 runCommand('{ ' + install + ' ;} 2>&1')
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
698
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
699 print "Done %s"%(name,)
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
700 print ""
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
701
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
702 os.chdir(curdir)
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
703
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
704 def buildLibraries():
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
705 """
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
706 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
707 """
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
708 print ""
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
709 print "Building required libraries"
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
710 print ""
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
711 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
712 os.mkdir(universal)
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
713 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
714 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
715
52459
974c2bef2800 * Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52450
diff changeset
716 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
717 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
718
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
719
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 def buildPythonDocs():
52450
8df4e0c06e94 * Updates installed dependencies to latest releaases (bzip, zlib, ...)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52004
diff changeset
722 # 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
723 # inside the framwork. pydoc and IDLE will pick it up there.
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
724 print "Install python documentation"
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
725 rootDir = os.path.join(WORKDIR, '_root')
52450
8df4e0c06e94 * Updates installed dependencies to latest releaases (bzip, zlib, ...)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52004
diff changeset
726 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
727 docdir = os.path.join(rootDir, 'pydocs')
52450
8df4e0c06e94 * Updates installed dependencies to latest releaases (bzip, zlib, ...)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52004
diff changeset
728 curDir = os.getcwd()
8df4e0c06e94 * Updates installed dependencies to latest releaases (bzip, zlib, ...)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52004
diff changeset
729 os.chdir(buildDir)
8df4e0c06e94 * Updates installed dependencies to latest releaases (bzip, zlib, ...)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52004
diff changeset
730 runCommand('make update')
60851
3d737f2ab901 Issue #8475: Pass absolute interpreter path to
Martin v. Löwis <martin@v.loewis.de>
parents: 60739
diff changeset
731 runCommand("make html PYTHON='%s'" % os.path.abspath(sys.executable))
52450
8df4e0c06e94 * Updates installed dependencies to latest releaases (bzip, zlib, ...)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52004
diff changeset
732 os.chdir(curDir)
8df4e0c06e94 * Updates installed dependencies to latest releaases (bzip, zlib, ...)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52004
diff changeset
733 if not os.path.exists(docdir):
8df4e0c06e94 * Updates installed dependencies to latest releaases (bzip, zlib, ...)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52004
diff changeset
734 os.mkdir(docdir)
56298
f99bca6ab0dc Fix for issue6957: ensure that the OSX installer
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 56145
diff changeset
735 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
736
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
737
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
738 def buildPython():
52459
974c2bef2800 * Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52450
diff changeset
739 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
740
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
741 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
742 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
743
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
744 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
745 shutil.rmtree(buildDir)
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
746 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
747 shutil.rmtree(rootDir)
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
748 os.mkdir(buildDir)
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
749 os.mkdir(rootDir)
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
750 os.mkdir(os.path.join(rootDir, 'empty-dir'))
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
751 curdir = os.getcwd()
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
752 os.chdir(buildDir)
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
753
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
754 # 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
755 # 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
756 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
757
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
758 # 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
759 # several paths.
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
760 version = getVersion()
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
761
52467
99829c908058 Fix for issue 13095
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52459
diff changeset
762 # Since the extra libs are not in their installed framework location
99829c908058 Fix for issue 13095
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52459
diff changeset
763 # during the build, augment the library path so that the interpreter
99829c908058 Fix for issue 13095
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52459
diff changeset
764 # will find them during its extension import sanity checks.
99829c908058 Fix for issue 13095
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52459
diff changeset
765 os.environ['DYLD_LIBRARY_PATH'] = os.path.join(WORKDIR,
99829c908058 Fix for issue 13095
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52459
diff changeset
766 'libraries', 'usr', 'local', 'lib')
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
767 print "Running configure..."
52459
974c2bef2800 * Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52450
diff changeset
768 runCommand("%s -C --enable-framework --enable-universalsdk=%s "
974c2bef2800 * Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52450
diff changeset
769 "--with-universal-archs=%s "
974c2bef2800 * Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52450
diff changeset
770 "LDFLAGS='-g -L%s/libraries/usr/local/lib' "
974c2bef2800 * Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52450
diff changeset
771 "OPT='-g -O3 -I%s/libraries/usr/local/include' 2>&1"%(
974c2bef2800 * Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52450
diff changeset
772 shellQuote(os.path.join(SRCDIR, 'configure')), shellQuote(SDKPATH),
974c2bef2800 * Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52450
diff changeset
773 UNIVERSALARCHS,
974c2bef2800 * Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52450
diff changeset
774 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
775 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
776
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
777 print "Running make"
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
778 runCommand("make")
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
779
40292
cbe133d72e39 Fix a number of typos in strings and comments (sf#1589070)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 40144
diff changeset
780 print "Running make frameworkinstall"
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
781 runCommand("make frameworkinstall DESTDIR=%s"%(
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
782 shellQuote(rootDir)))
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
783
40292
cbe133d72e39 Fix a number of typos in strings and comments (sf#1589070)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 40144
diff changeset
784 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
785 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
786 shellQuote(rootDir)))
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
787
52467
99829c908058 Fix for issue 13095
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52459
diff changeset
788 del os.environ['DYLD_LIBRARY_PATH']
40292
cbe133d72e39 Fix a number of typos in strings and comments (sf#1589070)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 40144
diff changeset
789 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
790 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
791 runCommand("mv %s/* %s"%(
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
792 shellQuote(os.path.join(
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
793 WORKDIR, 'libraries', 'Library', 'Frameworks',
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
794 'Python.framework', 'Versions', getVersion(),
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
795 'lib')),
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
796 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
797 'Python.framework', 'Versions', getVersion(),
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
798 'lib'))))
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
799
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
800 print "Fix file modes"
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
801 frmDir = os.path.join(rootDir, 'Library', 'Frameworks', 'Python.framework')
40082
66b83d1ba2fc MacOSX: fix permission problem in the generated installer
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 39852
diff changeset
802 gid = grp.getgrnam('admin').gr_gid
66b83d1ba2fc MacOSX: fix permission problem in the generated installer
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 39852
diff changeset
803
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
804 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
805 for dn in dirnames:
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
806 os.chmod(os.path.join(dirpath, dn), 0775)
40082
66b83d1ba2fc MacOSX: fix permission problem in the generated installer
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 39852
diff changeset
807 os.chown(os.path.join(dirpath, dn), -1, gid)
40144
6609f020649f Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents: 40082
diff changeset
808
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
809
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
810 for fn in filenames:
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
811 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
812 continue
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
813
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
814 # "chmod g+w $fn"
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
815 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
816 st = os.stat(p)
40082
66b83d1ba2fc MacOSX: fix permission problem in the generated installer
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 39852
diff changeset
817 os.chmod(p, stat.S_IMODE(st.st_mode) | stat.S_IWGRP)
66b83d1ba2fc MacOSX: fix permission problem in the generated installer
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 39852
diff changeset
818 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
819
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
820 # 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
821 # phase. Remove those because those directories won't be there on
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
822 # the end-users system.
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
823 path =os.path.join(rootDir, 'Library', 'Frameworks', 'Python.framework',
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
824 'Versions', version, 'lib', 'python%s'%(version,),
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
825 'config', 'Makefile')
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
826 fp = open(path, 'r')
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
827 data = fp.read()
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
828 fp.close()
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 data = data.replace('-L%s/libraries/usr/local/lib'%(WORKDIR,), '')
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
831 data = data.replace('-I%s/libraries/usr/local/include'%(WORKDIR,), '')
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
832 fp = open(path, 'w')
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
833 fp.write(data)
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
834 fp.close()
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
835
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
836 # 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
837 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
838 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
839 '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
840 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
841 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
842 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
843 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
844 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
845 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
846 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
847
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
848 os.chdir(curdir)
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
849
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
850
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
851
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
852 def patchFile(inPath, outPath):
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
853 data = fileContents(inPath)
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
854 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
855 data = data.replace('$VERSION', getVersion())
52459
974c2bef2800 * Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52450
diff changeset
856 data = data.replace('$MACOSX_DEPLOYMENT_TARGET', ''.join((DEPTARGET, ' or later')))
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
857 data = data.replace('$ARCHITECTURES', "i386, ppc")
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
858 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
859
5a994d26a3cf - Change fixapplepython23.py to ensure that it will run with /usr/bin/python
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 38650
diff changeset
860 # 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
861 data = data.replace('$PYTHONFRAMEWORKINSTALLDIR', '/Library/Frameworks/Python.framework')
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
862 fp = open(outPath, 'wb')
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
863 fp.write(data)
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
864 fp.close()
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
865
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
866 def patchScript(inPath, outPath):
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
867 data = fileContents(inPath)
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
868 data = data.replace('@PYVER@', getVersion())
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
869 fp = open(outPath, 'wb')
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
870 fp.write(data)
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
871 fp.close()
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
872 os.chmod(outPath, 0755)
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
873
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
874
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
875
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
876 def packageFromRecipe(targetDir, recipe):
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
877 curdir = os.getcwd()
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
878 try:
40292
cbe133d72e39 Fix a number of typos in strings and comments (sf#1589070)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 40144
diff changeset
879 # The major version (such as 2.5) is included in the package name
cbe133d72e39 Fix a number of typos in strings and comments (sf#1589070)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 40144
diff changeset
880 # 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
881 # common.
5a994d26a3cf - Change fixapplepython23.py to ensure that it will run with /usr/bin/python
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 38650
diff changeset
882 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
883 srcdir = recipe.get('source')
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
884 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
885 postflight = recipe.get('postflight')
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
886 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
887 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
888
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
889 print "- building package %s"%(pkgname,)
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
890
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
891 # Substitute some variables
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
892 textvars = dict(
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
893 VER=getVersion(),
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
894 FULLVER=getFullVersion(),
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
895 )
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
896 readme = readme % textvars
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
897
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
898 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
899 pkgroot = pkgroot % textvars
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
900 else:
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
901 pkgroot = '/'
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
902
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
903 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
904 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
905 srcdir = srcdir % textvars
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
906
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
907 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
908 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
909
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
910 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
911 os.makedirs(packageContents)
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
912
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
913 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
914 os.chdir(srcdir)
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
915 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
916 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
917 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
918
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
919 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
920 fp = open(fn, 'w')
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
921 fp.write('pmkrpkg1')
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
922 fp.close()
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
923
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
924 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
925 os.mkdir(rsrcDir)
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
926 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
927 fp.write(readme)
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
928 fp.close()
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
929
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
930 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
931 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
932
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
933 vers = getFullVersion()
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
934 major, minor = map(int, getVersion().split('.', 2))
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
935 pl = Plist(
52459
974c2bef2800 * Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52450
diff changeset
936 CFBundleGetInfoString="Python.%s %s"%(pkgname, vers,),
974c2bef2800 * Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52450
diff changeset
937 CFBundleIdentifier='org.python.Python.%s'%(pkgname,),
974c2bef2800 * Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52450
diff changeset
938 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
939 CFBundleShortVersionString=vers,
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
940 IFMajorVersion=major,
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
941 IFMinorVersion=minor,
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
942 IFPkgFormatVersion=0.10000000149011612,
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
943 IFPkgFlagAllowBackRev=False,
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
944 IFPkgFlagAuthorizationAction="RootAuthorization",
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
945 IFPkgFlagDefaultLocation=pkgroot,
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
946 IFPkgFlagFollowLinks=True,
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
947 IFPkgFlagInstallFat=True,
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
948 IFPkgFlagIsRequired=isRequired,
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
949 IFPkgFlagOverwritePermissions=False,
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
950 IFPkgFlagRelocatable=False,
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
951 IFPkgFlagRestartAction="NoRestart",
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
952 IFPkgFlagRootVolumeOnly=True,
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
953 IFPkgFlagUpdateInstalledLangauges=False,
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
954 )
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
955 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
956
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
957 pl = Plist(
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
958 IFPkgDescriptionDescription=readme,
52459
974c2bef2800 * Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52450
diff changeset
959 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
960 IFPkgDescriptionVersion=vers,
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
961 )
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
962 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
963
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
964 finally:
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
965 os.chdir(curdir)
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
966
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
967
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
968 def makeMpkgPlist(path):
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
969
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
970 vers = getFullVersion()
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
971 major, minor = map(int, getVersion().split('.', 2))
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
972
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
973 pl = Plist(
52459
974c2bef2800 * Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52450
diff changeset
974 CFBundleGetInfoString="Python %s"%(vers,),
974c2bef2800 * Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52450
diff changeset
975 CFBundleIdentifier='org.python.Python',
974c2bef2800 * Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52450
diff changeset
976 CFBundleName='Python',
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
977 CFBundleShortVersionString=vers,
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
978 IFMajorVersion=major,
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
979 IFMinorVersion=minor,
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
980 IFPkgFlagComponentDirectory="Contents/Packages",
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
981 IFPkgFlagPackageList=[
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
982 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
983 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
984 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
985 )
56145
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
986 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
987 ],
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
988 IFPkgFormatVersion=0.10000000149011612,
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
989 IFPkgFlagBackgroundScaling="proportional",
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
990 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
991 IFPkgFlagAuthorizationAction="RootAuthorization",
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
992 )
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
993
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
994 writePlist(pl, path)
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
995
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
996
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
997 def buildInstaller():
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
998
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
999 # Zap all compiled files
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1000 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
1001 for fn in filenames:
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1002 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
1003 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
1004
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1005 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
1006 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
1007 shutil.rmtree(outdir)
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1008 os.mkdir(outdir)
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1009
52459
974c2bef2800 * Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52450
diff changeset
1010 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
1011 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
1012 os.makedirs(pkgcontents)
56145
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
1013 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
1014 packageFromRecipe(pkgcontents, recipe)
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1015
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1016 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
1017
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1018 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
1019 fp = open(fn, 'w')
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1020 fp.write('pmkrpkg1')
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1021 fp.close()
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 os.mkdir(rsrcDir)
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1024
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1025 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
1026 pl = Plist(
52459
974c2bef2800 * Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52450
diff changeset
1027 IFPkgDescriptionTitle="Python",
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1028 IFPkgDescriptionVersion=getVersion(),
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1029 )
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1030
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1031 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
1032 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
1033 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
1034 if fn.endswith('.jpg'):
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1035 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
1036 else:
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1037 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
1038
38752
5a994d26a3cf - Change fixapplepython23.py to ensure that it will run with /usr/bin/python
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 38650
diff changeset
1039 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
1040
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1041
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1042 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
1043 if clear:
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1044 del _saved[:]
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1045 if not _saved:
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1046 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
1047 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
1048 _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
1049 return _saved[0]
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1050
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1051
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1052 def buildDMG():
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1053 """
40292
cbe133d72e39 Fix a number of typos in strings and comments (sf#1589070)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 40144
diff changeset
1054 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
1055 """
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1056 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
1057 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
1058 shutil.rmtree(outdir)
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1059
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1060 imagepath = os.path.join(outdir,
56145
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
1061 '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
1062 if INCLUDE_TIMESTAMP:
56145
9234305d3740 * Make it easier to build custom installers (such as a 3-way universal build)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52512
diff changeset
1063 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
1064 imagepath = imagepath + '.dmg'
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1065
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1066 os.mkdir(outdir)
52459
974c2bef2800 * Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52450
diff changeset
1067 volname='Python %s'%(getFullVersion())
974c2bef2800 * Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52450
diff changeset
1068 runCommand("hdiutil create -format UDRW -volname %s -srcfolder %s %s"%(
974c2bef2800 * Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52450
diff changeset
1069 shellQuote(volname),
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1070 shellQuote(os.path.join(WORKDIR, 'installer')),
52459
974c2bef2800 * Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52450
diff changeset
1071 shellQuote(imagepath + ".tmp.dmg" )))
974c2bef2800 * Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52450
diff changeset
1072
974c2bef2800 * Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52450
diff changeset
1073
974c2bef2800 * Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52450
diff changeset
1074 if not os.path.exists(os.path.join(WORKDIR, "mnt")):
974c2bef2800 * Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52450
diff changeset
1075 os.mkdir(os.path.join(WORKDIR, "mnt"))
974c2bef2800 * Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52450
diff changeset
1076 runCommand("hdiutil attach %s -mountroot %s"%(
974c2bef2800 * Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52450
diff changeset
1077 shellQuote(imagepath + ".tmp.dmg"), shellQuote(os.path.join(WORKDIR, "mnt"))))
974c2bef2800 * Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52450
diff changeset
1078
974c2bef2800 * Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52450
diff changeset
1079 # Custom icon for the DMG, shown when the DMG is mounted.
974c2bef2800 * Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52450
diff changeset
1080 shutil.copy("../Icons/Disk Image.icns",
974c2bef2800 * Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52450
diff changeset
1081 os.path.join(WORKDIR, "mnt", volname, ".VolumeIcon.icns"))
974c2bef2800 * Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52450
diff changeset
1082 runCommand("/Developer/Tools/SetFile -a C %s/"%(
974c2bef2800 * Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52450
diff changeset
1083 shellQuote(os.path.join(WORKDIR, "mnt", volname)),))
974c2bef2800 * Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52450
diff changeset
1084
974c2bef2800 * Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52450
diff changeset
1085 runCommand("hdiutil detach %s"%(shellQuote(os.path.join(WORKDIR, "mnt", volname))))
974c2bef2800 * Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52450
diff changeset
1086
974c2bef2800 * Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52450
diff changeset
1087 setIcon(imagepath + ".tmp.dmg", "../Icons/Disk Image.icns")
974c2bef2800 * Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52450
diff changeset
1088 runCommand("hdiutil convert %s -format UDZO -o %s"%(
974c2bef2800 * Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52450
diff changeset
1089 shellQuote(imagepath + ".tmp.dmg"), shellQuote(imagepath)))
974c2bef2800 * Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52450
diff changeset
1090 setIcon(imagepath, "../Icons/Disk Image.icns")
974c2bef2800 * Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52450
diff changeset
1091
974c2bef2800 * Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52450
diff changeset
1092 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
1093
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1094 return imagepath
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1095
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1096
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1097 def setIcon(filePath, icnsPath):
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1098 """
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1099 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
1100 """
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1101
61119
1b894594490f Fix for issue 8476
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 60851
diff changeset
1102 dirPath = os.path.normpath(os.path.dirname(__file__))
1b894594490f Fix for issue 8476
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 60851
diff changeset
1103 toolPath = os.path.join(dirPath, "seticon.app/Contents/MacOS/seticon")
52450
8df4e0c06e94 * Updates installed dependencies to latest releaases (bzip, zlib, ...)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52004
diff changeset
1104 if not os.path.exists(toolPath) or os.stat(toolPath).st_mtime < os.stat(dirPath + '/seticon.m').st_mtime:
8df4e0c06e94 * Updates installed dependencies to latest releaases (bzip, zlib, ...)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52004
diff changeset
1105 # NOTE: The tool is created inside an .app bundle, otherwise it won't work due
8df4e0c06e94 * Updates installed dependencies to latest releaases (bzip, zlib, ...)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52004
diff changeset
1106 # to connections to the window server.
61119
1b894594490f Fix for issue 8476
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 60851
diff changeset
1107 appPath = os.path.join(dirPath, "seticon.app/Contents/MacOS")
1b894594490f Fix for issue 8476
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 60851
diff changeset
1108 if not os.path.exists(appPath):
1b894594490f Fix for issue 8476
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 60851
diff changeset
1109 os.makedirs(appPath)
52450
8df4e0c06e94 * Updates installed dependencies to latest releaases (bzip, zlib, ...)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52004
diff changeset
1110 runCommand("cc -o %s %s/seticon.m -framework Cocoa"%(
8df4e0c06e94 * Updates installed dependencies to latest releaases (bzip, zlib, ...)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52004
diff changeset
1111 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
1112
52450
8df4e0c06e94 * Updates installed dependencies to latest releaases (bzip, zlib, ...)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52004
diff changeset
1113 runCommand("%s %s %s"%(shellQuote(os.path.abspath(toolPath)), shellQuote(icnsPath),
8df4e0c06e94 * Updates installed dependencies to latest releaases (bzip, zlib, ...)
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52004
diff changeset
1114 shellQuote(filePath)))
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1115
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1116 def main():
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1117 # 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
1118 parseOptions()
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1119 checkEnvironment()
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1120
52459
974c2bef2800 * Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52450
diff changeset
1121 os.environ['MACOSX_DEPLOYMENT_TARGET'] = DEPTARGET
56298
f99bca6ab0dc Fix for issue6957: ensure that the OSX installer
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 56145
diff changeset
1122 os.environ['CC'] = CC
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1123
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1124 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
1125 shutil.rmtree(WORKDIR)
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1126 os.mkdir(WORKDIR)
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1127
60686
22737a99bf8c Add check to build-installer.py to ensure that
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 59518
diff changeset
1128 os.environ['LC_ALL'] = 'C'
22737a99bf8c Add check to build-installer.py to ensure that
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 59518
diff changeset
1129
38273
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1130 # 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
1131 buildLibraries()
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 # Now build python itself
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1134 buildPython()
52512
962eba62299f Minor update to OSX build-installer script, needed
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52467
diff changeset
1135
962eba62299f Minor update to OSX build-installer script, needed
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52467
diff changeset
1136 # And then build the documentation
962eba62299f Minor update to OSX build-installer script, needed
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52467
diff changeset
1137 # Remove the Deployment Target from the shell
962eba62299f Minor update to OSX build-installer script, needed
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52467
diff changeset
1138 # environment, it's no longer needed and
962eba62299f Minor update to OSX build-installer script, needed
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52467
diff changeset
1139 # an unexpected build target can cause problems
962eba62299f Minor update to OSX build-installer script, needed
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52467
diff changeset
1140 # when Sphinx and its dependencies need to
962eba62299f Minor update to OSX build-installer script, needed
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52467
diff changeset
1141 # be (re-)installed.
962eba62299f Minor update to OSX build-installer script, needed
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52467
diff changeset
1142 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
1143 buildPythonDocs()
52512
962eba62299f Minor update to OSX build-installer script, needed
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52467
diff changeset
1144
962eba62299f Minor update to OSX build-installer script, needed
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52467
diff changeset
1145
962eba62299f Minor update to OSX build-installer script, needed
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 52467
diff changeset
1146 # 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
1147 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
1148 "Python %s"%(getVersion(),), "Update Shell Profile.command")
52004
240231ac79cf Fix issue 5224.
Ronald Oussoren <ronaldoussoren@mac.com>
parents: 50095
diff changeset
1149 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
1150
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
1151 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
1152 getVersion(),))
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1153 os.chmod(folder, 0755)
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1154 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
1155
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1156 # Create the installer
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1157 buildInstaller()
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 # 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
1160 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
1161
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1162 # 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
1163 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
1164
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1165 fp = open(os.path.join(WORKDIR, 'installer', 'Build.txt'), 'w')
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1166 print >> fp, "# BUILD INFO"
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1167 print >> fp, "# Date:", time.ctime()
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1168 print >> fp, "# By:", pwd.getpwuid(os.getuid()).pw_gecos
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1169 fp.close()
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1170
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1171 # 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
1172 buildDMG()
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1173
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1174 if __name__ == "__main__":
9ae69bcab9f7 Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents: 38272
diff changeset
1175 main()