|
#!/bin/bash |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
set -e -x |
|
|
|
|
|
if [[ -z "${REPO_ROOT}" ]]; then |
|
echo "REPO_ROOT environment variable should be set by the caller." |
|
exit 1 |
|
fi |
|
if [[ -z "${PY_BIN}" ]]; then |
|
echo "PY_BIN environment variable should be set by the caller." |
|
exit 1 |
|
fi |
|
if [[ -z "${PY_TAG}" ]]; then |
|
echo "PY_TAG environment variable should be set by the caller." |
|
exit 1 |
|
fi |
|
|
|
|
|
VENV=${REPO_ROOT}/venv${PY_BIN} |
|
${PY_BIN} -m venv ${VENV} |
|
curl https://bootstrap.pypa.io/get-pip.py | ${VENV}/bin/python |
|
${VENV}/bin/python -m pip install \ |
|
--requirement ${REPO_ROOT}/scripts/dev-requirements.txt |
|
|
|
|
|
DIST_WHEELS="${REPO_ROOT}/dist_wheels" |
|
mkdir -p ${DIST_WHEELS} |
|
cd ${REPO_ROOT} |
|
${VENV}/bin/python setup.py build_ext \ |
|
--include-dirs=${REPO_ROOT}/usr/include \ |
|
--library-dirs=${REPO_ROOT}/usr/lib \ |
|
--rpath=${REPO_ROOT}/usr/lib |
|
${VENV}/bin/python -m pip wheel ${REPO_ROOT} --wheel-dir ${DIST_WHEELS} |
|
|
|
|
|
FIXED_WHEELS="${REPO_ROOT}/wheels" |
|
mkdir -p ${FIXED_WHEELS} |
|
${VENV}/bin/delocate-wheel \ |
|
--wheel-dir ${FIXED_WHEELS} \ |
|
--verbose \ |
|
${DIST_WHEELS}/google_crc32c*${PY_TAG}*.whl |
|
|
|
|
|
rm -fr ${DIST_WHEELS} |
|
rm -fr ${VENV} |
|
|