docker_build_package.sh 1.44 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/bin/bash
# Depends on:
#   REPO_DIR | PKG_SPEC
#       (REPO_DIR for in source build; PKG_SPEC for pip build)
#   PYTHON_VERSION
#   BUILD_COMMIT
#   UNICODE_WIDTH  (can be empty)
#   BUILD_DEPENDS  (can be empty)
set -e

# Manylinux, openblas version, lex_ver, Python versions
MULTIBUILD_DIR=$(dirname "${BASH_SOURCE[0]}")
source $MULTIBUILD_DIR/manylinux_utils.sh
source $MULTIBUILD_DIR/common_utils.sh

# Configuration for this package
source /io/config_funcs.sh

# Unicode widths
UNICODE_WIDTH=${UNICODE_WIDTH:-32}
WHEEL_SDIR=${WHEEL_SDIR:-wheelhouse}

# Do any building prior to package building
if [ -n $(is_function "pre_build") ]; then
    # Library building tools
    source $MULTIBUILD_DIR/docker_lib_builders.sh
    pre_build
fi

# Directory to store wheels
rm_mkdir /unfixed_wheels

if [ -n "$REPO_DIR" ]; then
    # Enter source tree
    cd /io/$REPO_DIR
    build_source="."
elif [ -n "$PKG_SPEC" ]; then
    build_source=$PKG_SPEC
else:
    echo "Must specify REPO_DIR or PKG_SPEC"
    exit 1
fi

WHEELHOUSE=/io/$WHEEL_SDIR

# Compile wheel
PIP="$(cpython_path $PYTHON_VERSION $UNICODE_WIDTH)/bin/pip"
if [ -n "$BUILD_DEPENDS" ]; then
    $PIP install -f $MANYLINUX_URL $BUILD_DEPENDS
fi
clean_fix_source $BUILD_COMMIT
if [ -n "$REPO_DIR" ]; then clean_fix_source $BUILD_COMMIT; fi
$PIP wheel -f $MANYLINUX_URL -w /unfixed_wheels --no-deps $build_source

# Bundle external shared libraries into the wheels
repair_wheelhouse /unfixed_wheels $WHEELHOUSE