--- /dev/null
+#!/bin/sh -e
+
+# Remove util-linux dependency among other things.
+cat >> Modules/Setup <<EOF
+*disabled*
+_uuid nis ossaudiodev
+EOF
+
+# Reported 20-27% performance improvements.
+# See: "PythonNoSemanticInterpositionSpeedup"
+export CFLAGS="$CFLAGS -fno-semantic-interposition"
+export CXXFLAGS="$CXXFLAGS -fno-semantic-interposition"
+export LDFLAGS="$LDFLAGS -fno-semantic-interposition"
+
+patch -p1 < python3-always-pip.patch
+
+./configure \
+ --prefix=/usr \
+ --enable-shared \
+ --with-system-expat \
+ --with-system-ffi \
+ --with-ensurepip=yes \
+ --without-doc-strings
+
+make
+make DESTDIR="$1" install
+
+ln -s python3 "$1/usr/bin/python"
+ln -s pip3 "$1/usr/bin/pip"
+
+# Make static library writable.
+chmod u+w "$1/usr/lib/libpython"*
+
+# Let's make some kind of effort to reduce the overall
+# size of Python by removing a bunch of rarely used and
+# otherwise useless components.
+#
+# This can't be done via ./configure as the build system
+# doesn't give you this much control over the process.
+{
+ cd "$1/usr/lib/python"*
+ rm -rf test ./*/test ./*/tests
+ rm -rf idlelib turtle* config-*
+
+ cd "$1/usr/bin"
+ rm -f idle*
+}
--- /dev/null
+diff --git a/Lib/ensurepip/__init__.py b/Lib/ensurepip/__init__.py
+index f3152a5..52f6312 100644
+--- a/Lib/ensurepip/__init__.py
++++ b/Lib/ensurepip/__init__.py
+@@ -116,7 +116,7 @@ def _bootstrap(*, root=None, upgrade=False, user=False,
+ additional_paths.append(os.path.join(tmpdir, wheel_name))
+
+ # Construct the arguments to be passed to the pip command
+- args = ["install", "--no-cache-dir", "--no-index", "--find-links", tmpdir]
++ args = ["install", "-I", "--no-cache-dir", "--no-index", "--find-links", tmpdir]
+ if root:
+ args += ["--root", root]
+ if upgrade: