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
```
This commit is contained in:
cclauss
2014-08-23 09:38:30 +02:00
parent 361eb53257
commit ee93719b79
+20
View File
@@ -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
}