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