Commit 7f45a31d authored by Ned Deily's avatar Ned Deily

Issue #22877: PEP 477 - keep 2.7 and 3.x installers in sync.

parent 6473ecbd
...@@ -198,7 +198,7 @@ def library_recipes(): ...@@ -198,7 +198,7 @@ def library_recipes():
LT_10_5 = bool(getDeptargetTuple() < (10, 5)) LT_10_5 = bool(getDeptargetTuple() < (10, 5))
# Disable for now # Disable for now
if False: # if (getDeptargetTuple() > (10, 5)) and (getVersionTuple() >= (3, 5)): if False: # if getDeptargetTuple() > (10, 5):
result.extend([ result.extend([
dict( dict(
name="Tcl 8.5.15", name="Tcl 8.5.15",
...@@ -239,7 +239,7 @@ def library_recipes(): ...@@ -239,7 +239,7 @@ def library_recipes():
), ),
]) ])
if getVersionTuple() >= (3, 3): if PYTHON_3:
result.extend([ result.extend([
dict( dict(
name="XZ 5.0.5", name="XZ 5.0.5",
...@@ -369,8 +369,6 @@ def library_recipes(): ...@@ -369,8 +369,6 @@ 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",
...@@ -439,12 +437,8 @@ def pkg_recipes(): ...@@ -439,12 +437,8 @@ 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_lt_python34, selected='selected',
), ),
]
if getVersionTuple() >= (3, 4):
result.append(
dict( dict(
name="PythonInstallPip", name="PythonInstallPip",
long_name="Install or upgrade pip", long_name="Install or upgrade pip",
...@@ -457,8 +451,8 @@ def pkg_recipes(): ...@@ -457,8 +451,8 @@ def pkg_recipes():
source="/empty-dir", source="/empty-dir",
required=False, required=False,
selected='selected', selected='selected',
) ),
) ]
if getDeptargetTuple() < (10, 4) and not PYTHON_3: if getDeptargetTuple() < (10, 4) and not PYTHON_3:
result.append( result.append(
...@@ -977,7 +971,7 @@ def buildPython(): ...@@ -977,7 +971,7 @@ def buildPython():
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)], (' ', '--without-ensurepip ')[PYTHON_3],
shellQuote(WORKDIR)[1:-1], shellQuote(WORKDIR)[1:-1],
shellQuote(WORKDIR)[1:-1])) shellQuote(WORKDIR)[1:-1]))
...@@ -1159,7 +1153,9 @@ def patchFile(inPath, outPath): ...@@ -1159,7 +1153,9 @@ def patchFile(inPath, outPath):
fp.close() fp.close()
def patchScript(inPath, outPath): def patchScript(inPath, outPath):
major, minor = getVersionMajorMinor()
data = fileContents(inPath) data = fileContents(inPath)
data = data.replace('@PYMAJOR@', str(major))
data = data.replace('@PYVER@', getVersion()) data = data.replace('@PYVER@', getVersion())
fp = open(outPath, 'w') fp = open(outPath, 'w')
fp.write(data) fp.write(data)
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
# #
PYVER="@PYVER@" PYVER="@PYVER@"
PYMAJOR="3" PYMAJOR="@PYMAJOR@"
FWK="/Library/Frameworks/Python.framework/Versions/${PYVER}" FWK="/Library/Frameworks/Python.framework/Versions/${PYVER}"
RELFWKBIN="../../..${FWK}/bin" RELFWKBIN="../../..${FWK}/bin"
...@@ -34,11 +34,10 @@ chmod -R g+w "${FWK}/lib/python${PYVER}/site-packages" "${FWK}/bin" ...@@ -34,11 +34,10 @@ chmod -R g+w "${FWK}/lib/python${PYVER}/site-packages" "${FWK}/bin"
if [ -d /usr/local/bin ] ; then if [ -d /usr/local/bin ] ; then
( (
cd /usr/local/bin install_links_if_our_fw() {
# Create pipx.y and easy_install-x.y links if /usr/local/bin/pythonx.y if [ "$(readlink -n ./$1)" = "${RELFWKBIN}/$1" ] ; then
# is linked to this framework version shift
if [ "$(readlink -n ./python${PYVER})" = "${RELFWKBIN}/python${PYVER}" ] ; then for fn ;
for fn in "pip${PYVER}" "easy_install-${PYVER}" ;
do do
if [ -e "${RELFWKBIN}/${fn}" ] ; then if [ -e "${RELFWKBIN}/${fn}" ] ; then
rm -f ./${fn} rm -f ./${fn}
...@@ -48,18 +47,23 @@ if [ -d /usr/local/bin ] ; then ...@@ -48,18 +47,23 @@ if [ -d /usr/local/bin ] ; then
fi fi
done done
fi fi
}
cd /usr/local/bin
# Create pipx.y and easy_install-x.y links if /usr/local/bin/pythonx.y
# is linked to this framework version
install_links_if_our_fw "python${PYVER}" \
"pip${PYVER}" "easy_install-${PYVER}"
# Create pipx link if /usr/local/bin/pythonx is linked to this version # Create pipx link if /usr/local/bin/pythonx is linked to this version
if [ "$(readlink -n ./python${PYMAJOR})" = "${RELFWKBIN}/python${PYMAJOR}" ] ; then install_links_if_our_fw "python${PYMAJOR}" \
for fn in "pip${PYMAJOR}" ; "pip${PYMAJOR}"
do
if [ -e "${RELFWKBIN}/${fn}" ] ; then # Create pip and easy_install link if /usr/local/bin/python
rm -f ./${fn} # is linked to this version
ln -s "${RELFWKBIN}/${fn}" "./${fn}" install_links_if_our_fw "python" \
chgrp -h admin "./${fn}" "pip" "easy_install"
chmod -h g+w "./${fn}"
fi
done
fi
) )
fi fi
exit 0 exit 0
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment