mirror of
https://codeberg.org/kiss-community/repo
synced 2024-11-15 11:10:08 -07:00
d5265cfbac
It breaks the inspect.signature function for classes that don't explicitly set a constructor, because the `__text_signature__` attribute is empty ``` from inspect import signature class Test: pass print(signature(Test.__init__)) ``` This is used in some python modules like telethon
45 lines
1.0 KiB
Bash
Executable File
45 lines
1.0 KiB
Bash
Executable File
#!/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 LDFLAGS="$LDFLAGS -fno-semantic-interposition"
|
|
|
|
for patch in *.patch; do
|
|
patch -p1 < "$patch"
|
|
done
|
|
|
|
./configure \
|
|
--prefix=/usr \
|
|
--enable-shared \
|
|
--with-system-expat \
|
|
--with-system-ffi \
|
|
--with-ensurepip=yes
|
|
|
|
make EXTRA_CFLAGS="$CFLAGS -DTHREAD_STACK_SIZE=0x100000"
|
|
make install
|
|
|
|
ln -s python3 "$1/usr/bin/python"
|
|
ln -s pip3 "$1/usr/bin/pip"
|
|
|
|
# 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 pydoc* idlelib turtle* config-*
|
|
|
|
cd "$1/usr/bin"
|
|
rm -f pydoc* idle*
|
|
}
|