You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

175 lines
3.6 KiB

3 years ago
#!/bin/sh
set -e
set -o pipefail
scheme="$1"
1 year ago
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
}
3 years ago
echo "==> Install system packages"
1 year ago
apk --no-cache add \
bash \
ghostscript \
gnupg \
graphviz \
perl \
py-pygments \
python3 \
tar \
ttf-freefont \
wget \
make \
xz
# Dependencies needed by latexindent
apk --no-cache add \
perl-log-dispatch \
perl-log-log4perl \
perl-namespace-autoclean \
perl-params-validationcompiler \
perl-specio \
perl-unicode-linebreak \
perl-yaml-tiny
apk --no-cache \
--repository=http://dl-cdn.alpinelinux.org/alpine/edge/testing \
add \
perl-file-homedir
apk update --no-cache
apk upgrade --no-cache
#gpg --keyserver hkp://pool.sks-keyservers.net --recv-keys 0D5E5D9106BAB6BC
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 --keyserver hkp://keyserver.ubuntu.com --recv-keys 0D5E5D9106BAB6BC
#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 -profile=/texlive.profile
3 years ago
# Install additional packages for non full scheme
if [ "$scheme" != "full" ]; then
1 year ago
tlmgr install \
collection-fontsrecommended \
collection-fontutils \
xgreek \
xltxtra \
biber \
biblatex \
latexmk \
collection-xetex \
polyglossia \
greek-fontenc \
hyphen-english \
hyphen-greek \
xetex \
t2 \
tools \
oberdiek \
bigfoot \
zapfding \
xstring \
datetime \
nomencl \
geometry \
setspace \
footmisc \
tocloft \
fancyhdr \
titlesec \
graphics \
graphics-cfg \
caption \
amsmath \
amscls \
mathspec \
enumitem \
makecell \
multirow \
was \
xcolor \
listings \
ulem \
hyperref \
latexconfig \
url \
natbib \
lastpage \
totcount \
pdfpages \
textcase \
fp \
extsizes \
fmtcount \
koma-script \
pdflscape \
texliveonfly
3 years ago
echo "==> extra packages"
1 year ago
extrap=/extrapackages
3 years ago
if [ -f $extrap ]; then
1 year ago
while read -r line; do
extrapackages="$extrapackages $line"
done < $extrap
3 years ago
1 year ago
tlmgr install $extrapackages
3 years ago
else
echo "No extrapackages file"
fi
1 year ago
cp /usr/local/texlive/2020/texmf-var/fonts/conf/texlive-fontconfig.conf /etc/fonts/conf.d/09-texlive.conf
3 years ago
1 year ago
apk add --no-cache msttcorefonts-installer
3 years ago
1 year ago
update-ms-fonts
3 years ago
1 year ago
fc-cache -f
3 years ago
fi
1 year ago
texhash
3 years ago
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 \
1 year ago
/setup.sh \
/extrapackages \
3 years ago
/texlive.profile \
/texlive_pgp_keys.asc \
/tmp/install-tl \
/tmp/install-tl-unx