Mercurial > cpython-lru_cache-weakref
annotate Mac/BuildScript/build-installer.py @ 54294:dba767bc3155 legacy-trunk
remove mention of old ctypes version
| author | Benjamin Peterson <benjamin@python.org> |
|---|---|
| date | Sat, 23 May 2009 20:59:09 +0000 |
| parents | 962eba62299f |
| children | 9234305d3740 |
| rev | line source |
|---|---|
|
52450
8df4e0c06e94
* Updates installed dependencies to latest releaases (bzip, zlib, ...)
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52004
diff
changeset
|
1 #!/usr/bin/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 |
|
40295
ed2ac8084e04
Whitespace changes to make the source more compliant with PEP8 (SF#1589070)
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
40292
diff
changeset
|
64 SDKPATH = "/Developer/SDKs/MacOSX10.4u.sdk" |
|
ed2ac8084e04
Whitespace changes to make the source more compliant with PEP8 (SF#1589070)
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
40292
diff
changeset
|
65 #SDKPATH = "/" |
|
38273
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
66 |
|
52459
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
67 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
|
68 '64-bit': ('x86_64', 'ppc64',), |
|
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
69 'all': ('i386', 'ppc', 'x86_64', 'ppc64',) } |
|
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
70 |
|
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
71 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
|
72 |
|
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
73 UNIVERSALARCHS = '32-bit' |
|
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
74 |
|
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
75 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
|
76 |
|
38645
a3668e94fc6d
mv Mac/OSX/BuildScript one level up
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
38358
diff
changeset
|
77 # 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
|
78 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
|
79 os.path.dirname( |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
80 os.path.dirname( |
|
38645
a3668e94fc6d
mv Mac/OSX/BuildScript one level up
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
38358
diff
changeset
|
81 os.path.abspath(__file__ |
|
a3668e94fc6d
mv Mac/OSX/BuildScript one level up
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
38358
diff
changeset
|
82 )))) |
|
38273
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
83 |
|
52459
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
84 # $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
|
85 DEPTARGET = '10.3' |
|
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
86 |
|
40295
ed2ac8084e04
Whitespace changes to make the source more compliant with PEP8 (SF#1589070)
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
40292
diff
changeset
|
87 USAGE = textwrap.dedent("""\ |
|
38273
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
88 Usage: build_python [options] |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
89 |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
90 Options: |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
91 -? 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
|
92 -b DIR |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
93 --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
|
94 --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
|
95 --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
|
96 --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
|
97 --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
|
98 --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
|
99 """)% globals() |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
100 |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
101 |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
102 # 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
|
103 # batteries included python. |
|
52459
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
104 # [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
|
105 # 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
|
106 def library_recipes(): |
|
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
107 return [ |
|
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
108 dict( |
|
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
109 name="Bzip2 1.0.4", |
|
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
110 url="http://www.bzip.org/1.0.4/bzip2-1.0.4.tar.gz", |
|
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
111 checksum='fc310b254f6ba5fbb5da018f04533688', |
|
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
112 configure=None, |
|
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
113 install='make install PREFIX=%s/usr/local/ CFLAGS="-arch %s -isysroot %s"'%( |
|
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
114 shellQuote(os.path.join(WORKDIR, 'libraries')), |
|
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
115 ' -arch '.join(ARCHLIST), |
|
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
116 SDKPATH, |
|
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
117 ), |
|
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
118 ), |
|
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
119 dict( |
|
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
120 name="ZLib 1.2.3", |
|
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
121 url="http://www.gzip.org/zlib/zlib-1.2.3.tar.gz", |
|
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
122 checksum='debc62758716a169df9f62e6ab2bc634', |
|
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
123 configure=None, |
|
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
124 install='make install prefix=%s/usr/local/ CFLAGS="-arch %s -isysroot %s"'%( |
|
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
125 shellQuote(os.path.join(WORKDIR, 'libraries')), |
|
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
126 ' -arch '.join(ARCHLIST), |
|
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
127 SDKPATH, |
|
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
128 ), |
|
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
129 ), |
|
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
130 dict( |
|
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
131 # Note that GNU readline is GPL'd software |
|
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
132 name="GNU Readline 5.1.4", |
|
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
133 url="http://ftp.gnu.org/pub/gnu/readline/readline-5.1.tar.gz" , |
|
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
134 checksum='7ee5a692db88b30ca48927a13fd60e46', |
|
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
135 patchlevel='0', |
|
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
136 patches=[ |
|
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
137 # The readline maintainers don't do actual micro releases, but |
|
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
138 # just ship a set of patches. |
|
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
139 'http://ftp.gnu.org/pub/gnu/readline/readline-5.1-patches/readline51-001', |
|
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
140 'http://ftp.gnu.org/pub/gnu/readline/readline-5.1-patches/readline51-002', |
|
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
141 'http://ftp.gnu.org/pub/gnu/readline/readline-5.1-patches/readline51-003', |
|
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
142 'http://ftp.gnu.org/pub/gnu/readline/readline-5.1-patches/readline51-004', |
|
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
143 ] |
|
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
144 ), |
|
38273
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
145 |
|
52459
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
146 dict( |
|
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
147 name="SQLite 3.6.11", |
|
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
148 url="http://www.sqlite.org/sqlite-3.6.11.tar.gz", |
|
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
149 checksum='7ebb099696ab76cc6ff65dd496d17858', |
|
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
150 configure_pre=[ |
|
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
151 '--enable-threadsafe', |
|
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
152 '--enable-tempstore', |
|
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
153 '--enable-shared=no', |
|
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
154 '--enable-static=yes', |
|
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
155 '--disable-tcl', |
|
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
156 ] |
|
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
157 ), |
|
38273
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
158 |
|
52459
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
159 dict( |
|
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
160 name="NCurses 5.5", |
|
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
161 url="http://ftp.gnu.org/pub/gnu/ncurses/ncurses-5.5.tar.gz", |
|
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
162 checksum='e73c1ac10b4bfc46db43b2ddfd6244ef', |
|
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
163 configure_pre=[ |
|
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
164 "--without-cxx", |
|
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
165 "--without-ada", |
|
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
166 "--without-progs", |
|
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
167 "--without-curses-h", |
|
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
168 "--enable-shared", |
|
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
169 "--with-shared", |
|
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
170 "--datadir=/usr/share", |
|
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
171 "--sysconfdir=/etc", |
|
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
172 "--sharedstatedir=/usr/com", |
|
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
173 "--with-terminfo-dirs=/usr/share/terminfo", |
|
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
174 "--with-default-terminfo-dir=/usr/share/terminfo", |
|
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
175 "--libdir=/Library/Frameworks/Python.framework/Versions/%s/lib"%(getVersion(),), |
|
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
176 "--enable-termcap", |
|
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
177 ], |
|
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
178 patches=[ |
|
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
179 "ncurses-5.5.patch", |
|
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
180 ], |
|
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
181 useLDFlags=False, |
|
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
182 install='make && make install DESTDIR=%s && cd %s/usr/local/lib && ln -fs ../../../Library/Frameworks/Python.framework/Versions/%s/lib/lib* .'%( |
|
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
183 shellQuote(os.path.join(WORKDIR, 'libraries')), |
|
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
184 shellQuote(os.path.join(WORKDIR, 'libraries')), |
|
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
185 getVersion(), |
|
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
186 ), |
|
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
187 ), |
|
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
188 dict( |
|
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
189 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
|
190 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
|
191 checksum='ec2b87e833779681a0c3a814aa71359e', |
|
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
192 buildDir="build_unix", |
|
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
193 configure="../dist/configure", |
|
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
194 configure_pre=[ |
|
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
195 '--includedir=/usr/local/include/db4', |
|
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
196 ] |
|
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
197 ), |
|
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
198 ] |
|
38273
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
199 |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
200 |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
201 # Instructions for building packages inside the .mpkg. |
|
40295
ed2ac8084e04
Whitespace changes to make the source more compliant with PEP8 (SF#1589070)
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
40292
diff
changeset
|
202 PKG_RECIPES = [ |
|
38273
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
203 dict( |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
204 name="PythonFramework", |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
205 long_name="Python Framework", |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
206 source="/Library/Frameworks/Python.framework", |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
207 readme="""\ |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
208 This package installs Python.framework, that is the python |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
209 interpreter and the standard library. This also includes Python |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
210 wrappers for lots of Mac OS X API's. |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
211 """, |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
212 postflight="scripts/postflight.framework", |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
213 ), |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
214 dict( |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
215 name="PythonApplications", |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
216 long_name="GUI Applications", |
|
46626
a1c6f2ab597e
Fix for issue #2573: Can't change the framework name on OS X builds
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
46197
diff
changeset
|
217 source="/Applications/Python %(VER)s", |
|
38273
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
218 readme="""\ |
|
40292
cbe133d72e39
Fix a number of typos in strings and comments (sf#1589070)
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
40144
diff
changeset
|
219 This package installs IDLE (an interactive Python IDE), |
|
38645
a3668e94fc6d
mv Mac/OSX/BuildScript one level up
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
38358
diff
changeset
|
220 Python Launcher and Build Applet (create application bundles |
|
a3668e94fc6d
mv Mac/OSX/BuildScript one level up
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
38358
diff
changeset
|
221 from python scripts). |
|
a3668e94fc6d
mv Mac/OSX/BuildScript one level up
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
38358
diff
changeset
|
222 |
|
a3668e94fc6d
mv Mac/OSX/BuildScript one level up
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
38358
diff
changeset
|
223 It also installs a number of examples and demos. |
|
38273
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
224 """, |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
225 required=False, |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
226 ), |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
227 dict( |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
228 name="PythonUnixTools", |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
229 long_name="UNIX command-line tools", |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
230 source="/usr/local/bin", |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
231 readme="""\ |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
232 This package installs the unix tools in /usr/local/bin for |
|
52459
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
233 compatibility with older releases of Python. This package |
|
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
234 is not necessary to use Python. |
|
38273
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
235 """, |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
236 required=False, |
|
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 dict( |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
239 name="PythonDocumentation", |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
240 long_name="Python Documentation", |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
241 topdir="/Library/Frameworks/Python.framework/Versions/%(VER)s/Resources/English.lproj/Documentation", |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
242 source="/pydocs", |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
243 readme="""\ |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
244 This package installs the python documentation at a location |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
245 that is useable for pydoc and IDLE. If you have installed Xcode |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
246 it will also install a link to the documentation in |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
247 /Developer/Documentation/Python |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
248 """, |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
249 postflight="scripts/postflight.documentation", |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
250 required=False, |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
251 ), |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
252 dict( |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
253 name="PythonProfileChanges", |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
254 long_name="Shell profile updater", |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
255 readme="""\ |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
256 This packages updates your shell profile to make sure that |
|
52459
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
257 the Python tools are found by your shell in preference of |
|
38273
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
258 the system provided Python tools. |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
259 |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
260 If you don't install this package you'll have to add |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
261 "/Library/Frameworks/Python.framework/Versions/%(VER)s/bin" |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
262 to your PATH by hand. |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
263 """, |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
264 postflight="scripts/postflight.patch-profile", |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
265 topdir="/Library/Frameworks/Python.framework", |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
266 source="/empty-dir", |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
267 required=False, |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
268 ), |
|
38645
a3668e94fc6d
mv Mac/OSX/BuildScript one level up
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
38358
diff
changeset
|
269 dict( |
|
a3668e94fc6d
mv Mac/OSX/BuildScript one level up
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
38358
diff
changeset
|
270 name="PythonSystemFixes", |
|
a3668e94fc6d
mv Mac/OSX/BuildScript one level up
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
38358
diff
changeset
|
271 long_name="Fix system Python", |
|
a3668e94fc6d
mv Mac/OSX/BuildScript one level up
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
38358
diff
changeset
|
272 readme="""\ |
|
38650
a0761ceb8633
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
38645
diff
changeset
|
273 This package updates the system python installation on |
|
38645
a3668e94fc6d
mv Mac/OSX/BuildScript one level up
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
38358
diff
changeset
|
274 Mac OS X 10.3 to ensure that you can build new python extensions |
|
40292
cbe133d72e39
Fix a number of typos in strings and comments (sf#1589070)
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
40144
diff
changeset
|
275 using that copy of python after installing this version. |
|
38752
5a994d26a3cf
- Change fixapplepython23.py to ensure that it will run with /usr/bin/python
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
38650
diff
changeset
|
276 """, |
|
38645
a3668e94fc6d
mv Mac/OSX/BuildScript one level up
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
38358
diff
changeset
|
277 postflight="../Tools/fixapplepython23.py", |
|
a3668e94fc6d
mv Mac/OSX/BuildScript one level up
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
38358
diff
changeset
|
278 topdir="/Library/Frameworks/Python.framework", |
|
a3668e94fc6d
mv Mac/OSX/BuildScript one level up
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
38358
diff
changeset
|
279 source="/empty-dir", |
|
a3668e94fc6d
mv Mac/OSX/BuildScript one level up
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
38358
diff
changeset
|
280 required=False, |
|
a3668e94fc6d
mv Mac/OSX/BuildScript one level up
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
38358
diff
changeset
|
281 ) |
|
38273
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
282 ] |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
283 |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
284 def fatal(msg): |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
285 """ |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
286 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
|
287 """ |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
288 sys.stderr.write('FATAL: ') |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
289 sys.stderr.write(msg) |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
290 sys.stderr.write('\n') |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
291 sys.exit(1) |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
292 |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
293 def fileContents(fn): |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
294 """ |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
295 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
|
296 """ |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
297 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
|
298 |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
299 def runCommand(commandline): |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
300 """ |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
301 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
|
302 unless the command fails. |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
303 """ |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
304 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
|
305 data = fd.read() |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
306 xit = fd.close() |
|
46197
01a7e66525c2
#2503 make singletons compared with "is" not == or !=
Benjamin Peterson <benjamin@python.org>
parents:
40295
diff
changeset
|
307 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
|
308 sys.stdout.write(data) |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
309 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
|
310 |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
311 if VERBOSE: |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
312 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
|
313 |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
314 def captureCommand(commandline): |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
315 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
|
316 data = fd.read() |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
317 xit = fd.close() |
|
46197
01a7e66525c2
#2503 make singletons compared with "is" not == or !=
Benjamin Peterson <benjamin@python.org>
parents:
40295
diff
changeset
|
318 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
|
319 sys.stdout.write(data) |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
320 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
|
321 |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
322 return data |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
323 |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
324 def checkEnvironment(): |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
325 """ |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
326 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
|
327 """ |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
328 |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
329 if platform.system() != 'Darwin': |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
330 fatal("This script should be run on a Mac OS X 10.4 system") |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
331 |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
332 if platform.release() <= '8.': |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
333 fatal("This script should be run on a Mac OS X 10.4 system") |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
334 |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
335 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
|
336 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
|
337 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
|
338 |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
339 |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
340 |
|
40295
ed2ac8084e04
Whitespace changes to make the source more compliant with PEP8 (SF#1589070)
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
40292
diff
changeset
|
341 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
|
342 """ |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
343 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
|
344 """ |
|
52459
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
345 global WORKDIR, DEPSRC, SDKPATH, SRCDIR, DEPTARGET |
|
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
346 global UNIVERSALOPTS, UNIVERSALARCHS, ARCHLIST |
|
38273
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
347 |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
348 if args is None: |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
349 args = sys.argv[1:] |
|
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 try: |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
352 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
|
353 [ '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
|
354 '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
|
355 except getopt.error, msg: |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
356 print msg |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
357 sys.exit(1) |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
358 |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
359 if args: |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
360 print "Additional arguments" |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
361 sys.exit(1) |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
362 |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
363 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
|
364 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
|
365 print USAGE |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
366 sys.exit(0) |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
367 |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
368 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
|
369 WORKDIR=v |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
370 |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
371 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
|
372 DEPSRC=v |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
373 |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
374 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
|
375 SDKPATH=v |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
376 |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
377 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
|
378 SRCDIR=v |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
379 |
|
52459
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
380 elif k in ('--dep-target', ): |
|
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
381 DEPTARGET=v |
|
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
382 |
|
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
383 elif k in ('--universal-archs', ): |
|
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
384 if v in UNIVERSALOPTS: |
|
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
385 UNIVERSALARCHS = v |
|
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
386 ARCHLIST = universal_opts_map[UNIVERSALARCHS] |
|
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
387 else: |
|
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
388 raise NotImplementedError, v |
|
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
389 |
|
38273
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
390 else: |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
391 raise NotImplementedError, k |
|
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 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
|
394 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
|
395 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
|
396 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
|
397 |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
398 print "Settings:" |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
399 print " * Source directory:", SRCDIR |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
400 print " * Build directory: ", WORKDIR |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
401 print " * SDK location: ", SDKPATH |
|
52459
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
402 print " * Third-party source:", DEPSRC |
|
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
403 print " * Deployment target:", DEPTARGET |
|
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
404 print " * Universal architectures:", ARCHLIST |
|
38273
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
405 print "" |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
406 |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
407 |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
408 |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
409 |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
410 def extractArchive(builddir, archiveName): |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
411 """ |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
412 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
|
413 extracted archive. |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
414 |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
415 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
|
416 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
|
417 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
|
418 """ |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
419 curdir = os.getcwd() |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
420 try: |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
421 os.chdir(builddir) |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
422 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
|
423 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
|
424 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
|
425 shutil.rmtree(retval) |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
426 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
|
427 |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
428 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
|
429 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
|
430 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
|
431 shutil.rmtree(retval) |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
432 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
|
433 |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
434 elif archiveName.endswith('.tar'): |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
435 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
|
436 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
|
437 shutil.rmtree(retval) |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
438 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
|
439 |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
440 elif archiveName.endswith('.zip'): |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
441 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
|
442 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
|
443 shutil.rmtree(retval) |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
444 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
|
445 |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
446 data = fp.read() |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
447 xit = fp.close() |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
448 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
|
449 sys.stdout.write(data) |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
450 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
|
451 |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
452 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
|
453 |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
454 finally: |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
455 os.chdir(curdir) |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
456 |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
457 KNOWNSIZES = { |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
458 "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
|
459 "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
|
460 } |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
461 |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
462 def downloadURL(url, fname): |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
463 """ |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
464 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
|
465 """ |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
466 try: |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
467 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
|
468 except OSError: |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
469 pass |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
470 else: |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
471 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
|
472 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
|
473 return |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
474 fpIn = urllib2.urlopen(url) |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
475 fpOut = open(fname, 'wb') |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
476 block = fpIn.read(10240) |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
477 try: |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
478 while block: |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
479 fpOut.write(block) |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
480 block = fpIn.read(10240) |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
481 fpIn.close() |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
482 fpOut.close() |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
483 except: |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
484 try: |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
485 os.unlink(fname) |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
486 except: |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
487 pass |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
488 |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
489 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
|
490 """ |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
491 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
|
492 '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
|
493 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
|
494 """ |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
495 curdir = os.getcwd() |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
496 |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
497 name = recipe['name'] |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
498 url = recipe['url'] |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
499 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
|
500 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
|
501 shellQuote(basedir))) |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
502 |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
503 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
|
504 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
|
505 |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
506 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
|
507 os.mkdir(DEPSRC) |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
508 |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
509 |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
510 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
|
511 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
|
512 |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
513 else: |
|
52459
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
514 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
|
515 print "Downloading %s"%(name,) |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
516 downloadURL(url, sourceArchive) |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
517 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
|
518 |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
519 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
|
520 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
|
521 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
|
522 os.mkdir(buildDir) |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
523 |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
524 workDir = extractArchive(buildDir, sourceArchive) |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
525 os.chdir(workDir) |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
526 if 'buildDir' in recipe: |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
527 os.chdir(recipe['buildDir']) |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
528 |
|
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 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
|
531 if fn.startswith('http://'): |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
532 # 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
|
533 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
|
534 downloadURL(fn, path) |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
535 fn = path |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
536 |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
537 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
|
538 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
|
539 shellQuote(fn),)) |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
540 |
|
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
|
541 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
|
542 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
|
543 "--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
|
544 "--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
|
545 "--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
|
546 #"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
|
547 ] |
|
38273
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
548 |
|
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
|
549 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
|
550 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
|
551 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
|
552 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
|
553 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
|
554 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
|
555 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
|
556 |
|
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
|
557 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
|
558 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
|
559 "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
|
560 ' -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
|
561 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
|
562 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
|
563 "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
|
564 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
|
565 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
|
566 ' -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
|
567 ]) |
|
7c8990cccf9b
Use staticly build copies of zlib and bzip2 to build the OSX installer, that
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
38752
diff
changeset
|
568 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
|
569 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
|
570 "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
|
571 ' -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
|
572 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
|
573 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
|
574 ]) |
|
38273
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
575 |
|
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
|
576 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
|
577 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
|
578 |
|
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
|
579 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
|
580 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
|
581 |
|
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
|
582 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
|
583 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
|
584 |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
585 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
|
586 runCommand('{ ' + install + ' ;} 2>&1') |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
587 |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
588 print "Done %s"%(name,) |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
589 print "" |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
590 |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
591 os.chdir(curdir) |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
592 |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
593 def buildLibraries(): |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
594 """ |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
595 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
|
596 """ |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
597 print "" |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
598 print "Building required libraries" |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
599 print "" |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
600 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
|
601 os.mkdir(universal) |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
602 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
|
603 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
|
604 |
|
52459
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
605 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
|
606 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
|
607 |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
608 |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
609 |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
610 def buildPythonDocs(): |
|
52450
8df4e0c06e94
* Updates installed dependencies to latest releaases (bzip, zlib, ...)
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52004
diff
changeset
|
611 # 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
|
612 # 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
|
613 print "Install python documentation" |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
614 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
|
615 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
|
616 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
|
617 curDir = os.getcwd() |
|
8df4e0c06e94
* Updates installed dependencies to latest releaases (bzip, zlib, ...)
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52004
diff
changeset
|
618 os.chdir(buildDir) |
|
8df4e0c06e94
* Updates installed dependencies to latest releaases (bzip, zlib, ...)
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52004
diff
changeset
|
619 runCommand('make update') |
|
8df4e0c06e94
* Updates installed dependencies to latest releaases (bzip, zlib, ...)
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52004
diff
changeset
|
620 runCommand('make html') |
|
8df4e0c06e94
* Updates installed dependencies to latest releaases (bzip, zlib, ...)
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52004
diff
changeset
|
621 os.chdir(curDir) |
|
8df4e0c06e94
* Updates installed dependencies to latest releaases (bzip, zlib, ...)
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52004
diff
changeset
|
622 if not os.path.exists(docdir): |
|
8df4e0c06e94
* Updates installed dependencies to latest releaases (bzip, zlib, ...)
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52004
diff
changeset
|
623 os.mkdir(docdir) |
|
8df4e0c06e94
* Updates installed dependencies to latest releaases (bzip, zlib, ...)
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52004
diff
changeset
|
624 os.rename(os.path.join(buildDir, 'build', 'html'), |
|
8df4e0c06e94
* Updates installed dependencies to latest releaases (bzip, zlib, ...)
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52004
diff
changeset
|
625 os.path.join(docdir, 'python-docs-html')) |
|
38273
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
626 |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
627 |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
628 def buildPython(): |
|
52459
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
629 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
|
630 |
|
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', 'python') |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
632 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
|
633 |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
634 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
|
635 shutil.rmtree(buildDir) |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
636 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
|
637 shutil.rmtree(rootDir) |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
638 os.mkdir(buildDir) |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
639 os.mkdir(rootDir) |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
640 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
|
641 curdir = os.getcwd() |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
642 os.chdir(buildDir) |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
643 |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
644 # 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
|
645 # 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
|
646 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
|
647 |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
648 # 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
|
649 # several paths. |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
650 version = getVersion() |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
651 |
|
52467
99829c908058
Fix for issue 13095
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52459
diff
changeset
|
652 # 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
|
653 # 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
|
654 # will find them during its extension import sanity checks. |
|
99829c908058
Fix for issue 13095
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52459
diff
changeset
|
655 os.environ['DYLD_LIBRARY_PATH'] = os.path.join(WORKDIR, |
|
99829c908058
Fix for issue 13095
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52459
diff
changeset
|
656 '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
|
657 print "Running configure..." |
|
52459
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
658 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
|
659 "--with-universal-archs=%s " |
|
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
660 "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
|
661 "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
|
662 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
|
663 UNIVERSALARCHS, |
|
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
664 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
|
665 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
|
666 |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
667 print "Running make" |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
668 runCommand("make") |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
669 |
|
40292
cbe133d72e39
Fix a number of typos in strings and comments (sf#1589070)
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
40144
diff
changeset
|
670 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
|
671 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
|
672 shellQuote(rootDir))) |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
673 |
|
40292
cbe133d72e39
Fix a number of typos in strings and comments (sf#1589070)
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
40144
diff
changeset
|
674 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
|
675 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
|
676 shellQuote(rootDir))) |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
677 |
|
52467
99829c908058
Fix for issue 13095
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52459
diff
changeset
|
678 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
|
679 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
|
680 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
|
681 runCommand("mv %s/* %s"%( |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
682 shellQuote(os.path.join( |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
683 WORKDIR, 'libraries', 'Library', 'Frameworks', |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
684 'Python.framework', 'Versions', getVersion(), |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
685 'lib')), |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
686 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
|
687 'Python.framework', 'Versions', getVersion(), |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
688 'lib')))) |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
689 |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
690 print "Fix file modes" |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
691 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
|
692 gid = grp.getgrnam('admin').gr_gid |
|
66b83d1ba2fc
MacOSX: fix permission problem in the generated installer
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
39852
diff
changeset
|
693 |
|
38273
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
694 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
|
695 for dn in dirnames: |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
696 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
|
697 os.chown(os.path.join(dirpath, dn), -1, gid) |
|
40144
6609f020649f
Whitespace normalization.
Tim Peters <tim.peters@gmail.com>
parents:
40082
diff
changeset
|
698 |
|
38273
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
699 |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
700 for fn in filenames: |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
701 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
|
702 continue |
|
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 # "chmod g+w $fn" |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
705 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
|
706 st = os.stat(p) |
|
40082
66b83d1ba2fc
MacOSX: fix permission problem in the generated installer
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
39852
diff
changeset
|
707 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
|
708 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
|
709 |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
710 # 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
|
711 # 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
|
712 # the end-users system. |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
713 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
|
714 '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
|
715 'config', 'Makefile') |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
716 fp = open(path, 'r') |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
717 data = fp.read() |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
718 fp.close() |
|
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 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
|
721 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
|
722 fp = open(path, 'w') |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
723 fp.write(data) |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
724 fp.close() |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
725 |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
726 # 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
|
727 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
|
728 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
|
729 '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
|
730 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
|
731 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
|
732 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
|
733 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
|
734 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
|
735 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
|
736 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
|
737 |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
738 os.chdir(curdir) |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
739 |
|
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 |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
742 def patchFile(inPath, outPath): |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
743 data = fileContents(inPath) |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
744 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
|
745 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
|
746 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
|
747 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
|
748 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
|
749 |
|
5a994d26a3cf
- Change fixapplepython23.py to ensure that it will run with /usr/bin/python
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
38650
diff
changeset
|
750 # 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
|
751 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
|
752 fp = open(outPath, 'wb') |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
753 fp.write(data) |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
754 fp.close() |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
755 |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
756 def patchScript(inPath, outPath): |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
757 data = fileContents(inPath) |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
758 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
|
759 fp = open(outPath, 'wb') |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
760 fp.write(data) |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
761 fp.close() |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
762 os.chmod(outPath, 0755) |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
763 |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
764 |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
765 |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
766 def packageFromRecipe(targetDir, recipe): |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
767 curdir = os.getcwd() |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
768 try: |
|
40292
cbe133d72e39
Fix a number of typos in strings and comments (sf#1589070)
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
40144
diff
changeset
|
769 # 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
|
770 # 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
|
771 # common. |
|
5a994d26a3cf
- Change fixapplepython23.py to ensure that it will run with /usr/bin/python
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
38650
diff
changeset
|
772 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
|
773 srcdir = recipe.get('source') |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
774 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
|
775 postflight = recipe.get('postflight') |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
776 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
|
777 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
|
778 |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
779 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
|
780 |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
781 # Substitute some variables |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
782 textvars = dict( |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
783 VER=getVersion(), |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
784 FULLVER=getFullVersion(), |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
785 ) |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
786 readme = readme % textvars |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
787 |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
788 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
|
789 pkgroot = pkgroot % textvars |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
790 else: |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
791 pkgroot = '/' |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
792 |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
793 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
|
794 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
|
795 srcdir = srcdir % textvars |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
796 |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
797 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
|
798 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
|
799 |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
800 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
|
801 os.makedirs(packageContents) |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
802 |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
803 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
|
804 os.chdir(srcdir) |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
805 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
|
806 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
|
807 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
|
808 |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
809 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
|
810 fp = open(fn, 'w') |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
811 fp.write('pmkrpkg1') |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
812 fp.close() |
|
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 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
|
815 os.mkdir(rsrcDir) |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
816 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
|
817 fp.write(readme) |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
818 fp.close() |
|
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 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
|
821 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
|
822 |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
823 vers = getFullVersion() |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
824 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
|
825 pl = Plist( |
|
52459
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
826 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
|
827 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
|
828 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
|
829 CFBundleShortVersionString=vers, |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
830 IFMajorVersion=major, |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
831 IFMinorVersion=minor, |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
832 IFPkgFormatVersion=0.10000000149011612, |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
833 IFPkgFlagAllowBackRev=False, |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
834 IFPkgFlagAuthorizationAction="RootAuthorization", |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
835 IFPkgFlagDefaultLocation=pkgroot, |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
836 IFPkgFlagFollowLinks=True, |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
837 IFPkgFlagInstallFat=True, |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
838 IFPkgFlagIsRequired=isRequired, |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
839 IFPkgFlagOverwritePermissions=False, |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
840 IFPkgFlagRelocatable=False, |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
841 IFPkgFlagRestartAction="NoRestart", |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
842 IFPkgFlagRootVolumeOnly=True, |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
843 IFPkgFlagUpdateInstalledLangauges=False, |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
844 ) |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
845 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
|
846 |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
847 pl = Plist( |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
848 IFPkgDescriptionDescription=readme, |
|
52459
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
849 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
|
850 IFPkgDescriptionVersion=vers, |
|
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 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
|
853 |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
854 finally: |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
855 os.chdir(curdir) |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
856 |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
857 |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
858 def makeMpkgPlist(path): |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
859 |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
860 vers = getFullVersion() |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
861 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
|
862 |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
863 pl = Plist( |
|
52459
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
864 CFBundleGetInfoString="Python %s"%(vers,), |
|
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
865 CFBundleIdentifier='org.python.Python', |
|
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
866 CFBundleName='Python', |
|
38273
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
867 CFBundleShortVersionString=vers, |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
868 IFMajorVersion=major, |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
869 IFMinorVersion=minor, |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
870 IFPkgFlagComponentDirectory="Contents/Packages", |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
871 IFPkgFlagPackageList=[ |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
872 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
|
873 IFPkgFlagPackageLocation='%s-%s.pkg'%(item['name'], getVersion()), |
|
38273
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
874 IFPkgFlagPackageSelection='selected' |
|
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 for item in PKG_RECIPES |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
877 ], |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
878 IFPkgFormatVersion=0.10000000149011612, |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
879 IFPkgFlagBackgroundScaling="proportional", |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
880 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
|
881 IFPkgFlagAuthorizationAction="RootAuthorization", |
|
38273
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
882 ) |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
883 |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
884 writePlist(pl, path) |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
885 |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
886 |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
887 def buildInstaller(): |
|
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 # Zap all compiled files |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
890 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
|
891 for fn in filenames: |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
892 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
|
893 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
|
894 |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
895 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
|
896 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
|
897 shutil.rmtree(outdir) |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
898 os.mkdir(outdir) |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
899 |
|
52459
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
900 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
|
901 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
|
902 os.makedirs(pkgcontents) |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
903 for recipe in PKG_RECIPES: |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
904 packageFromRecipe(pkgcontents, recipe) |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
905 |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
906 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
|
907 |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
908 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
|
909 fp = open(fn, 'w') |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
910 fp.write('pmkrpkg1') |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
911 fp.close() |
|
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 os.mkdir(rsrcDir) |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
914 |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
915 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
|
916 pl = Plist( |
|
52459
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
917 IFPkgDescriptionTitle="Python", |
|
38273
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
918 IFPkgDescriptionVersion=getVersion(), |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
919 ) |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
920 |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
921 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
|
922 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
|
923 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
|
924 if fn.endswith('.jpg'): |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
925 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
|
926 else: |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
927 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
|
928 |
|
38752
5a994d26a3cf
- Change fixapplepython23.py to ensure that it will run with /usr/bin/python
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
38650
diff
changeset
|
929 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
|
930 |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
931 |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
932 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
|
933 if clear: |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
934 del _saved[:] |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
935 if not _saved: |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
936 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
|
937 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
|
938 _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
|
939 return _saved[0] |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
940 |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
941 |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
942 def buildDMG(): |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
943 """ |
|
40292
cbe133d72e39
Fix a number of typos in strings and comments (sf#1589070)
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
40144
diff
changeset
|
944 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
|
945 """ |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
946 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
|
947 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
|
948 shutil.rmtree(outdir) |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
949 |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
950 imagepath = os.path.join(outdir, |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
951 'python-%s-macosx'%(getFullVersion(),)) |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
952 if INCLUDE_TIMESTAMP: |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
953 imagepath = imagepath + '%04d-%02d-%02d'%(time.localtime()[:3]) |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
954 imagepath = imagepath + '.dmg' |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
955 |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
956 os.mkdir(outdir) |
|
52459
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
957 volname='Python %s'%(getFullVersion()) |
|
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
958 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
|
959 shellQuote(volname), |
|
38273
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
960 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
|
961 shellQuote(imagepath + ".tmp.dmg" ))) |
|
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
962 |
|
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
963 |
|
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
964 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
|
965 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
|
966 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
|
967 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
|
968 |
|
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
969 # 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
|
970 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
|
971 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
|
972 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
|
973 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
|
974 |
|
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
975 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
|
976 |
|
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
977 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
|
978 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
|
979 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
|
980 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
|
981 |
|
974c2bef2800
* Set a custom icon on the Python installer DMG
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52450
diff
changeset
|
982 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
|
983 |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
984 return imagepath |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
985 |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
986 |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
987 def setIcon(filePath, icnsPath): |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
988 """ |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
989 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
|
990 """ |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
991 |
|
52450
8df4e0c06e94
* Updates installed dependencies to latest releaases (bzip, zlib, ...)
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52004
diff
changeset
|
992 toolPath = os.path.join(os.path.dirname(__file__), "seticon.app/Contents/MacOS/seticon") |
|
8df4e0c06e94
* Updates installed dependencies to latest releaases (bzip, zlib, ...)
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52004
diff
changeset
|
993 dirPath = os.path.dirname(__file__) |
|
8df4e0c06e94
* Updates installed dependencies to latest releaases (bzip, zlib, ...)
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52004
diff
changeset
|
994 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
|
995 # 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
|
996 # to connections to the window server. |
|
8df4e0c06e94
* Updates installed dependencies to latest releaases (bzip, zlib, ...)
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52004
diff
changeset
|
997 if not os.path.exists('seticon.app/Contents/MacOS'): |
|
8df4e0c06e94
* Updates installed dependencies to latest releaases (bzip, zlib, ...)
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52004
diff
changeset
|
998 os.makedirs('seticon.app/Contents/MacOS') |
|
8df4e0c06e94
* Updates installed dependencies to latest releaases (bzip, zlib, ...)
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52004
diff
changeset
|
999 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
|
1000 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
|
1001 |
|
52450
8df4e0c06e94
* Updates installed dependencies to latest releaases (bzip, zlib, ...)
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52004
diff
changeset
|
1002 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
|
1003 shellQuote(filePath))) |
|
38273
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 def main(): |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
1006 # 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
|
1007 parseOptions() |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
1008 checkEnvironment() |
|
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 os.environ['MACOSX_DEPLOYMENT_TARGET'] = DEPTARGET |
|
38273
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
1011 |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
1012 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
|
1013 shutil.rmtree(WORKDIR) |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
1014 os.mkdir(WORKDIR) |
|
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 # 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
|
1017 buildLibraries() |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
1018 |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
1019 # Now build python itself |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
1020 buildPython() |
|
52512
962eba62299f
Minor update to OSX build-installer script, needed
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52467
diff
changeset
|
1021 |
|
962eba62299f
Minor update to OSX build-installer script, needed
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52467
diff
changeset
|
1022 # And then build the documentation |
|
962eba62299f
Minor update to OSX build-installer script, needed
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52467
diff
changeset
|
1023 # 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
|
1024 # 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
|
1025 # 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
|
1026 # 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
|
1027 # be (re-)installed. |
|
962eba62299f
Minor update to OSX build-installer script, needed
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52467
diff
changeset
|
1028 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
|
1029 buildPythonDocs() |
|
52512
962eba62299f
Minor update to OSX build-installer script, needed
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52467
diff
changeset
|
1030 |
|
962eba62299f
Minor update to OSX build-installer script, needed
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52467
diff
changeset
|
1031 |
|
962eba62299f
Minor update to OSX build-installer script, needed
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
52467
diff
changeset
|
1032 # 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
|
1033 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
|
1034 "Python %s"%(getVersion(),), "Update Shell Profile.command") |
| 52004 | 1035 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
|
1036 |
|
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
|
1037 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
|
1038 getVersion(),)) |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
1039 os.chmod(folder, 0755) |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
1040 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
|
1041 |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
1042 # Create the installer |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
1043 buildInstaller() |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
1044 |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
1045 # 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
|
1046 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
|
1047 |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
1048 # 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
|
1049 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
|
1050 |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
1051 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
|
1052 print >> fp, "# BUILD INFO" |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
1053 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
|
1054 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
|
1055 fp.close() |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
1056 |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
1057 |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
1058 |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
1059 # 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
|
1060 buildDMG() |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
1061 |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
1062 |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
1063 if __name__ == "__main__": |
|
9ae69bcab9f7
Add missing svn:eol-style property to text files.
Tim Peters <tim.peters@gmail.com>
parents:
38272
diff
changeset
|
1064 main() |
