mirror of
https://github.com/kennethreitz/heroku-buildpack-python.git
synced 2026-06-05 23:10:16 +00:00
a259143c0b
Since we need to set it regardless of whether the vendored library existed previously or not.
35 lines
1.0 KiB
Bash
Executable File
35 lines
1.0 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
# This script serves as the Pylibmc build step of the
|
|
# [**Python Buildpack**](https://github.com/heroku/heroku-buildpack-python)
|
|
# compiler.
|
|
#
|
|
# A [buildpack](https://devcenter.heroku.com/articles/buildpacks) is an
|
|
# adapter between a Python application and Heroku's runtime.
|
|
#
|
|
# This script is invoked by [`bin/compile`](/).
|
|
|
|
# The location of the pre-compiled libmemcached binary.
|
|
VENDORED_MEMCACHED="https://lang-python.s3.amazonaws.com/$STACK/libraries/vendor/libmemcache.tar.gz"
|
|
|
|
# Syntax sugar.
|
|
source $BIN_DIR/utils
|
|
|
|
|
|
bpwatch start pylibmc_install
|
|
|
|
# If pylibmc exists within requirements, use vendored libmemcached.
|
|
if (pip-grep -s requirements.txt pylibmc &> /dev/null) then
|
|
|
|
if [ ! -d ".heroku/vendor/lib/sasl2" ]; then
|
|
echo "-----> Noticed pylibmc. Bootstrapping libmemcached."
|
|
mkdir -p .heroku/vendor
|
|
# Download and extract libmemcached into target vendor directory.
|
|
curl $VENDORED_MEMCACHED -s | tar zxv -C .heroku/vendor &> /dev/null
|
|
fi
|
|
|
|
export LIBMEMCACHED=$(pwd)/vendor
|
|
fi
|
|
|
|
bpwatch stop pylibmc_install
|