Commit 008de7fc authored by Rob Buckley's avatar Rob Buckley
Browse files

build 64b only for 10.9-based pythons

parent 755f72c1
...@@ -15,8 +15,15 @@ BUILD_PREFIX="${BUILD_PREFIX:-/usr/local}" ...@@ -15,8 +15,15 @@ BUILD_PREFIX="${BUILD_PREFIX:-/usr/local}"
# Default compilation flags for OSX # Default compilation flags for OSX
# IS_OSX is defined in common_utils.sh # IS_OSX is defined in common_utils.sh
if [ -n "$IS_OSX" ]; then if [ -n "$IS_OSX" ]; then
# Dual arch build by default MAC_ARCH=$(mac_arch_for_pyosx_version $MB_PYTHON_OSX_VER)
ARCH_FLAGS=${ARCH_FLAGS:-"-arch i386 -arch x86_64"} if [ "$MAC_ARCH" == "intel" ]; then
ARCH_FLAGS=${ARCH_FLAGS:-"-arch i386 -arch x86_64"}
elif [ "$MAC_ARCH" == "x86_x64" ]; then
ARCH_FLAGS=${ARCH_FLAGS:-"-arch x86_64"}
else
echo "invalid ARCH = '$MAC_ARCH'"
exit 1
fi
# Only set CFLAGS, FFLAGS if they are not already defined. Build functions # Only set CFLAGS, FFLAGS if they are not already defined. Build functions
# can override the arch flags by setting CFLAGS, FFLAGS # can override the arch flags by setting CFLAGS, FFLAGS
export CFLAGS="${CFLAGS:-$ARCH_FLAGS}" export CFLAGS="${CFLAGS:-$ARCH_FLAGS}"
......
...@@ -127,6 +127,27 @@ function pyinst_fname_for_version { ...@@ -127,6 +127,27 @@ function pyinst_fname_for_version {
echo "python-$py_version-macosx${osx_ver}.$inst_ext" echo "python-$py_version-macosx${osx_ver}.$inst_ext"
} }
function mac_arch_for_pyosx_version {
# echo arch (intel or x86_64) that the given the minimum macOS that
# the python version is targetted for.
# Parameters
# $py_osx_ver (python version in major.minor.extra format)
# note this is the version the python is built for, not that of the
# local system
py_osx_ver=$1
check_var $py_osx_ver
if [ $py_osx_ver -eq "10.6" ]; then
echo "intel"
elif [ $py_osx_ver -eq "10.9" ]; then
echo "x86_x64"
else
echo "Invalid python osx version: ${py_osx_ver}, supported values: 10.6 and 10.9"
exit 1
fi
echo
}
function install_macpython { function install_macpython {
# Install Python and set $PYTHON_EXE to the installed executable # Install Python and set $PYTHON_EXE to the installed executable
# Parameters: # Parameters:
...@@ -308,17 +329,16 @@ function repair_wheelhouse { ...@@ -308,17 +329,16 @@ function repair_wheelhouse {
# 10.10. The wheels are built against Python.org Python, and so will # 10.10. The wheels are built against Python.org Python, and so will
# in fact be compatible with either 10.6+ or 10.9+, depending on the value # in fact be compatible with either 10.6+ or 10.9+, depending on the value
# of MB_PYTHON_OSX_VER. pip < 6.0 doesn't realize this, so, in case users # of MB_PYTHON_OSX_VER. pip < 6.0 doesn't realize this, so, in case users
# have older pip, add platform tags to specify compatibility with later OSX. # try to install have older pip, add platform tags to specify compatibility
# Not necessary for OSX released well after pip 6.0. See: # with later OSX. Not necessary for OSX released well after pip 6.0. See:
# https://github.com/MacPython/wiki/wiki/Spinning-wheels#question-will-pip-give-me-a-broken-wheel # https://github.com/MacPython/wiki/wiki/Spinning-wheels#question-will-pip-give-me-a-broken-wheel
if [ $MB_PYTHON_OSX_VER == "10.6" ]; then local MAC_ARCH=$(mac_arch_for_pyosx_version $MB_PYTHON_OSX_VER)
# assume that 10.6-based python is dual arch (32/64-bit) if [ "$MAC_ARCH" == "x86_x64" ]; then
delocate-addplat --rm-orig -x 10_9 -x 10_10 $wheelhouse/*.whl
elif [ $MB_PYTHON_OSX_VER == "10.9" ]; then
# assume that 10.9-based python is 64-bit arch only
delocate-addplat --rm-orig -p macosx_10_10_x86_64 $wheelhouse/*.whl delocate-addplat --rm-orig -p macosx_10_10_x86_64 $wheelhouse/*.whl
elif [ "$MAC_ARCH" == "intel" ]; then
delocate-addplat --rm-orig -x 10_9 -x 10_10 $wheelhouse/*.whl
else else
echo "Invalid python macosx version $MB_PYTHON_OSX_VER" 1>&2 echo "invalid ARCH = '$MAC_ARCH'"
exit 1 exit 1
fi fi
} }
......
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