2019-06-25 15:24:27 +00:00
|
|
|
#!/bin/sh -e
|
|
|
|
|
2020-03-24 13:44:52 +00:00
|
|
|
# Remove util-linux dependency among other things.
|
2020-02-07 23:55:12 +00:00
|
|
|
cat >> Modules/Setup <<EOF
|
|
|
|
*disabled*
|
2020-03-24 13:44:52 +00:00
|
|
|
_uuid nis ossaudiodev
|
2020-02-07 23:55:12 +00:00
|
|
|
EOF
|
|
|
|
|
2020-03-28 11:49:47 +00:00
|
|
|
# Reported 20-27% performance improvements.
|
|
|
|
# See: "PythonNoSemanticInterpositionSpeedup"
|
|
|
|
export CFLAGS="$CFLAGS -fno-semantic-interposition"
|
|
|
|
export LDFLAGS="$LDFLAGS -fno-semantic-interposition"
|
|
|
|
|
2021-08-10 17:01:13 +00:00
|
|
|
for patch in *.patch; do
|
|
|
|
patch -p1 < "$patch"
|
|
|
|
done
|
2020-03-24 13:44:52 +00:00
|
|
|
|
2019-06-25 15:24:27 +00:00
|
|
|
./configure \
|
2019-06-27 09:10:08 +00:00
|
|
|
--prefix=/usr \
|
2019-09-09 10:19:14 +00:00
|
|
|
--enable-shared \
|
|
|
|
--with-system-expat \
|
|
|
|
--with-system-ffi \
|
2023-01-30 10:39:45 +00:00
|
|
|
--with-ensurepip=yes
|
2019-06-25 15:24:27 +00:00
|
|
|
|
2021-08-10 11:13:14 +00:00
|
|
|
make EXTRA_CFLAGS="$CFLAGS -DTHREAD_STACK_SIZE=0x100000"
|
2021-07-18 03:09:11 +00:00
|
|
|
make install
|
2019-06-25 17:08:58 +00:00
|
|
|
|
|
|
|
ln -s python3 "$1/usr/bin/python"
|
2019-08-28 18:55:53 +00:00
|
|
|
ln -s pip3 "$1/usr/bin/pip"
|
2019-08-30 00:31:47 +00:00
|
|
|
|
2020-03-24 13:44:52 +00:00
|
|
|
# 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
|
2023-02-16 10:15:09 +00:00
|
|
|
rm -rf idlelib turtle* config-*
|
2020-03-24 13:44:52 +00:00
|
|
|
|
|
|
|
cd "$1/usr/bin"
|
2023-02-16 10:15:09 +00:00
|
|
|
rm -f idle*
|
2020-03-24 13:44:52 +00:00
|
|
|
}
|