-
-
Notifications
You must be signed in to change notification settings - Fork 21
/
setup.sh
executable file
·88 lines (80 loc) · 2.3 KB
/
setup.sh
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
88
#!/bin/sh
set -e
scheme="$1"
retry() {
retries=$1
shift
count=0
until "$@"; do
exit=$?
wait="$(echo "2^$count" | bc)"
count="$(echo "$count + 1" | bc)"
if [ "$count" -lt "$retries" ]; then
echo "Retry $count/$retries exited $exit, retrying in $wait seconds..."
sleep "$wait"
else
echo "Retry $count/$retries exited $exit, no more retries left."
return "$exit"
fi
done
}
head -1 /etc/apk/repositories | sed s'/alpine\/.*$/alpine\/edge\/testing/' >> /etc/apk/repositories
echo "==> Install system packages"
apk --no-cache add \
bash \
ghostscript \
gnupg \
graphviz \
openjdk11-jre-headless \
perl \
perl-app-cpanminus \
perl-file-homedir \
perl-log-log4perl \
perl-log-dispatch \
perl-namespace-autoclean \
perl-params-validationcompiler \
perl-specio \
perl-unicode-linebreak \
perl-yaml-tiny \
py-pygments \
python2 \
python3 \
tar \
ttf-freefont \
wget \
xz
echo "==> Install TeXLive"
mkdir -p /tmp/install-tl
cd /tmp/install-tl
MIRROR_URL="$(wget -q -S -O /dev/null http://mirror.ctan.org/ 2>&1 | sed -ne 's/.*Location: \(\w*\)/\1/p' | head -n 1)"
wget -nv "${MIRROR_URL}systems/texlive/tlnet/install-tl-unx.tar.gz"
wget -nv "${MIRROR_URL}systems/texlive/tlnet/install-tl-unx.tar.gz.sha512"
wget -nv "${MIRROR_URL}systems/texlive/tlnet/install-tl-unx.tar.gz.sha512.asc"
gpg --no-default-keyring --keyring trustedkeys.kbx --import /texlive_pgp_keys.asc
gpgv ./install-tl-unx.tar.gz.sha512.asc ./install-tl-unx.tar.gz.sha512
sha512sum -c ./install-tl-unx.tar.gz.sha512
mkdir -p /tmp/install-tl/installer
tar --strip-components 1 -zxf /tmp/install-tl/install-tl-unx.tar.gz -C /tmp/install-tl/installer
retry 3 /tmp/install-tl/installer/install-tl -scheme "$scheme" -profile=/texlive.profile
# Install additional packages for non full scheme
if [ "$scheme" != "full" ]; then
tlmgr install \
collection-fontsrecommended \
collection-fontutils \
biber \
biblatex \
latexmk \
texliveonfly
fi
echo "==> Clean up"
rm -rf \
/opt/texlive/texdir/install-tl \
/opt/texlive/texdir/install-tl.log \
/opt/texlive/texdir/texmf-dist/doc \
/opt/texlive/texdir/texmf-dist/source \
/opt/texlive/texdir/texmf-var/web2c/tlmgr.log \
/root/.gnupg \
/setup.sh \
/texlive.profile \
/texlive_pgp_keys.asc \
/tmp/install-tl