Skip to content

Commit 9bd5fa7

Browse files
committed
replace formula sqlite install
1 parent 89885a4 commit 9bd5fa7

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

builds/runtimes/python3

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,19 @@ python_version=${BASE^} # this gives us only the filename with version number
1616
version_number=$(echo "$python_version" | cut -d- -f2) # this returns just X.X.X
1717
dep_url=https://python.org/ftp/python/${version_number}/${python_version}.tgz
1818

19-
# shellcheck source=bin/utils
20-
source "$BIN_DIR/steps/sqlite3"
21-
22-
sqlite3_version
23-
echo "Setting up SQLite3 Headers for $SQLITE3_VERSION"
24-
sqlite3_install "$OUT_PREFIX" "$SQLITE3_VERSION" 1
25-
26-
echo "Building Python 3..."
27-
echo "Pulling from source: ${dep_url}"
28-
19+
# Install SQLITE, as headers are not available out of the box on the stack
20+
apt-get install libsqlite3-dev
21+
needed=( libsqlite3-dev )
22+
if [[ $STACK != "heroku-16" && $STACK != "heroku-16" ]]; then
23+
needed+=( realpath )
24+
25+
# Check whether our packages are missing on the stack
26+
missing=$(comm -1 -3 <(dpkg-query -W -f '${package}\n' | sort) <(IFS=$'\n'; echo "${needed[*]}" | sort))
27+
if [[ "$missing" ]]; then
28+
# install missing and needed packages
29+
apt-get update -qq || { echo "Failed to 'apt-get update'. You must build this formula using Docker."; exit 1; }
30+
apt-get install -q -y $missing
31+
fi
2932

3033
curl -L "${dep_url}" | tar xz -C "${OUT_PREFIX}"
3134
mv "${OUT_PREFIX}/${python_version}" src

0 commit comments

Comments
 (0)