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

# Get needed utilities
6
7
8
MULTIBUILD_DIR=$(dirname "${BASH_SOURCE[0]}")
source $MULTIBUILD_DIR/terryfy/travis_tools.sh
source $MULTIBUILD_DIR/common_utils.sh
9
10
11
12
13
14
15
16
17

function before_install {
    export CC=clang
    export CXX=clang++
    get_python_environment macpython $TRAVIS_PYTHON_VERSION venv
    source venv/bin/activate
    pip install --upgrade pip wheel
}

18
19
function build_wheel {
    # Builds wheel, puts into $WHEEL_SDIR
20
21
    #
    # Depends on
22
    #  WHEEL_SDIR
23
    #  BUILD_DEPENDS
24
    #  REPO_DIR | PKG_SPEC
25
    #  BUILD_COMMIT
26
    local wheelhouse=$PWD/$WHEEL_SDIR
27
    if [ -n "$BUILD_PRE_SCRIPT" ]; then source $BUILD_PRE_SCRIPT; fi
Matthew Brett's avatar
Matthew Brett committed
28
    if [ -n "$BUILD_DEPENDS" ]; then pip install $BUILD_DEPENDS; fi
29
30
31
32
33
    if [ -n "$REPO_DIR" ]; then
        cd $REPO_DIR
        git fetch origin
        git checkout $BUILD_COMMIT
        git clean -fxd
34
        pip wheel -w $wheelhouse --no-deps .
35
36
        cd ..
    else
37
        pip wheel -w $wheelhouse --no-deps $PKG_SPEC
38
    fi
39
    pip install delocate
40
41
42
    delocate-listdeps $wheelhouse/*.whl # lists library dependencies
    delocate-wheel $wheelhouse/*.whl # copies library dependencies into wheel
    delocate-addplat --rm-orig -x 10_9 -x 10_10 $wheelhouse/*.whl
43
}