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

# Get needed utilities
6
MULTIBUILD_DIR=$(dirname "${BASH_SOURCE[0]}")
Matthew Brett's avatar
Matthew Brett committed
7
source $MULTIBUILD_DIR/osx_utils.sh
8
9
10

# Local configuration may define custom pre-build, source patching
source $PWD/config_funcs.sh
11
12
13
14

function before_install {
    export CC=clang
    export CXX=clang++
Matthew Brett's avatar
Matthew Brett committed
15
    get_macpython_environment $TRAVIS_PYTHON_VERSION venv
16
17
18
19
    source venv/bin/activate
    pip install --upgrade pip wheel
}

20
21
function build_wheel {
    # Builds wheel, puts into $WHEEL_SDIR
22
23
    #
    # Depends on
24
    #  WHEEL_SDIR
25
    #  BUILD_DEPENDS
26
    #  REPO_DIR | PKG_SPEC
27
    #  BUILD_COMMIT
28
    local wheelhouse=$PWD/$WHEEL_SDIR
29
    if [ -n $(is_function "pre_build") ]; then pre_build; fi
Matthew Brett's avatar
Matthew Brett committed
30
    if [ -n "$BUILD_DEPENDS" ]; then pip install $BUILD_DEPENDS; fi
31
    if [ -n "$REPO_DIR" ]; then
32
33
34
        (cd $REPO_DIR \
            && clean_fix_source $BUILD_COMMIT \
            && pip wheel -w $wheelhouse --no-deps .)
35
    else
36
        pip wheel -w $wheelhouse --no-deps $PKG_SPEC
37
    fi
38
    pip install delocate
39
40
41
    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
42
}