From ee93719b79219551dc2cfca252a7e4376e6d01e4 Mon Sep 17 00:00:00 2001 From: cclauss <cclauss@bluewin.ch> Date: Sat, 23 Aug 2014 09:38:30 +0200 Subject: [PATCH] Add download_python function to reduce repetition Create a common download_python() function that allows most other files in the build/runtimes directory to be simplified to something of the form: ``` #!/usr/bin/env bash # Build Path: /app/.heroku/python/ # Build Deps: libraries/sqlite OUT_PREFIX=$1 source ./download_python download_python "2.7.8" cd src ./configure --prefix=$OUT_PREFIX make make install ``` --- builds/runtimes/download_python | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 builds/runtimes/download_python diff --git a/builds/runtimes/download_python b/builds/runtimes/download_python new file mode 100644 index 00000000..c57a6ab2 --- /dev/null +++ b/builds/runtimes/download_python @@ -0,0 +1,20 @@ +#!/usr/bin/env bash +# Build Path: /app/.heroku/python/ +# Build Deps: libraries/sqlite + +# download_python(PYTHON_VERSION) +# Example usage: download_python "2.7.8" +download_python() +{ + PYTHON_VERSION=$1 + + if [ -z $PYTHON_VERSION ] + then + $PYTHON_VERSION="2.7.8" + fi + + echo "Building Python $PYTHON_VERSION..." + SOURCE_TARBALL="http://python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tgz" + curl -L $SOURCE_TARBALL | tar xz + mv Python-$PYTHON_VERSION src +} -- GitLab