Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
b38be3bc
Commit
b38be3bc
authored
Apr 09, 2014
by
Ned Deily
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #20644: Keep build-installer.py in sync across active versions.
parent
5e9a4b15
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
50 additions
and
77 deletions
+50
-77
Mac/BuildScript/build-installer.py
Mac/BuildScript/build-installer.py
+50
-77
No files found.
Mac/BuildScript/build-installer.py
View file @
b38be3bc
...
@@ -8,7 +8,9 @@ OS X 10.5 and the 10.5 SDK.
...
@@ -8,7 +8,9 @@ OS X 10.5 and the 10.5 SDK.
Please ensure that this script keeps working with Python 2.5, to avoid
Please ensure that this script keeps working with Python 2.5, to avoid
bootstrap issues (/usr/bin/python is Python 2.5 on OSX 10.5). Sphinx,
bootstrap issues (/usr/bin/python is Python 2.5 on OSX 10.5). Sphinx,
which is used to build the documentation, currently requires at least
which is used to build the documentation, currently requires at least
Python 2.4.
Python 2.4. However, as of Python 3.4.1, Doc builds require an external
sphinx-build and the current versions of Sphinx now require at least
Python 2.6.
In addition to what is supplied with OS X 10.5+ and Xcode 3+, the script
In addition to what is supplied with OS X 10.5+ and Xcode 3+, the script
requires an installed version of hg and a third-party version of
requires an installed version of hg and a third-party version of
...
@@ -21,8 +23,8 @@ installing the most recent ActiveTcl 8.4 or 8.5 version.
...
@@ -21,8 +23,8 @@ installing the most recent ActiveTcl 8.4 or 8.5 version.
32-bit-only installer builds are still possible on OS X 10.4 with Xcode 2.5
32-bit-only installer builds are still possible on OS X 10.4 with Xcode 2.5
and the installation of additional components, such as a newer Python
and the installation of additional components, such as a newer Python
(2.5 is needed for Python parser updates), hg, and
svn (
for the documentation
(2.5 is needed for Python parser updates), hg, and for the documentation
build).
build
either svn (pre-3.4.1) or sphinx-build (3.4.1 and later
).
Usage: see USAGE variable in the script.
Usage: see USAGE variable in the script.
"""
"""
...
@@ -193,7 +195,8 @@ def library_recipes():
...
@@ -193,7 +195,8 @@ def library_recipes():
LT_10_5
=
bool
(
DEPTARGET
<
'10.5'
)
LT_10_5
=
bool
(
DEPTARGET
<
'10.5'
)
if
(
DEPTARGET
>
'10.5'
)
and
(
getVersionTuple
()
>=
(
3
,
4
)):
# Disable for now
if
False
:
# if (DEPTARGET > '10.5') and (getVersionTuple() >= (3, 5)):
result
.
extend
([
result
.
extend
([
dict
(
dict
(
name
=
"Tcl 8.5.15"
,
name
=
"Tcl 8.5.15"
,
...
@@ -237,9 +240,9 @@ def library_recipes():
...
@@ -237,9 +240,9 @@ def library_recipes():
if
getVersionTuple
()
>=
(
3
,
3
):
if
getVersionTuple
()
>=
(
3
,
3
):
result
.
extend
([
result
.
extend
([
dict
(
dict
(
name
=
"XZ 5.0.
3
"
,
name
=
"XZ 5.0.
5
"
,
url
=
"http://tukaani.org/xz/xz-5.0.
3
.tar.gz"
,
url
=
"http://tukaani.org/xz/xz-5.0.
5
.tar.gz"
,
checksum
=
'
fefe52f9ecd521de2a8ce38c21a27574
'
,
checksum
=
'
19d924e066b6fff0bc9d1981b4e53196
'
,
configure_pre
=
[
configure_pre
=
[
'--disable-dependency-tracking'
,
'--disable-dependency-tracking'
,
]
]
...
@@ -282,9 +285,9 @@ def library_recipes():
...
@@ -282,9 +285,9 @@ def library_recipes():
),
),
),
),
dict
(
dict
(
name
=
"SQLite 3.
7.13
"
,
name
=
"SQLite 3.
8.3.1
"
,
url
=
"http://www.sqlite.org/
sqlite-autoconf-3071300
.tar.gz"
,
url
=
"http://www.sqlite.org/
2014/sqlite-autoconf-3080301
.tar.gz"
,
checksum
=
'
c97df403e8a3d5b67bb408fcd6aabd8e
'
,
checksum
=
'
509ff98d8dc9729b618b7e96612079c6
'
,
extra_cflags
=
(
'-Os '
extra_cflags
=
(
'-Os '
'-DSQLITE_ENABLE_FTS4 '
'-DSQLITE_ENABLE_FTS4 '
'-DSQLITE_ENABLE_FTS3_PARENTHESIS '
'-DSQLITE_ENABLE_FTS3_PARENTHESIS '
...
@@ -364,6 +367,8 @@ def library_recipes():
...
@@ -364,6 +367,8 @@ def library_recipes():
# Instructions for building packages inside the .mpkg.
# Instructions for building packages inside the .mpkg.
def
pkg_recipes
():
def
pkg_recipes
():
unselected_for_python3
=
(
'selected'
,
'unselected'
)[
PYTHON_3
]
unselected_for_python3
=
(
'selected'
,
'unselected'
)[
PYTHON_3
]
# unselected if 3.0 through 3.3, selected otherwise (2.x or >= 3.4)
unselected_for_lt_python34
=
(
'selected'
,
'unselected'
)[(
3
,
0
)
<=
getVersionTuple
()
<
(
3
,
4
)]
result
=
[
result
=
[
dict
(
dict
(
name
=
"PythonFramework"
,
name
=
"PythonFramework"
,
...
@@ -432,10 +437,27 @@ def pkg_recipes():
...
@@ -432,10 +437,27 @@ def pkg_recipes():
topdir
=
"/Library/Frameworks/Python.framework"
,
topdir
=
"/Library/Frameworks/Python.framework"
,
source
=
"/empty-dir"
,
source
=
"/empty-dir"
,
required
=
False
,
required
=
False
,
selected
=
unselected_for_
python3
,
selected
=
unselected_for_
lt_python34
,
),
),
]
]
if
getVersionTuple
()
>=
(
3
,
4
):
result
.
append
(
dict
(
name
=
"PythonInstallPip"
,
long_name
=
"Install or upgrade pip"
,
readme
=
"""
\
This package installs (or upgrades from an earlier version)
pip, a tool for installing and managing Python packages.
"""
,
postflight
=
"scripts/postflight.ensurepip"
,
topdir
=
"/Library/Frameworks/Python.framework"
,
source
=
"/empty-dir"
,
required
=
False
,
selected
=
'selected'
,
)
)
if
DEPTARGET
<
'10.4'
and
not
PYTHON_3
:
if
DEPTARGET
<
'10.4'
and
not
PYTHON_3
:
result
.
append
(
result
.
append
(
dict
(
dict
(
...
@@ -453,6 +475,7 @@ def pkg_recipes():
...
@@ -453,6 +475,7 @@ def pkg_recipes():
selected
=
unselected_for_python3
,
selected
=
unselected_for_python3
,
)
)
)
)
return
result
return
result
def
fatal
(
msg
):
def
fatal
(
msg
):
...
@@ -567,20 +590,6 @@ def checkEnvironment():
...
@@ -567,20 +590,6 @@ def checkEnvironment():
%
frameworks
[
'Tk'
],
%
frameworks
[
'Tk'
],
]
]
# For 10.6+ builds, we build two versions of _tkinter:
# - the traditional version (renamed to _tkinter_library.so) linked
# with /Library/Frameworks/{Tcl,Tk}.framework
# - the default version linked with our builtin copies of Tcl and Tk
if
(
DEPTARGET
>
'10.5'
)
and
(
getVersionTuple
()
>=
(
3
,
4
)):
EXPECTED_SHARED_LIBS
[
'_tkinter_library.so'
]
=
\
EXPECTED_SHARED_LIBS
[
'_tkinter.so'
]
EXPECTED_SHARED_LIBS
[
'_tkinter.so'
]
=
[
"/Library/Frameworks/Python.framework/Versions/%s/lib/libtcl%s.dylib"
%
(
getVersion
(),
frameworks
[
'Tcl'
]),
"/Library/Frameworks/Python.framework/Versions/%s/lib/libtk%s.dylib"
%
(
getVersion
(),
frameworks
[
'Tk'
]),
]
# Remove inherited environment variables which might influence build
# Remove inherited environment variables which might influence build
environ_var_prefixes
=
[
'CPATH'
,
'C_INCLUDE_'
,
'DYLD_'
,
'LANG'
,
'LC_'
,
environ_var_prefixes
=
[
'CPATH'
,
'C_INCLUDE_'
,
'DYLD_'
,
'LANG'
,
'LC_'
,
'LD_'
,
'LIBRARY_'
,
'PATH'
,
'PYTHON'
]
'LD_'
,
'LIBRARY_'
,
'PATH'
,
'PYTHON'
]
...
@@ -601,7 +610,11 @@ def checkEnvironment():
...
@@ -601,7 +610,11 @@ def checkEnvironment():
base_path
=
base_path
+
':'
+
OLD_DEVELOPER_TOOLS
base_path
=
base_path
+
':'
+
OLD_DEVELOPER_TOOLS
os
.
environ
[
'PATH'
]
=
base_path
os
.
environ
[
'PATH'
]
=
base_path
print
(
"Setting default PATH: %s"
%
(
os
.
environ
[
'PATH'
]))
print
(
"Setting default PATH: %s"
%
(
os
.
environ
[
'PATH'
]))
# Ensure ws have access to hg and to sphinx-build.
# You may have to create links in /usr/bin for them.
runCommand
(
'hg --version'
)
if
getVersionTuple
()
>=
(
3
,
4
):
runCommand
(
'sphinx-build --version'
)
def
parseOptions
(
args
=
None
):
def
parseOptions
(
args
=
None
):
"""
"""
...
@@ -914,8 +927,15 @@ def buildPythonDocs():
...
@@ -914,8 +927,15 @@ def buildPythonDocs():
docdir
=
os
.
path
.
join
(
rootDir
,
'pydocs'
)
docdir
=
os
.
path
.
join
(
rootDir
,
'pydocs'
)
curDir
=
os
.
getcwd
()
curDir
=
os
.
getcwd
()
os
.
chdir
(
buildDir
)
os
.
chdir
(
buildDir
)
# The Doc build changed for 3.4 (technically, for 3.4.1)
if
getVersionTuple
()
<
(
3
,
4
):
# This step does an svn checkout of sphinx and its dependencies
runCommand
(
'make update'
)
runCommand
(
'make update'
)
runCommand
(
"make html PYTHON='%s'"
%
os
.
path
.
abspath
(
sys
.
executable
))
runCommand
(
"make html PYTHON='%s'"
%
os
.
path
.
abspath
(
sys
.
executable
))
else
:
runCommand
(
'make clean'
)
# Assume sphinx-build is on our PATH, checked in checkEnvironment
runCommand
(
'make html'
)
os
.
chdir
(
curDir
)
os
.
chdir
(
curDir
)
if
not
os
.
path
.
exists
(
docdir
):
if
not
os
.
path
.
exists
(
docdir
):
os
.
mkdir
(
docdir
)
os
.
mkdir
(
docdir
)
...
@@ -955,34 +975,19 @@ def buildPython():
...
@@ -955,34 +975,19 @@ def buildPython():
runCommand
(
"%s -C --enable-framework --enable-universalsdk=%s "
runCommand
(
"%s -C --enable-framework --enable-universalsdk=%s "
"--with-universal-archs=%s "
"--with-universal-archs=%s "
"%s "
"%s "
"%s "
"LDFLAGS='-g -L%s/libraries/usr/local/lib' "
"LDFLAGS='-g -L%s/libraries/usr/local/lib' "
"CFLAGS='-g -I%s/libraries/usr/local/include' 2>&1"
%
(
"CFLAGS='-g -I%s/libraries/usr/local/include' 2>&1"
%
(
shellQuote
(
os
.
path
.
join
(
SRCDIR
,
'configure'
)),
shellQuote
(
SDKPATH
),
shellQuote
(
os
.
path
.
join
(
SRCDIR
,
'configure'
)),
shellQuote
(
SDKPATH
),
UNIVERSALARCHS
,
UNIVERSALARCHS
,
(
' '
,
'--with-computed-gotos '
)[
PYTHON_3
],
(
' '
,
'--with-computed-gotos '
)[
PYTHON_3
],
(
' '
,
'--without-ensurepip '
)[
getVersionTuple
()
>=
(
3
,
4
)],
shellQuote
(
WORKDIR
)[
1
:
-
1
],
shellQuote
(
WORKDIR
)[
1
:
-
1
],
shellQuote
(
WORKDIR
)[
1
:
-
1
]))
shellQuote
(
WORKDIR
)[
1
:
-
1
]))
print
(
"Running make"
)
print
(
"Running make"
)
runCommand
(
"make"
)
runCommand
(
"make"
)
# For deployment targets of 10.6 and higher, we build our own version
# of Tcl and Cocoa Aqua Tk libs because the Apple-supplied Tk 8.5 is
# out-of-date and has critical bugs. Save the _tkinter.so that was
# linked with /Library/Frameworks/{Tck,Tk}.framework and build
# another _tkinter.so linked with our builtin Tcl and Tk libs.
if
(
DEPTARGET
>
'10.5'
)
and
(
getVersionTuple
()
>=
(
3
,
4
)):
runCommand
(
"find build -name '_tkinter.so' "
" -execdir mv '{}' _tkinter_library.so
\
;
"
)
print("
Running
make
to
build
builtin
_tkinter
")
runCommand("
make
TCLTK_INCLUDES
=
'-I%s/libraries/usr/local/include'
"
"
TCLTK_LIBS
=
'-L%s/libraries/usr/local/lib -ltcl8.5 -ltk8.5'"%(
shellQuote(WORKDIR)[1:-1],
shellQuote(WORKDIR)[1:-1]))
# make a copy which will be moved to lib-tkinter later
runCommand("
find
build
-
name
'_tkinter.so'
"
"
-
execdir
cp
-
p
'{}'
_tkinter_builtin
.
so
\
;
")
print
(
"Running make install"
)
print
(
"Running make install"
)
runCommand
(
"make install DESTDIR=%s"
%
(
runCommand
(
"make install DESTDIR=%s"
%
(
shellQuote
(
rootDir
)))
shellQuote
(
rootDir
)))
...
@@ -1007,27 +1012,11 @@ def buildPython():
...
@@ -1007,27 +1012,11 @@ def buildPython():
'Python.framework'
,
'Versions'
,
'Python.framework'
,
'Versions'
,
version
,
'lib'
,
'python%s'
%
(
version
,))
version
,
'lib'
,
'python%s'
%
(
version
,))
# If we made multiple versions of _tkinter, move them to
# their own directories under python lib. This allows
# users to select which to import by manipulating sys.path
# directly or with PYTHONPATH.
if (DEPTARGET > '10.5') and (getVersionTuple() >= (3, 4)):
TKINTERS = ['builtin', 'library']
tkinter_moves = [('_tkinter_' + tkn + '.so',
os.path.join(path_to_lib, 'lib-tkinter', tkn))
for tkn in TKINTERS]
# Create the destination directories under lib-tkinter.
# The permissions and uid/gid will be fixed up next.
for tkm in tkinter_moves:
os.makedirs(tkm[1])
print
(
"Fix file modes"
)
print
(
"Fix file modes"
)
frmDir
=
os
.
path
.
join
(
rootDir
,
'Library'
,
'Frameworks'
,
'Python.framework'
)
frmDir
=
os
.
path
.
join
(
rootDir
,
'Library'
,
'Frameworks'
,
'Python.framework'
)
gid
=
grp
.
getgrnam
(
'admin'
).
gr_gid
gid
=
grp
.
getgrnam
(
'admin'
).
gr_gid
shared_lib_error
=
False
shared_lib_error
=
False
moves_list = []
for
dirpath
,
dirnames
,
filenames
in
os
.
walk
(
frmDir
):
for
dirpath
,
dirnames
,
filenames
in
os
.
walk
(
frmDir
):
for
dn
in
dirnames
:
for
dn
in
dirnames
:
os
.
chmod
(
os
.
path
.
join
(
dirpath
,
dn
),
STAT_0o775
)
os
.
chmod
(
os
.
path
.
join
(
dirpath
,
dn
),
STAT_0o775
)
...
@@ -1053,25 +1042,9 @@ def buildPython():
...
@@ -1053,25 +1042,9 @@ def buildPython():
%
(
sl
,
p
))
%
(
sl
,
p
))
shared_lib_error
=
True
shared_lib_error
=
True
# If this is a _tkinter variant, move it to its own directory
# now that we have fixed its permissions and checked that it
# was linked properly. The directory was created earlier.
# The files are moved after the entire tree has been walked
# since the shared library checking depends on the files
# having unique names.
if (DEPTARGET > '10.5') and (getVersionTuple() >= (3, 4)):
for tkm in tkinter_moves:
if fn == tkm[0]:
moves_list.append(
(p, os.path.join(tkm[1], '_tkinter.so')))
if
shared_lib_error
:
if
shared_lib_error
:
fatal
(
"Unexpected shared library errors."
)
fatal
(
"Unexpected shared library errors."
)
# Now do the moves.
for ml in moves_list:
shutil.move(ml[0], ml[1])
if
PYTHON_3
:
if
PYTHON_3
:
LDVERSION
=
None
LDVERSION
=
None
VERSION
=
None
VERSION
=
None
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment