travis_osx_steps.sh 1.43 KB
Newer Older
1
#!/bin/bash
2
# Wheel build, install, run test steps on OSX
3
4
set -e

5
6
7
8
9
if ([ "$GITHUB_WORKFLOW" != "" ] || [ "$PIPELINE_WORKSPACE" != "" ]) && [ "$SDKROOT" == "" ] && ([ "$PLAT" == "arm64" ] || [ "$PLAT" == "universal2" ]); then
    sudo xcode-select -switch /Applications/Xcode_12.2.app
    export SDKROOT=/Applications/Xcode_12.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.0.sdk
fi

10
# Get needed utilities
11
MULTIBUILD_DIR=$(dirname "${BASH_SOURCE[0]}")
12
MB_PYTHON_VERSION=${MB_PYTHON_VERSION:-$TRAVIS_PYTHON_VERSION}
13
14
15

ENV_VARS_PATH=${ENV_VARS_PATH:-env_vars.sh}

16
# These load common_utils.sh
Matthew Brett's avatar
Matthew Brett committed
17
source $MULTIBUILD_DIR/osx_utils.sh
18
19
MB_PYTHON_OSX_VER=${MB_PYTHON_OSX_VER:-$(macpython_sdk_for_version $MB_PYTHON_VERSION)}

20
if [ -r "$ENV_VARS_PATH" ]; then source "$ENV_VARS_PATH"; fi
21
source $MULTIBUILD_DIR/configure_build.sh
22
source $MULTIBUILD_DIR/library_builders.sh
23

24
25
# NB - config.sh sourced at end of this function.
# config.sh can override any function defined here.
26
27
28
29

function before_install {
    export CC=clang
    export CXX=clang++
30

31
    get_macpython_environment $MB_PYTHON_VERSION venv
32
33
34
35
    source venv/bin/activate
    pip install --upgrade pip wheel
}

36
# build_wheel function defined in common_utils (via osx_utils)
37
# install_run function defined in common_utils
38
39

# Local configuration may define custom pre-build, source patching.
40
# It can also overwrite the functions above.
41
42
CONFIG_PATH=${CONFIG_PATH:-config.sh}
source "$CONFIG_PATH"