Skip to content

Instantly share code, notes, and snippets.

@brennie
Created February 7, 2018 21:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brennie/6b37d1e9416a736d14f7f6d92afb107e to your computer and use it in GitHub Desktop.
Save brennie/6b37d1e9416a736d14f7f6d92afb107e to your computer and use it in GitHub Desktop.
#!/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