docker_build_wrap.sh 1.58 KB
Newer Older
1
2
#!/bin/bash
# Depends on:
3
#   BUILD_COMMANDS
4
#   PYTHON_VERSION
5
#   BUILD_COMMIT (may be used by config.sh)
6
#   UNICODE_WIDTH  (can be empty)
7
#   BUILD_DEPENDS  (may be used by config.sh, can be empty)
8
9
set -e

10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
function activate_ccache {
    # Link up the correct location for ccache
    ln -s /parent-home/.ccache $HOME/.ccache

    # Now install ccache
    yum install -y ccache

    # Create fake compilers and prepend them to the PATH
    # Note that yum is supposed to create these for us,
    # but I had trouble finding them
    local ccache_dir=/usr/lib/ccache/compilers
    mkdir -p $ccache_dir
    ln -s /usr/bin/ccache $CCACHE_DIR/gcc
    ln -s /usr/bin/ccache $CCACHE_DIR/g++
    ln -s /usr/bin/ccache $CCACHE_DIR/cc
    ln -s /usr/bin/ccache $CCACHE_DIR/c++
    export PATH=$CCACHE_DIR:$PATH

    # Prove to the developer that ccache is activated
    which gcc
}

xoviat's avatar
xoviat committed
32
if [ $USE_CCACHE == 1 ]; then
33
    activate_ccache
xoviat's avatar
xoviat committed
34
35
fi

36
37
38
39
40
41
# Unicode width, default 32
UNICODE_WIDTH=${UNICODE_WIDTH:-32}

# Location of wheels, default "wheelhouse"
WHEEL_SDIR=${WHEEL_SDIR:-wheelhouse}

42
# Always pull in common and library builder utils
43
MULTIBUILD_DIR=$(dirname "${BASH_SOURCE[0]}")
44
# These routines also source common_utils.sh
45
source $MULTIBUILD_DIR/manylinux_utils.sh
46
source $MULTIBUILD_DIR/library_builders.sh
47
48
49
50
51
52
53
54
55
56
57

# Set PATH for chosen Python, Unicode width
export PATH="$(cpython_path $PYTHON_VERSION $UNICODE_WIDTH)/bin:$PATH"

# Change into root directory of repo
cd /io

# Configuration for this package, possibly overriding `build_wheel` defined in
# `common_utils.sh` via `manylinux_utils.sh`.
source config.sh

58
$BUILD_COMMANDS