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

11
12
13
# Change into root directory of repo
cd /io

14
15
16
17
18
19
# Unicode width, default 32
UNICODE_WIDTH=${UNICODE_WIDTH:-32}

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

20
21
22
# Location of `config.sh` file, default "./config.sh"
CONFIG_PATH=${CONFIG_PATH:-config.sh}

23
# Path is relative to repository from which we ran
24
ENV_VARS_PATH=${ENV_VARS_PATH:-env_vars.sh}
25

26
# Always pull in common and library builder utils
27
MULTIBUILD_DIR=$(dirname "${BASH_SOURCE[0]}")
28
# These routines also source common_utils.sh
29
source $MULTIBUILD_DIR/manylinux_utils.sh
30
if [ -r "$ENV_VARS_PATH" ]; then source "$ENV_VARS_PATH"; fi
31
source $MULTIBUILD_DIR/configure_build.sh
32
source $MULTIBUILD_DIR/library_builders.sh
33

xoviat's avatar
xoviat committed
34
35
36
37
if [ "$USE_CCACHE" == "1" ]; then
    activate_ccache
fi

mattip's avatar
mattip committed
38
39
40
41
42
43
44
45
46
47
48
# The following also sets PYTHON_EXE and PIP_CMD
if [ "${PYTHON_VERSION:0:4}" == "pypy" ]; then
  install_pypy $PYTHON_VERSION
  export PATH=$(dirname $PYTHON_EXE):$PATH
else
  # Set PATH for chosen Python, Unicode width
  PYTHON_EXE=$(cpython_path $PYTHON_VERSION $UNICODE_WIDTH)/bin/python
  ls $(dirname $PYTHON_EXE)
  export PATH="$(dirname $PYTHON_EXE):$PATH"
  install_pip
fi
49
50
51

# Configuration for this package, possibly overriding `build_wheel` defined in
# `common_utils.sh` via `manylinux_utils.sh`.
52
source "$CONFIG_PATH"
53

54
$BUILD_COMMANDS