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"
12 months 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"
12 months ago
/sbin/apk --no-cache add \
12 months ago
bash \
ghostscript \
gnupg \
graphviz \
perl \
py-pygments \
python3 \
tar \
ttf-freefont \
wget \
make \
xz
# Dependencies needed by latexindent
12 months ago
/sbin/apk --no-cache add \
12 months ago
perl-log-dispatch \
perl-log-log4perl \
perl-namespace-autoclean \
perl-params-validationcompiler \
perl-specio \
perl-unicode-linebreak \
perl-yaml-tiny
12 months ago
/sbin/apk --no-cache \
12 months ago
--repository=http://dl-cdn.alpinelinux.org/alpine/edge/testing \
add \
perl-file-homedir
12 months ago
/sbin/apk update --no-cache
/sbin/apk upgrade --no-cache
12 months ago
#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
12 months 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"
12 months ago
extrap=/extrapackages
3 years ago
if [ -f $extrap ]; then
12 months ago
while read -r line; do
extrapackages="$extrapackages $line"
done < $extrap
3 years ago
12 months ago
tlmgr install $extrapackages
3 years ago
else
echo "No extrapackages file"
fi
12 months ago
cp /usr/local/texlive/2020/texmf-var/fonts/conf/texlive-fontconfig.conf /etc/fonts/conf.d/09-texlive.conf
3 years ago
12 months ago
/sbin/apk add --no-cache msttcorefonts-installer
3 years ago
12 months ago
update-ms-fonts
3 years ago
12 months ago
fc-cache -f
3 years ago
fi
12 months 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 \
12 months ago
/setup.sh \
/extrapackages \
3 years ago
/texlive.profile \
/texlive_pgp_keys.asc \
/tmp/install-tl \
/tmp/install-tl-unx