Skip to content

Commit a724dfc

Browse files
committed
Add new formula for python3 and latest 3.6 and 3.7 patches
1 parent aecdedd commit a724dfc

File tree

3 files changed

+15
-7
lines changed

3 files changed

+15
-7
lines changed

builds/runtimes/python-3.6.9

100644100755
File mode changed.

builds/runtimes/python-3.7.4

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/usr/bin/env bash
2+
# Build Path: /app/.heroku/python/
3+
# Build Deps: libraries/sqlite
4+
5+
source $(dirname $0)/python3

builds/runtimes/python3

100644100755
Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,16 @@ set -o pipefail
66
set -eu
77

88
OUT_PREFIX=$1
9+
BIN_DIR="$(cd "$(dirname "$0")"/../.. || exit; pwd)/bin"
10+
export BIN_DIR
911

1012
dep_formula=${0#$WORKSPACE_DIR/} # this is the original script, e.g. pypy-5.3.1
1113
dep_name=$(basename $BASH_SOURCE) # this is us
12-
dep_version=${dep_formula##*"/${dep_name}-"} # "subtract" our name from full version name
13-
dep_package=$(echo $dep_name | tr p P)-${dep_version} # it's always "Python-…"
14-
dep_dirname=${dep_package}-linux64 # this is uppercased
15-
dep_archive_name=${dep_dirname}.tar.bz2 # this is uppercased too
16-
dep_url=https://python.org/ftp/python/${dep_version}/${dep_package}.tgz
1714

15+
BASE=${dep_formula##*/}
16+
python_version=${BASE^}
17+
version_number=$(echo "$python_version" | cut -d- -f2)
18+
dep_url=https://python.org/ftp/python/${version_number}/${python_version}.tgz
1819

1920
# echo "Installing necesary sqlite headers"
2021
# # install the necessary sqlite headers
@@ -30,10 +31,12 @@ echo "Setting up SQLite3 Headers for $SQLITE3_VERSION"
3031
sqlite3_install "$OUT_PREFIX" "$SQLITE3_VERSION" 1
3132

3233
echo "Building Python 3..."
34+
echo "Pulling from source: ${dep_url}"
3335

34-
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
3536

36-
mv "${dep_package}" src
37+
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
38+
echo "`ls`"
39+
mv "${OUT_PREFIX}/${python_version}" src
3740
cd src
3841

3942
./configure --prefix=$OUT_PREFIX --with-ensurepip=no

0 commit comments

Comments
 (0)