mirror of
https://github.com/kennethreitz/heroku-buildpack-python.git
synced 2026-06-05 23:10:16 +00:00
23 lines
769 B
Bash
Executable File
23 lines
769 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
# fail hard
|
|
set -o pipefail
|
|
# fail harder
|
|
set -eu
|
|
|
|
OUT_PREFIX=$1
|
|
|
|
dep_formula=${0#$WORKSPACE_DIR/} # this is the original script, e.g. pypy-5.3.1
|
|
dep_name=$(basename $BASH_SOURCE) # this is us
|
|
dep_version=${dep_formula##*"/${dep_name}-"} # "subtract" our name from full version name
|
|
dep_package=${dep_name}${dep_version_prefix:-}-v${dep_version}${dep_version_suffix:-}
|
|
dep_dirname=${dep_package}-linux64
|
|
dep_archive_name=${dep_dirname}.tar.bz2
|
|
dep_url=https://bitbucket.org/pypy/pypy/downloads/${dep_archive_name}
|
|
|
|
echo "Building PyPy3…"
|
|
|
|
curl -L "${dep_url}" | tar jx -C "${OUT_PREFIX}" --strip-components 1 # extract to $OUT_PREFIX, drop the first directory level, which is the archive name
|
|
|
|
ln "$OUT_PREFIX/bin/pypy3" "$OUT_PREFIX/bin/python"
|