"vscode:/vscode.git/clone" did not exist on "d3614c8bae2c539ca47b48e319febdfc7d7897bb"
Commit bec7515f authored by Rob Buckley's avatar Rob Buckley
Browse files

use MB_PYTHON_OSX_VER for defaults in osx_utils.sh

parent e62f5118
...@@ -15,13 +15,14 @@ BUILD_PREFIX="${BUILD_PREFIX:-/usr/local}" ...@@ -15,13 +15,14 @@ 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
MAC_ARCH=$(mac_arch_for_pyosx_version $MB_PYTHON_OSX_VER) source $MULTIBUILD_DIR/osx_utils.sh
if [[ "$MAC_ARCH" == "intel" ]]; then PLAT=$(mac_cpython_arch_for_osx_ver)
if [[ $PLAT == intel ]]; then
ARCH_FLAGS=${ARCH_FLAGS:-"-arch i386 -arch x86_64"} ARCH_FLAGS=${ARCH_FLAGS:-"-arch i386 -arch x86_64"}
elif [[ "$MAC_ARCH" == "x86_x64" ]]; then elif [[ $PLAT == x86_64 ]]; then
ARCH_FLAGS=${ARCH_FLAGS:-"-arch x86_64"} ARCH_FLAGS=${ARCH_FLAGS:-"-arch x86_64"}
else else
echo "invalid ARCH = '$MAC_ARCH'" echo "invalid platform = '$PLAT', supported values are 'intel' or 'x86_64'"
exit 1 exit 1
fi 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
......
...@@ -9,6 +9,7 @@ source $MULTIBUILD_DIR/common_utils.sh ...@@ -9,6 +9,7 @@ source $MULTIBUILD_DIR/common_utils.sh
MACPYTHON_URL=https://www.python.org/ftp/python MACPYTHON_URL=https://www.python.org/ftp/python
MACPYTHON_PY_PREFIX=/Library/Frameworks/Python.framework/Versions MACPYTHON_PY_PREFIX=/Library/Frameworks/Python.framework/Versions
MACPYTHON_DEFAULT_OSX="10.6" MACPYTHON_DEFAULT_OSX="10.6"
MB_PYTHON_OSX_VER=${MB_PYTHON_OSX_VER:-$MACPYTHON_DEFAULT_OSX}
GET_PIP_URL=https://bootstrap.pypa.io/get-pip.py GET_PIP_URL=https://bootstrap.pypa.io/get-pip.py
DOWNLOADS_SDIR=downloads DOWNLOADS_SDIR=downloads
WORKING_SDIR=working WORKING_SDIR=working
...@@ -123,8 +124,7 @@ function pyinst_fname_for_version { ...@@ -123,8 +124,7 @@ function pyinst_fname_for_version {
# $py_version (python version in major.minor.extra format) # $py_version (python version in major.minor.extra format)
# $py_osx_ver: {major.minor | not defined} # $py_osx_ver: {major.minor | not defined}
# if defined, the macosx version that python is built for, e.g. # if defined, the macosx version that python is built for, e.g.
# "10.6" or "10.9", if not defined, uses the default # "10.6" or "10.9", if not defined, uses the default MACPYTHON_DEFAULT_OSX
# MACPYTHON_DEFAULT_OSX
# Note: this is the version the Python is built for, and hence # Note: this is the version the Python is built for, and hence
# the min version supported, NOT the version of the current system # the min version supported, NOT the version of the current system
local py_version=$1 local py_version=$1
...@@ -134,16 +134,15 @@ function pyinst_fname_for_version { ...@@ -134,16 +134,15 @@ function pyinst_fname_for_version {
} }
function mac_arch_for_pyosx_version { function mac_cpython_arch_for_osx_ver {
# echo arch (intel or x86_64) that cpython builds targetted for the # echo arch (intel or x86_64) for cpython python.org builds targetted for
# given minimum macOS are targetted for # the given minimum macOS version
# Parameters # Parameters
# $py_osx_ver (major.minor | not defined} # $py_osx_ver (major.minor | not defined}
# if defined, the macosx version that python is built for, e.g. # the macosx version that python is built for, e.g.
# "10.6" or "10.9", if not defined, uses the default # "10.6" or "10.9", or MB_PYTHON_OSX_VER if undefined
# MACPYTHON_DEFAULT_OSX #
py_osx_ver=${1:-$MACPYTHON_DEFAULT_OSX} py_osx_ver=${1:-$MB_PYTHON_OSX_VER}
check_var $py_osx_ver
if [[ "$py_osx_ver" == "10.6" ]]; then if [[ "$py_osx_ver" == "10.6" ]]; then
echo "intel" echo "intel"
elif [[ "$py_osx_ver" == "10.9" ]]; then elif [[ "$py_osx_ver" == "10.9" ]]; then
...@@ -301,8 +300,10 @@ function get_macpython_environment { ...@@ -301,8 +300,10 @@ function get_macpython_environment {
# $venv_dir : {directory_name|not defined} # $venv_dir : {directory_name|not defined}
# If defined - make virtualenv in this directory, set python / pip # If defined - make virtualenv in this directory, set python / pip
# commands accordingly # commands accordingly
# NOTE: to use the default for $py_osx_ver while defining $venv_dir, set # $py_osx_ver: {major.minor | not defined}
# $py_osx_ver to "" (empty string) # if defined, the macosx version that python is built for, e.g.
# "10.6" or "10.9", if not defined, use the version from the
# environment variable MB_PYTHON_OSX_VER
# #
# Installs Python # Installs Python
# Sets $PYTHON_EXE to path to Python executable # Sets $PYTHON_EXE to path to Python executable
......
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