mirror of
https://github.com/kennethreitz/heroku-buildpack-python.git
synced 2026-06-05 23:10:16 +00:00
Compare commits
16 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a0029a8411 | |||
| 2de3b6cf1c | |||
| fd19ec2c6a | |||
| 6aec3ed37a | |||
| 7f7f0f7e3d | |||
| dd210c9002 | |||
| 2ae4bd156f | |||
| 8740fcdbad | |||
| fb18948243 | |||
| e104d36785 | |||
| 1786231a49 | |||
| fa8e09ae9c | |||
| 2dd212d020 | |||
| 15acd305d1 | |||
| 5a65a39c5e | |||
| f18754f8f0 |
+4
-1
@@ -159,11 +159,14 @@ source $BIN_DIR/steps/mercurial
|
|||||||
# Pylibmc support.
|
# Pylibmc support.
|
||||||
source $BIN_DIR/steps/pylibmc
|
source $BIN_DIR/steps/pylibmc
|
||||||
|
|
||||||
|
# Libffi support.
|
||||||
|
source $BIN_DIR/steps/cryptography
|
||||||
|
|
||||||
# Install dependencies with Pip.
|
# Install dependencies with Pip.
|
||||||
source $BIN_DIR/steps/pip-install
|
source $BIN_DIR/steps/pip-install
|
||||||
|
|
||||||
# Django collectstatic support.
|
# Django collectstatic support.
|
||||||
source $BIN_DIR/steps/collectstatic
|
sub-env $BIN_DIR/steps/collectstatic
|
||||||
|
|
||||||
|
|
||||||
# ### Finalize
|
# ### Finalize
|
||||||
|
|||||||
Executable
+37
@@ -0,0 +1,37 @@
|
|||||||
|
#!/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](http://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 cryptography binary.
|
||||||
|
VENDORED_LIBFFI="http://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 pylibmc exists within requirements, use vendored cryptography.
|
||||||
|
if (pip-grep -s requirements.txt cffi pylibmc &> /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.
|
||||||
|
curl $VENDORED_LIBFFI -s | tar zxv -C .heroku/vendor &> /dev/null
|
||||||
|
|
||||||
|
export LIBFFI=$(pwd)/vendor
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
bpwatch stop libffi_install
|
||||||
@@ -3,7 +3,11 @@ set +e
|
|||||||
bpwatch start pip_uninstall
|
bpwatch start pip_uninstall
|
||||||
if [[ -f .heroku/python/requirements-declared.txt ]]; then
|
if [[ -f .heroku/python/requirements-declared.txt ]]; then
|
||||||
|
|
||||||
pip-diff --stale .heroku/python/requirements-declared.txt requirements.txt > .heroku/python/requirements-stale.txt
|
cp .heroku/python/requirements-declared.txt requirements-declared.txt
|
||||||
|
|
||||||
|
pip-diff --stale requirements-declared.txt requirements.txt > .heroku/python/requirements-stale.txt
|
||||||
|
|
||||||
|
rm -fr requirements-declared.txt
|
||||||
|
|
||||||
if [[ -s .heroku/python/requirements-stale.txt ]]; then
|
if [[ -s .heroku/python/requirements-stale.txt ]]; then
|
||||||
puts-step "Uninstalling stale dependencies"
|
puts-step "Uninstalling stale dependencies"
|
||||||
|
|||||||
+8
-11
@@ -10,30 +10,27 @@
|
|||||||
# This script is invoked by [`bin/compile`](/).
|
# This script is invoked by [`bin/compile`](/).
|
||||||
|
|
||||||
# The location of the pre-compiled libmemcached binary.
|
# The location of the pre-compiled libmemcached binary.
|
||||||
VENDORED_MEMCACHED="http://cl.ly/0a191R3K160t1w1P0N25/vendor-libmemcached.tar.gz"
|
VENDORED_MEMCACHED="http://lang-python.s3.amazonaws.com/$STACK/libraries/vendor/libmemcache.tar.gz"
|
||||||
|
|
||||||
# Syntax sugar.
|
# Syntax sugar.
|
||||||
source $BIN_DIR/utils
|
source $BIN_DIR/utils
|
||||||
|
|
||||||
|
|
||||||
bpwatch start pylibmc_install
|
bpwatch start pylibmc_install
|
||||||
|
|
||||||
# If pylibmc exists within requirements, use vendored libmemcached.
|
# If pylibmc exists within requirements, use vendored libmemcached.
|
||||||
if (pip-grep -s requirements.txt pylibmc) then
|
if (pip-grep -s requirements.txt pylibmc &> /dev/null) then
|
||||||
echo "-----> Noticed pylibmc. Bootstrapping libmemcached."
|
|
||||||
cd .heroku
|
|
||||||
|
|
||||||
if [ -d "vendor/lib/sasl2" ]; then
|
if [ -d ".heroku/vendor/lib/sasl2" ]; then
|
||||||
export LIBMEMCACHED=$(pwd)/vendor
|
export LIBMEMCACHED=$(pwd)/vendor
|
||||||
else
|
else
|
||||||
|
echo "-----> Noticed pylibmc. Bootstrapping libmemcached."
|
||||||
|
mkdir -p .heroku/vendor
|
||||||
# Download and extract libmemcached into target vendor directory.
|
# Download and extract libmemcached into target vendor directory.
|
||||||
curl -s -L -o tmp-libmemcached.tar.gz $VENDORED_MEMCACHED
|
curl $VENDORED_MEMCACHED -s | tar zxv -C .heroku/vendor &> /dev/null
|
||||||
tar -zxvf tmp-libmemcached.tar.gz > /dev/null
|
|
||||||
rm tmp-libmemcached.tar.gz
|
|
||||||
export LIBMEMCACHED=$(pwd)/vendor
|
export LIBMEMCACHED=$(pwd)/vendor
|
||||||
fi
|
fi
|
||||||
|
|
||||||
export LIBMEMCACHED=$(pwd)/vendor
|
|
||||||
cd ..
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
bpwatch stop pylibmc_install
|
bpwatch stop pylibmc_install
|
||||||
|
|||||||
Vendored
+5
-8
@@ -1,6 +1,5 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
# Build Path: /app/.heroku/python/
|
# Build Path: /app/.heroku/vendor/
|
||||||
# Build Deps: libraries/autoconf
|
|
||||||
|
|
||||||
OUT_PREFIX=$1
|
OUT_PREFIX=$1
|
||||||
|
|
||||||
@@ -11,14 +10,12 @@ hash -r
|
|||||||
|
|
||||||
echo "Building libffi..."
|
echo "Building libffi..."
|
||||||
|
|
||||||
SOURCE_TARBALL='https://github.com/atgreen/libffi/archive/master.tar.gz'
|
SOURCE_TARBALL='http://cl.ly/2s1t1u3v0N0I/download/libffi-3.1.tar'
|
||||||
|
|
||||||
curl -L $SOURCE_TARBALL | tar xz
|
curl -L $SOURCE_TARBALL | tar x
|
||||||
mv libffi-master libffi
|
|
||||||
|
|
||||||
cd libffi
|
cd libffi-3.1
|
||||||
./autogen.sh
|
./configure --prefix=$OUT_PREFIX --disable-static &&
|
||||||
./configure --prefix=$OUT_PREFIX --enable-shared
|
|
||||||
make
|
make
|
||||||
make install
|
make install
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user