forked from cloudfoundry/python-buildpack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcryptography
More file actions
executable file
·39 lines (30 loc) · 1.38 KB
/
cryptography
File metadata and controls
executable file
·39 lines (30 loc) · 1.38 KB
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
#!/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 libffi binary.
VENDORED_LIBFFI="https://lang-python.s3.amazonaws.com/$STACK/libraries/vendor/libffi.tar.gz"
PKG_CONFIG_PATH="/app/.heroku/vendor/lib/pkgconfig:$PKG_CONFIG_PATH"
# Syntax sugar.
source $BIN_DIR/utils
bpwatch start libffi_install
# If a package using cffi exists within requirements, use vendored libffi.
if (pip-grep -s requirements.txt bcrypt cffi cryptography django[bcrypt] Django[bcrypt] PyNaCl pyOpenSSL PyOpenSSL requests[security] misaka &> /dev/null) then
if [ -d ".heroku/vendor/lib/libffi-3.1.1" ]; then
export LIBFFI=$(pwd)/vendor
else
echo "-----> Noticed cffi. Bootstrapping libffi."
mkdir -p .heroku/vendor
# Download and extract cryptography into target vendor directory.
echo "Downloaded [`translate_dependency_url $VENDORED_LIBFFI`]"
# Download and extract libffi into target vendor directory.
curl `translate_dependency_url $VENDORED_LIBFFI` -s | tar zxv -C .heroku/vendor &> /dev/null
export LIBFFI=$(pwd)/vendor
fi
fi
bpwatch stop libffi_install