]> git.armaanb.net Git - asd-repo.git/blob - core/python/build
Restructure repository
[asd-repo.git] / core / python / build
1 #!/bin/sh -e
2
3 # Remove util-linux dependency among other things.
4 cat >> Modules/Setup <<EOF
5 *disabled*
6 _uuid nis ossaudiodev
7 EOF
8
9 # Reported 20-27% performance improvements.
10 # See: "PythonNoSemanticInterpositionSpeedup"
11 export CFLAGS="$CFLAGS -fno-semantic-interposition"
12 export CXXFLAGS="$CXXFLAGS -fno-semantic-interposition"
13 export LDFLAGS="$LDFLAGS -fno-semantic-interposition"
14
15 patch -p1 < python3-always-pip.patch
16
17 ./configure \
18     --prefix=/usr \
19     --enable-shared \
20     --with-system-expat \
21     --with-system-ffi \
22     --with-ensurepip=yes \
23     --without-doc-strings
24
25 make
26 make DESTDIR="$1" install
27
28 ln -s python3 "$1/usr/bin/python"
29 ln -s pip3    "$1/usr/bin/pip"
30
31 # Make static library writable.
32 chmod u+w "$1/usr/lib/libpython"*
33
34 # Let's make some kind of effort to reduce the overall
35 # size of Python by removing a bunch of rarely used and
36 # otherwise useless components.
37 #
38 # This can't be done via ./configure as the build system
39 # doesn't give you this much control over the process.
40 {
41     cd "$1/usr/lib/python"*
42     rm -rf test ./*/test ./*/tests
43     rm -rf idlelib turtle* config-*
44
45     cd "$1/usr/bin"
46     rm -f idle*
47 }