Created
February 7, 2018 21:57
-
-
Save brennie/6b37d1e9416a736d14f7f6d92afb107e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -euo pipefail | |
if (( $# != 1 )); then | |
echo "usage: ${0} PYSVN_ARCHIVE" | |
exit 1 | |
fi | |
OUTPUT_DIR="$(pwd)" | |
PYSVN_ARCHIVE="${1}" | |
PYSVN_VERSION="$(echo "${PYSVN_ARCHIVE}" | sed -E 's/pysvn-(.+).tar.gz/\1/')" | |
BUILD_DIR=$(mktemp -d) | |
PYSVN_DIR="${BUILD_DIR}/pysvn-${PYSVN_VERSION}" | |
export MACOSX_DEPLOYMENT_TARGET=$( | |
sw_vers | | |
gawk '/ProductVersion/ { print gensub(/10\.([0-9]+)\..*/, "10.\\1", 1, $2); }' | |
) | |
tar -xzf "${PYSVN_ARCHIVE}" -C "${BUILD_DIR}" | |
cd "${PYSVN_DIR}" | |
PYCXX_DIR="$(pwd)/$(find Import -type d -depth 1)" | |
cd Source | |
python setup.py configure \ | |
--link-python-framework-via-dynamic-lookup \ | |
--pycxx-dir="${PYCXX_DIR}" | |
make | |
cd .. | |
python setup.py bdist_wheel | |
mv -- dist/*.whl "${OUTPUT_DIR}" | |
rm -rf -- "${PYSVN_DIR}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment