-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmake.sh
More file actions
executable file
·87 lines (80 loc) · 2.16 KB
/
make.sh
File metadata and controls
executable file
·87 lines (80 loc) · 2.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
export PATH=/opt/drycc/python/bin:$PATH
export LANG=C.UTF-8
# build dependencies
install-packages \
gpg-agent \
dirmngr \
gpg \
wget \
libbluetooth-dev \
tk-dev \
uuid-dev
export PYTHON_VERSION=${STACK_VERSION}
export PATH=/opt/drycc/python/bin:$PATH
set -eux; \
\
wget -O python.tar.xz "https://www.python.org/ftp/python/${PYTHON_VERSION%%[a-z]*}/Python-$PYTHON_VERSION.tar.xz"; \
mkdir -p /usr/src/python; \
tar --extract --directory /usr/src/python --strip-components=1 --file python.tar.xz; \
rm python.tar.xz; \
\
cd /usr/src/python; \
gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \
./configure \
--prefix=/opt/drycc/python \
--build="$gnuArch" \
--enable-loadable-sqlite-extensions \
--enable-optimizations \
--enable-option-checking=fatal \
--enable-shared \
--with-lto \
--with-system-expat \
--with-system-ffi \
--without-ensurepip \
; \
nproc="$(nproc)"; \
make -j "$nproc" \
; \
make install; \
cd /; \
cp -rf /usr/src/python/Include /opt/drycc/python/include; \
rm -rf /usr/src/python; \
\
find /opt/drycc/python -depth \
\( \
\( -type d -a \( -name test -o -name tests -o -name idle_test \) \) \
-o \( -type f -a \( -name '*.pyc' -o -name '*.pyo' -o -name '*.a' \) \) \
\) -exec rm -rf '{}' + \
; \
\
ldconfig; \
\
python3 --version
# make some useful symlinks that are expected to exist ("/opt/drycc/python/bin/python" and friends)
set -eux; \
for src in idle3 pydoc3 python3 python3-config; do \
dst="$(echo "$src" | tr -d 3)"; \
[ -s "/opt/drycc/python/bin/$src" ]; \
[ ! -e "/opt/drycc/python/bin/$dst" ]; \
ln -svT "/opt/drycc/python/bin/$src" "/opt/drycc/python/bin/$dst"; \
done
# https://github.com/pypa/get-pip
export PYTHON_GET_PIP_URL=https://github.com/pypa/get-pip/raw/main/public/get-pip.py
set -eux; \
\
wget -O get-pip.py "$PYTHON_GET_PIP_URL"; \
\
python get-pip.py \
--disable-pip-version-check \
--no-cache-dir \
; \
pip --version; \
\
find /opt/drycc/python -depth \
\( \
\( -type d -a \( -name test -o -name tests -o -name idle_test \) \) \
-o \
\( -type f -a \( -name '*.pyc' -o -name '*.pyo' \) \) \
\) -exec rm -rf '{}' + \
; \
rm -f get-pip.py