|
| 1 | +#!/bin/bash |
| 2 | +set -euxo pipefail |
| 3 | + |
| 4 | +ARCH=$(uname -m) |
| 5 | + |
| 6 | +if [[ "$ARCH" == "ppc64le" ]]; then |
| 7 | + echo "Installing TeX Live from source for $ARCH" |
| 8 | + |
| 9 | + # Download and extract source |
| 10 | + wget https://ftp.math.utah.edu/pub/tex/historic/systems/texlive/2025/texlive-20250308-source.tar.xz |
| 11 | + tar -xf texlive-20250308-source.tar.xz |
| 12 | + cd texlive-20250308-source |
| 13 | + |
| 14 | + # Install build dependencies |
| 15 | + dnf install -y gcc-toolset-13 perl make libX11-devel libXt-devel \ |
| 16 | + zlib-devel freetype-devel libpng-devel ncurses-devel \ |
| 17 | + gd-devel libtool wget tar xz bison flex libXaw-devel |
| 18 | + |
| 19 | + source /opt/rh/gcc-toolset-13/enable |
| 20 | + |
| 21 | + # Create build directory |
| 22 | + mkdir ../texlive-build |
| 23 | + cd ../texlive-build |
| 24 | + |
| 25 | + # Configure, build, install |
| 26 | + ../texlive-20250308-source/configure --prefix=/usr/local/texlive |
| 27 | + make -j$(nproc) |
| 28 | + make install |
| 29 | + |
| 30 | + # Symlink for pdflatex |
| 31 | + cd /usr/local/texlive/bin/powerpc64le-unknown-linux-gnu |
| 32 | + ln -s pdftex pdflatex |
| 33 | + |
| 34 | + # Cleanup TeX source to reduce image size |
| 35 | + rm -rf /texlive-20250308-source /texlive-build |
| 36 | + |
| 37 | + export PATH="/usr/local/texlive/bin/powerpc64le-unknown-linux-gnu:$PATH" |
| 38 | + pdflatex --version |
| 39 | +fi |
| 40 | + |
| 41 | +if [[ "$ARCH" == "x86_64" ]]; then |
| 42 | + # tex live installation |
| 43 | + echo "Installing TexLive to allow PDf export from Notebooks" |
| 44 | + curl -L https://mirror.ctan.org/systems/texlive/tlnet/install-tl-unx.tar.gz -o install-tl-unx.tar.gz |
| 45 | + zcat < install-tl-unx.tar.gz | tar xf - |
| 46 | + cd install-tl-2* |
| 47 | + perl ./install-tl --no-interaction --scheme=scheme-small --texdir=/usr/local/texlive |
| 48 | + cd /usr/local/texlive/bin/x86_64-linux |
| 49 | + ./tlmgr install tcolorbox pdfcol adjustbox titling enumitem soul ucs collection-fontsrecommended |
| 50 | +fi |
| 51 | + |
0 commit comments