From a724dfc62ebac9ade3e10adb9e6a1d1c5157b62f Mon Sep 17 00:00:00 2001 From: Casey Faist Date: Thu, 29 Aug 2019 15:08:54 -0700 Subject: [PATCH] Add new formula for python3 and latest 3.6 and 3.7 patches --- builds/runtimes/python-3.6.9 | 0 builds/runtimes/python-3.7.4 | 5 +++++ builds/runtimes/python3 | 17 ++++++++++------- 3 files changed, 15 insertions(+), 7 deletions(-) mode change 100644 => 100755 builds/runtimes/python-3.6.9 create mode 100755 builds/runtimes/python-3.7.4 mode change 100644 => 100755 builds/runtimes/python3 diff --git a/builds/runtimes/python-3.6.9 b/builds/runtimes/python-3.6.9 old mode 100644 new mode 100755 diff --git a/builds/runtimes/python-3.7.4 b/builds/runtimes/python-3.7.4 new file mode 100755 index 0000000..dea889d --- /dev/null +++ b/builds/runtimes/python-3.7.4 @@ -0,0 +1,5 @@ +#!/usr/bin/env bash +# Build Path: /app/.heroku/python/ +# Build Deps: libraries/sqlite + +source $(dirname $0)/python3 diff --git a/builds/runtimes/python3 b/builds/runtimes/python3 old mode 100644 new mode 100755 index 730e874..c0712c8 --- a/builds/runtimes/python3 +++ b/builds/runtimes/python3 @@ -6,15 +6,16 @@ set -o pipefail set -eu OUT_PREFIX=$1 +BIN_DIR="$(cd "$(dirname "$0")"/../.. || exit; pwd)/bin" +export BIN_DIR 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=$(echo $dep_name | tr p P)-${dep_version} # it's always "Python-…" -dep_dirname=${dep_package}-linux64 # this is uppercased -dep_archive_name=${dep_dirname}.tar.bz2 # this is uppercased too -dep_url=https://python.org/ftp/python/${dep_version}/${dep_package}.tgz +BASE=${dep_formula##*/} +python_version=${BASE^} +version_number=$(echo "$python_version" | cut -d- -f2) +dep_url=https://python.org/ftp/python/${version_number}/${python_version}.tgz # echo "Installing necesary sqlite headers" # # install the necessary sqlite headers @@ -30,10 +31,12 @@ echo "Setting up SQLite3 Headers for $SQLITE3_VERSION" sqlite3_install "$OUT_PREFIX" "$SQLITE3_VERSION" 1 echo "Building Python 3..." +echo "Pulling from source: ${dep_url}" -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 -mv "${dep_package}" src +curl -L "${dep_url}" | tar xz -C "${OUT_PREFIX}" # --strip-components 1 # extract to $OUT_PREFIX, drop the first directory level, which is the archive name +echo "`ls`" +mv "${OUT_PREFIX}/${python_version}" src cd src ./configure --prefix=$OUT_PREFIX --with-ensurepip=no