File tree Expand file tree Collapse file tree 2 files changed +39
-5
lines changed Expand file tree Collapse file tree 2 files changed +39
-5
lines changed Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+ # Build Path: /app/.heroku/python/
3
+
4
+ OUT_PREFIX=$1
5
+ BIN_DIR=" $( cd " $( dirname " $0 " ) " /../.. || exit ; pwd) /bin"
6
+ export BIN_DIR
7
+
8
+ # Orient ourselves and build download link
9
+ dep_formula=${0# $WORKSPACE_DIR / } # this is the original script, e.g. pypy-5.3.1
10
+ BASE=${dep_formula##*/ } # this gives us relative path
11
+ python_version=${BASE^} # this gives us only the filename with version number
12
+ version_number=$( echo " $python_version " | cut -d- -f2) # this returns just X.X.X
13
+ dep_url=https://python.org/ftp/python/${version_number} /${python_version} .tgz
14
+
15
+ # shellcheck source=bin/utils
16
+ source " $BIN_DIR /steps/sqlite3"
17
+
18
+ sqlite3_version
19
+ echo " Setting up SQLite3 Headers for $SQLITE3_VERSION "
20
+ sqlite3_install " $OUT_PREFIX " " $SQLITE3_VERSION " 1
21
+
22
+ echo " Building Python 3..."
23
+ echo " Pulling from source: ${dep_url} "
24
+
25
+ curl -L " ${dep_url} " | tar xz -C " ${OUT_PREFIX} "
26
+ mv " ${OUT_PREFIX} /${python_version} " src
27
+ cd src
28
+
29
+ ./configure --prefix=$OUT_PREFIX --enable-unicode=ucs4 --with-ensurepip=no
30
+ make
31
+ make install
32
+
33
+ # Remove unneeded test directories, similar to the official Docker Python images:
34
+ # https://github.com/docker-library/python
35
+ find " ${OUT_PREFIX} " \( -type d -a \( -name test -o -name tests \) \) -exec rm -rf ' {}' +
Original file line number Diff line number Diff line change @@ -9,12 +9,11 @@ OUT_PREFIX=$1
9
9
BIN_DIR=" $( cd " $( dirname " $0 " ) " /../.. || exit ; pwd) /bin"
10
10
export BIN_DIR
11
11
12
+ # Orient ourselves and build download link
12
13
dep_formula=${0# $WORKSPACE_DIR / } # this is the original script, e.g. pypy-5.3.1
13
- dep_name=$( basename $BASH_SOURCE ) # this is us
14
-
15
- BASE=${dep_formula##*/ }
16
- python_version=${BASE^}
17
- version_number=$( echo " $python_version " | cut -d- -f2)
14
+ BASE=${dep_formula##*/ } # this gives us relative path
15
+ python_version=${BASE^} # this gives us only the filename with version number
16
+ version_number=$( echo " $python_version " | cut -d- -f2) # this returns just X.X.X
18
17
dep_url=https://python.org/ftp/python/${version_number} /${python_version} .tgz
19
18
20
19
# shellcheck source=bin/utils
You can’t perform that action at this time.
0 commit comments