travis_osx_steps.sh 1.11 KB
Newer Older
1
#!/bin/bash
2
# Install and wheel building steps on OSX
3
4
5
set -e

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

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
}

function build_wheels {
    # Builds wheel, puts into $WHEELHOUSE
    #
    # Depends on
22
    #  REPO_DIR | PKG_SPEC
23
24
25
    #  BUILD_DEPENDS
    #  BUILD_COMMIT
    #  WHEELHOUSE
Matthew Brett's avatar
Matthew Brett committed
26
    if [ -n "$BUILD_DEPENDS" ]; then pip install $BUILD_DEPENDS; fi
27
28
29
30
31
32
33
34
35
36
    if [ -n "$REPO_DIR" ]; then
        cd $REPO_DIR
        git fetch origin
        git checkout $BUILD_COMMIT
        git clean -fxd
        pip wheel -w $WHEELHOUSE --no-deps .
        cd ..
    else
        pip wheel -w $WHEELHOUSE --no-deps $PKG_SPEC
    fi
37
38
39
40
41
    pip install delocate
    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
}